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
75d3f7cac51c0e02c045b42958bd33a7655ebdb9
fix updated version number
NIFTYCloud-mbaas/ncmb_unity,NIFTYCloud-mbaas/ncmb_unity,NIFTYCloud-mbaas/ncmb_unity
ncmb_unity/Assets/NCMB/CommonConstant.cs
ncmb_unity/Assets/NCMB/CommonConstant.cs
/******* Copyright 2014 NIFTY Corporation All Rights Reserved. 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; namespace NCMB.Internal { //通信種別 internal enum ConnectType { //GET通信 GET, //POST通信 POST, //PUT通信 PUT, //DELETE通信 DELETE } /// <summary> /// 定数を定義する共通用のクラスです /// </summary> internal static class CommonConstant { //service public static readonly string DOMAIN = "mb.api.cloud.nifty.com";//ドメイン public static readonly string DOMAIN_URL = "https://mb.api.cloud.nifty.com";//ドメインのURL public static readonly string API_VERSION = "2013-09-01";//APIバージョン public static readonly string SDK_VERSION = "2.0.2"; //SDKバージョン //DEBUG LOG Setting: NCMBDebugにてdefine設定をしてください } }
/******* Copyright 2014 NIFTY Corporation All Rights Reserved. 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; namespace NCMB.Internal { //通信種別 internal enum ConnectType { //GET通信 GET, //POST通信 POST, //PUT通信 PUT, //DELETE通信 DELETE } /// <summary> /// 定数を定義する共通用のクラスです /// </summary> internal static class CommonConstant { //service public static readonly string DOMAIN = "mb.api.cloud.nifty.com";//ドメイン public static readonly string DOMAIN_URL = "https://mb.api.cloud.nifty.com";//ドメインのURL public static readonly string API_VERSION = "2013-09-01";//APIバージョン public static readonly string SDK_VERSION = "2.0.1"; //SDKバージョン //DEBUG LOG Setting: NCMBDebugにてdefine設定をしてください } }
apache-2.0
C#
1798c3ef6fec59038626c5c43c7c59e5cab5a1bd
fix updated version number
NIFTYCloud-mbaas/ncmb_unity,NIFTYCloud-mbaas/ncmb_unity,NIFTYCloud-mbaas/ncmb_unity
ncmb_unity/Assets/NCMB/CommonConstant.cs
ncmb_unity/Assets/NCMB/CommonConstant.cs
/******* Copyright 2014 NIFTY Corporation All Rights Reserved. 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; namespace NCMB.Internal { //通信種別 internal enum ConnectType { //GET通信 GET, //POST通信 POST, //PUT通信 PUT, //DELETE通信 DELETE } /// <summary> /// 定数を定義する共通用のクラスです /// </summary> internal static class CommonConstant { //service public static readonly string DOMAIN = "mb.api.cloud.nifty.com";//ドメイン public static readonly string DOMAIN_URL = "https://mb.api.cloud.nifty.com";//ドメインのURL public static readonly string API_VERSION = "2013-09-01";//APIバージョン public static readonly string SDK_VERSION = "2.2.0"; //SDKバージョン //DEBUG LOG Setting: NCMBDebugにてdefine設定をしてください } }
/******* Copyright 2014 NIFTY Corporation All Rights Reserved. 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; namespace NCMB.Internal { //通信種別 internal enum ConnectType { //GET通信 GET, //POST通信 POST, //PUT通信 PUT, //DELETE通信 DELETE } /// <summary> /// 定数を定義する共通用のクラスです /// </summary> internal static class CommonConstant { //service public static readonly string DOMAIN = "mb.api.cloud.nifty.com";//ドメイン public static readonly string DOMAIN_URL = "https://mb.api.cloud.nifty.com";//ドメインのURL public static readonly string API_VERSION = "2013-09-01";//APIバージョン public static readonly string SDK_VERSION = "2.1.1"; //SDKバージョン //DEBUG LOG Setting: NCMBDebugにてdefine設定をしてください } }
apache-2.0
C#
1906f7bebdfe94c40e79b19b8f8c7cc1044d891b
Add citation for Ref.cs
Changer098/ChristmasPi,Changer098/ChristmasPi,Changer098/ChristmasPi,Changer098/ChristmasPi
src/Data/Models/Ref.cs
src/Data/Models/Ref.cs
using System; namespace ChristmasPi.Data.Models { /// <summary> /// A way to store references to value types /// </summary> /// <source>https://stackoverflow.com/a/2258102</source> public sealed class Ref<T> { private Func<T> getter; private Action<T> setter; public Ref(Func<T> getter, Action<T> setter) { this.getter = getter; this.setter = setter; } public T Value { get { return getter(); } set { setter(value); } } } }
using System; namespace ChristmasPi.Data.Models { public sealed class Ref<T> { private Func<T> getter; private Action<T> setter; public Ref(Func<T> getter, Action<T> setter) { this.getter = getter; this.setter = setter; } public T Value { get { return getter(); } set { setter(value); } } } }
apache-2.0
C#
7b0e696f93574e0b806732565089403dabf8a439
Update project settings
sakapon/Bellona.Analysis
Bellona/Analysis/Properties/AssemblyInfo.cs
Bellona/Analysis/Properties/AssemblyInfo.cs
using System; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // アセンブリに関する一般情報は以下の属性セットをとおして制御されます。 // アセンブリに関連付けられている情報を変更するには、 // これらの属性値を変更してください。 [assembly: AssemblyTitle("Bellona.Analysis")] [assembly: AssemblyDescription("The library for statistical analysis.")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Keiho Sakapon")] [assembly: AssemblyProduct("Bellona")] [assembly: AssemblyCopyright("© 2015 Keiho Sakapon")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] [assembly: AssemblyMetadata("ProjectUrl", "https://github.com/sakapon/Bellona.Analysis")] [assembly: AssemblyMetadata("LicenseUrl", "https://github.com/sakapon/Bellona.Analysis/blob/master/LICENSE")] [assembly: AssemblyMetadata("Tags", "Machine Learning")] [assembly: AssemblyMetadata("ReleaseNotes", "")] // ComVisible を false に設定すると、その型はこのアセンブリ内で COM コンポーネントから // 参照不可能になります。COM からこのアセンブリ内の型にアクセスする場合は、 // その型の ComVisible 属性を true に設定してください。 [assembly: ComVisible(false)] // 次の GUID は、このプロジェクトが COM に公開される場合の、typelib の ID です [assembly: Guid("6134e5f8-5f37-4568-b2cb-49fed28cad2c")] // アセンブリのバージョン情報は、以下の 4 つの値で構成されています: // // Major Version // Minor Version // Build Number // Revision // // すべての値を指定するか、下のように '*' を使ってビルドおよびリビジョン番号を // 既定値にすることができます: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0")] [assembly: CLSCompliant(true)] [assembly: InternalsVisibleTo("UnitTest")]
using System; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // アセンブリに関する一般情報は以下の属性セットをとおして制御されます。 // アセンブリに関連付けられている情報を変更するには、 // これらの属性値を変更してください。 [assembly: AssemblyTitle("Bellona.Analysis")] [assembly: AssemblyDescription("The library for statistical analysis.")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Keiho Sakapon")] [assembly: AssemblyProduct("Bellona")] [assembly: AssemblyCopyright("© 2015 Keiho Sakapon")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] [assembly: AssemblyMetadata("ProjectUrl", "https://github.com/sakapon/Bellona.Analysis")] [assembly: AssemblyMetadata("LicenseUrl", "https://github.com/sakapon/Bellona.Analysis/blob/master/LICENSE")] [assembly: AssemblyMetadata("Tags", "Machine Learning")] [assembly: AssemblyMetadata("ReleaseNotes", "")] // ComVisible を false に設定すると、その型はこのアセンブリ内で COM コンポーネントから // 参照不可能になります。COM からこのアセンブリ内の型にアクセスする場合は、 // その型の ComVisible 属性を true に設定してください。 [assembly: ComVisible(false)] // 次の GUID は、このプロジェクトが COM に公開される場合の、typelib の ID です [assembly: Guid("6134e5f8-5f37-4568-b2cb-49fed28cad2c")] // アセンブリのバージョン情報は、以下の 4 つの値で構成されています: // // Major Version // Minor Version // Build Number // Revision // // すべての値を指定するか、下のように '*' を使ってビルドおよびリビジョン番号を // 既定値にすることができます: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: CLSCompliant(true)] [assembly: InternalsVisibleTo("UnitTest")]
mit
C#
fb1aadfb93f8edf81119324f58f627440dee49b8
Add DiscogRelease properties: lowest_price and num_for_sale
David-Desmaisons/DiscogsClient
DiscogsClient/Data/Result/DiscogsRelease.cs
DiscogsClient/Data/Result/DiscogsRelease.cs
using System; namespace DiscogsClient.Data.Result { public class DiscogsRelease : DiscogsReleaseBase { public DiscogsReleaseArtist[] extraartists { get; set; } public DiscogsReleaseLabel[] labels { get; set; } public DiscogsReleaseLabel[] companies { get; set; } public DiscogsFormat[] formats { get; set; } public DiscogsIdentifier[] identifiers { get; set; } public DiscogsCommunity community { get; set; } public DiscogsReleaseLabel[] series { get; set; } public string artists_sort { get; set; } public string catno { get; set; } public string country { get; set; } public DateTime date_added { get; set; } public DateTime date_changed { get; set; } /// <remarks>Grams</remarks> public int estimated_weight { get; set; } public int format_quantity { get; set; } public decimal lowest_price { get; set; } public int master_id { get; set; } public string master_url { get; set; } public string notes { get; set; } public int num_for_sale { get; set; } public string released { get; set; } public string released_formatted { get; set; } public string status { get; set; } public string thumb { get; set; } } }
using System; namespace DiscogsClient.Data.Result { public class DiscogsRelease : DiscogsReleaseBase { public DiscogsReleaseArtist[] extraartists { get; set; } public DiscogsReleaseLabel[] labels { get; set; } public DiscogsReleaseLabel[] companies { get; set; } public DiscogsFormat[] formats { get; set; } public DiscogsIdentifier[] identifiers { get; set; } public DiscogsCommunity community { get; set; } public DiscogsReleaseLabel[] series { get; set; } public string artists_sort { get; set; } public string catno { get; set; } public string country { get; set; } public DateTime date_added { get; set; } public DateTime date_changed { get; set; } public int estimated_weight { get; set; } public int format_quantity { get; set; } public int master_id { get; set; } public string master_url { get; set; } public string notes { get; set; } public string released { get; set; } public string released_formatted { get; set; } public string status { get; set; } public string thumb { get; set; } } }
mit
C#
7722526d449d8d926d92d9df5a3e01fdb0b93cc2
Update JsonGrammar to use StringParser for more speed
ArsenShnurkov/Eto.Parse,ArsenShnurkov/Eto.Parse,picoe/Eto.Parse,smbecker/Eto.Parse,smbecker/Eto.Parse,picoe/Eto.Parse
Eto.Parse.Samples/JsonGrammar.cs
Eto.Parse.Samples/JsonGrammar.cs
using System; using Eto.Parse.Parsers; using System.Linq; namespace Eto.Parse.Samples { public class JsonGrammar : Grammar { public JsonGrammar() : base("json") { // terminals var jstring = new StringParser { AllowEscapeCharacters = true }; var jnumber = new NumberParser { AllowExponent = true, AllowSign = true, AllowDecimal = true }; var comma = Terminals.Literal(","); // nonterminals (things we're interested in getting back) var jobject = new NamedParser("Object"); var jarray = new NamedParser("Array"); var jvalue = new NamedParser("Value"); var jprop = new NamedParser("Property"); var ws = -Terminals.WhiteSpace; // rules var jobjectBr = "{" & ~jobject & "}"; var jarrayBr = "[" & ~jarray & "]"; jvalue.Inner = jstring | jnumber | jobjectBr | jarrayBr | "true" | "false" | "null"; jobject.Inner = jprop & -(comma & jprop); jprop.Inner = jstring & ":" & jvalue; jarray.Inner = jvalue & -(comma & jvalue); // separate sequence and repeating parsers by whitespace jvalue.SeparateChildrenBy(ws); // allow whitespace before and after this.Inner = ws & jvalue & ws; } } }
using System; using Eto.Parse.Parsers; using System.Linq; namespace Eto.Parse.Samples { public class JsonGrammar : Grammar { public JsonGrammar() : base("json") { // terminals var jstring = new GroupParser("\""); var jnumber = new NumberParser { AllowExponent = true, AllowSign = true, AllowDecimal = true }; var comma = Terminals.Literal(","); // nonterminals (things we're interested in getting back) var jobject = new NamedParser("Object"); var jarray = new NamedParser("Array"); var jvalue = new NamedParser("Value"); var jprop = new NamedParser("Property"); var ws = -Terminals.WhiteSpace; // rules var jobjectBr = "{" & ~jobject & "}"; var jarrayBr = "[" & ~jarray & "]"; jvalue.Inner = jstring | jnumber | jobjectBr | jarrayBr | "true" | "false" | "null"; jobject.Inner = jprop & -(comma & jprop); jprop.Inner = jstring & ":" & jvalue; jarray.Inner = jvalue & -(comma & jvalue); // separate sequence and repeating parsers by whitespace jvalue.SeparateChildrenBy(ws); // allow whitespace before and after this.Inner = ws & jvalue & ws; // turn off character errors, named parser errors are granular enough SetError<CharParser>(false); } } }
mit
C#
6e1f30d81653d5a4d2832fbfa5ecc161efe91196
Remove Culture since that causes issues for Workbooks
kzu/Logo
src/es/AssemblyInfo.cs
src/es/AssemblyInfo.cs
using System.Reflection; [assembly: AssemblyTitle("Logo en español para Xamarin Workbooks")] [assembly: AssemblyDescription("Aprende a programar con Xamarin Workbooks, C# y la legendaria Tortuga!")] // NuGet package metadata [assembly: AssemblyMetadata("id", "Logo.es")] [assembly: AssemblyMetadata("authors", "Daniel Cazzulino")]
using System.Reflection; [assembly: AssemblyTitle("Logo en español para Xamarin Workbooks")] [assembly: AssemblyDescription("Aprende a programar con Xamarin Workbooks, C# y la legendaria Tortuga!")] [assembly: AssemblyCulture("es")] // NuGet package metadata [assembly: AssemblyMetadata("id", "Logo.es")] [assembly: AssemblyMetadata("authors", "Daniel Cazzulino")]
mit
C#
05a5a63e96bc2c017b0bfdf5b76be2963d699701
Update assembly version to 2.2
jmezach/NuGet2,mrward/NuGet.V2,GearedToWar/NuGet2,indsoft/NuGet2,themotleyfool/NuGet,jmezach/NuGet2,mono/nuget,rikoe/nuget,pratikkagda/nuget,dolkensp/node.net,kumavis/NuGet,chocolatey/nuget-chocolatey,zskullz/nuget,GearedToWar/NuGet2,RichiCoder1/nuget-chocolatey,mono/nuget,themotleyfool/NuGet,mrward/NuGet.V2,jmezach/NuGet2,alluran/node.net,GearedToWar/NuGet2,mrward/nuget,antiufo/NuGet2,chocolatey/nuget-chocolatey,chocolatey/nuget-chocolatey,jholovacs/NuGet,jholovacs/NuGet,akrisiun/NuGet,RichiCoder1/nuget-chocolatey,GearedToWar/NuGet2,antiufo/NuGet2,jholovacs/NuGet,chocolatey/nuget-chocolatey,mrward/NuGet.V2,RichiCoder1/nuget-chocolatey,zskullz/nuget,mrward/nuget,dolkensp/node.net,mrward/NuGet.V2,xoofx/NuGet,rikoe/nuget,xoofx/NuGet,xoofx/NuGet,oliver-feng/nuget,antiufo/NuGet2,RichiCoder1/nuget-chocolatey,indsoft/NuGet2,OneGet/nuget,jmezach/NuGet2,zskullz/nuget,oliver-feng/nuget,oliver-feng/nuget,jholovacs/NuGet,indsoft/NuGet2,chester89/nugetApi,pratikkagda/nuget,pratikkagda/nuget,alluran/node.net,mrward/nuget,GearedToWar/NuGet2,xoofx/NuGet,anurse/NuGet,pratikkagda/nuget,RichiCoder1/nuget-chocolatey,mrward/nuget,antiufo/NuGet2,oliver-feng/nuget,dolkensp/node.net,chester89/nugetApi,jmezach/NuGet2,mrward/nuget,themotleyfool/NuGet,ctaggart/nuget,pratikkagda/nuget,mrward/NuGet.V2,antiufo/NuGet2,alluran/node.net,antiufo/NuGet2,oliver-feng/nuget,RichiCoder1/nuget-chocolatey,anurse/NuGet,jholovacs/NuGet,zskullz/nuget,indsoft/NuGet2,rikoe/nuget,GearedToWar/NuGet2,OneGet/nuget,dolkensp/node.net,akrisiun/NuGet,oliver-feng/nuget,mono/nuget,xoofx/NuGet,jmezach/NuGet2,ctaggart/nuget,mrward/nuget,mrward/NuGet.V2,chocolatey/nuget-chocolatey,mono/nuget,pratikkagda/nuget,OneGet/nuget,rikoe/nuget,atheken/nuget,xoofx/NuGet,alluran/node.net,kumavis/NuGet,jholovacs/NuGet,indsoft/NuGet2,chocolatey/nuget-chocolatey,ctaggart/nuget,atheken/nuget,OneGet/nuget,ctaggart/nuget,indsoft/NuGet2
Common/CommonAssemblyInfo.cs
Common/CommonAssemblyInfo.cs
using System.Reflection; using System.Resources; using System.Runtime.InteropServices; [assembly: AssemblyCompany("Outercurve Foundation")] [assembly: AssemblyProduct("NuGet")] [assembly: AssemblyCopyright("\x00a9 Outercurve Foundation. All rights reserved.")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] #if !FIXED_ASSEMBLY_VERSION [assembly: AssemblyVersion("2.2.0.0")] [assembly: AssemblyInformationalVersion("2.2.0")] #endif [assembly: NeutralResourcesLanguage("en-US")]
using System.Reflection; using System.Resources; using System.Runtime.InteropServices; [assembly: AssemblyCompany("Outercurve Foundation")] [assembly: AssemblyProduct("NuGet")] [assembly: AssemblyCopyright("\x00a9 Outercurve Foundation. All rights reserved.")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] #if !FIXED_ASSEMBLY_VERSION [assembly: AssemblyVersion("2.1.0.0")] [assembly: AssemblyInformationalVersion("2.1.0")] #endif [assembly: NeutralResourcesLanguage("en-US")]
apache-2.0
C#
f6616ba3b32db1cf91963de28187e35bc6c6b4ea
Update account balance check, account can have zero balance and still be valid.
interfax/interfax-dotnet,interfax/interfax-dotnet
InterFAX.Api.Test.Integration/AccountTests.cs
InterFAX.Api.Test.Integration/AccountTests.cs
using NUnit.Framework; namespace InterFAX.Api.Test.Integration { [TestFixture] public class AccountTests { [Test] public void can_get_balance() { var interfax = new FaxClient(); var actual = interfax.Account.GetBalance().Result; //Assert.IsTrue(actual > 0); } } }
using NUnit.Framework; namespace InterFAX.Api.Test.Integration { [TestFixture] public class AccountTests { [Test] public void can_get_balance() { var interfax = new FaxClient(); var actual = interfax.Account.GetBalance().Result; Assert.IsTrue(actual > 0); } } }
mit
C#
b305e0767a73a33fabc6a7fc5663353363527a5d
Fix missing ConfigureAwait call
jskeet/gax-dotnet,jskeet/gax-dotnet,googleapis/gax-dotnet,googleapis/gax-dotnet
Google.Api.Gax.Grpc/Rest/RestCallInvoker.cs
Google.Api.Gax.Grpc/Rest/RestCallInvoker.cs
/* * Copyright 2020 Google LLC * Use of this source code is governed by a BSD-style * license that can be found in the LICENSE file or at * https://developers.google.com/open-source/licenses/bsd */ using Grpc.Core; using System; using System.Threading.Tasks; namespace Google.Api.Gax.Grpc.Rest { /// <summary> /// CallInvoker implementation which uses regular HTTP requests with JSON payloads. /// This just delegates back to the <see cref="RestChannel"/> that it wraps. /// </summary> internal sealed class RestCallInvoker : CallInvoker { private readonly RestChannel _channel; internal RestCallInvoker(RestChannel channel) => _channel = channel; /// <inheritdoc /> public override AsyncClientStreamingCall<TRequest, TResponse> AsyncClientStreamingCall<TRequest, TResponse>(Method<TRequest, TResponse> method, string host, CallOptions options) => throw new NotSupportedException("Streaming methods are not supported by the hybrid REST/gRPC mode"); /// <inheritdoc /> public override AsyncDuplexStreamingCall<TRequest, TResponse> AsyncDuplexStreamingCall<TRequest, TResponse>(Method<TRequest, TResponse> method, string host, CallOptions options) => throw new NotSupportedException("Streaming methods are not supported by the hybrid REST/gRPC mode"); /// <inheritdoc /> public override AsyncServerStreamingCall<TResponse> AsyncServerStreamingCall<TRequest, TResponse>(Method<TRequest, TResponse> method, string host, CallOptions options, TRequest request) => throw new NotSupportedException("Streaming methods are not supported by the hybrid REST/gRPC mode"); /// <inheritdoc /> public override AsyncUnaryCall<TResponse> AsyncUnaryCall<TRequest, TResponse>(Method<TRequest, TResponse> method, string host, CallOptions options, TRequest request) => _channel.AsyncUnaryCall(method, host, options, request); /// <inheritdoc /> public override TResponse BlockingUnaryCall<TRequest, TResponse>(Method<TRequest, TResponse> method, string host, CallOptions options, TRequest request) => // TODO: Try to make this more efficient? Task.Run(async () => await AsyncUnaryCall(method, host, options, request).ConfigureAwait(false)).ResultWithUnwrappedExceptions(); } }
/* * Copyright 2020 Google LLC * Use of this source code is governed by a BSD-style * license that can be found in the LICENSE file or at * https://developers.google.com/open-source/licenses/bsd */ using Grpc.Core; using System; using System.Threading.Tasks; namespace Google.Api.Gax.Grpc.Rest { /// <summary> /// CallInvoker implementation which uses regular HTTP requests with JSON payloads. /// This just delegates back to the <see cref="RestChannel"/> that it wraps. /// </summary> internal sealed class RestCallInvoker : CallInvoker { private readonly RestChannel _channel; internal RestCallInvoker(RestChannel channel) => _channel = channel; /// <inheritdoc /> public override AsyncClientStreamingCall<TRequest, TResponse> AsyncClientStreamingCall<TRequest, TResponse>(Method<TRequest, TResponse> method, string host, CallOptions options) => throw new NotSupportedException("Streaming methods are not supported by the hybrid REST/gRPC mode"); /// <inheritdoc /> public override AsyncDuplexStreamingCall<TRequest, TResponse> AsyncDuplexStreamingCall<TRequest, TResponse>(Method<TRequest, TResponse> method, string host, CallOptions options) => throw new NotSupportedException("Streaming methods are not supported by the hybrid REST/gRPC mode"); /// <inheritdoc /> public override AsyncServerStreamingCall<TResponse> AsyncServerStreamingCall<TRequest, TResponse>(Method<TRequest, TResponse> method, string host, CallOptions options, TRequest request) => throw new NotSupportedException("Streaming methods are not supported by the hybrid REST/gRPC mode"); /// <inheritdoc /> public override AsyncUnaryCall<TResponse> AsyncUnaryCall<TRequest, TResponse>(Method<TRequest, TResponse> method, string host, CallOptions options, TRequest request) => _channel.AsyncUnaryCall(method, host, options, request); /// <inheritdoc /> public override TResponse BlockingUnaryCall<TRequest, TResponse>(Method<TRequest, TResponse> method, string host, CallOptions options, TRequest request) => // TODO: Try to make this more efficient? Task.Run(async () => await AsyncUnaryCall(method, host, options, request)).ResultWithUnwrappedExceptions(); } }
bsd-3-clause
C#
e5a4156c552486d9ac65ec91f5322d9b83cbd294
Add additional code gen smoke test cases
IntelliTect/Coalesce,IntelliTect/Coalesce,IntelliTect/Coalesce,IntelliTect/Coalesce
src/IntelliTect.Coalesce.Tests/TargetClasses/CaseDtoStandalone.cs
src/IntelliTect.Coalesce.Tests/TargetClasses/CaseDtoStandalone.cs
using System.Collections; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.Linq; using IntelliTect.Coalesce; using IntelliTect.Coalesce.DataAnnotations; using IntelliTect.Coalesce.Tests.TargetClasses.TestDbContext; #nullable enable namespace IntelliTect.Coalesce.Tests.TargetClasses { [Coalesce] public class CaseDtoStandalone : IClassDto<Case, TestDbContext.TestDbContext> { [Key] public int CaseId { get; set; } public string? Title { get; set; } public void MapTo(Case obj, IMappingContext context) { obj.Title = Title; } public void MapFrom(Case obj, IMappingContext context, IncludeTree? tree = null) { CaseId = obj.CaseKey; Title = obj.Title; } } public class ExternalTypeWithDtoProp { public CaseDtoStandalone Case { get; set; } public ICollection<CaseDtoStandalone> Cases { get; set; } public List<CaseDtoStandalone> CasesList { get; set; } public CaseDtoStandalone[] CasesArray { get; set; } } }
using System.Collections; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.Linq; using IntelliTect.Coalesce; using IntelliTect.Coalesce.DataAnnotations; using IntelliTect.Coalesce.Tests.TargetClasses.TestDbContext; #nullable enable namespace IntelliTect.Coalesce.Tests.TargetClasses { [Coalesce] public class CaseDtoStandalone : IClassDto<Case, TestDbContext.TestDbContext> { [Key] public int CaseId { get; set; } public string? Title { get; set; } public void MapTo(Case obj, IMappingContext context) { obj.Title = Title; } public void MapFrom(Case obj, IMappingContext context, IncludeTree? tree = null) { CaseId = obj.CaseKey; Title = obj.Title; } } public class ExternalTypeWithDtoProp { public CaseDtoStandalone Case { get; set; } } }
apache-2.0
C#
20091aa991560fb72be97b2f4724e452b96444f1
Change back to Node to ThreadSafeCollection (https://github.com/MetacoSA/NBitcoin/pull/698)
MetacoSA/NBitcoin,NicolasDorier/NBitcoin,MetacoSA/NBitcoin
NBitcoin/Protocol/Filters/NodeFiltersCollection.cs
NBitcoin/Protocol/Filters/NodeFiltersCollection.cs
#if !NOSOCKET using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace NBitcoin.Protocol.Filters { public class NodeFiltersCollection : ThreadSafeCollection<INodeFilter> { public IDisposable Add(Action<IncomingMessage, Action> onReceiving, Action<Node, Payload, Action> onSending = null) { return base.Add(new ActionFilter(onReceiving, onSending)); } } } #endif
#if !NOSOCKET using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace NBitcoin.Protocol.Filters { public class NodeFiltersCollection : ThreadSafeList<INodeFilter> { public IDisposable Add(Action<IncomingMessage, Action> onReceiving, Action<Node, Payload, Action> onSending = null) { return base.Add(new ActionFilter(onReceiving, onSending)); } } } #endif
mit
C#
390b37c03a814df534c0b3302ad78dbc0f935a36
Fix XPackCluster. Set license json from reading file, based on path in environment variable.
elastic/elasticsearch-net,elastic/elasticsearch-net
src/Tests/Framework/ManagedElasticsearch/Clusters/XPackCluster.cs
src/Tests/Framework/ManagedElasticsearch/Clusters/XPackCluster.cs
using System; using System.IO; using Elastic.Managed.Ephemeral; using Elastic.Xunit; using Elasticsearch.Net; using Nest; using Tests.Framework.ManagedElasticsearch.NodeSeeders; using Tests.Framework.ManagedElasticsearch.Tasks; namespace Tests.Framework.ManagedElasticsearch.Clusters { public class XPackClusterConfiguration : ClientTestClusterConfiguration { public XPackClusterConfiguration() : this(ClusterFeatures.SSL | ClusterFeatures.Security) { } public XPackClusterConfiguration(ClusterFeatures features) : base(ClusterFeatures.XPack | features, 1) { // Get license file path from environment variable var licenseFilePath = Environment.GetEnvironmentVariable("ES_LICENSE_FILE"); if (!string.IsNullOrEmpty(licenseFilePath) && File.Exists(licenseFilePath)) { var licenseContents = File.ReadAllText(licenseFilePath); this.XPackLicenseJson = licenseContents; } this.ShowElasticsearchOutputAfterStarted = false; this.AdditionalBeforeNodeStartedTasks.Add(new EnsureWatcherActionConfigurationInElasticsearchYaml()); } } public class XPackCluster : XunitClusterBase<XPackClusterConfiguration>, INestTestCluster { public XPackCluster() : this(new XPackClusterConfiguration()) { } public XPackCluster(XPackClusterConfiguration configuration) : base(configuration) { } protected virtual ConnectionSettings Authenticate(ConnectionSettings s) => s .BasicAuthentication(ClusterAuthentication.Admin.Username, ClusterAuthentication.Admin.Password); protected virtual ConnectionSettings ConnectionSettings(ConnectionSettings s) => s .ServerCertificateValidationCallback(CertificateValidations.AllowAll); public virtual IElasticClient Client => this.GetOrAddClient(s=>Authenticate(ConnectionSettings(s))); protected override void SeedCluster() => new DefaultSeeder(this.Client).SeedNode(); } }
using Elastic.Managed.Ephemeral; using Elastic.Xunit; using Elasticsearch.Net; using Nest; using Tests.Framework.ManagedElasticsearch.NodeSeeders; using Tests.Framework.ManagedElasticsearch.Tasks; namespace Tests.Framework.ManagedElasticsearch.Clusters { public class XPackClusterConfiguration : ClientTestClusterConfiguration { public XPackClusterConfiguration() : this(ClusterFeatures.SSL | ClusterFeatures.Security) { } public XPackClusterConfiguration(ClusterFeatures features) : base(ClusterFeatures.XPack | features, 1) { this.ShowElasticsearchOutputAfterStarted = false; this.AdditionalBeforeNodeStartedTasks.Add(new EnsureWatcherActionConfigurationInElasticsearchYaml()); } } public class XPackCluster : XunitClusterBase<XPackClusterConfiguration>, INestTestCluster { public XPackCluster() : this(new XPackClusterConfiguration()) { } public XPackCluster(XPackClusterConfiguration configuration) : base(configuration) { } protected virtual ConnectionSettings Authenticate(ConnectionSettings s) => s .BasicAuthentication(ClusterAuthentication.Admin.Username, ClusterAuthentication.Admin.Password); protected virtual ConnectionSettings ConnectionSettings(ConnectionSettings s) => s .ServerCertificateValidationCallback(CertificateValidations.AllowAll); public virtual IElasticClient Client => this.GetOrAddClient(s=>Authenticate(ConnectionSettings(s))); protected override void SeedCluster() => new DefaultSeeder(this.Client).SeedNode(); } }
apache-2.0
C#
a31a3349e90ed4cc26c6efa8c509ffca4319464a
Update copyright.
tompostler/lecture-convert
lecture-convert/Properties/AssemblyInfo.cs
lecture-convert/Properties/AssemblyInfo.cs
using System.Resources; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("lecture-convert")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("lecture-convert")] [assembly: AssemblyCopyright("Copyright © UnlimitedInf 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("356debd9-05c1-4d46-84ae-02167cdbe856")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: NeutralResourcesLanguage("en-US")]
using System.Resources; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("lecture-convert")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("lecture-convert")] [assembly: AssemblyCopyright("Copyright © 2015")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("356debd9-05c1-4d46-84ae-02167cdbe856")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: NeutralResourcesLanguage("en-US")]
apache-2.0
C#
a986e151f8b7e93215ef299dd3ea9f217ba9cd36
Rewrite login method without explicit synchronization
k-t/SharpHaven
MonoHaven.Client/Network/LoginService.cs
MonoHaven.Client/Network/LoginService.cs
using System; using System.Threading.Tasks; namespace MonoHaven.Network { public class LoginService { private readonly LoginSettings settings; public LoginService(LoginSettings settings) { this.settings = settings; } public event EventHandler<LoginStatusEventArgs> StatusChanged; public async Task<LoginResult> LoginAsync(string userName, string password) { try { ChangeStatus("Authenticating..."); var cookie = await Task<byte[]>.Factory.StartNew(() => Authenticate(userName, password)); if (cookie == null) return new LoginResult("Username or password incorrect"); ChangeStatus("Connecting..."); var connection = CreateConnection(userName, cookie); await Task.Factory.StartNew(connection.Open); return new LoginResult(); } catch (Exception e) { return new LoginResult(e.Message); } } private byte[] Authenticate(string userName, string password) { byte[] cookie; using (var authClient = new AuthClient(settings.AuthHost, settings.AuthPort)) { authClient.Connect(); authClient.BindUser(userName); return authClient.TryPassword(password, out cookie) ? cookie : null; } } private GameConnection CreateConnection(string userName, byte[] cookie) { var settings = new ConnectionSettings { Host = this.settings.GameHost, Port = this.settings.GamePort, UserName = userName, Cookie = cookie }; return new GameConnection(settings); } private void ChangeStatus(string status) { var args = new LoginStatusEventArgs(status); if (StatusChanged != null) StatusChanged(this, args); } } }
using System; using System.ComponentModel; using System.Threading.Tasks; namespace MonoHaven.Network { public class LoginService { private readonly LoginSettings settings; public LoginService(LoginSettings settings) { this.settings = settings; } public event EventHandler<LoginStatusEventArgs> StatusChanged; public LoginResult Login(string userName, string password) { return Login(userName, password, null); } public async Task<LoginResult> LoginAsync(string userName, string password) { var operation = AsyncOperationManager.CreateOperation(null); var result = await Task<LoginResult>.Factory.StartNew( () => Login(userName, password, operation)); return result; } private LoginResult Login(string userName, string password, AsyncOperation operation) { byte[] cookie; try { ChangeStatus("Authenticating...", operation); if (!Authenticate(userName, password, out cookie)) return new LoginResult("Username or password incorrect"); ChangeStatus("Connecting...", operation); var connection = CreateConnection(userName, cookie); connection.Open(); return new LoginResult(); } catch (Exception e) { return new LoginResult(e.Message); } } private bool Authenticate(string userName, string password, out byte[] cookie) { using (var authClient = new AuthClient(settings.AuthHost, settings.AuthPort)) { authClient.Connect(); authClient.BindUser(userName); return authClient.TryPassword(password, out cookie); } } private GameConnection CreateConnection(string userName, byte[] cookie) { var settings = new ConnectionSettings { Host = this.settings.GameHost, Port = this.settings.GamePort, UserName = userName, Cookie = cookie }; return new GameConnection(settings); } private void ChangeStatus(string status, AsyncOperation operation) { var args = new LoginStatusEventArgs(status); if (operation != null) operation.Post(_ => OnStatusChanged(args), null); else OnStatusChanged(args); } private void OnStatusChanged(LoginStatusEventArgs args) { if (StatusChanged != null) StatusChanged(this, args); } } }
mit
C#
bbc07aa098cbbf82f24950f3abca8e915d5790a6
Add non-generic ITableDependency and base ITableDependency<T> on it
christiandelbianco/monitor-table-change-with-sqltabledependency
TableDependency/Abstracts/ITableDependency.cs
TableDependency/Abstracts/ITableDependency.cs
#region License // TableDependency, SqlTableDependency // Copyright (c) 2015-2018 Christian Del Bianco. All rights reserved. // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated documentation // files (the "Software"), to deal in the Software without // restriction, including without limitation the rights to use, // copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following // conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. #endregion using System.Diagnostics; using System.Globalization; using System.Text; using TableDependency.Delegates; using TableDependency.Enums; namespace TableDependency.Abstracts { public interface ITableDependency { #region Events event ErrorEventHandler OnError; event StatusEventHandler OnStatusChanged; #endregion #region Methods void Start(int timeOut = 120, int watchDogTimeOut = 180); void Stop(); #endregion #region Properties TraceLevel TraceLevel { get; set; } TraceListener TraceListener { get; set; } TableDependencyStatus Status { get; } Encoding Encoding { get; set; } CultureInfo CultureInfo { get; set; } string DataBaseObjectsNamingConvention { get; } string TableName { get; } string SchemaName { get; } #endregion } public interface ITableDependency<T> : ITableDependency where T : class, new() { #region Events event ChangedEventHandler<T> OnChanged; #endregion } }
#region License // TableDependency, SqlTableDependency // Copyright (c) 2015-2018 Christian Del Bianco. All rights reserved. // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated documentation // files (the "Software"), to deal in the Software without // restriction, including without limitation the rights to use, // copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following // conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. #endregion using System.Diagnostics; using System.Globalization; using System.Text; using TableDependency.Delegates; using TableDependency.Enums; namespace TableDependency.Abstracts { public interface ITableDependency<T> where T : class, new() { #region Events event ChangedEventHandler<T> OnChanged; event ErrorEventHandler OnError; event StatusEventHandler OnStatusChanged; #endregion #region Methods void Start(int timeOut = 120, int watchDogTimeOut = 180); void Stop(); #endregion #region Properties TraceLevel TraceLevel { get; set; } TraceListener TraceListener { get; set; } TableDependencyStatus Status { get; } Encoding Encoding { get; set; } CultureInfo CultureInfo { get; set; } string DataBaseObjectsNamingConvention { get; } string TableName { get; } string SchemaName { get; } #endregion } }
mit
C#
947ef60d3b6ff250f92b246f195dd41742afe488
add exception handled
AspectCore/AspectCore-Framework,AspectCore/AspectCore-Framework,AspectCore/Lite,AspectCore/Abstractions
src/AspectCore.Lite.DependencyInjection/Internal/SupportOriginalService.cs
src/AspectCore.Lite.DependencyInjection/Internal/SupportOriginalService.cs
using AspectCore.Lite.DependencyInjection; using System; namespace AspectCore.Lite.DependencyInjection.Internal { internal class SupportOriginalService : ISupportOriginalService { private readonly IServiceProvider serviceProvider; public SupportOriginalService(IServiceProvider serviceProvider) { this.serviceProvider = serviceProvider; } public object GetService(Type serviceType) { try { return serviceProvider.GetService(serviceType); } catch (Exception exception) { throw new InvalidOperationException($"Unable to resolve original service for type '{serviceType}'.", exception); } } public IServiceProvider OriginalServiceProvider { get { return serviceProvider; } } } }
using AspectCore.Lite.DependencyInjection; using System; namespace AspectCore.Lite.DependencyInjection.Internal { internal class SupportOriginalService : ISupportOriginalService { private readonly IServiceProvider serviceProvider; public SupportOriginalService(IServiceProvider serviceProvider) { this.serviceProvider = serviceProvider; } public object GetService(Type serviceType) { return serviceProvider.GetService(serviceType); } public IServiceProvider OriginalServiceProvider { get { return serviceProvider; } } } }
mit
C#
2d0d15512f67197c01bbe6cae54934638e8c9bef
バージョン番号更新。
YKSoftware/YKToolkit.Controls
YKToolkit.Controls/Properties/AssemblyInfo.cs
YKToolkit.Controls/Properties/AssemblyInfo.cs
using System.Reflection; using System.Runtime.InteropServices; using System.Windows; [assembly: AssemblyTitle("YKToolkit.Controls")] #if NET4 [assembly: AssemblyDescription(".NET Framework 4.0 用 の WPF カスタムコントロールライブラリです。")] #else [assembly: AssemblyDescription("WPF カスタムコントロールライブラリです。")] #endif [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("YKSoftware")] [assembly: AssemblyProduct("YKToolkit.Controls")] [assembly: AssemblyCopyright("Copyright © 2015 YKSoftware")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] [assembly: ComVisible(false)] [assembly:ThemeInfo(ResourceDictionaryLocation.None, ResourceDictionaryLocation.SourceAssembly)] [assembly: AssemblyVersion("2.4.4.0")]
using System.Reflection; using System.Runtime.InteropServices; using System.Windows; [assembly: AssemblyTitle("YKToolkit.Controls")] #if NET4 [assembly: AssemblyDescription(".NET Framework 4.0 用 の WPF カスタムコントロールライブラリです。")] #else [assembly: AssemblyDescription("WPF カスタムコントロールライブラリです。")] #endif [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("YKSoftware")] [assembly: AssemblyProduct("YKToolkit.Controls")] [assembly: AssemblyCopyright("Copyright © 2015 YKSoftware")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] [assembly: ComVisible(false)] [assembly:ThemeInfo(ResourceDictionaryLocation.None, ResourceDictionaryLocation.SourceAssembly)] [assembly: AssemblyVersion("2.4.3.0")]
mit
C#
c4c59d6f50672ccbbe2aaa0dfde00312cfbe9023
Update log controller for ow-server-enet
eKiosk/HardwareSensorSystem,eKiosk/HardwareSensorSystem,eKiosk/HardwareSensorSystem
src/HardwareSensorSystem.SensorTechnology/Controllers/OwServerEnet2LogController.cs
src/HardwareSensorSystem.SensorTechnology/Controllers/OwServerEnet2LogController.cs
using HardwareSensorSystem.SensorTechnology.Models; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using Microsoft.EntityFrameworkCore; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Xml.Linq; namespace HardwareSensorSystem.SensorTechnology.Controllers { public class OwServerEnet2LogController : Controller { private SensorTechnologyDbContext _context; public OwServerEnet2LogController(SensorTechnologyDbContext context) { _context = context; } [AllowAnonymous] [HttpPost("api/devices/{deviceId}/log/ow-server-enet")] public async Task<IActionResult> Log([FromRoute]int deviceId) { XDocument file = XDocument.Load(HttpContext.Request.Body); var romIdName = XName.Get("ROMId", file.Root.Name.NamespaceName); var dataSensors = file.Root.Elements().Select(sensor => new { SerialNumber = sensor.Element(romIdName).Value, Data = sensor.Elements().Where(element => element != sensor.Element(romIdName)) }); var groupedProperties = await _context.Sensors.Where(sensor => sensor.DeviceId.Equals(deviceId)) .Join(_context.SensorProperties .Where(property => property.Name.Equals("SENSOR_ID")) .Where(property => dataSensors.Any(e => e.SerialNumber.Equals(property.Value))), sensor => sensor.Id, property => property.SensorId, (sensor, _) => sensor) .GroupJoin(_context.SensorProperties, sensor => sensor.Id, property => property.SensorId, (_, properties) => properties) .ToListAsync(); foreach (var properties in groupedProperties) { var serialNumber = properties.Single(property => property.Name.Equals("SENSOR_ID")).Value; try { var data = dataSensors.Single(e => e.SerialNumber.Equals(serialNumber)).Data; } catch { } } return Ok(); } } }
using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Xml.Linq; namespace HardwareSensorSystem.SensorTechnology.Controllers { public class OwServerEnet2LogController : Controller { [AllowAnonymous] [HttpPost("api/devices/{deviceId}/log")] public async Task<IActionResult> Log([FromRoute]int deviceId) { XDocument file = XDocument.Load(HttpContext.Request.Body); var romIdName = XName.Get("ROMId", file.Root.Name.NamespaceName); var dataSensors = file.Root.Elements().Select(sensor => new { SerialNumber = sensor.Element(romIdName).Value, Data = sensor.Elements().Where(element => element != sensor.Element(romIdName)) }); return Ok(); } } }
apache-2.0
C#
55f830a305a908fd3488f47f4fbde985b0b9f375
Fix typo cultur -> culture
yaronthurm/Pinger
Pinger/Code/Program.cs
Pinger/Code/Program.cs
using System; using System.IO; using System.Windows.Forms; namespace PingTester { static class Program { /* TODO: * issue 1: add support to new file format (xml) * issue 2: add full support for telnet, ssh, remote desktop, vnc (icons and prebuilt passwords) * issue 3: add log file to ping responses and state changes * issue 4: add indication to name of opend file * issue 5: add status bar indication how much online/offline * * issue 6: add support for rapid ping (lots of users sending ping at once) * issue 7: add response time to stats (min, max, avg) */ public const string LastPingerFileName = "pinger_history.txt"; /// <summary> /// The main entry point for the application. /// </summary> [STAThread] static void Main(string[] Args) { try { var culture = System.Configuration.ConfigurationManager.AppSettings["Globalization.CultureInfo"]; if (culture == "he" || culture == "en") System.Threading.Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo(culture); Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); FrmMain main = new FrmMain(); main.LastPingerFileName = Path.Combine(System.Environment.CurrentDirectory, Program.LastPingerFileName); if (Args.Length > 0) main.StartupFileName = Args[0]; else main.StartupFileName = main.LastPingerFileName; Application.Run(main); } catch (Exception ex) { MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1); } } } }
using System; using System.IO; using System.Windows.Forms; namespace PingTester { static class Program { /* TODO: * issue 1: add support to new file format (xml) * issue 2: add full support for telnet, ssh, remote desktop, vnc (icons and prebuilt passwords) * issue 3: add log file to ping responses and state changes * issue 4: add indication to name of opend file * issue 5: add status bar indication how much online/offline * * issue 6: add support for rapid ping (lots of users sending ping at once) * issue 7: add response time to stats (min, max, avg) */ public const string LastPingerFileName = "pinger_history.txt"; /// <summary> /// The main entry point for the application. /// </summary> [STAThread] static void Main(string[] Args) { try { var cultur = System.Configuration.ConfigurationManager.AppSettings["Globalization.CultureInfo"]; if (cultur == "he" || cultur == "en") System.Threading.Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo(cultur); Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); FrmMain main = new FrmMain(); main.LastPingerFileName = Path.Combine(System.Environment.CurrentDirectory, Program.LastPingerFileName); if (Args.Length > 0) main.StartupFileName = Args[0]; else main.StartupFileName = main.LastPingerFileName; Application.Run(main); } catch (Exception ex) { MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1); } } } }
mit
C#
56adf9647e18b3deb08fddb5a9795ebdf55f7292
Update UnityProject/Assets/Scripts/Inventory/NamedSlot.cs
fomalsd/unitystation,fomalsd/unitystation,fomalsd/unitystation,fomalsd/unitystation,fomalsd/unitystation,fomalsd/unitystation,fomalsd/unitystation
UnityProject/Assets/Scripts/Inventory/NamedSlot.cs
UnityProject/Assets/Scripts/Inventory/NamedSlot.cs
using System; /// <summary> /// All possible item slots. You MUST specify the ordinal otherwise it will break everything. /// </summary> [Serializable] public enum NamedSlot { //NOTE: To ensure safety of things, like scriptable objects, that are referencing this enum, you must NOT change //the ordinals and any new value you add must specify a new ordinal value //player inventory stuff outerwear = 0, belt = 1, head = 2, feet = 3, //NOTE: I don't think this is used, and mask is used instead face = 4, mask = 5, uniform = 6, leftHand = 7, rightHand = 8, eyes = 9, back = 10, hands = 11, ear = 12, neck = 13, handcuffs = 14, id = 15, storage01 = 16, storage02 = 17, suitStorage = 18, //alternative for non-nullable null value none = 2048, } // NOTE: Ensure that NamedSlotFlagged == 2^(NamedSlot). /// <summary> /// All possible item slots as a flagged enum. /// </summary> [Serializable, Flags] public enum NamedSlotFlagged { None = 1 << 0, Outerwear = 1 << 1, Belt = 1 << 2, Head = 1 << 3, Feet = 1 << 4, Mask = 1 << 5, Uniform = 1 << 6, LeftHand = 1 << 7, RightHand = 1 << 8, Eyes = 1 << 9, Back = 1 << 10, Hands = 1 << 11, Ear = 1 << 12, Neck = 1 << 13, Handcuffs = 1 << 14, ID = 1 << 15, Storage01 = 1 << 16, storage02 = 1 << 17, SuitStorage = 1 << 18 }
using System; /// <summary> /// All possible item slots. You MUST specify the ordinal otherwise it will break everything. /// </summary> [Serializable] public enum NamedSlot { //NOTE: To ensure safety of things, like scriptable objects, that are referencing this enum, you must NOT change //the ordinals and any new value you add must specify a new ordinal value //player inventory stuff outerwear = 0, belt = 1, head = 2, feet = 3, //NOTE: I don't think this is used, and mask is used instead face = 4, mask = 5, uniform = 6, leftHand = 7, rightHand = 8, eyes = 9, back = 10, hands = 11, ear = 12, neck = 13, handcuffs = 14, id = 15, storage01 = 16, storage02 = 17, suitStorage = 18, //alternative for non-nullable null value none = 2048, } // NOTE: Ensure that NamedSlotFlagged == 2^(NamedSlot). /// <summary> /// All possible item slots as a flagged enum. /// </summary> [Serializable, Flags] public enum NamedSlotFlagged { None = 0, Outerwear = 1, Belt = 2, Head = 4, Feet = 8, Mask = 32, Uniform = 64, LeftHand = 128, RightHand = 256, Eyes = 512, Back = 1024, Hands = 2048, Ear = 4096, Neck = 8192, Handcuffs = 16384, ID = 32768, Storage01 = 65536, storage02 = 131072, SuitStorage = 262144 }
agpl-3.0
C#
07b52dfbbea7b84a17fd907ff9d0a597cd67e02a
add tests for base 16 number (hex) + cleanup
martinlindhe/Punku
PunkuTests/Math/NaturalNumber.cs
PunkuTests/Math/NaturalNumber.cs
using System; using NUnit.Framework; using Punku; [TestFixture] [Category ("Math")] public class Math_NaturalNumber { [Test] public void ToDecimal01 () { var x = new NaturalNumber ("12345"); Assert.AreEqual (x.ToDecimal (), 12345); } [Test] public void ToDecimal02 () { var x = new NaturalNumber ("00012345"); Assert.AreEqual (x.ToDecimal (), 12345); } [Test] public void ToDecimal03 () { var x = new NaturalNumber ("0"); Assert.AreEqual (x.ToDecimal (), 0); } [Test] [ExpectedException (typeof(ArgumentOutOfRangeException))] public void ToDecimal04 () { var x = new NaturalNumber (""); } [ExpectedException (typeof(ArgumentOutOfRangeException))] public void ToDecimal05 () { var x = new NaturalNumber ("1", 1); } [ExpectedException (typeof(ArgumentOutOfRangeException))] public void ToDecimal06 () { var x = new NaturalNumber ("1", 0); } [Test] public void ToDecimal07 () { var x = new NaturalNumber ("79228162514264337593543950335"); Assert.AreEqual (x.ToDecimal (), Decimal.MaxValue); } [Test] [ExpectedException (typeof(OverflowException))] public void ToDecimal08 () { var x = new NaturalNumber ("79228162514264337593543950336"); x.ToDecimal (); } [Test] public void ToDecimal09 () { var bb = new NaturalNumber ("11111111", 2); Assert.AreEqual (bb.ToDecimal (), 255); } [Test] public void ToDecimal10 () { var bb = new NaturalNumber ("FF", 16); Assert.AreEqual (bb.ToDecimal (), 255); } [Test] public void Verify01 () { var x = new NaturalNumber ("123"); Assert.AreEqual ( x.Digits, new byte[] { 1, 2, 3 } ); } [Test] public void Verify02 () { var x = new NaturalNumber ("0"); Assert.AreEqual ( x.Digits, new byte[] { 0 } ); } }
using System; using NUnit.Framework; using Punku; [TestFixture] [Category ("Math")] public class Math_NaturalNumber { [Test] public void ToDecimal01 () { var bb = new NaturalNumber ("12345"); Assert.AreEqual (bb.ToDecimal (), 12345); } [Test] public void ToDecimal02 () { var bb = new NaturalNumber ("00012345"); Assert.AreEqual (bb.ToDecimal (), 12345); } [Test] public void ToDecimal03 () { var bb = new NaturalNumber ("0"); Assert.AreEqual (bb.ToDecimal (), 0); } [Test] [ExpectedException (typeof(FormatException))] public void ToDecimal04 () { var bb = new NaturalNumber (""); } [Test] public void ToDecimal05 () { var bb = new NaturalNumber ("79228162514264337593543950335"); Assert.AreEqual (bb.ToDecimal (), Decimal.MaxValue); } [Test] [ExpectedException (typeof(OverflowException))] public void ToDecimal06 () { var bb = new NaturalNumber ("79228162514264337593543950336"); bb.ToDecimal (); } [Test] public void ToDecimal07 () { var bb = new NaturalNumber ("11111111", 2); Assert.AreEqual (bb.ToDecimal (), 255); } [Test] public void Verify01 () { var bb = new NaturalNumber ("123"); Assert.AreEqual ( bb.Digits, new byte[] { 1, 2, 3 } ); } [Test] public void Verify02 () { var bb = new NaturalNumber ("0"); Assert.AreEqual ( bb.Digits, new byte[] { 0 } ); } }
mit
C#
3b815536498f04290e15054ea5ee3c84d88b1cfe
Replace more hard-coded directory separators with "Path.DirectorySeparatorChar"
YuvalItzchakov/aerospike-client-csharp
AerospikeClient/Lua/LuaConfig.cs
AerospikeClient/Lua/LuaConfig.cs
/* * Copyright 2012-2015 Aerospike, Inc. * * Portions may be licensed to Aerospike, Inc. under one or more contributor * license agreements. * * 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.IO; namespace Aerospike.Client { /// <summary> /// Lua static configuration variables. These variables apply to all AerospikeClient instances /// in a single process. /// </summary> public sealed class LuaConfig { /// <summary> /// Directory location which contains user defined Lua source files. /// </summary> public static string PackagePath = "udf" + Path.DirectorySeparatorChar + "?.lua"; /// <summary> /// Maximum number of Lua runtime instances to cache at any point in time. /// Each query with an aggregation function requires a Lua instance. /// If the number of concurrent queries exceeds the Lua pool size, a new Lua /// instance will still be created, but it will not be returned to the pool. /// </summary> public static int InstancePoolSize = 5; } }
/* * Copyright 2012-2015 Aerospike, Inc. * * Portions may be licensed to Aerospike, Inc. under one or more contributor * license agreements. * * 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; namespace Aerospike.Client { /// <summary> /// Lua static configuration variables. These variables apply to all AerospikeClient instances /// in a single process. /// </summary> public sealed class LuaConfig { /// <summary> /// Directory location which contains user defined Lua source files. /// </summary> public static string PackagePath = "udf/?.lua"; /// <summary> /// Maximum number of Lua runtime instances to cache at any point in time. /// Each query with an aggregation function requires a Lua instance. /// If the number of concurrent queries exceeds the Lua pool size, a new Lua /// instance will still be created, but it will not be returned to the pool. /// </summary> public static int InstancePoolSize = 5; } }
apache-2.0
C#
22e9a95486ffb6c5751a3b75dbc22a5eb00ae5e2
Add button to move to page1. it means both of destination page must set "HasNavigationBar=False"
ytabuchi/Study
XF_TabbedPage/XF_TabbedPage/XF_TabbedPage/Page3.cs
XF_TabbedPage/XF_TabbedPage/XF_TabbedPage/Page3.cs
using System; using System.Collections.Generic; using System.Linq; using System.Reflection.Emit; using System.Text; using Xamarin.Forms; namespace XF_TabbedPage { public class Page3 : ContentPage { public Page3() { NavigationPage.SetHasNavigationBar(this, false); var label = new Label { Text = "Hello TabbedPage 3!", TextColor = Color.FromHex("#666666"), HorizontalTextAlignment = TextAlignment.Center }; var button1 = new Button { Text = "GoTo Page3", Command = new Command(() => { Navigation.PushAsync(new Page3()); }) }; var button2 = new Button { Text = "GoTo Page1", Command = new Command(() => { Navigation.PushAsync(new Page1()); }) }; Title = "TabPage 3"; BackgroundColor = Color.FromHex("#eeeeff"); Content = new StackLayout { Padding = 8, VerticalOptions = LayoutOptions.CenterAndExpand, Children = { label, button1, button2 } }; } } }
using System; using System.Collections.Generic; using System.Linq; using System.Reflection.Emit; using System.Text; using Xamarin.Forms; namespace XF_TabbedPage { public class Page3 : ContentPage { public Page3() { NavigationPage.SetHasNavigationBar(this, false); var label = new Label { Text = "Hello TabbedPage 3!", TextColor = Color.FromHex("#666666"), HorizontalTextAlignment = TextAlignment.Center }; var button = new Button { Text = "GoTo NextPage", Command = new Command(() => { Navigation.PushAsync(new Page3()); }) }; Title = "TabPage 3"; BackgroundColor = Color.FromHex("#eeeeff"); Content = new StackLayout { Padding = 8, VerticalOptions = LayoutOptions.CenterAndExpand, Children = { label, button } }; } } }
mit
C#
a46c3af6469fc0436ee7aa197318a84f0e9e64be
Update Assembly Version
samtoubia/azure-sdk-for-net,btasdoven/azure-sdk-for-net,JasonYang-MSFT/azure-sdk-for-net,Yahnoosh/azure-sdk-for-net,jamestao/azure-sdk-for-net,AzCiS/azure-sdk-for-net,shutchings/azure-sdk-for-net,ScottHolden/azure-sdk-for-net,olydis/azure-sdk-for-net,DheerendraRathor/azure-sdk-for-net,ahosnyms/azure-sdk-for-net,shahabhijeet/azure-sdk-for-net,samtoubia/azure-sdk-for-net,pankajsn/azure-sdk-for-net,pilor/azure-sdk-for-net,jamestao/azure-sdk-for-net,ahosnyms/azure-sdk-for-net,olydis/azure-sdk-for-net,jamestao/azure-sdk-for-net,r22016/azure-sdk-for-net,SiddharthChatrolaMs/azure-sdk-for-net,djyou/azure-sdk-for-net,AsrOneSdk/azure-sdk-for-net,shahabhijeet/azure-sdk-for-net,jhendrixMSFT/azure-sdk-for-net,hyonholee/azure-sdk-for-net,nathannfan/azure-sdk-for-net,DheerendraRathor/azure-sdk-for-net,peshen/azure-sdk-for-net,hyonholee/azure-sdk-for-net,brjohnstmsft/azure-sdk-for-net,jackmagic313/azure-sdk-for-net,brjohnstmsft/azure-sdk-for-net,ScottHolden/azure-sdk-for-net,btasdoven/azure-sdk-for-net,begoldsm/azure-sdk-for-net,ayeletshpigelman/azure-sdk-for-net,nathannfan/azure-sdk-for-net,shahabhijeet/azure-sdk-for-net,smithab/azure-sdk-for-net,MichaelCommo/azure-sdk-for-net,SiddharthChatrolaMs/azure-sdk-for-net,shutchings/azure-sdk-for-net,AsrOneSdk/azure-sdk-for-net,ahosnyms/azure-sdk-for-net,Yahnoosh/azure-sdk-for-net,r22016/azure-sdk-for-net,samtoubia/azure-sdk-for-net,smithab/azure-sdk-for-net,pilor/azure-sdk-for-net,brjohnstmsft/azure-sdk-for-net,nathannfan/azure-sdk-for-net,jamestao/azure-sdk-for-net,brjohnstmsft/azure-sdk-for-net,JasonYang-MSFT/azure-sdk-for-net,AzCiS/azure-sdk-for-net,mihymel/azure-sdk-for-net,jackmagic313/azure-sdk-for-net,AzureAutomationTeam/azure-sdk-for-net,r22016/azure-sdk-for-net,brjohnstmsft/azure-sdk-for-net,smithab/azure-sdk-for-net,atpham256/azure-sdk-for-net,yugangw-msft/azure-sdk-for-net,yoavrubin/azure-sdk-for-net,AzureAutomationTeam/azure-sdk-for-net,JasonYang-MSFT/azure-sdk-for-net,mihymel/azure-sdk-for-net,jhendrixMSFT/azure-sdk-for-net,jackmagic313/azure-sdk-for-net,jhendrixMSFT/azure-sdk-for-net,Yahnoosh/azure-sdk-for-net,MichaelCommo/azure-sdk-for-net,yoavrubin/azure-sdk-for-net,yaakoviyun/azure-sdk-for-net,atpham256/azure-sdk-for-net,shutchings/azure-sdk-for-net,stankovski/azure-sdk-for-net,samtoubia/azure-sdk-for-net,jackmagic313/azure-sdk-for-net,hyonholee/azure-sdk-for-net,SiddharthChatrolaMs/azure-sdk-for-net,atpham256/azure-sdk-for-net,djyou/azure-sdk-for-net,ayeletshpigelman/azure-sdk-for-net,yaakoviyun/azure-sdk-for-net,olydis/azure-sdk-for-net,AzCiS/azure-sdk-for-net,ayeletshpigelman/azure-sdk-for-net,shahabhijeet/azure-sdk-for-net,djyou/azure-sdk-for-net,AsrOneSdk/azure-sdk-for-net,pilor/azure-sdk-for-net,peshen/azure-sdk-for-net,yugangw-msft/azure-sdk-for-net,AsrOneSdk/azure-sdk-for-net,jackmagic313/azure-sdk-for-net,mihymel/azure-sdk-for-net,hyonholee/azure-sdk-for-net,DheerendraRathor/azure-sdk-for-net,peshen/azure-sdk-for-net,hyonholee/azure-sdk-for-net,pankajsn/azure-sdk-for-net,begoldsm/azure-sdk-for-net,pankajsn/azure-sdk-for-net,btasdoven/azure-sdk-for-net,MichaelCommo/azure-sdk-for-net,ayeletshpigelman/azure-sdk-for-net,yoavrubin/azure-sdk-for-net,markcowl/azure-sdk-for-net,stankovski/azure-sdk-for-net,ScottHolden/azure-sdk-for-net,yugangw-msft/azure-sdk-for-net,begoldsm/azure-sdk-for-net,AzureAutomationTeam/azure-sdk-for-net,yaakoviyun/azure-sdk-for-net
src/ResourceManagement/Compute/Microsoft.Azure.Management.Compute/Properties/AssemblyInfo.cs
src/ResourceManagement/Compute/Microsoft.Azure.Management.Compute/Properties/AssemblyInfo.cs
// // Copyright (c) Microsoft. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // using System.Reflection; using System.Resources; [assembly: AssemblyTitle("Microsoft Azure Compute Management Library")] [assembly: AssemblyDescription("Provides management functionality for Microsoft Azure Compute Resources.")] [assembly: AssemblyVersion("13.0.0.0")] [assembly: AssemblyFileVersion("13.0.0.0")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Microsoft")] [assembly: AssemblyProduct("Microsoft Azure .NET SDK")] [assembly: AssemblyCopyright("Copyright (c) Microsoft Corporation")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] [assembly: NeutralResourcesLanguage("en")]
// // Copyright (c) Microsoft. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // using System.Reflection; using System.Resources; [assembly: AssemblyTitle("Microsoft Azure Compute Management Library")] [assembly: AssemblyDescription("Provides management functionality for Microsoft Azure Compute Resources.")] [assembly: AssemblyVersion("10.0.0.0")] [assembly: AssemblyFileVersion("10.1.0.0")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Microsoft")] [assembly: AssemblyProduct("Microsoft Azure .NET SDK")] [assembly: AssemblyCopyright("Copyright (c) Microsoft Corporation")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] [assembly: NeutralResourcesLanguage("en")]
mit
C#
61a94bb56dad6c65365bdcb3ce8d27618e258c87
Add missing URL property in AttachmentAction
Inumedia/SlackAPI
SlackAPI/Attachment.cs
SlackAPI/Attachment.cs
namespace SlackAPI { //See: https://api.slack.com/docs/attachments public class Attachment { public string callback_id; public string fallback; public string color; public string pretext; public string author_name; public string author_link; public string author_icon; public string title; public string title_link; public string text; public Field[] fields; public IBlock[] blocks; public string image_url; public string thumb_url; public string[] mrkdwn_in; public AttachmentAction[] actions; public string footer; public string footer_icon; } public class Field{ public string title; public string value; public bool @short; } //See: https://api.slack.com/docs/message-buttons#action_fields public class AttachmentAction { public AttachmentAction(string name, string text) { this.name = name; this.text = text; } public string name { get; } public string text { get; } public string style; public string type = "button"; public string value; public ActionConfirm confirm; public string url; } //see: https://api.slack.com/docs/message-buttons#confirmation_fields public class ActionConfirm { public string title; public string text; public string ok_text; public string dismiss_text; } }
namespace SlackAPI { //See: https://api.slack.com/docs/attachments public class Attachment { public string callback_id; public string fallback; public string color; public string pretext; public string author_name; public string author_link; public string author_icon; public string title; public string title_link; public string text; public Field[] fields; public IBlock[] blocks; public string image_url; public string thumb_url; public string[] mrkdwn_in; public AttachmentAction[] actions; public string footer; public string footer_icon; } public class Field{ public string title; public string value; public bool @short; } //See: https://api.slack.com/docs/message-buttons#action_fields public class AttachmentAction { public AttachmentAction(string name, string text) { this.name = name; this.text = text; } public string name { get; } public string text { get; } public string style; public string type = "button"; public string value; public ActionConfirm confirm; } //see: https://api.slack.com/docs/message-buttons#confirmation_fields public class ActionConfirm { public string title; public string text; public string ok_text; public string dismiss_text; } }
mit
C#
eb757d7aef7ee2a74d034e5378223e45aa50d996
Add missing field to config
LordMike/TMDbLib
TMDbLib/Objects/General/ConfigImageTypes.cs
TMDbLib/Objects/General/ConfigImageTypes.cs
using System.Collections.Generic; using Newtonsoft.Json; namespace TMDbLib.Objects.General { public class ConfigImageTypes { [JsonProperty("base_url")] public string BaseUrl { get; set; } [JsonProperty("secure_base_url")] public string SecureBaseUrl { get; set; } [JsonProperty("poster_sizes")] public List<string> PosterSizes { get; set; } [JsonProperty("backdrop_sizes")] public List<string> BackdropSizes { get; set; } [JsonProperty("profile_sizes")] public List<string> ProfileSizes { get; set; } [JsonProperty("logo_sizes")] public List<string> LogoSizes { get; set; } [JsonProperty("still_sizes")] public List<string> StillSizes { get; set; } } }
using System.Collections.Generic; using Newtonsoft.Json; namespace TMDbLib.Objects.General { public class ConfigImageTypes { [JsonProperty("base_url")] public string BaseUrl { get; set; } [JsonProperty("secure_base_url")] public string SecureBaseUrl { get; set; } [JsonProperty("poster_sizes")] public List<string> PosterSizes { get; set; } [JsonProperty("backdrop_sizes")] public List<string> BackdropSizes { get; set; } [JsonProperty("profile_sizes")] public List<string> ProfileSizes { get; set; } [JsonProperty("logo_sizes")] public List<string> LogoSizes { get; set; } } }
mit
C#
d840b4b3e9224b9310f10d311c6f1e391369b045
Fix an error in test (#5041)
jackmagic313/azure-sdk-for-net,jamestao/azure-sdk-for-net,stankovski/azure-sdk-for-net,jackmagic313/azure-sdk-for-net,jackmagic313/azure-sdk-for-net,yugangw-msft/azure-sdk-for-net,markcowl/azure-sdk-for-net,yugangw-msft/azure-sdk-for-net,AsrOneSdk/azure-sdk-for-net,hyonholee/azure-sdk-for-net,shahabhijeet/azure-sdk-for-net,jackmagic313/azure-sdk-for-net,ayeletshpigelman/azure-sdk-for-net,AsrOneSdk/azure-sdk-for-net,AsrOneSdk/azure-sdk-for-net,hyonholee/azure-sdk-for-net,jackmagic313/azure-sdk-for-net,AsrOneSdk/azure-sdk-for-net,hyonholee/azure-sdk-for-net,brjohnstmsft/azure-sdk-for-net,ayeletshpigelman/azure-sdk-for-net,jamestao/azure-sdk-for-net,stankovski/azure-sdk-for-net,brjohnstmsft/azure-sdk-for-net,hyonholee/azure-sdk-for-net,ayeletshpigelman/azure-sdk-for-net,jamestao/azure-sdk-for-net,shahabhijeet/azure-sdk-for-net,hyonholee/azure-sdk-for-net,brjohnstmsft/azure-sdk-for-net,shahabhijeet/azure-sdk-for-net,ayeletshpigelman/azure-sdk-for-net,shahabhijeet/azure-sdk-for-net,brjohnstmsft/azure-sdk-for-net,yugangw-msft/azure-sdk-for-net,jamestao/azure-sdk-for-net,brjohnstmsft/azure-sdk-for-net
src/SDKs/CognitiveServices/dataPlane/Search/BingCustomSearch/BingCustomSearch.Tests/CustomSearchTests.cs
src/SDKs/CognitiveServices/dataPlane/Search/BingCustomSearch/BingCustomSearch.Tests/CustomSearchTests.cs
using Microsoft.Azure.Test.HttpRecorder; using Microsoft.Azure.CognitiveServices.Search.CustomSearch; using Microsoft.Azure.CognitiveServices.Search.CustomSearch.Models; using Microsoft.Rest.ClientRuntime.Azure.TestFramework; using System.Linq; using Xunit; using System.Net.Http; namespace SearchSDK.Tests { public class CustomSearchTests { private static string SubscriptionKey = "fake"; [Fact] public void CustomSearch() { using (MockContext context = MockContext.Start(this.GetType().FullName)) { HttpMockServer.Initialize(this.GetType().FullName, "CustomSearch"); ICustomSearchClient client = new CustomSearchClient(new ApiKeyServiceClientCredentials(SubscriptionKey), HttpMockServer.CreateInstance()); var resp = client.CustomInstance.SearchAsync(query: "tom cruise", customConfig: "0").Result; Assert.NotNull(resp); Assert.NotNull(resp.WebPages); Assert.NotNull(resp.WebPages.WebSearchUrl); Assert.NotNull(resp.WebPages.Value); Assert.NotNull(resp.WebPages.Value[0].DisplayUrl); } } } }
using Microsoft.Azure.Test.HttpRecorder; using Microsoft.Azure.CognitiveServices.Search.CustomSearch; using Microsoft.Azure.CognitiveServices.Search.CustomSearch.Models; using Microsoft.Rest.ClientRuntime.Azure.TestFramework; using System.Linq; using Xunit; using System.Net.Http; namespace SearchSDK.Tests { public class CustomSearchTests { private static string SubscriptionKey = "fake"; [Fact] public void CustomSearch() { using (MockContext context = MockContext.Start(this.GetType().FullName)) { HttpMockServer.Initialize(this.GetType().FullName, "CustomSearch"); ICustomSearchAPI client = new CustomSearchAPI(new ApiKeyServiceClientCredentials(SubscriptionKey), HttpMockServer.CreateInstance()); var resp = client.CustomInstance.SearchAsync(query: "tom cruise", customConfig: "0").Result; Assert.NotNull(resp); Assert.NotNull(resp.WebPages); Assert.NotNull(resp.WebPages.WebSearchUrl); Assert.NotNull(resp.WebPages.Value); Assert.NotNull(resp.WebPages.Value[0].DisplayUrl); } } } }
mit
C#
a4d6c788b2e603031a00e5d7a3e45d075de8f197
Make a picture unque for every next level
Barrelrolla/MonsterClicker
MonsterClicker/MonsterClicker/Monster.cs
MonsterClicker/MonsterClicker/Monster.cs
using System; using System.Collections.Generic; namespace MonsterClicker { using Interfaces; using System.Numerics; using System.Windows.Forms; public class Monster : IMonster { private BigInteger health; private static BigInteger startHealth = 10; private BigInteger nextLevelHealth = startHealth; //private List<string> photosPaths; private Random randomGenerator; //TODO: exp and money - every next monster must have more money and exp //TODO: exp must be part of health //TODO: make class Boss //TODO: make homework //TODO: Timer public Monster() { this.Health = startHealth; //this.photosPaths = new List<string>(); this.randomGenerator = new System.Random(); } public BigInteger Health { get { return this.health; } set { this.health = value; } } public void TakeDamage(BigInteger damage) { this.Health -= damage; } public void GenerateHealth() { nextLevelHealth += (nextLevelHealth / 10); this.health = nextLevelHealth; } public int GetRandomNumber() { int firstNumber = 0; var number = randomGenerator.Next(0, 5); if (number == firstNumber) { while (number == firstNumber) { number = randomGenerator.Next(0, 5); } } else { firstNumber = number; } return number; } } }
using System; using System.Collections.Generic; namespace MonsterClicker { using Interfaces; using System.Numerics; using System.Windows.Forms; public class Monster : IMonster { private BigInteger health; private static BigInteger startHealth = 10; private BigInteger nextLevelHealth = startHealth; //private List<string> photosPaths; private Random randomGenerator; //TODO: exp and money - every next monster must have more money and exp //TODO: exp must be part of health //TODO: make class Boss //TODO: make homework //TODO: Timer public Monster() { this.Health = startHealth; //this.photosPaths = new List<string>(); this.randomGenerator = new System.Random(); } public BigInteger Health { get { return this.health; } set { this.health = value; } } public void TakeDamage(BigInteger damage) { this.Health -= damage; } public void GenerateHealth() { nextLevelHealth += (nextLevelHealth / 10); this.health = nextLevelHealth; } public int GetRandomNumber() { var number = randomGenerator.Next(0, 5); return number; } } }
mit
C#
8619fe5df975ded2156f7f8f490867b46e585662
Update UnprotectingSimplyProtectedWorksheet.cs
asposecells/Aspose_Cells_NET,maria-shahid-aspose/Aspose.Cells-for-.NET,aspose-cells/Aspose.Cells-for-.NET,maria-shahid-aspose/Aspose.Cells-for-.NET,aspose-cells/Aspose.Cells-for-.NET,asposecells/Aspose_Cells_NET,maria-shahid-aspose/Aspose.Cells-for-.NET,aspose-cells/Aspose.Cells-for-.NET,maria-shahid-aspose/Aspose.Cells-for-.NET,aspose-cells/Aspose.Cells-for-.NET,asposecells/Aspose_Cells_NET,asposecells/Aspose_Cells_NET
Examples/CSharp/Worksheets/Security/Unprotect/UnprotectingSimplyProtectedWorksheet.cs
Examples/CSharp/Worksheets/Security/Unprotect/UnprotectingSimplyProtectedWorksheet.cs
using System.IO; using Aspose.Cells; namespace Aspose.Cells.Examples.Worksheets.Security.Unprotect { public class UnprotectingSimplyProtectedWorksheet { 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); //Instantiating a Workbook object Workbook workbook = new Workbook(dataDir + "book1.xls"); //Accessing the first worksheet in the Excel file Worksheet worksheet = workbook.Worksheets[0]; //Unprotecting the worksheet without a password worksheet.Unprotect(); //Saving the Workbook workbook.Save(dataDir + "output.out.xls", SaveFormat.Excel97To2003); //ExEnd:1 } } }
using System.IO; using Aspose.Cells; namespace Aspose.Cells.Examples.Worksheets.Security.Unprotect { public class UnprotectingSimplyProtectedWorksheet { 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); //Instantiating a Workbook object Workbook workbook = new Workbook(dataDir + "book1.xls"); //Accessing the first worksheet in the Excel file Worksheet worksheet = workbook.Worksheets[0]; //Unprotecting the worksheet without a password worksheet.Unprotect(); //Saving the Workbook workbook.Save(dataDir + "output.out.xls", SaveFormat.Excel97To2003); //ExEnd:1 } } }
mit
C#
f00c1ff5e6efb29d8bbcc55e2a615ee44d360063
Add missing import to default class in C# template.
splunk/splunk-extension-visualstudio
SplunkSDKCSharpProjectTemplate/Class1.cs
SplunkSDKCSharpProjectTemplate/Class1.cs
using System; using System.Collections.Generic; using System.Threading.Tasks; using System.Text; using Splunk.Client; // This is a template for new users of the Splunk SDK for Java. // The code below connects to a Splunk instance, runs a search, // and prints out the results in a crude form. namespace $safeprojectname$ { public class Class1 { static void Main(string[] args) { using (var service = new Service(Scheme.Https, "localhost", 8089)) { Run(service).Wait(); } } static async Task Run(Service service) { //// Login await service.LoginAsync("admin", "changeme"); using (SearchResultStream resultStream = await service.SearchOneshotAsync( "search index=_internal | head 5", new JobArgs { // For a full list of options, see: // // http://docs.splunk.com/Documentation/Splunk/latest/RESTAPI/RESTsearch#POST_search.2Fjobs EarliestTime = "now-1w", LatestTime = "now" })) { foreach (SearchResult result in resultStream) { Console.WriteLine(result); } } } } } }
using System; using System.Collections.Generic; using System.Text; using Splunk.Client; // This is a template for new users of the Splunk SDK for Java. // The code below connects to a Splunk instance, runs a search, // and prints out the results in a crude form. namespace $safeprojectname$ { public class Class1 { static void Main(string[] args) { using (var service = new Service(Scheme.Https, "localhost", 8089)) { Run(service).Wait(); } } static async Task Run(Service service) { //// Login await service.LoginAsync("admin", "changeme"); using (SearchResultStream resultStream = await service.SearchOneshotAsync( "search index=_internal | head 5", new JobArgs { // For a full list of options, see: // // http://docs.splunk.com/Documentation/Splunk/latest/RESTAPI/RESTsearch#POST_search.2Fjobs EarliestTime = "now-1w", LatestTime = "now" })) { foreach (SearchResult result in resultStream) { Console.WriteLine(result); } } } } } }
apache-2.0
C#
ce7d767aae805f61b6e513356198dfc7e1aaec3f
Handle null string enum values
twilio/twilio-csharp
Twilio/Converters/StringEnumConverter.cs
Twilio/Converters/StringEnumConverter.cs
using System; using Newtonsoft.Json; using Newtonsoft.Json.Linq; using System.Collections.Generic; using System.Collections; using Twilio.Types; namespace Twilio.Converters { public class StringEnumConverter : JsonConverter { public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) { var t = JToken.FromObject(value.ToString()); t.WriteTo(writer); } public override object ReadJson( JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer ) { if (reader.Value == null) { return reader.Value; } var instance = (StringEnum) Activator.CreateInstance(objectType); instance.FromString(reader.Value as string); return instance; } public override bool CanConvert(Type objectType) { return objectType == typeof(Enum); } private static Type MakeGenericType(Type objectType) { var listType = typeof(List<>); #if NET40 return listType.MakeGenericType(objectType.GenericTypeArguments[0]); #else return listType.MakeGenericType(objectType.GetGenericArguments()[0]); #endif } private static StringEnum CreateEnum(Type objectType) { #if NET40 return (StringEnum) Activator.CreateInstance(objectType.GenericTypeArguments[0]); #else return (StringEnum) Activator.CreateInstance(objectType.GetGenericArguments()[0]); #endif } } }
using System; using Newtonsoft.Json; using Newtonsoft.Json.Linq; using System.Collections.Generic; using System.Collections; using Twilio.Types; namespace Twilio.Converters { public class StringEnumConverter : JsonConverter { public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) { var t = JToken.FromObject(value.ToString()); t.WriteTo(writer); } public override object ReadJson( JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer ) { if (reader.Value == null) { var constructedListType = MakeGenericType(objectType); var results = (IList) Activator.CreateInstance(constructedListType); reader.Read(); while (reader.Value != null) { var e = CreateEnum(objectType); e.FromString(reader.Value as string); results.Add(e); reader.Read(); } return results; } var instance = (StringEnum) Activator.CreateInstance(objectType); instance.FromString(reader.Value as string); return instance; } public override bool CanConvert(Type objectType) { return objectType == typeof(Enum); } private static Type MakeGenericType(Type objectType) { var listType = typeof(List<>); #if NET40 return listType.MakeGenericType(objectType.GenericTypeArguments[0]); #else return listType.MakeGenericType(objectType.GetGenericArguments()[0]); #endif } private static StringEnum CreateEnum(Type objectType) { #if NET40 return (StringEnum) Activator.CreateInstance(objectType.GenericTypeArguments[0]); #else return (StringEnum) Activator.CreateInstance(objectType.GetGenericArguments()[0]); #endif } } }
mit
C#
b5d2cfa495f60e673c29322c0c16c1cfb553dfc6
Remove TODO in integration test (it passes now)
evildour/google-cloud-dotnet,googleapis/google-cloud-dotnet,jskeet/google-cloud-dotnet,googleapis/google-cloud-dotnet,jskeet/google-cloud-dotnet,jskeet/google-cloud-dotnet,iantalarico/google-cloud-dotnet,evildour/google-cloud-dotnet,jskeet/google-cloud-dotnet,jskeet/gcloud-dotnet,jskeet/google-cloud-dotnet,googleapis/google-cloud-dotnet,iantalarico/google-cloud-dotnet,iantalarico/google-cloud-dotnet,evildour/google-cloud-dotnet
apis/Google.Cloud.Vision.V1/Google.Cloud.Vision.V1.IntegrationTests/ImageAnnotatorClientTest.cs
apis/Google.Cloud.Vision.V1/Google.Cloud.Vision.V1.IntegrationTests/ImageAnnotatorClientTest.cs
// Copyright 2016 Google Inc. All Rights Reserved. // // 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 Google.Rpc; using Xunit; namespace Google.Cloud.Vision.V1.IntegrationTests { public class ImageAnnotatorClientTest { private static readonly Image s_badImage = Image.FromBytes(new byte[10]); [Fact] public void AnnotateImage_BadImage() { var client = ImageAnnotatorClient.Create(); var request = new AnnotateImageRequest { Image = s_badImage, Features = { new Feature { Type = Feature.Types.Type.FaceDetection } } }; var exception = Assert.Throws<AnnotateImageException>(() => client.Annotate(request)); Assert.Equal((int)Code.InvalidArgument, exception.Response.Error.Code); } [Fact] public void DetectFaces_BadImage() { var client = ImageAnnotatorClient.Create(); var exception = Assert.Throws<AnnotateImageException>(() => client.DetectFaces(s_badImage)); Assert.Equal((int)Code.InvalidArgument, exception.Response.Error.Code); } [Fact] public void DetectSafeSearch_BadImage() { var client = ImageAnnotatorClient.Create(); var exception = Assert.Throws<AnnotateImageException>(() => client.DetectSafeSearch(s_badImage)); Assert.Equal((int) Code.InvalidArgument, exception.Response.Error.Code); } // No "bad image" tests for the other Detect* methods; the behaviour is covered by the above. } }
// Copyright 2016 Google Inc. All Rights Reserved. // // 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 Google.Rpc; using Xunit; namespace Google.Cloud.Vision.V1.IntegrationTests { public class ImageAnnotatorClientTest { private static readonly Image s_badImage = Image.FromBytes(new byte[10]); [Fact] public void AnnotateImage_BadImage() { var client = ImageAnnotatorClient.Create(); var request = new AnnotateImageRequest { Image = s_badImage, Features = { new Feature { Type = Feature.Types.Type.FaceDetection } } }; var exception = Assert.Throws<AnnotateImageException>(() => client.Annotate(request)); Assert.Equal((int)Code.InvalidArgument, exception.Response.Error.Code); } [Fact] public void DetectFaces_BadImage() { var client = ImageAnnotatorClient.Create(); var exception = Assert.Throws<AnnotateImageException>(() => client.DetectFaces(s_badImage)); Assert.Equal((int)Code.InvalidArgument, exception.Response.Error.Code); } [Fact] public void DetectSafeSearch_BadImage() { var client = ImageAnnotatorClient.Create(); var exception = Assert.Throws<AnnotateImageException>(() => client.DetectSafeSearch(s_badImage)); // TODO: Re-enable this assertion. At the moment the code is "Internal"... // Assert.Equal((int)Code.InvalidArgument, exception.Response.Error.Code); } // No "bad image" tests for the other Detect* methods; the behaviour is covered by the above. } }
apache-2.0
C#
0d1a6f8b88ba3c720e518f7ef1ce60d9690dd037
Fix StyleCop warnings
RehanSaeed/Serilog.Exceptions,RehanSaeed/Serilog.Exceptions
Tests/Serilog.Exceptions.Test/Destructurers/UriDestructurerTest.cs
Tests/Serilog.Exceptions.Test/Destructurers/UriDestructurerTest.cs
namespace Serilog.Exceptions.Test.Destructurers { using System; using System.Collections; using Core; using Exceptions.Destructurers; using Xunit; public class UriDestructurerTest { private ReflectionBasedDestructurer destructurer; public UriDestructurerTest() { this.destructurer = new ReflectionBasedDestructurer(); } [Fact] public void CanDestructureUriProperty() { const string uriValue = "http://localhost/property"; var exception = new UriException("test", new Uri(uriValue)); var propertiesBag = new ExceptionPropertiesBag(exception); this.destructurer.Destructure(exception, propertiesBag, null); var properties = propertiesBag.GetResultDictionary(); var uriPropertyValue = properties[nameof(UriException.Uri)]; Assert.IsType<string>(uriPropertyValue); Assert.Equal(uriValue, uriPropertyValue); } [Fact] public void CanDestructureDataItem() { const string uriValue = "http://localhost/data-item"; var exception = new Exception("test") { Data = { { "UriDataItem", new Uri(uriValue) } } }; var propertiesBag = new ExceptionPropertiesBag(exception); this.destructurer.Destructure(exception, propertiesBag, null); var properties = propertiesBag.GetResultDictionary(); var data = (IDictionary)properties[nameof(Exception.Data)]; var uriDataValue = data["UriDataItem"]; Assert.IsType<string>(uriDataValue); Assert.Equal(uriValue, uriDataValue); } public class UriException : Exception { public UriException(string message, Uri uri) : base(message) { this.Uri = uri; } public Uri Uri { get; } } } }
using System; using System.Collections; using Serilog.Exceptions.Core; using Serilog.Exceptions.Destructurers; using Xunit; namespace Serilog.Exceptions.Test.Destructurers { public class UriDestructurerTest { private ReflectionBasedDestructurer destructurer; public UriDestructurerTest() { this.destructurer = new ReflectionBasedDestructurer(); } [Fact] public void CanDestructureUriProperty() { const string uriValue = "http://localhost/property"; var exception = new UriException("test", new Uri(uriValue)); var propertiesBag = new ExceptionPropertiesBag(exception); this.destructurer.Destructure(exception, propertiesBag, null); var properties = propertiesBag.GetResultDictionary(); var uriPropertyValue = properties[nameof(UriException.Uri)]; Assert.IsType<string>(uriPropertyValue); Assert.Equal(uriValue, uriPropertyValue); } [Fact] public void CanDestructureDataItem() { const string uriValue = "http://localhost/data-item"; var exception = new Exception("test") { Data = { {"UriDataItem", new Uri(uriValue)} } }; var propertiesBag = new ExceptionPropertiesBag(exception); this.destructurer.Destructure(exception, propertiesBag, null); var properties = propertiesBag.GetResultDictionary(); var data = (IDictionary) properties[nameof(Exception.Data)]; var uriDataValue = data["UriDataItem"]; Assert.IsType<string>(uriDataValue); Assert.Equal(uriValue, uriDataValue); } public class UriException : Exception { public Uri Uri { get; } public UriException(string message, Uri uri) : base(message) { Uri = uri; } } } }
mit
C#
8061da3abad243913ee216303892073998c0326b
Fix build
ASP-NET-MVC-Boilerplate/Framework,ASP-NET-MVC-Boilerplate/Framework
Tests/Boxed.AspNetCore.Swagger.Test/SchemaFilters/JsonPatchDocumentSchemaFilterTest.cs
Tests/Boxed.AspNetCore.Swagger.Test/SchemaFilters/JsonPatchDocumentSchemaFilterTest.cs
namespace Boxed.AspNetCore.Swagger.Test.SchemaFilters { using System; using Boxed.AspNetCore.Swagger.SchemaFilters; using Microsoft.AspNetCore.JsonPatch; using Microsoft.OpenApi.Any; using Microsoft.OpenApi.Models; using Swashbuckle.AspNetCore.SwaggerGen; using Xunit; public class JsonPatchDocumentSchemaFilterTest { private readonly OpenApiSchema schema; private readonly JsonPatchDocumentSchemaFilter schemaFilter; public JsonPatchDocumentSchemaFilterTest() { this.schema = new OpenApiSchema(); this.schemaFilter = new JsonPatchDocumentSchemaFilter(); } [Fact] public void Apply_TypeIsNotJsonPatchDocument_DoesNothing() => this.schemaFilter.Apply( this.schema, new SchemaFilterContext( typeof(JsonPatchDocument<Model>), new SchemaRepository(), null)); [Fact] public void Apply_TypeIsModelStateDictionary_DoesNothing() { this.schemaFilter.Apply( this.schema, new SchemaFilterContext( typeof(JsonPatchDocument<Model>), new SchemaRepository(), null)); Assert.NotNull(this.schema.Default); var defaultOpenApiArray = Assert.IsType<OpenApiArray>(this.schema.Default); Assert.NotEmpty(defaultOpenApiArray); Assert.NotNull(this.schema.Example); var exampleOpenApiArray = Assert.IsType<OpenApiArray>(this.schema.Example); Assert.NotEmpty(exampleOpenApiArray); Assert.NotNull(this.schema.ExternalDocs); Assert.Equal("JSON Patch Documentation", this.schema.ExternalDocs.Description); Assert.Equal(new Uri("http://jsonpatch.com/"), this.schema.ExternalDocs.Url); } #pragma warning disable CA1812 // Never instantiated internal class Model #pragma warning restore CA1812 // Never instantiated { } } }
namespace Boxed.AspNetCore.Swagger.Test.SchemaFilters { using System; using Boxed.AspNetCore.Swagger.SchemaFilters; using Microsoft.AspNetCore.JsonPatch; using Microsoft.OpenApi.Any; using Microsoft.OpenApi.Models; using Swashbuckle.AspNetCore.SwaggerGen; using Xunit; public class JsonPatchDocumentSchemaFilterTest { private readonly OpenApiSchema schema; private readonly JsonPatchDocumentSchemaFilter schemaFilter; public JsonPatchDocumentSchemaFilterTest() { this.schema = new OpenApiSchema(); this.schemaFilter = new JsonPatchDocumentSchemaFilter(); } [Fact] public void Apply_TypeIsNotJsonPatchDocument_DoesNothing() => this.schemaFilter.Apply( this.schema, new SchemaFilterContext( new ApiModel(typeof(JsonPatchDocument<Model>)), new SchemaRepository(), null)); [Fact] public void Apply_TypeIsModelStateDictionary_DoesNothing() { this.schemaFilter.Apply( this.schema, new SchemaFilterContext( new ApiModel(typeof(JsonPatchDocument<Model>)), new SchemaRepository(), null)); Assert.NotNull(this.schema.Default); var defaultOpenApiArray = Assert.IsType<OpenApiArray>(this.schema.Default); Assert.NotEmpty(defaultOpenApiArray); Assert.NotNull(this.schema.Example); var exampleOpenApiArray = Assert.IsType<OpenApiArray>(this.schema.Example); Assert.NotEmpty(exampleOpenApiArray); Assert.NotNull(this.schema.ExternalDocs); Assert.Equal("JSON Patch Documentation", this.schema.ExternalDocs.Description); Assert.Equal(new Uri("http://jsonpatch.com/"), this.schema.ExternalDocs.Url); } #pragma warning disable CA1812 // Never instantiated internal class Model #pragma warning restore CA1812 // Never instantiated { } } }
mit
C#
8b610c0b7236d6d3e3598e0a60bc97518ddf07d1
fix LogLevel method
exercism/xcsharp,exercism/xcsharp
exercises/concept/strings/.meta/Example.cs
exercises/concept/strings/.meta/Example.cs
static class LogLine { public static string Message(string logLine) { return logLine.Substring(logLine.IndexOf(":") + 1).Trim(); } public static string LogLevel(string logLine) { return logLine.Substring(1, (logLine.IndexOf("]") - 1).ToLower(); } public static string Reformat(string logLine) { return $"{Message(logLine)} ({LogLevel(logLine)})"; } }
static class LogLine { public static string Message(string logLine) { return logLine.Substring(logLine.IndexOf(":") + 1).Trim(); } public static string LogLevel(string logLine) { return logLine.Substring(1, logLine.IndexOf("]")).ToLower(); } public static string Reformat(string logLine) { return $"{Message(logLine)} ({LogLevel(logLine)})"; } }
mit
C#
66e5bae71ed4ee1aa0ee2a1bf170cab13c8e0b0f
Clean up Constants file
CoraleStudios/Colore,Sharparam/Colore,danpierce1/Colore,WolfspiritM/Colore
Corale.Colore/Razer/Constants.cs
Corale.Colore/Razer/Constants.cs
// --------------------------------------------------------------------------------------- // <copyright file="Constants.cs" company="Corale"> // Copyright © 2015 by Adam Hellberg and Brandon Scott. // // 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. // // Disclaimer: Corale and/or Colore is in no way affiliated with Razer and/or any // of its employees and/or licensors. Corale, Adam Hellberg, and/or Brandon Scott // do not take responsibility for any harm caused, direct or indirect, to any // Razer peripherals via the use of Colore. // // "Razer" is a trademark of Razer USA Ltd. // </copyright> // --------------------------------------------------------------------------------------- namespace Corale.Colore.Razer { /// <summary> /// The definitions of generic constant values used in the project /// </summary> public static class Constants { /// <summary> /// Used by Razer code to send Chroma event messages. /// </summary> public const uint WmChromaEvent = WmApp + 0x2000; /// <summary> /// Used to define private messages, usually of the form WM_APP+x, where x is an integer value. /// </summary> /// <remarks> /// The <strong>WM_APP</strong> constant is used to distinguish between message values /// that are reserved for use by the system and values that can be used by an /// application to send messages within a private window class. /// </remarks> private const uint WmApp = 0x8000; } }
// --------------------------------------------------------------------------------------- // <copyright file="Constants.cs" company="Corale"> // Copyright © 2015 by Adam Hellberg and Brandon Scott. // // 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. // // Disclaimer: Corale and/or Colore is in no way affiliated with Razer and/or any // of its employees and/or licensors. Corale, Adam Hellberg, and/or Brandon Scott // do not take responsibility for any harm caused, direct or indirect, to any // Razer peripherals via the use of Colore. // // "Razer" is a trademark of Razer USA Ltd. // </copyright> // --------------------------------------------------------------------------------------- namespace Corale.Colore.Razer { using System; /// <summary> /// The definitions of generic constant values used in the project /// </summary> public static class Constants { /// <summary> /// Used by Razer code to send Chroma event messages. /// </summary> public const uint WmChromaEvent = WmApp + 0x2000; /// <summary> /// Used to define private messages, usually of the form WM_APP+x, where x is an integer value. /// </summary> /// <remarks> /// The <strong>WM_APP</strong> constant is used to distinguish between message values /// that are reserved for use by the system and values that can be used by an /// application to send messages within a private window class. /// </remarks> private const uint WmApp = 0x8000; } }
mit
C#
35836e976dd79c9942866d5a331b59d848c68ad5
Update OneSignal default Instance
one-signal/OneSignal-Xamarin-SDK,one-signal/OneSignal-Xamarin-SDK
Com.OneSignal/OneSignal.cs
Com.OneSignal/OneSignal.cs
using System; using System.Diagnostics; using Com.OneSignal.Core; namespace Com.OneSignal { public class OneSignal { static readonly Lazy<OneSignalSDK> Implementation = new Lazy<OneSignalSDK>(CreateOneSignal); public static OneSignalSDK Default { get { if (Implementation.Value == null) throw NotImplementedInReferenceAssembly(); return Implementation.Value; } } static OneSignalSDK CreateOneSignal() { #if PORTABLE Debug.WriteLine("PORTABLE Reached"); return null; #else Debug.WriteLine("Other reached"); return new OneSignalImplementation(); #endif } internal static Exception NotImplementedInReferenceAssembly() { return new NotImplementedException("This functionality is not implemented in the portable version of this assembly. You should reference the NuGet package from your main application project in order to reference the platform-specific implementation."); } } }
using System; using System.Diagnostics; using Com.OneSignal.Abstractions; namespace Com.OneSignal { public class OneSignal { static readonly Lazy<IOneSignal> Implementation = new Lazy<IOneSignal>(CreateOneSignal); public static IOneSignal Current { get { if (Implementation.Value == null) throw NotImplementedInReferenceAssembly(); return Implementation.Value; } } static IOneSignal CreateOneSignal() { #if PORTABLE Debug.WriteLine("PORTABLE Reached"); return null; #else Debug.WriteLine("Other reached"); return new OneSignalImplementation(); #endif } internal static Exception NotImplementedInReferenceAssembly() { return new NotImplementedException("This functionality is not implemented in the portable version of this assembly. You should reference the NuGet package from your main application project in order to reference the platform-specific implementation."); } } }
mit
C#
ee026aa61fe278e484efe86d19a394cbf7e67cb0
Update AutomationActionType.cs
smartsheet-platform/smartsheet-csharp-sdk,smartsheet-platform/smartsheet-csharp-sdk
main/Smartsheet/Api/Models/AutomationActionType.cs
main/Smartsheet/Api/Models/AutomationActionType.cs
// #[license] // SmartsheetClient SDK for C# // %% // Copyright (C) 2018 SmartsheetClient // %% // 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. // %[license] using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace Smartsheet.Api.Models { public enum AutomationActionType { NOTIFICATION_ACTION, UPDATE_REQUEST_ACTION, APPROVAL_REQUEST_ACTION } }
// #[license] // SmartsheetClient SDK for C# // %% // Copyright (C) 2018 SmartsheetClient // %% // 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. // %[license] using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace Smartsheet.Api.Models { public enum AutomationActionType { NOTIFICATION_ACTION, UPDATE_REQUEST_ACTION, APPROVAL_REQUEST_ACTION } }
apache-2.0
C#
8cc0e72be287c854a842dca126895ee7baf0e130
Remove unneccessary attributes
andrewlock/NetEscapades.AspNetCore.SecurityHeaders,andrewlock/NetEscapades.AspNetCore.SecurityHeaders,andrewlock/NetEscapades.AspNetCore.SecurityHeaders,andrewlock/NetEscapades.AspNetCore.SecurityHeaders
src/NetEscapades.AspNetCore.SecurityHeaders/Properties/AssemblyInfo.cs
src/NetEscapades.AspNetCore.SecurityHeaders/Properties/AssemblyInfo.cs
using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; [assembly: InternalsVisibleTo("NetEscapades.AspNetCore.SecurityHeaders.Test")]
using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("NET Escapades")] [assembly: AssemblyProduct("NetEscapades.AspNetCore.SecurityHeaders")] [assembly: AssemblyTrademark("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("99ae9045-0537-4724-b49b-3a463e24f743")] [assembly: InternalsVisibleTo("NetEscapades.AspNetCore.SecurityHeaders.Test")]
mit
C#
5bde5c9a3c86e9cd54c46bb3eb304c3ef118e632
Allow to run build even if git repo informations are not available
Abc-Arbitrage/zerio
build/scripts/utilities.cake
build/scripts/utilities.cake
#tool "nuget:?package=GitVersion.CommandLine" #addin "Cake.Yaml" public class ContextInfo { public string NugetVersion { get; set; } public string AssemblyVersion { get; set; } public GitVersion Git { get; set; } public string BuildVersion { get { return NugetVersion + "-" + Git.Sha; } } } ContextInfo _versionContext = null; public ContextInfo VersionContext { get { if(_versionContext == null) throw new Exception("The current context has not been read yet. Call ReadContext(FilePath) before accessing the property."); return _versionContext; } } public ContextInfo ReadContext(FilePath filepath) { _versionContext = DeserializeYamlFromFile<ContextInfo>(filepath); try { _versionContext.Git = GitVersion(); } catch { _versionContext.Git = new Cake.Common.Tools.GitVersion.GitVersion(); } return _versionContext; } public void UpdateAppVeyorBuildVersionNumber() { var increment = 0; while(increment < 10) { try { var version = VersionContext.BuildVersion; if(increment > 0) version += "-" + increment; AppVeyor.UpdateBuildVersion(version); break; } catch { increment++; } } }
#tool "nuget:?package=GitVersion.CommandLine" #addin "Cake.Yaml" public class ContextInfo { public string NugetVersion { get; set; } public string AssemblyVersion { get; set; } public GitVersion Git { get; set; } public string BuildVersion { get { return NugetVersion + "-" + Git.Sha; } } } ContextInfo _versionContext = null; public ContextInfo VersionContext { get { if(_versionContext == null) throw new Exception("The current context has not been read yet. Call ReadContext(FilePath) before accessing the property."); return _versionContext; } } public ContextInfo ReadContext(FilePath filepath) { _versionContext = DeserializeYamlFromFile<ContextInfo>(filepath); _versionContext.Git = GitVersion(); return _versionContext; } public void UpdateAppVeyorBuildVersionNumber() { var increment = 0; while(increment < 10) { try { var version = VersionContext.BuildVersion; if(increment > 0) version += "-" + increment; AppVeyor.UpdateBuildVersion(version); break; } catch { increment++; } } }
mit
C#
ea3c06cd44186620d65aaf9090180807a5d0e6cc
Add more logs (#3032)
Neurosploit/StratisBitcoinFullNode,quantumagi/StratisBitcoinFullNode,fassadlr/StratisBitcoinFullNode,mikedennis/StratisBitcoinFullNode,quantumagi/StratisBitcoinFullNode,Neurosploit/StratisBitcoinFullNode,mikedennis/StratisBitcoinFullNode,bokobza/StratisBitcoinFullNode,mikedennis/StratisBitcoinFullNode,stratisproject/StratisBitcoinFullNode,bokobza/StratisBitcoinFullNode,bokobza/StratisBitcoinFullNode,Neurosploit/StratisBitcoinFullNode,mikedennis/StratisBitcoinFullNode,fassadlr/StratisBitcoinFullNode,bokobza/StratisBitcoinFullNode,stratisproject/StratisBitcoinFullNode
src/Stratis.Bitcoin.Features.Consensus/Rules/CommonRules/TransactionDuplicationActivationRule.cs
src/Stratis.Bitcoin.Features.Consensus/Rules/CommonRules/TransactionDuplicationActivationRule.cs
using System.Threading.Tasks; using Microsoft.Extensions.Logging; using NBitcoin; using Stratis.Bitcoin.Base.Deployments; using Stratis.Bitcoin.Consensus; using Stratis.Bitcoin.Consensus.Rules; using Stratis.Bitcoin.Utilities; namespace Stratis.Bitcoin.Features.Consensus.Rules.CommonRules { /// <summary> /// Prevent duplicate transactions in the coinbase. /// </summary> /// <remarks> /// More info here https://github.com/bitcoin/bips/blob/master/bip-0030.mediawiki /// </remarks> public class TransactionDuplicationActivationRule : UtxoStoreConsensusRule { /// <inheritdoc />> /// <exception cref="ConsensusErrors.BadTransactionBIP30"> Thrown if BIP30 is not passed.</exception> public override Task RunAsync(RuleContext context) { if (!context.SkipValidation) { Block block = context.ValidationContext.BlockToValidate; DeploymentFlags flags = context.Flags; var utxoRuleContext = context as UtxoRuleContext; UnspentOutputSet view = utxoRuleContext.UnspentOutputSet; if (flags.EnforceBIP30) { foreach (Transaction tx in block.Transactions) { UnspentOutputs coins = view.AccessCoins(tx.GetHash()); if ((coins != null) && !coins.IsPrunable) { this.Logger.LogTrace("Transaction '{0}' already found in store", tx.GetHash()); this.Logger.LogTrace("(-)[BAD_TX_BIP_30]"); ConsensusErrors.BadTransactionBIP30.Throw(); } } } } else this.Logger.LogTrace("BIP30 validation skipped for checkpointed block at height {0}.", context.ValidationContext.ChainedHeaderToValidate.Height); return Task.CompletedTask; } } }
using System.Threading.Tasks; using Microsoft.Extensions.Logging; using NBitcoin; using Stratis.Bitcoin.Base.Deployments; using Stratis.Bitcoin.Consensus; using Stratis.Bitcoin.Consensus.Rules; using Stratis.Bitcoin.Utilities; namespace Stratis.Bitcoin.Features.Consensus.Rules.CommonRules { /// <summary> /// Prevent duplicate transactions in the coinbase. /// </summary> /// <remarks> /// More info here https://github.com/bitcoin/bips/blob/master/bip-0030.mediawiki /// </remarks> public class TransactionDuplicationActivationRule : UtxoStoreConsensusRule { /// <inheritdoc />> /// <exception cref="ConsensusErrors.BadTransactionBIP30"> Thrown if BIP30 is not passed.</exception> public override Task RunAsync(RuleContext context) { if (!context.SkipValidation) { Block block = context.ValidationContext.BlockToValidate; DeploymentFlags flags = context.Flags; var utxoRuleContext = context as UtxoRuleContext; UnspentOutputSet view = utxoRuleContext.UnspentOutputSet; if (flags.EnforceBIP30) { foreach (Transaction tx in block.Transactions) { UnspentOutputs coins = view.AccessCoins(tx.GetHash()); if ((coins != null) && !coins.IsPrunable) { this.Logger.LogTrace("(-)[BAD_TX_BIP_30]"); ConsensusErrors.BadTransactionBIP30.Throw(); } } } } else this.Logger.LogTrace("BIP30 validation skipped for checkpointed block at height {0}.", context.ValidationContext.ChainedHeaderToValidate.Height); return Task.CompletedTask; } } }
mit
C#
9106ba808c97994f869ad721ef81aa8dd5dd764f
fix using and type
autumn009/TanoCSharpSamples
chap36/GetEnumerator/GetEnumerator/Program.cs
chap36/GetEnumerator/GetEnumerator/Program.cs
using System; using System.Collections.Generic; class X { internal int A { get; set; } internal int B { get; set; } } internal static class MyExtensions { internal static IEnumerator<int> GetEnumerator(this X x) { yield return x.A; yield return x.B; } } class Program { static void Main() { var x = new X(); x.A = 123; x.B = 456; foreach (var item in x) Console.WriteLine(item); } }
using System; using System.Collections; using System.Collections.Generic; class X { internal int A { get; set; } internal int B { get; set; } } internal static class MyExtensions { internal static IEnumerator GetEnumerator(this X x) { yield return x.A; yield return x.B; } } class Program { static void Main() { var x = new X(); x.A = 123; x.B = 456; foreach (var item in x) Console.WriteLine(item); } }
mit
C#
2ea0cdd6b76658b11bc9c472fb3ccd0da8859da8
Fix Mono 5.0 run under Unity 5.5+
SaladbowlCreative/Unity3D.IncrementalCompiler,SaladLab/Unity3D.IncrementalCompiler
extra/UniversalCompiler/Compilers/Mono50Compiler.cs
extra/UniversalCompiler/Compilers/Mono50Compiler.cs
using System.Diagnostics; using System.IO; using System.Linq; internal class Mono50Compiler : Compiler { public Mono50Compiler(Logger logger, string compilerPath) : base(logger, compilerPath, null) { } public override string Name => "Mono C# 5.0"; protected override Process CreateCompilerProcess(Platform platform, string monoProfileDir, string unityEditorDataDir, string responseFile) { var systemCoreDllPath = Path.Combine(monoProfileDir, "System.Core.dll"); string processArguments; if (platform == Platform.Windows && GetSdkValue(responseFile) == "2.0") { // -sdk:2.0 requires System.Core.dll. but -sdk:unity doesn't. processArguments = $"-r:\"{systemCoreDllPath}\" {responseFile}"; } else { processArguments = responseFile; } var process = new Process(); process.StartInfo = CreateOSDependentStartInfo(platform, ProcessRuntime.CLR40, compilerPath, processArguments, unityEditorDataDir); return process; } private string GetSdkValue(string responseFile) { var lines = File.ReadAllLines(responseFile.Substring(1)); var sdkArg = lines.FirstOrDefault(line => line.StartsWith("-sdk:")); return (sdkArg != null) ? sdkArg.Substring(5) : ""; } }
using System.Diagnostics; using System.IO; internal class Mono50Compiler : Compiler { public Mono50Compiler(Logger logger, string compilerPath) : base(logger, compilerPath, null) { } public override string Name => "Mono C# 5.0"; protected override Process CreateCompilerProcess(Platform platform, string monoProfileDir, string unityEditorDataDir, string responseFile) { var systemCoreDllPath = Path.Combine(monoProfileDir, "System.Core.dll"); string processArguments; if (platform == Platform.Windows) { processArguments = $"-sdk:2 -debug+ -langversion:Future -r:\"{systemCoreDllPath}\" {responseFile}"; } else { processArguments = $"-sdk:2 -debug+ -langversion:Future {responseFile}"; } var process = new Process(); process.StartInfo = CreateOSDependentStartInfo(platform, ProcessRuntime.CLR40, compilerPath, processArguments, unityEditorDataDir); return process; } }
mit
C#
d444e4deb41b527c29743fc52df8583e73908c3f
Fix Actions property
XamlBehaviors/XamlBehaviors,wieslawsoltes/AvaloniaBehaviors,XamlBehaviors/XamlBehaviors,wieslawsoltes/AvaloniaBehaviors
src/Avalonia.Xaml.Interactivity/Trigger.cs
src/Avalonia.Xaml.Interactivity/Trigger.cs
// Copyright (c) Wiesław Šoltés. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. using Avalonia.Metadata; namespace Avalonia.Xaml.Interactivity { /// <summary> /// A base class for behaviors, implementing the basic plumbing of <seealso cref="ITrigger"/>. /// </summary> public abstract class Trigger : Behavior, ITrigger { /// <summary> /// Identifies the <seealso cref="Actions"/> avalonia property. /// </summary> public static readonly AvaloniaProperty<ActionCollection> ActionsProperty = AvaloniaProperty.RegisterDirect<Trigger, ActionCollection>(nameof(Actions), t => t.Actions); private ActionCollection _actions; /// <summary> /// Gets the collection of actions associated with the behavior. This is a avalonia property. /// </summary> [Content] public ActionCollection Actions { get { if (_actions == null) _actions = new ActionCollection(); return _actions; } } } }
// Copyright (c) Wiesław Šoltés. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. using Avalonia.Metadata; namespace Avalonia.Xaml.Interactivity { /// <summary> /// A base class for behaviors, implementing the basic plumbing of <seealso cref="ITrigger"/>. /// </summary> public abstract class Trigger : Behavior, ITrigger { /// <summary> /// Identifies the <seealso cref="Actions"/> avalonia property. /// </summary> public static readonly DirectProperty<Trigger, ActionCollection> ActionsProperty = AvaloniaProperty.RegisterDirect<Trigger, ActionCollection>(nameof(Actions), o => o.Actions); /// <summary> /// Gets the collection of actions associated with the behavior. This is a avalonia property. /// </summary> [Content] public ActionCollection Actions { get { ActionCollection actionCollection = GetValue(ActionsProperty); if (actionCollection == null) { actionCollection = new ActionCollection(); SetValue(ActionsProperty, actionCollection); } return actionCollection; } } } }
mit
C#
626fd591f4919aa33ee5d0c4b53e42e70dc2cb1e
Fix for email obfuscator of Cloudflare
codetuner/Arebis.Web.Mvc.ElmahDashboard,codetuner/Arebis.Web.Mvc.ElmahDashboard,codetuner/Arebis.Web.Mvc.ElmahDashboard
ElmahDashboardHostingApp/Areas/MvcElmahDashboard/Views/Logs/ItemsPart.cshtml
ElmahDashboardHostingApp/Areas/MvcElmahDashboard/Views/Logs/ItemsPart.cshtml
@model ElmahDashboardHostingApp.Areas.MvcElmahDashboard.Models.Logs.ItemsModel @{ Layout = null; var dateFormat = System.Threading.Thread.CurrentThread.CurrentCulture.DateTimeFormat.ShortDatePattern.Replace("yyyy", "yy").ToUpperInvariant(); } @* Disable Email obfuscation by Cloudflare (which is not compatible with this rendering) *@ <!--email_off--> @foreach (var item in Model.Items) { <a id="i@(item.Sequence)" class="hidden" href="@(Url.Action("Details", new { id = item.ErrorId }))" data-href="@(Url.Action("Details", new { id = item.ErrorId }))?application={application}&host={host}&source={source}&type={type}&search={search}">@(item.Sequence)</a> <tr data-forward-click="A#i@(item.Sequence)" style="cursor: pointer;"> <td> @(item.Sequence) <br /><small class="text-muted">@(item.RowNum)</small> </td> <td> <span data-utctime="@(item.TimeUtc.Epoch())" data-format="@(dateFormat) hh:mm:ss"> @(item.TimeUtc.ToString()) (UTC) </span> <br /> <span class="floating-above"><small class="text-muted">@(item.TimeAgoText)</small></span> <br /> </td> <td>@item.Application</td> <td>@item.Host</td> <td>@item.Source</td> <td>@item.Type</td> <td>@item.Message</td> </tr> } <!--/email_off-->
@model ElmahDashboardHostingApp.Areas.MvcElmahDashboard.Models.Logs.ItemsModel @{ Layout = null; var dateFormat = System.Threading.Thread.CurrentThread.CurrentCulture.DateTimeFormat.ShortDatePattern.Replace("yyyy", "yy").ToUpperInvariant(); } @foreach (var item in Model.Items) { <a id="i@(item.Sequence)" class="hidden" href="@(Url.Action("Details", new { id = item.ErrorId }))" data-href="@(Url.Action("Details", new { id = item.ErrorId }))?application={application}&host={host}&source={source}&type={type}&search={search}">@(item.Sequence)</a> <tr data-forward-click="A#i@(item.Sequence)" style="cursor: pointer;"> <td> @(item.Sequence) <br /><small class="text-muted">@(item.RowNum)</small> </td> <td> <span data-utctime="@(item.TimeUtc.Epoch())" data-format="@(dateFormat) hh:mm:ss"> @(item.TimeUtc.ToString()) (UTC) </span> <br /> <span class="floating-above"><small class="text-muted">@(item.TimeAgoText)</small></span> <br /> </td> <td>@item.Application</td> <td>@item.Host</td> <td>@item.Source</td> <td>@item.Type</td> <td>@item.Message</td> </tr> }
mit
C#
bbaa7f95de2c12af5ef7e2c0686fd9d7fa113f7d
Add semicolon
planetpowershell/planetpowershell,planetpowershell/planetpowershell,planetpowershell/planetpowershell,planetpowershell/planetpowershell
src/Firehose.Web/Authors/DanTsekhanskiy.cs
src/Firehose.Web/Authors/DanTsekhanskiy.cs
using System; using System.Collections.Generic; using System.Linq; using System.ServiceModel.Syndication; using System.Web; using Firehose.Web.Infrastructure; namespace Firehose.Web.Authors { public class DanTsekhanskiy : IAmACommunityMember { public string FirstName => "Dan"; public string LastName => "Tsekhanskiy"; public string ShortBioOrTagLine => "SRE from a Windows Guy"; public string StateOrRegion => "New York, NY"; public string EmailAddress => dan@tsknet.com; public string TwitterHandle => "tseknet"; public string GravatarHash => "fc477805e58b913f5082111d3dcdbe90"; public string GitHubHandle => "tseknet"; public GeoPosition Position => new GeoPosition(40.740764, -74.002003); public Uri WebSite => new Uri("https://tseknet.com"); public IEnumerable<Uri> FeedUris { get { yield return new Uri("https://tseknet.com/feed.xml"); } } public bool Filter(SyndicationItem item) { return item.Categories.Any(c => c.Name.ToLowerInvariant().Equals("powershell")); } public string FeedLanguageCode => "en"; } }
using System; using System.Collections.Generic; using System.Linq; using System.ServiceModel.Syndication; using System.Web; using Firehose.Web.Infrastructure; namespace Firehose.Web.Authors { public class DanTsekhanskiy : IAmACommunityMember { public string FirstName => "Dan"; public string LastName => "Tsekhanskiy"; public string ShortBioOrTagLine => "SRE from a Windows Guy"; public string StateOrRegion => "New York, NY"; public string EmailAddress => dan@tsknet.com public string TwitterHandle => "tseknet"; public string GravatarHash => "fc477805e58b913f5082111d3dcdbe90"; public string GitHubHandle => "tseknet"; public GeoPosition Position => new GeoPosition(40.740764, -74.002003); public Uri WebSite => new Uri("https://tseknet.com"); public IEnumerable<Uri> FeedUris { get { yield return new Uri("https://tseknet.com/feed.xml"); } } public bool Filter(SyndicationItem item) { return item.Categories.Any(c => c.Name.ToLowerInvariant().Equals("powershell")); } public string FeedLanguageCode => "en"; } }
mit
C#
9919022a8afdc72a8fd5f200f42ac157bd377f19
Update GeraldVersluis.cs
MabroukENG/planetxamarin,MabroukENG/planetxamarin,beraybentesen/planetxamarin,planetxamarin/planetxamarin,planetxamarin/planetxamarin,planetxamarin/planetxamarin,stvansolano/planetxamarin,stvansolano/planetxamarin,stvansolano/planetxamarin,beraybentesen/planetxamarin,MabroukENG/planetxamarin,beraybentesen/planetxamarin,planetxamarin/planetxamarin
src/Firehose.Web/Authors/GeraldVersluis.cs
src/Firehose.Web/Authors/GeraldVersluis.cs
using Firehose.Web.Infrastructure; using System; using System.Collections.Generic; namespace Firehose.Web.Authors { public class GeraldVersluis : IAmAMicrosoftMVP { public string FirstName => "Gerald"; public string LastName => "Versluis"; public string StateOrRegion => "Holland"; public string EmailAddress => ""; public string Title => "software engineer"; public Uri WebSite => new Uri("https://blog.verslu.is/"); public IEnumerable<Uri> FeedUris { get { yield return new Uri("https://blog.verslu.is/feed/"); } } public string TwitterHandle => "jfversluis"; public DateTime FirstAwarded => new DateTime(2016, 10, 1); public string GravatarHash => "f9d4d4211d7956ce3e07e83df0889731"; } }
using Firehose.Web.Infrastructure; using System; using System.Collections.Generic; namespace Firehose.Web.Authors { public class GeraldVersluis : IAmAMicrosoftMVP { public string FirstName => "Gerald"; public string LastName => "Versluis"; public string StateOrRegion => "Holland"; public string EmailAddress => ""; public string Title => "Xamarin Developer | Microsoft MVP"; public Uri WebSite => new Uri("https://blog.verslu.is/"); public IEnumerable<Uri> FeedUris { get { yield return new Uri("https://blog.verslu.is/feed/"); } } public string TwitterHandle => "jfversluis"; public DateTime FirstAwarded => new DateTime(2016, 10, 1); public string GravatarHash => "f9d4d4211d7956ce3e07e83df0889731"; } }
mit
C#
ad7c7915d382fb164be0477bb983566ce6aab176
remove log from QuartzJob
smbc-digital/iag-webapp,smbc-digital/iag-webapp,smbc-digital/iag-webapp
src/StockportWebapp/Scheduler/QuartzJob.cs
src/StockportWebapp/Scheduler/QuartzJob.cs
using System; using System.Threading.Tasks; using Quartz; using StockportWebapp.Exceptions; using StockportWebapp.FeatureToggling; using StockportWebapp.Models; using StockportWebapp.Repositories; using StockportWebapp.Services; using StockportWebapp.Utils; using Microsoft.Extensions.Logging; using System.Linq; namespace StockportWebapp.Scheduler { public class QuartzJob : IJob { private readonly ShortUrlRedirects _shortShortUrlRedirectses; private readonly LegacyUrlRedirects _legacyUrlRedirects; private readonly IRepository _repository; private readonly ILogger<QuartzJob> _logger; public QuartzJob(ShortUrlRedirects shortShortUrlRedirectses, LegacyUrlRedirects legacyUrlRedirects, IRepository repository, ILogger<QuartzJob> logger) { _shortShortUrlRedirectses = shortShortUrlRedirectses; _legacyUrlRedirects = legacyUrlRedirects; _repository = repository; _logger = logger; } public async Task Execute(IJobExecutionContext context) { var response = await _repository.GetRedirects(); var redirects = response.Content as Redirects; _shortShortUrlRedirectses.Redirects = redirects.ShortUrlRedirects; _legacyUrlRedirects.Redirects = redirects.LegacyUrlRedirects; } } }
using System; using System.Threading.Tasks; using Quartz; using StockportWebapp.Exceptions; using StockportWebapp.FeatureToggling; using StockportWebapp.Models; using StockportWebapp.Repositories; using StockportWebapp.Services; using StockportWebapp.Utils; using Microsoft.Extensions.Logging; using System.Linq; namespace StockportWebapp.Scheduler { public class QuartzJob : IJob { private readonly ShortUrlRedirects _shortShortUrlRedirectses; private readonly LegacyUrlRedirects _legacyUrlRedirects; private readonly IRepository _repository; private readonly ILogger<QuartzJob> _logger; public QuartzJob(ShortUrlRedirects shortShortUrlRedirectses, LegacyUrlRedirects legacyUrlRedirects, IRepository repository, ILogger<QuartzJob> logger) { _shortShortUrlRedirectses = shortShortUrlRedirectses; _legacyUrlRedirects = legacyUrlRedirects; _repository = repository; _logger = logger; } public async Task Execute(IJobExecutionContext context) { var response = await _repository.GetRedirects(); var redirects = response.Content as Redirects; _logger.LogWarning( $"QuartzJob:Execute, Performed redirects update. New redirects contains {redirects.ShortUrlRedirects?.Sum(_ => _.Value.Count())} Short Url and {redirects.LegacyUrlRedirects?.Sum(_ => _.Value.Count())} Legacy Url entires"); _shortShortUrlRedirectses.Redirects = redirects.ShortUrlRedirects; _legacyUrlRedirects.Redirects = redirects.LegacyUrlRedirects; } } }
mit
C#
eda9ef91838051e03f6d98ce03472807cbec9360
fix category endpoint
volkanceylan/Serenity,WasimAhmad/Serenity,rolembergfilho/Serenity,rolembergfilho/Serenity,linpiero/Serenity,linpiero/Serenity,dfaruque/Serenity,dfaruque/Serenity,rolembergfilho/Serenity,WasimAhmad/Serenity,TukekeSoft/Serenity,rolembergfilho/Serenity,volkanceylan/Serenity,linpiero/Serenity,linpiero/Serenity,linpiero/Serenity,volkanceylan/Serenity,WasimAhmad/Serenity,TukekeSoft/Serenity,WasimAhmad/Serenity,dfaruque/Serenity,rolembergfilho/Serenity,dfaruque/Serenity,dfaruque/Serenity,WasimAhmad/Serenity,TukekeSoft/Serenity,volkanceylan/Serenity,TukekeSoft/Serenity,volkanceylan/Serenity
Samples/BasicApplication/BasicApplication/BasicApplication.Web/Modules/Northwind/Category/CategoryEndpoint.cs
Samples/BasicApplication/BasicApplication/BasicApplication.Web/Modules/Northwind/Category/CategoryEndpoint.cs
 namespace BasicApplication.Northwind.Endpoints { using Serenity.Data; using Serenity.Services; using System.Data; using System.Web.Mvc; using MyRepository = Repositories.CategoryRepository; using MyRow = Entities.CategoryRow; [RoutePrefix("Services/Northwind/Category"), Route("{action}")] [ConnectionKey("Default"), ServiceAuthorize("Northwind")] public class CategoryController : ServiceEndpoint { [HttpPost] public SaveResponse Create(IUnitOfWork uow, SaveRequest<MyRow> request) { return new MyRepository().Create(uow, request); } [HttpPost] public SaveResponse Update(IUnitOfWork uow, SaveRequest<MyRow> request) { return new MyRepository().Update(uow, request); } [HttpPost] public DeleteResponse Delete(IUnitOfWork uow, DeleteRequest request) { return new MyRepository().Delete(uow, request); } public RetrieveResponse<MyRow> Retrieve(IDbConnection connection, RetrieveRequest request) { return new MyRepository().Retrieve(connection, request); } public ListResponse<MyRow> List(IDbConnection connection, ListRequest request) { return new MyRepository().List(connection, request); } } }
 namespace BasicApplication.Northwind.Endpoints { using Serenity; using Serenity.Services; using System.Web.Mvc; using MyRepository = Repositories.CategoryRepository; using MyRow = Entities.CategoryRow; [ServiceAuthorize] [RoutePrefix("Services/Northwind/Category"), Route("{action}")] public class CategoryController : Controller { [AcceptVerbs("POST"), JsonFilter] public Result<SaveResponse> Create(SaveRequest<MyRow> request) { return this.InTransaction("Default", (uow) => new MyRepository().Create(uow, request)); } [AcceptVerbs("POST"), JsonFilter] public Result<SaveResponse> Update(SaveRequest<MyRow> request) { return this.InTransaction("Default", (uow) => new MyRepository().Update(uow, request)); } [AcceptVerbs("POST"), JsonFilter] public Result<DeleteResponse> Delete(DeleteRequest request) { return this.InTransaction("Default", (uow) => new MyRepository().Delete(uow, request)); } [AcceptVerbs("POST"), JsonFilter] public Result<UndeleteResponse> Undelete(UndeleteRequest request) { return this.InTransaction("Default", (uow) => new MyRepository().Undelete(uow, request)); } [AcceptVerbs("GET", "POST"), JsonFilter] public Result<RetrieveResponse<MyRow>> Retrieve(RetrieveRequest request) { return this.UseConnection("Default", (cnn) => new MyRepository().Retrieve(cnn, request)); } [AcceptVerbs("GET", "POST"), JsonFilter] public Result<ListResponse<MyRow>> List(ListRequest request) { return this.UseConnection("Default", (cnn) => new MyRepository().List(cnn, request)); } } }
mit
C#
0427399746e323d12c8f432cc243fd3284857b11
add stress tests
ceee/PocketSharp
PocketSharp.Tests/StressTests.cs
PocketSharp.Tests/StressTests.cs
using PocketSharp.Models; using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Threading.Tasks; using Xunit; namespace PocketSharp.Tests { public class StressTests : TestsBase { private static IEnumerable<string> urls; private static string[] tags = new string[] { "css", "js", "csharp", "windows", "microsoft" }; public StressTests() : base() { // !! please don't misuse this account !! client = new PocketClient( consumerKey: "20000-786d0bc8c39294e9829111d6", callbackUri: "http://frontendplay.com", accessCode: "9b8ecb6b-7801-1a5c-7b39-2ba05b" ); urls = File.ReadAllLines("../../url-100000.csv").Select(item => item.Split(',')[1]); } [Fact] public async Task Are100ItemsRetrievedProperly() { List<PocketItem> items = await client.Get(count: 100, state: State.all); Assert.True(items.Count == 100); } [Fact] public async Task Are1000ItemsRetrievedProperly() { List<PocketItem> items = await client.Get(count: 1000, state: State.all); Assert.True(items.Count == 1000); } [Fact] public async Task Are2500ItemsRetrievedProperly() { List<PocketItem> items = await client.Get(count: 2500, state: State.all); Assert.True(items.Count == 2500); } [Fact] public async Task Are5000ItemsRetrievedProperly() { List<PocketItem> items = await client.Get(count: 5000, state: State.all); Assert.True(items.Count == 5000); } [Fact] public async Task AreItemsRetrievedProperlyWithoutLimit() { List<PocketItem> items = await client.Get(state: State.all); Assert.True(items.Count > 0); } [Fact] public async Task IsSearchSuccessfullyOnBigList() { List<PocketItem> items = await client.Get(search: "google"); Assert.True(items.Count > 0); Assert.True(items[0].FullTitle.ToLower().Contains("google")); } [Fact] public async Task IsTagSearchSuccessfullyOnBigList() { List<PocketItem> items = await client.SearchByTag(tags[0]); Assert.True(items.Count > 1); bool found = false; items[0].Tags.ForEach(tag => { if (tag.Name.Contains(tags[0])) { found = true; } }); Assert.True(found); } [Fact] public async Task RetrieveTagsReturnsResultOnBigList() { List<PocketTag> items = await client.GetTags(); items.ForEach(tag => { Assert.True(tags.Contains(tag.Name)); }); Assert.Equal(items.Count, tags.Length); } private async Task FillAccount(int offset, int count) { int r; int r2; string[] tag; Random rnd = new Random(); foreach (string url in urls.Skip(offset).Take(count)) { r = rnd.Next(tags.Length); r2 = rnd.Next(tags.Length); tag = new string[] { tags[r], tags[r2] }; await client.Add(new Uri("http://" + url), tag); } } } }
using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Threading.Tasks; using Xunit; namespace PocketSharp.Tests { public class StressTests : TestsBase { private static IEnumerable<string> urls; private static string[] tags = new string[] { "css", "js", "csharp", "windows", "microsoft" }; public StressTests() : base() { // !! please don't misuse this account !! client = new PocketClient( consumerKey: "20000-786d0bc8c39294e9829111d6", callbackUri: "http://frontendplay.com", accessCode: "9b8ecb6b-7801-1a5c-7b39-2ba05b" ); urls = File.ReadAllLines("../../url-10000.csv").Select(item => item.Split(',')[1]); } [Fact] public async Task Are100IdingtemsRetrievedProperly() { await FillAccount(9273, 10000); } [Fact] public async Task Are1000ItemsRetrievedProperly() { } [Fact] public async Task Are10000ItemsRetrievedProperly() { } [Fact] public async Task Are0ItemsRetrievedProperly() { } [Fact] public async Task IsSearchedSuccessfullyOn10000Items() { } private async Task FillAccount(int offset, int count) { int r; int r2; string[] tag; Random rnd = new Random(); foreach (string url in urls.Skip(offset).Take(count)) { r = rnd.Next(tags.Length); r2 = rnd.Next(tags.Length); tag = new string[] { tags[r], tags[r2] }; await client.Add(new Uri("http://" + url), tag); } } } }
mit
C#
0a268c71405af6185021423dd68720a3c3808667
Update GdalDriverInfo.cs
LANDIS-II-Foundation/Landis-Spatial-Modeling-Library
src/RasterIO.Gdal/GdalDriverInfo.cs
src/RasterIO.Gdal/GdalDriverInfo.cs
// Contributors: // James Domingo, Green Code LLC using System; using System.Collections.Generic; using OSGeo.GDAL; namespace Landis.SpatialModeling.CoreServices { public static class GdalDriverInfo { public static void PrintAll() { try { Gdal.AllRegister(); Console.WriteLine("Registered GDAL drivers:"); List<DriverInfo> drivers = new List<DriverInfo>(Gdal.GetDriverCount()); for (int i = 0; i < Gdal.GetDriverCount(); ++i) { Driver driver = Gdal.GetDriver(i); DriverInfo driverInfo = new DriverInfo(driver); drivers.Add(driverInfo); } drivers.Sort(DriverInfo.CompareShortName); PrintCreateCapabilities(drivers); } catch (ApplicationException exc) { Console.WriteLine("Application exception: {0}", exc); } } public static void PrintCreateCapabilities(List<DriverInfo> driverInfos) { Console.WriteLine("Create,CreateCopy,Driver Code,Driver Description"); foreach (DriverInfo driverInfo in driverInfos) { string createStr = driverInfo.HasCreate ? "Y" : ""; string createCopyStr = driverInfo.HasCreateCopy ? "Y" : ""; Console.WriteLine("{0},{1},{2},\"{3}\"", createStr, createCopyStr, driverInfo.ShortName, driverInfo.LongName); } } public static void PrintMetadata(Driver driver, string prefix) { string[] metadata = driver.GetMetadata(""); foreach (string metadataItem in metadata) Console.WriteLine("{0}{1}", prefix, metadataItem); } } }
// Copyright 2010 Green Code LLC // All rights reserved. // // The copyright holders license this file under the New (3-clause) BSD // License (the "License"). You may not use this file except in // compliance with the License. A copy of the License is available at // // http://www.opensource.org/licenses/BSD-3-Clause // // and is included in the NOTICE.txt file distributed with this work. // // Contributors: // James Domingo, Green Code LLC using System; using System.Collections.Generic; using OSGeo.GDAL; namespace Landis.SpatialModeling.CoreServices { public static class GdalDriverInfo { public static void PrintAll() { try { Gdal.AllRegister(); Console.WriteLine("Registered GDAL drivers:"); List<DriverInfo> drivers = new List<DriverInfo>(Gdal.GetDriverCount()); for (int i = 0; i < Gdal.GetDriverCount(); ++i) { Driver driver = Gdal.GetDriver(i); DriverInfo driverInfo = new DriverInfo(driver); drivers.Add(driverInfo); } drivers.Sort(DriverInfo.CompareShortName); PrintCreateCapabilities(drivers); } catch (ApplicationException exc) { Console.WriteLine("Application exception: {0}", exc); } } public static void PrintCreateCapabilities(List<DriverInfo> driverInfos) { Console.WriteLine("Create,CreateCopy,Driver Code,Driver Description"); foreach (DriverInfo driverInfo in driverInfos) { string createStr = driverInfo.HasCreate ? "Y" : ""; string createCopyStr = driverInfo.HasCreateCopy ? "Y" : ""; Console.WriteLine("{0},{1},{2},\"{3}\"", createStr, createCopyStr, driverInfo.ShortName, driverInfo.LongName); } } public static void PrintMetadata(Driver driver, string prefix) { string[] metadata = driver.GetMetadata(""); foreach (string metadataItem in metadata) Console.WriteLine("{0}{1}", prefix, metadataItem); } } }
apache-2.0
C#
9ceba58e92454f4b4bd8fdcca9af3b4217f02a70
Fix datalist markup
peterblazejewicz/documentdb-todo-app-aspnet5,peterblazejewicz/documentdb-todo-app-aspnet5
src/ToDoApp/Views/Home/Index.cshtml
src/ToDoApp/Views/Home/Index.cshtml
@using Microsoft.Extensions.OptionsModel @using ToDoApp.Models @inject IOptions<DocumentDbOptions> config <h1>@ViewData["Title"]</h1> <h1>ToDo Application<br/> <small>backed by Azure DocumentDb</small></h1> <blockquote> <p>To highlight how you can efficiently leverage Azure DocumentDB to store and query JSON documents, this article provides an end-to-end walk-through showing you how to build a todo app using Azure DocumentDB. The tasks will be stored as JSON documents in Azure DocumentDB.</p> <footer> <a href="https://azure.microsoft.com/en-us/documentation/articles/documentdb-dotnet-application/#AddItemIndexView"><cite title="Web application development with ASP.NET MVC using DocumentDB">DOCUMENTATION DOCUMENTDB</cite></a> </footer> </blockquote> <div class="row"> <div class="col-lg-12"> <h2>DocumentDb configuration:</h2> <dl> <dt>Database:</dt> <dd>@config.Value.Database</dd> <dt>Collection:</dt> <dd>@config.Value.Collection</dd> <dt>EndPoint:</dt> <dd>@config.Value.EndPoint</dd> <dt>AuthKey:</dt> <dd>@config.Value.AuthKey</dd> </dl> </div> </div>
@using Microsoft.Extensions.OptionsModel @using ToDoApp.Models @inject IOptions<DocumentDbOptions> config <h1>@ViewData["Title"]</h1> <h1>ToDo Application<br/> <small>backed by Azure DocumentDb</small></h1> <blockquote> <p>To highlight how you can efficiently leverage Azure DocumentDB to store and query JSON documents, this article provides an end-to-end walk-through showing you how to build a todo app using Azure DocumentDB. The tasks will be stored as JSON documents in Azure DocumentDB.</p> <footer> <a href="https://azure.microsoft.com/en-us/documentation/articles/documentdb-dotnet-application/#AddItemIndexView"><cite title="Web application development with ASP.NET MVC using DocumentDB">DOCUMENTATION DOCUMENTDB</cite></a> </footer> </blockquote> <div class="row"> <div class="col-lg-12"> <h2>DocumentDb configuration:</h2> <dl> <dt>Database:</dt> <dd>@config.Value.Database</dd> </dl> <dl> <dt>Collection:</dt> <dd>@config.Value.Collection</dd> </dl> <dl> <dt>EndPoint:</dt> <dd>@config.Value.EndPoint</dd> </dl> <dl> <dt>AuthKey:</dt> <dd>@config.Value.AuthKey</dd> </dl> </div> </div>
unlicense
C#
cfddee4676b48c3c5a41f05ac99d64a3a810fbd3
fix and improve user management test
JetBrains/YouTrackSharp,JetBrains/YouTrackSharp
tests/YouTrackSharp.Tests/Integration/Management/UserManagement/CreateAndUpdateUser.cs
tests/YouTrackSharp.Tests/Integration/Management/UserManagement/CreateAndUpdateUser.cs
using System; using System.Threading.Tasks; using Xunit; using YouTrackSharp.Tests.Infrastructure; namespace YouTrackSharp.Tests.Integration.Management.UserManagement { public partial class UserManagementServiceTests { public class CreateAndUpdateUser { [Fact(Skip = "Don't want to pollute our server instance with random users.")] public async Task Valid_Connection_Updates_User() { // Arrange var connection = Connections.Demo3Token; var service = connection.CreateUserManagementService(); var randomUsername = "test" + Guid.NewGuid().ToString().Replace("-", string.Empty); var randomPassword = "pwd" + Guid.NewGuid().ToString().Replace("-", string.Empty); await service.CreateUser(randomUsername, "Test User", randomUsername + "@example.org", null, randomPassword); // Act await service.UpdateUser(randomUsername, "Test user (updated)"); // Assert try { var result = await service.GetUser(randomUsername); Assert.NotNull(result); Assert.Equal("Test user (updated)", result.FullName); } finally { // Delete the user await service.DeleteUser(randomUsername); } } } } }
using System; using System.Threading.Tasks; using Xunit; using YouTrackSharp.Tests.Infrastructure; namespace YouTrackSharp.Tests.Integration.Management.UserManagement { public partial class UserManagementServiceTests { public class CreateAndUpdateUser { [Fact(Skip = "Don't want to pollute our server instance with random users.")] public async Task Valid_Connection_Updates_User() { // Arrange var connection = Connections.Demo3Token; var service = connection.CreateUserManagementService(); var randomUsername = "test" + Guid.NewGuid().ToString().Replace("-", string.Empty); var randomPassword = "pwd" + Guid.NewGuid().ToString().Replace("-", string.Empty); await service.CreateUser(randomUsername, "Test User", "test1@example.org", null, randomPassword); // Act await service.UpdateUser(randomUsername, "Test user (updated)"); // Assert try { var result = await service.GetUser(randomUsername); Assert.NotNull(result); Assert.Equal("Test user (updated)", randomUsername); } finally { // Delete the user await service.DeleteUser(randomUsername); } } } } }
apache-2.0
C#
77e26db516ed097c16c419e37d2ad04ef8829ca9
Add credentials to UsersEndpointTests
thedillonb/octokit.net,octokit-net-test-org/octokit.net,Sarmad93/octokit.net,nsrnnnnn/octokit.net,shiftkey/octokit.net,octokit-net-test/octokit.net,cH40z-Lord/octokit.net,editor-tools/octokit.net,ivandrofly/octokit.net,shiftkey/octokit.net,SamTheDev/octokit.net,octokit/octokit.net,devkhan/octokit.net,SmithAndr/octokit.net,daukantas/octokit.net,naveensrinivasan/octokit.net,devkhan/octokit.net,alfhenrik/octokit.net,hahmed/octokit.net,michaKFromParis/octokit.net,SamTheDev/octokit.net,Red-Folder/octokit.net,rlugojr/octokit.net,adamralph/octokit.net,magoswiat/octokit.net,M-Zuber/octokit.net,eriawan/octokit.net,M-Zuber/octokit.net,ivandrofly/octokit.net,yonglehou/octokit.net,fake-organization/octokit.net,kolbasov/octokit.net,chunkychode/octokit.net,bslliw/octokit.net,shiftkey-tester-org-blah-blah/octokit.net,nsnnnnrn/octokit.net,gabrielweyer/octokit.net,darrelmiller/octokit.net,khellang/octokit.net,mminns/octokit.net,gdziadkiewicz/octokit.net,shiftkey-tester-org-blah-blah/octokit.net,octokit/octokit.net,yonglehou/octokit.net,dlsteuer/octokit.net,khellang/octokit.net,dampir/octokit.net,mminns/octokit.net,gabrielweyer/octokit.net,hahmed/octokit.net,alfhenrik/octokit.net,dampir/octokit.net,shiftkey-tester/octokit.net,rlugojr/octokit.net,octokit-net-test-org/octokit.net,shana/octokit.net,shana/octokit.net,fffej/octokit.net,shiftkey-tester/octokit.net,thedillonb/octokit.net,brramos/octokit.net,eriawan/octokit.net,gdziadkiewicz/octokit.net,SLdragon1989/octokit.net,takumikub/octokit.net,editor-tools/octokit.net,TattsGroup/octokit.net,Sarmad93/octokit.net,geek0r/octokit.net,TattsGroup/octokit.net,ChrisMissal/octokit.net,chunkychode/octokit.net,kdolan/octokit.net,forki/octokit.net,SmithAndr/octokit.net,hitesh97/octokit.net
Nocto.Tests.Integration/UsersEndpointTests.cs
Nocto.Tests.Integration/UsersEndpointTests.cs
using System.Threading.Tasks; using FluentAssertions; using Nocto.Http; using Xunit; namespace Nocto.Tests.Integration { public class UsersEndpointTests { public class TheGetMethod { [Fact] public async Task ReturnsSpecifiedUser() { var github = new GitHubClient { Credentials = new Credentials("xapitestaccountx", "octocat11") }; // Get a user by username var user = await github.User.Get("tclem"); user.Company.Should().Be("GitHub"); } } public class TheCurrentMethod { [Fact] public async Task ReturnsSpecifiedUser() { var github = new GitHubClient { Credentials = new Credentials("xapitestaccountx", "octocat11") }; var user = await github.User.Current(); user.Login.Should().Be("xapitestaccountx"); } } public class TheGetAllMethod { [Fact] public async Task ReturnsAPageOfUsers() { var github = new GitHubClient { Credentials = new Credentials("xapitestaccountx", "octocat11") }; var users = await github.User.GetAll(); users.Should().HaveCount(c => c > 0); } } } }
using System; using System.Threading.Tasks; using FluentAssertions; using Nocto.Http; using Xunit; namespace Nocto.Tests.Integration { public class UsersEndpointTests { public class TheGetMethod { [Fact] public async Task ReturnsSpecifiedUser() { var github = new GitHubClient { Credentials = new Credentials("xapitestaccountx", "octocat11") }; // Get a user by username var user = await github.User.Get("tclem"); user.Company.Should().Be("GitHub"); } } public class TheCurrentMethod { [Fact] public async Task ReturnsSpecifiedUser() { var github = new GitHubClient { Credentials = new Credentials("xapitestaccountx", "octocat11") }; var user = await github.User.Current(); user.Login.Should().Be("xapitestaccountx"); } } public class TheGetAllMethod { [Fact] public async Task ReturnsAllUsers() { var github = new GitHubClient(); var users = await github.User.GetAll(); users.Should().HaveCount(c => c > 0); } } } }
mit
C#
ddd4709bfd0ff7b85e6222c750ce31c52b518445
Add helper GetPropertyValue
clariuslabs/TransformOnBuild
Clarius.TransformOnBuild.MSBuild.Task/Clarius.TransformOnBuild.MSBuild.Task/TransformOnBuildTask.cs
Clarius.TransformOnBuild.MSBuild.Task/Clarius.TransformOnBuild.MSBuild.Task/TransformOnBuildTask.cs
using System; using System.Collections.Generic; using System.Linq; using System.Reflection; using Microsoft.Build.Execution; namespace Clarius.TransformOnBuild.MSBuild.Task { public class TransformOnBuildTask : Microsoft.Build.Utilities.Task { private ProjectInstance _projectInstance; private Dictionary<string, string> _properties; const BindingFlags BindingFlags = System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.FlattenHierarchy | System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.Public; public override bool Execute() { _projectInstance = GetProjectInstance(); _properties = _projectInstance.Properties.ToDictionary(p => p.Name, p => p.EvaluatedValue); return true; } /// <summary> /// Inspired by http://stackoverflow.com/questions/3043531/when-implementing-a-microsoft-build-utilities-task-how-to-i-get-access-to-the-va /// </summary> /// <returns></returns> private ProjectInstance GetProjectInstance() { var buildEngineType = BuildEngine.GetType(); var targetBuilderCallbackField = buildEngineType.GetField("targetBuilderCallback", BindingFlags); if (targetBuilderCallbackField == null) throw new Exception("Could not extract targetBuilderCallback from " + buildEngineType.FullName); var targetBuilderCallback = targetBuilderCallbackField.GetValue(BuildEngine); var targetCallbackType = targetBuilderCallback.GetType(); var projectInstanceField = targetCallbackType.GetField("projectInstance", BindingFlags); if (projectInstanceField == null) throw new Exception("Could not extract projectInstance from " + targetCallbackType.FullName); return (ProjectInstance) projectInstanceField.GetValue(targetBuilderCallback); } private string GetPropertyValue(string propertyName, bool throwIfNotFound = false) { string propertyValue; if (_properties.TryGetValue(propertyName, out propertyValue)) return propertyValue; if (throwIfNotFound) throw new Exception(string.Format("Could not resolve property $({0})", propertyName)); return ""; } } }
using System; using System.Collections.Generic; using System.Linq; using System.Reflection; using Microsoft.Build.Execution; namespace Clarius.TransformOnBuild.MSBuild.Task { public class TransformOnBuildTask : Microsoft.Build.Utilities.Task { private ProjectInstance _projectInstance; private Dictionary<string, string> _properties; const BindingFlags BindingFlags = System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.FlattenHierarchy | System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.Public; public override bool Execute() { _projectInstance = GetProjectInstance(); _properties = _projectInstance.Properties.ToDictionary(p => p.Name, p => p.EvaluatedValue); return true; } /// <summary> /// Inspired by http://stackoverflow.com/questions/3043531/when-implementing-a-microsoft-build-utilities-task-how-to-i-get-access-to-the-va /// </summary> /// <returns></returns> private ProjectInstance GetProjectInstance() { var buildEngineType = BuildEngine.GetType(); var targetBuilderCallbackField = buildEngineType.GetField("targetBuilderCallback", BindingFlags); if (targetBuilderCallbackField == null) throw new Exception("Could not extract targetBuilderCallback from " + buildEngineType.FullName); var targetBuilderCallback = targetBuilderCallbackField.GetValue(BuildEngine); var targetCallbackType = targetBuilderCallback.GetType(); var projectInstanceField = targetCallbackType.GetField("projectInstance", BindingFlags); if (projectInstanceField == null) throw new Exception("Could not extract projectInstance from " + targetCallbackType.FullName); return (ProjectInstance) projectInstanceField.GetValue(targetBuilderCallback); } } }
apache-2.0
C#
d25278622a0e8a918476c3702e8a2e60397773e3
Make test more readable
riganti/infrastructure
src/Infrastructure/Tests/Riganti.Utils.Infrastructure.Core.Tests/CoreNamespacesTests.cs
src/Infrastructure/Tests/Riganti.Utils.Infrastructure.Core.Tests/CoreNamespacesTests.cs
 using System.Linq; using Xunit; namespace Riganti.Utils.Infrastructure.Core.Tests { public class CoreNamespacesTests { /// <summary> /// If this test fail you have to correct the name space. /// If you are using Resharper you should set NamespaceProvider to false in folder properties /// </summary> [Fact] public void AllClassesHaveCorrectNameSpace_Test() { var correctNameSpace = "Riganti.Utils.Infrastructure.Core"; var infrastructureCoreAssembly = typeof(IRepository<,>).Assembly; var incorrectTypes = infrastructureCoreAssembly.GetTypes() .Where(t => t.Namespace != correctNameSpace) .Where(t => t.Namespace != "JetBrains.Profiler.Windows.Core.Instrumentation") //dotcover continuous testing add this namespace at runtime .Select(t => t.FullName) .ToArray(); var isIncorrectTypesEmpty = !incorrectTypes.Any(); Assert.True(isIncorrectTypesEmpty, $"Incorect types: {string.Join(", ", incorrectTypes)}"); } } }
 using System.Linq; using Xunit; namespace Riganti.Utils.Infrastructure.Core.Tests { public class CoreNamespacesTests { /// <summary> /// If this test fail you have to correct the name space. /// If you are using Resharper you should set NamespaceProvider to false in folder properties /// </summary> [Fact] public void AllClassesHaveCorrectNameSpace_Test() { var correctNameSpace = "Riganti.Utils.Infrastructure.Core"; var infrastructureCoreAssembly = typeof(IRepository<,>).Assembly; var incorrectTypes = infrastructureCoreAssembly.GetTypes() .Where(t => t.Namespace != correctNameSpace) .Where(t => t.Namespace != "JetBrains.Profiler.Windows.Core.Instrumentation") //dotcover continuous testing add this namespace at runtime .Select(t => t.FullName) .ToArray(); Assert.False(incorrectTypes.Any(), $"Incorect types: {string.Join(", ", incorrectTypes)}"); } } }
apache-2.0
C#
56bba0637b8447846099817ecfe703ee504f140a
Delete test.
nopara73/HiddenWallet,nopara73/HiddenWallet,nopara73/HiddenWallet,nopara73/HiddenWallet
WalletWasabi.Tests/StoreTests.cs
WalletWasabi.Tests/StoreTests.cs
using NBitcoin; using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; using WalletWasabi.Stores; using Xunit; namespace WalletWasabi.Tests { public class StoreTests { [Fact] public async Task IndexStoreTestsAsync() { var indexStore = new IndexStore(); var dir = Path.Combine(Global.DataDir, nameof(IndexStoreTestsAsync)); var network = Network.Main; await indexStore.InitializeAsync(dir, network); } [Fact] public async Task IoManagerTestsAsync() { var file1 = Path.Combine(Global.DataDir, nameof(IoManagerTestsAsync), $"file1.dat"); var file2 = Path.Combine(Global.DataDir, nameof(IoManagerTestsAsync), $"file2.dat"); Random random = new Random(); List<string> lines = new List<string>(); for (int i = 0; i < 1000; i++) { const string chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; string line = new string(Enumerable.Repeat(chars, 100) .Select(s => s[random.Next(s.Length)]).ToArray()); lines.Add(line); } // Single thread file operations IoManager ioman1 = new IoManager(file1); ioman1.DeleteMe(); Assert.False(ioman1.Exists()); await ioman1.WriteAllLinesAsync(lines); } } }
using NBitcoin; using System; using System.Collections.Generic; using System.IO; using System.Text; using System.Threading.Tasks; using WalletWasabi.Stores; using Xunit; namespace WalletWasabi.Tests { public class StoreTests { [Fact] public async Task IndexStoreTestsAsync() { var indexStore = new IndexStore(); var dir = Path.Combine(Global.DataDir, nameof(IndexStoreTestsAsync)); var network = Network.Main; await indexStore.InitializeAsync(dir, network); } } }
mit
C#
023692058b203a897101107adffd521a333d6a31
Enumerate packages.config file from repositories.config files.
Peter-Juhasz/PackageDiscovery
src/PackageDiscovery/Finders/NuGetPackageFinder.cs
src/PackageDiscovery/Finders/NuGetPackageFinder.cs
using System.Collections.Generic; using System.IO; using System.Linq; using System.Xml.Linq; namespace PackageDiscovery.Finders { public sealed class NuGetPackageFinder : IPackageFinder { public const string Moniker = "NuGet"; public IReadOnlyCollection<Package> FindPackages(DirectoryInfo directory) { var packagesFromRepositories = ( from f in directory .GetFiles("repositories.config", SearchOption.AllDirectories) let x = XDocument.Load(f.FullName) from r in x.Root.Elements("repository") select new FileInfo(Path.Combine(f.Directory.FullName, r.Attribute("path").Value)) ); var standalonePackages = directory .GetFiles("packages.config", SearchOption.AllDirectories); return standalonePackages.Union(packagesFromRepositories) .Select(f => XDocument.Load(f.FullName)) .SelectMany(x => x.Root.Elements("package")) .Select(x => new Package(Moniker, x.Attribute("id").Value, x.Attribute("version").Value)) .Distinct(p => new { p.Id, p.Version, p.IsDevelopmentPackage }) .OrderBy(p => p.Id) .ThenBy(p => p.Version) .ToList(); } } }
using System.Collections.Generic; using System.IO; using System.Linq; using System.Xml.Linq; namespace PackageDiscovery.Finders { public sealed class NuGetPackageFinder : IPackageFinder { public const string Moniker = "NuGet"; public IReadOnlyCollection<Package> FindPackages(DirectoryInfo directory) { return directory .GetFiles("packages.config", SearchOption.AllDirectories) .Select(f => XDocument.Load(f.FullName)) .SelectMany(x => x.Root.Elements("package")) .Select(x => new Package(Moniker, x.Attribute("id").Value, x.Attribute("version").Value)) .Distinct(p => new { p.Id, p.Version, p.IsDevelopmentPackage }) .OrderBy(p => p.Id) .ThenBy(p => p.Version) .ToList(); } } }
mit
C#
c95fb8ac9a1f7612884fe95a11e9e11554986ca5
Fix to use GetViewSize() instead of Screen.height.
Senspark/ee-x,Senspark/ee-x,Senspark/ee-x,Senspark/ee-x,Senspark/ee-x,Senspark/ee-x,Senspark/ee-x,Senspark/ee-x,Senspark/ee-x
unity/Runtime/Unity/UnityAdView.cs
unity/Runtime/Unity/UnityAdView.cs
using System.Threading.Tasks; using UnityEngine; namespace EE { public class UnityAdView : ObserverManager<IAdViewObserver>, IAdView { private readonly IAdView _ad; private readonly ObserverHandle _handle; private readonly int _screenHeight; public UnityAdView(IAdView ad) { _ad = ad; _handle = new ObserverHandle(); _handle.Bind(ad).AddObserver(new IAdViewObserver { OnLoaded = () => DispatchEvent(observer => observer.OnLoaded?.Invoke()), OnClicked = () => DispatchEvent(observer => observer.OnClicked?.Invoke()) }); (_, _screenHeight) = Platform.GetViewSize(); } public void Destroy() { _ad.Destroy(); _handle.Clear(); } public bool IsLoaded => _ad.IsLoaded; public Task<bool> Load() { return _ad.Load(); } public (float, float) Anchor { get { var (x, y) = _ad.Anchor; return (x, 1 - y); } set { var (x, y) = value; _ad.Anchor = (x, 1 - y); } } public (float, float) Position { get { var (x, y) = _ad.Position; return (x, _screenHeight - y); } set { var (x, y) = value; _ad.Position = (x, _screenHeight - y); } } public (float, float) Size { get => _ad.Size; set => _ad.Size = value; } public bool IsVisible { get => _ad.IsVisible; set => _ad.IsVisible = value; } } }
using System.Threading.Tasks; using UnityEngine; namespace EE { public class UnityAdView : ObserverManager<IAdViewObserver>, IAdView { private readonly IAdView _ad; private readonly ObserverHandle _handle; public UnityAdView(IAdView ad) { _ad = ad; _handle = new ObserverHandle(); _handle.Bind(ad).AddObserver(new IAdViewObserver { OnLoaded = () => DispatchEvent(observer => observer.OnLoaded?.Invoke()), OnClicked = () => DispatchEvent(observer => observer.OnClicked?.Invoke()) }); } public void Destroy() { _ad.Destroy(); _handle.Clear(); } public bool IsLoaded => _ad.IsLoaded; public Task<bool> Load() { return _ad.Load(); } public (float, float) Anchor { get { var (x, y) = _ad.Anchor; return (x, 1 - y); } set { var (x, y) = value; _ad.Anchor = (x, 1 - y); } } public (float, float) Position { get { var (x, y) = _ad.Position; return (x, Screen.height - y); } set { var (x, y) = value; _ad.Position = (x, Screen.height - y); } } public (float, float) Size { get => _ad.Size; set => _ad.Size = value; } public bool IsVisible { get => _ad.IsVisible; set => _ad.IsVisible = value; } } }
mit
C#
1534fd2fdc4b160b13815ae9ead391bb77a82e36
Change version number.
Clairety/ConnectMe,jockorob/BotBuilder,yakumo/BotBuilder,xiangyan99/BotBuilder,xiangyan99/BotBuilder,stevengum97/BotBuilder,dr-em/BotBuilder,msft-shahins/BotBuilder,navaei/BotBuilder,xiangyan99/BotBuilder,dr-em/BotBuilder,navaei/BotBuilder,jockorob/BotBuilder,xiangyan99/BotBuilder,msft-shahins/BotBuilder,digibaraka/BotBuilder,dr-em/BotBuilder,stevengum97/BotBuilder,jockorob/BotBuilder,yakumo/BotBuilder,dr-em/BotBuilder,mmatkow/BotBuilder,digibaraka/BotBuilder,yakumo/BotBuilder,navaei/BotBuilder,msft-shahins/BotBuilder,mmatkow/BotBuilder,yakumo/BotBuilder,stevengum97/BotBuilder,digibaraka/BotBuilder,Clairety/ConnectMe,mmatkow/BotBuilder,mmatkow/BotBuilder,Clairety/ConnectMe,digibaraka/BotBuilder,navaei/BotBuilder,Clairety/ConnectMe,jockorob/BotBuilder,msft-shahins/BotBuilder,stevengum97/BotBuilder
CSharp/Library/Properties/AssemblyInfo.cs
CSharp/Library/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("Microsoft.Bot.Builder")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Microsoft")] [assembly: AssemblyProduct("Microsoft Bot Builder")] [assembly: AssemblyCopyright("Copyright © 2016")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("cdfec7d6-847e-4c13-956b-0a960ae3eb60")] // 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.19")] [assembly: AssemblyFileVersion("0.9.0.19")] [assembly: InternalsVisibleTo("Microsoft.Bot.Builder.Tests")]
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("Microsoft.Bot.Builder")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Microsoft")] [assembly: AssemblyProduct("Microsoft Bot Builder")] [assembly: AssemblyCopyright("Copyright © 2016")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("cdfec7d6-847e-4c13-956b-0a960ae3eb60")] // 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.18")] [assembly: AssemblyFileVersion("0.9.0.18")] [assembly: InternalsVisibleTo("Microsoft.Bot.Builder.Tests")]
mit
C#
7631b53a2fa778bce1425053d84fa46b633fd066
Bump version to 0.5.0
sqt/cactbot,sqt/cactbot,sqt/cactbot,quisquous/cactbot,quisquous/cactbot,quisquous/cactbot,quisquous/cactbot,quisquous/cactbot,sqt/cactbot,sqt/cactbot,quisquous/cactbot
CactbotOverlay/Properties/AssemblyInfo.cs
CactbotOverlay/Properties/AssemblyInfo.cs
using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; [assembly: AssemblyTitle("CactbotOverlay")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("CactbotOverlay")] [assembly: AssemblyCopyright("Copyright 2017")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] [assembly: ComVisible(false)] [assembly: Guid("a7324717-0785-49ac-95e9-dc01bd7fbe7c")] // Version: // - Major Version // - Minor Version // - Build Number // - Revision // GitHub has only 3 version components, so Revision should always be 0. [assembly: AssemblyVersion("0.5.0.0")] [assembly: AssemblyFileVersion("0.5.0.0")]
using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; [assembly: AssemblyTitle("CactbotOverlay")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("CactbotOverlay")] [assembly: AssemblyCopyright("Copyright 2017")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] [assembly: ComVisible(false)] [assembly: Guid("a7324717-0785-49ac-95e9-dc01bd7fbe7c")] // Version: // - Major Version // - Minor Version // - Build Number // - Revision // GitHub has only 3 version components, so Revision should always be 0. [assembly: AssemblyVersion("0.4.1.0")] [assembly: AssemblyFileVersion("0.4.1.0")]
apache-2.0
C#
1bd5cf5fbef6f6d1005bfb1c8d562d0a8edea3aa
remove comma from list
DanielaPopova/TelerikAcademy_Homeworks,DanielaPopova/TelerikAcademy_Homeworks,DanielaPopova/TelerikAcademy_Homeworks
C#OOP/ExtensionMethodsDelegatesLambdaLINQ_HW/Problem02_IEnumerable/StartUp.cs
C#OOP/ExtensionMethodsDelegatesLambdaLINQ_HW/Problem02_IEnumerable/StartUp.cs
namespace Problem2_IEnumerable { using System; using System.Collections.Generic; using Problem2_IEnumerable.Extensions; // using System.Numerics; public class StartUp { public static void Main() { var testList = new List<int> { 2, 3, 4, 5, 8, 100, 14 }; // doesn't work with BigInteger Console.WriteLine(testList.Sum()); Console.WriteLine(testList.Product()); Console.WriteLine(testList.Min()); Console.WriteLine(testList.Max()); Console.WriteLine("{0:F4}", testList.Average()); } } }
namespace Problem2_IEnumerable { using System; using System.Collections.Generic; using Problem2_IEnumerable.Extensions; // using System.Numerics; public class StartUp { public static void Main() { var testList = new List<int> { 2, 3, 4, 5, 8, 100, 14, }; // doesn't work with BigInteger Console.WriteLine(testList.Sum()); Console.WriteLine(testList.Product()); Console.WriteLine(testList.Min()); Console.WriteLine(testList.Max()); Console.WriteLine("{0:F4}", testList.Average()); } } }
mit
C#
cf5812dbbf0a877086f726b8582c02c2a0bcc63e
fix updatedAfter filter for GetIssuesInProject
JetBrains/YouTrackSharp,JetBrains/YouTrackSharp
src/YouTrackSharp/Issues/IssuesService.Querying.cs
src/YouTrackSharp/Issues/IssuesService.Querying.cs
using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using YouTrackSharp.Generated; using YouTrackSharp.Internal; namespace YouTrackSharp.Issues { public partial class IssuesService { /// <inheritdoc /> public async Task<ICollection<Issue>> GetIssuesInProject(string projectId, string filter = null, int? skip = null, int? take = null, DateTime? updatedAfter = null, bool wikifyDescription = false) { if (string.IsNullOrEmpty(projectId)) { throw new ArgumentNullException(nameof(projectId)); } var queryString = "project:" + projectId; if (updatedAfter.HasValue) { queryString += " updated:" + updatedAfter?.ToString("yyyy'-'MM'-'dd'T'HH':'mm':'ss") + " .. *"; } queryString += " " + filter ?? ""; return await GetIssues(queryString, skip, take, wikifyDescription); } /// <inheritdoc /> public async Task<ICollection<Issue>> GetIssues(string filter = null, int? skip = null, int? take = null, bool wikifyDescription = false) { var client = await _connection.GetAuthenticatedApiClient(); var response = await client.IssuesGetAsync(filter, ISSUES_FIELDS_QUERY, skip, take); return response.Select(issue => Issue.FromApiEntity(issue, wikifyDescription)).ToList(); } /// <inheritdoc /> public async Task<long> GetIssueCount(string filter = null) { var query = !string.IsNullOrEmpty(filter) ? $"filter={Uri.EscapeDataString(filter)}" : string.Empty; var client = await _connection.GetAuthenticatedApiClient(); var retryPolicy = new LinearRetryPolicy<long>(async () => { var response = await client.IssuesGetterCountPostAsync("count", new IssueCountRequest(){Query = filter}); return response.Count; }, result => Task.FromResult(result < 0), TimeSpan.FromSeconds(1), 30); return await retryPolicy.Execute(); } } }
using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using YouTrackSharp.Generated; using YouTrackSharp.Internal; namespace YouTrackSharp.Issues { public partial class IssuesService { /// <inheritdoc /> public async Task<ICollection<Issue>> GetIssuesInProject(string projectId, string filter = null, int? skip = null, int? take = null, DateTime? updatedAfter = null, bool wikifyDescription = false) { if (string.IsNullOrEmpty(projectId)) { throw new ArgumentNullException(nameof(projectId)); } var queryString = "project:" + projectId; if (updatedAfter.HasValue) { queryString += " updated:" + updatedAfter?.ToString("yyyy'-'MM'-'dd'T'HH':'mm':'ss"); } queryString += " " + filter ?? ""; return await GetIssues(queryString, skip, take, wikifyDescription); } /// <inheritdoc /> public async Task<ICollection<Issue>> GetIssues(string filter = null, int? skip = null, int? take = null, bool wikifyDescription = false) { var client = await _connection.GetAuthenticatedApiClient(); var response = await client.IssuesGetAsync(filter, ISSUES_FIELDS_QUERY, skip, take); return response.Select(issue => Issue.FromApiEntity(issue, wikifyDescription)).ToList(); } /// <inheritdoc /> public async Task<long> GetIssueCount(string filter = null) { var query = !string.IsNullOrEmpty(filter) ? $"filter={Uri.EscapeDataString(filter)}" : string.Empty; var client = await _connection.GetAuthenticatedApiClient(); var retryPolicy = new LinearRetryPolicy<long>(async () => { var response = await client.IssuesGetterCountPostAsync("count", new IssueCountRequest(){Query = filter}); return response.Count; }, result => Task.FromResult(result < 0), TimeSpan.FromSeconds(1), 30); return await retryPolicy.Execute(); } } }
apache-2.0
C#
280ea123a7494400ba0dbb4f35cf2f7c7257bb0e
Fix PR display
jaredpar/jenkins,jaredpar/jenkins,jaredpar/jenkins
Dashboard/Views/Builds/TestFailure.cshtml
Dashboard/Views/Builds/TestFailure.cshtml
@model Dashboard.Models.TestFailureModel @using Dashboard.Jenkins @{ ViewBag.Title = Model.Name; var prValue = Model.IncludePullRequests ? @"checked=""checked""" : ""; var startDateValue = Model.StartDate.ToString("yyyy-MM-dd"); var showForPrStyle = Model.IncludePullRequests ? "" : "display: none"; } <h2>Test Case: @Model.Name</h2> <h3>Failed Jenkins Jobs</h3> <table class="table"> <thead><tr> <th>Build Number</th> <th>Machine Name</th> <th>Date</th> <th style="@showForPrStyle">PR Author</th> <th style="@showForPrStyle">PR Link</th> </tr></thead> <tbody> @foreach (var entity in Model.Builds) { var id = entity.BuildId; var uri = JenkinsUtil.GetUri(SharedConstants.DotnetJenkinsUri, JenkinsUtil.GetBuildPath(id)); var prUri = entity.PullRequestUrl ?? ""; <tr> <td><a href="@uri">@id.JobName @id.Number</a></td> <td>@entity.MachineName</td> <td>@entity.BuildDateTime.ToLocalTime().ToString("MM/dd hh:mm tt")</td> <td style="@showForPrStyle">@entity.PullRequestAuthor</td> <td style="@showForPrStyle"><a href="@prUri">@entity.PullRequestId</a></td> </tr> } </tbody> </table> <h2>Filter Results</h2> @using (Html.BeginForm(controllerName: "Builds", actionName: "Test", method: FormMethod.Get)) { <input type="hidden" name="name" value="@Model.Name" /> <div> <div>Include Pull Requests <input name="pr" type="checkbox" @prValue value="true" /></div> <div>Start Date <input name="startDate" type="date" value="@startDateValue"/></div> <div><input type="submit" value="Refresh" /></div> </div> }
@model Dashboard.Models.TestFailureModel @using Dashboard.Jenkins @{ ViewBag.Title = Model.Name; var prValue = Model.IncludePullRequests ? @"checked=""checked""" : ""; var startDateValue = Model.StartDate.ToString("yyyy-MM-dd"); var showForPrStyle = Model.IncludePullRequests ? "" : "display: none"; } <h2>Test Case: @Model.Name</h2> <h3>Failed Jenkins Jobs</h3> <table class="table"> <thead><tr> <th>Build Number</th> <th>Machine Name</th> <th>Date</th> <th style="@showForPrStyle">PR Author</th> <th style="@showForPrStyle">PR Link</th> </tr></thead> <tbody> @foreach (var entity in Model.Builds) { var id = entity.BuildId; var uri = JenkinsUtil.GetUri(SharedConstants.DotnetJenkinsUri, JenkinsUtil.GetBuildPath(id)); var prUri = entity.PullRequestUrl ?? ""; <tr> <td><a href="@uri">@id.JobName @id.Number</a></td> <td>@entity.MachineName</td> <td>@entity.BuildDateTime.ToLocalTime().ToString("MM/dd hh:mm tt")</td> <td>@entity.PullRequestAuthor</td> <td><a href="@prUri">@entity.PullRequestId</a></td> </tr> } </tbody> </table> <h2>Filter Results</h2> @using (Html.BeginForm(controllerName: "Builds", actionName: "Test", method: FormMethod.Get)) { <input type="hidden" name="name" value="@Model.Name" /> <div> <div>Include Pull Requests <input name="pr" type="checkbox" @prValue value="true" /></div> <div>Start Date <input name="startDate" type="date" value="@startDateValue"/></div> <div><input type="submit" value="Refresh" /></div> </div> }
apache-2.0
C#
ccf2b289eb0ca620f4bd7c1a9b1741b41ea3568e
Add docs region for User class
GoogleCloudPlatform/getting-started-dotnet,GoogleCloudPlatform/getting-started-dotnet,GoogleCloudPlatform/getting-started-dotnet
aspnet/4-auth/Models/User.cs
aspnet/4-auth/Models/User.cs
// Copyright(c) 2016 Google Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); you may not // use this file except in compliance with the License. You may obtain a copy of // the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, WITHOUT // WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the // License for the specific language governing permissions and limitations under // the License. using System.Security.Claims; using System.Security.Principal; namespace GoogleCloudSamples.Models { // [START user] public class User : ClaimsPrincipal { public User(IPrincipal principal) : base(principal as ClaimsPrincipal) { } public string Name => this.Identity.Name; public string UserId => this.FindFirst(ClaimTypes.NameIdentifier).Value; public string ProfileUrl => this.FindFirst(ClaimTypes.Uri).Value; } // [END user] }
// Copyright(c) 2016 Google Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); you may not // use this file except in compliance with the License. You may obtain a copy of // the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, WITHOUT // WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the // License for the specific language governing permissions and limitations under // the License. using System.Security.Claims; using System.Security.Principal; namespace GoogleCloudSamples.Models { public class User : ClaimsPrincipal { public User(IPrincipal principal) : base(principal as ClaimsPrincipal) { } public string Name => this.Identity.Name; public string UserId => this.FindFirst(ClaimTypes.NameIdentifier).Value; public string ProfileUrl => this.FindFirst(ClaimTypes.Uri).Value; } }
apache-2.0
C#
98d2cd9c369bee584e31eb45715f6f76d3ce9eca
fix #45 Disable transactions
aspnetboilerplate/aspnetboilerplate-samples,aspnetboilerplate/aspnetboilerplate-samples,aspnetboilerplate/aspnetboilerplate-samples,aspnetboilerplate/aspnetboilerplate-samples,aspnetboilerplate/aspnetboilerplate-samples,aspnetboilerplate/aspnetboilerplate-samples
SqliteDemo/aspnet-core/src/Volo.SqliteDemo.EntityFrameworkCore/EntityFrameworkCore/SqliteDemoEntityFrameworkModule.cs
SqliteDemo/aspnet-core/src/Volo.SqliteDemo.EntityFrameworkCore/EntityFrameworkCore/SqliteDemoEntityFrameworkModule.cs
using Abp.EntityFrameworkCore.Configuration; using Abp.Modules; using Abp.Reflection.Extensions; using Abp.Zero.EntityFrameworkCore; using Volo.SqliteDemo.EntityFrameworkCore.Seed; namespace Volo.SqliteDemo.EntityFrameworkCore { [DependsOn( typeof(SqliteDemoCoreModule), typeof(AbpZeroCoreEntityFrameworkCoreModule))] public class SqliteDemoEntityFrameworkModule : AbpModule { /* Used it tests to skip dbcontext registration, in order to use in-memory database of EF Core */ public bool SkipDbContextRegistration { get; set; } public bool SkipDbSeed { get; set; } public override void PreInitialize() { Configuration.UnitOfWork.IsTransactional = false; if (!SkipDbContextRegistration) { Configuration.Modules.AbpEfCore().AddDbContext<SqliteDemoDbContext>(options => { if (options.ExistingConnection != null) { SqliteDemoDbContextConfigurer.Configure(options.DbContextOptions, options.ExistingConnection); } else { SqliteDemoDbContextConfigurer.Configure(options.DbContextOptions, options.ConnectionString); } }); } } public override void Initialize() { IocManager.RegisterAssemblyByConvention(typeof(SqliteDemoEntityFrameworkModule).GetAssembly()); } public override void PostInitialize() { if (!SkipDbSeed) { SeedHelper.SeedHostDb(IocManager); } } } }
using Abp.EntityFrameworkCore.Configuration; using Abp.Modules; using Abp.Reflection.Extensions; using Abp.Zero.EntityFrameworkCore; using Volo.SqliteDemo.EntityFrameworkCore.Seed; namespace Volo.SqliteDemo.EntityFrameworkCore { [DependsOn( typeof(SqliteDemoCoreModule), typeof(AbpZeroCoreEntityFrameworkCoreModule))] public class SqliteDemoEntityFrameworkModule : AbpModule { /* Used it tests to skip dbcontext registration, in order to use in-memory database of EF Core */ public bool SkipDbContextRegistration { get; set; } public bool SkipDbSeed { get; set; } public override void PreInitialize() { if (!SkipDbContextRegistration) { Configuration.Modules.AbpEfCore().AddDbContext<SqliteDemoDbContext>(options => { if (options.ExistingConnection != null) { SqliteDemoDbContextConfigurer.Configure(options.DbContextOptions, options.ExistingConnection); } else { SqliteDemoDbContextConfigurer.Configure(options.DbContextOptions, options.ConnectionString); } }); } } public override void Initialize() { IocManager.RegisterAssemblyByConvention(typeof(SqliteDemoEntityFrameworkModule).GetAssembly()); } public override void PostInitialize() { if (!SkipDbSeed) { SeedHelper.SeedHostDb(IocManager); } } } }
mit
C#
100babb8a35a6d5c2f315eb092ff9b506cf3a4fe
copy paste error
yuxuac/docs.particular.net,pedroreys/docs.particular.net,WojcikMike/docs.particular.net,eclaus/docs.particular.net
samples/header-manipulation/Version_5/Sample/Pipeline/PipelineConfig.cs
samples/header-manipulation/Version_5/Sample/Pipeline/PipelineConfig.cs
using NServiceBus.Features; using NServiceBus.Pipeline; #region pipeline-config public class HeaderFeature : Feature { internal HeaderFeature() { EnableByDefault(); } protected override void Setup(FeatureConfigurationContext context) { context.Pipeline.Register<IncomingHeaderRegistration>(); context.Pipeline.Register<OutgoingHeaderRegistration>(); } } public class IncomingHeaderRegistration : RegisterStep { public IncomingHeaderRegistration() : base( stepId: "IncomingHeaderManipulation", behavior: typeof(IncomingHeaderBehavior), description: "Manipulates incoming headers") { InsertAfter(WellKnownStep.MutateIncomingTransportMessage); InsertBefore(WellKnownStep.InvokeHandlers); } } public class OutgoingHeaderRegistration : RegisterStep { public OutgoingHeaderRegistration() : base( stepId: "OutgoingHeaderManipulation", behavior: typeof(OutgoingHeaderBehavior), description: "Manipulates outgoing headers") { InsertAfter(WellKnownStep.MutateOutgoingTransportMessage); InsertBefore(WellKnownStep.DispatchMessageToTransport); } } #endregion
using NServiceBus.Features; using NServiceBus.Pipeline; #region pipeline-config public class HeaderFeature : Feature { internal HeaderFeature() { EnableByDefault(); } protected override void Setup(FeatureConfigurationContext context) { context.Pipeline.Register<IncomingHeaderRegistration>(); context.Pipeline.Register<OutgoingHeaderRegistration>(); } } public class IncomingHeaderRegistration : RegisterStep { public IncomingHeaderRegistration() : base("IncomingHeaderManipulation", typeof(IncomingHeaderBehavior), "Copies the shared data back to the logical messages") { InsertAfter(WellKnownStep.MutateIncomingTransportMessage); InsertBefore(WellKnownStep.InvokeHandlers); } } public class OutgoingHeaderRegistration : RegisterStep { public OutgoingHeaderRegistration() : base("OutgoingHeaderManipulation", typeof(OutgoingHeaderBehavior), "Saves the payload into the shared location") { InsertAfter(WellKnownStep.MutateOutgoingTransportMessage); InsertBefore(WellKnownStep.DispatchMessageToTransport); } } #endregion
apache-2.0
C#
b99448b0b158122533c7012b7171d22ceb7facac
Improve settings descriptions
Bjornej/GruntLauncher
GruntLauncher/OptionPage.cs
GruntLauncher/OptionPage.cs
using System; using System.Collections.Generic; using System.ComponentModel; using System.Linq; using System.Runtime.InteropServices; using System.Text; using System.Threading.Tasks; using Microsoft.VisualStudio.Shell; namespace Bjornej.GruntLauncher { [ClassInterface(ClassInterfaceType.AutoDual)] [CLSCompliant(false), ComVisible(true)] public class OptionPage : DialogPage { [Category("Tasks Parser")] [DisplayName("Exclusion")] [Description("Specify a Regex pattern to exclude some unwanted tasks from list.")] public string TaskRegex { get; set; } } }
using System; using System.Collections.Generic; using System.ComponentModel; using System.Linq; using System.Runtime.InteropServices; using System.Text; using System.Threading.Tasks; using Microsoft.VisualStudio.Shell; namespace Bjornej.GruntLauncher { [ClassInterface(ClassInterfaceType.AutoDual)] [CLSCompliant(false), ComVisible(true)] public class OptionPage : DialogPage { [Category("General")] [DisplayName("Task regex")] [Description("Regex to use to hide specific tasks from list.")] public string TaskRegex { get; set; } } }
mit
C#
921775df77255232fa26a5505d04d6d8c1d99524
Include a pepper in the hashing algorithm.
ravendb/ravendb.contrib
src/Raven.Client.Contrib.MVC/Auth/Default/BCryptSecurityEncoder.cs
src/Raven.Client.Contrib.MVC/Auth/Default/BCryptSecurityEncoder.cs
using System; using System.Collections.Generic; using System.Linq; using System.Text; using Raven.Client.Contrib.MVC.Auth.Interfaces; namespace Raven.Client.Contrib.MVC.Auth.Default { internal class BCryptSecurityEncoder : ISecurityEncoder { /// <summary> /// Generates a unique token. /// </summary> /// <returns>The unique token.</returns> public string GenerateToken() { return new Guid().ToString() .ToLowerInvariant() .Replace("-", ""); } /// <summary> /// Hashes the identifier with the provided salt. /// </summary> /// <param name="identifier">The identifier to hash.</param> /// <returns>The hashed identifier.</returns> public string Hash(string identifier) { const string pepper = "BCryptSecurityEncoder"; string salt = BCrypt.Net.BCrypt.GenerateSalt(workFactor: 10); return BCrypt.Net.BCrypt.HashPassword(identifier, salt + pepper); } /// <summary> /// Verifies if the identifier matches the hash. /// </summary> /// <param name="identifier">The identifier to check.</param> /// <param name="hash">The hash to check against.</param> /// <returns>true if the identifiers match, false otherwise.</returns> public bool Verify(string identifier, string hash) { return BCrypt.Net.BCrypt.Verify(identifier, hash); } } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using Raven.Client.Contrib.MVC.Auth.Interfaces; namespace Raven.Client.Contrib.MVC.Auth.Default { internal class BCryptSecurityEncoder : ISecurityEncoder { /// <summary> /// Generates a unique token. /// </summary> /// <returns>The unique token.</returns> public string GenerateToken() { return new Guid().ToString() .ToLowerInvariant() .Replace("-", ""); } /// <summary> /// Hashes the identifier with the provided salt. /// </summary> /// <param name="identifier">The identifier to hash.</param> /// <returns>The hashed identifier.</returns> public string Hash(string identifier) { return BCrypt.Net.BCrypt.HashPassword(identifier, workFactor: 10); } /// <summary> /// Verifies if the identifier matches the hash. /// </summary> /// <param name="identifier">The identifier to check.</param> /// <param name="hash">The hash to check against.</param> /// <returns>true if the identifiers match, false otherwise.</returns> public bool Verify(string identifier, string hash) { return BCrypt.Net.BCrypt.Verify(identifier, hash); } } }
mit
C#
ee0f9089b4bffeae2695d91dd5bb20f17684645e
Clean up a bit
tgstation/tgstation-server,tgstation/tgstation-server-tools,Cyberboss/tgstation-server,tgstation/tgstation-server,Cyberboss/tgstation-server
src/Tgstation.Server.Host/Security/WindowsSystemIdentityFactory.cs
src/Tgstation.Server.Host/Security/WindowsSystemIdentityFactory.cs
using Microsoft.Win32.SafeHandles; using System; using System.DirectoryServices.AccountManagement; using System.Runtime.InteropServices; using System.Security.Principal; using System.Threading; using System.Threading.Tasks; using Tgstation.Server.Host.Models; namespace Tgstation.Server.Host.Security { /// <summary> /// <see cref="ISystemIdentityFactory"/> for windows systems. Uses long running tasks due to potential networked domains /// </summary> sealed class WindowsSystemIdentityFactory : ISystemIdentityFactory { /// <inheritdoc /> public Task<ISystemIdentity> CreateSystemIdentity(User user, CancellationToken cancellationToken) => Task.Factory.StartNew(() => { if (user == null) throw new ArgumentNullException(nameof(user)); if (user.SystemIdentifier == null) throw new InvalidOperationException("User's SystemIdentifier must not be null!"); PrincipalContext pc = null; UserPrincipal principal = null; //machine logon first cause it's faster pc = new PrincipalContext(ContextType.Machine); principal = UserPrincipal.FindByIdentity(pc, user.SystemIdentifier); if (principal == null) { pc.Dispose(); //try domain now try { pc = new PrincipalContext(ContextType.Domain); principal = UserPrincipal.FindByIdentity(pc, user.SystemIdentifier); } catch (PrincipalServerDownException) { } if (principal == null) { pc?.Dispose(); return null; } } return (ISystemIdentity)new WindowsSystemIdentity(principal); }, cancellationToken, TaskCreationOptions.LongRunning, TaskScheduler.Current); /// <inheritdoc /> public Task<ISystemIdentity> CreateSystemIdentity(string username, string password, CancellationToken cancellationToken) => Task.Factory.StartNew(() => { if (username == null) throw new ArgumentNullException(nameof(username)); if (password == null) throw new ArgumentNullException(nameof(password)); var splits = username.Split('\\'); var res = NativeMethods.LogonUser(splits.Length > 1 ? splits[1] : splits[0], splits.Length > 1 ? splits[0] : null, password, 3 /*LOGON32_LOGON_NETWORK*/, 0 /*LOGON32_PROVIDER_DEFAULT*/, out var token); if (!res) return null; using (var handle = new SafeAccessTokenHandle(token)) //checked internally, windows identity always duplicates the handle when constructed with a userToken return (ISystemIdentity)new WindowsSystemIdentity(new WindowsIdentity(handle.DangerousGetHandle())); //https://github.com/dotnet/corefx/blob/6ed61acebe3214fcf79b4274f2bb9b55c0604a4d/src/System.Security.Principal.Windows/src/System/Security/Principal/WindowsIdentity.cs#L271 }, cancellationToken, TaskCreationOptions.LongRunning, TaskScheduler.Current); } }
using Microsoft.Win32.SafeHandles; using System; using System.DirectoryServices.AccountManagement; using System.Runtime.InteropServices; using System.Security.Principal; using System.Threading; using System.Threading.Tasks; using Tgstation.Server.Host.Models; namespace Tgstation.Server.Host.Security { /// <summary> /// <see cref="ISystemIdentityFactory"/> for windows systems. Uses long running tasks due to potential networked domains /// </summary> sealed class WindowsSystemIdentityFactory : ISystemIdentityFactory { /// <inheritdoc /> public Task<ISystemIdentity> CreateSystemIdentity(User user, CancellationToken cancellationToken) => Task.Factory.StartNew(() => { if (user == null) throw new ArgumentNullException(nameof(user)); if (user.SystemIdentifier == null) throw new InvalidOperationException("User's SystemIdentifier must not be null!"); PrincipalContext pc = null; UserPrincipal principal = null; //machine logon first cause it's faster try { pc = new PrincipalContext(ContextType.Machine); principal = UserPrincipal.FindByIdentity(pc, user.SystemIdentifier); } catch(COMException) { pc?.Dispose(); } if (principal == null) { //try domain now try { var udn = Environment.UserDomainName; pc = new PrincipalContext(ContextType.Domain, udn); principal = UserPrincipal.FindByIdentity(pc, user.SystemIdentifier); } catch (PrincipalServerDownException) { } if(principal == null) { pc?.Dispose(); return null; } } return (ISystemIdentity)new WindowsSystemIdentity(principal); }, cancellationToken, TaskCreationOptions.LongRunning, TaskScheduler.Current); /// <inheritdoc /> public Task<ISystemIdentity> CreateSystemIdentity(string username, string password, CancellationToken cancellationToken) => Task.Factory.StartNew(() => { if (username == null) throw new ArgumentNullException(nameof(username)); if (password == null) throw new ArgumentNullException(nameof(password)); var splits = username.Split('\\'); var res = NativeMethods.LogonUser(splits.Length > 1 ? splits[1] : splits[0], splits.Length > 1 ? splits[0] : null, password, 3 /*LOGON32_LOGON_NETWORK*/, 0 /*LOGON32_PROVIDER_DEFAULT*/, out var token); if (!res) return null; using (var handle = new SafeAccessTokenHandle(token)) //checked internally, windows identity always duplicates the handle when constructed with a userToken return (ISystemIdentity)new WindowsSystemIdentity(new WindowsIdentity(handle.DangerousGetHandle())); //https://github.com/dotnet/corefx/blob/6ed61acebe3214fcf79b4274f2bb9b55c0604a4d/src/System.Security.Principal.Windows/src/System/Security/Principal/WindowsIdentity.cs#L271 }, cancellationToken, TaskCreationOptions.LongRunning, TaskScheduler.Current); } }
agpl-3.0
C#
a8e743b14fef41ec0a584c4cfd4d52df19a9c5eb
Remove unnecessary using
mavasani/roslyn-analyzers,mavasani/roslyn-analyzers,dotnet/roslyn-analyzers,dotnet/roslyn-analyzers
src/Utilities/FlowAnalysis/Extensions/OperationBlocksExtensions.cs
src/Utilities/FlowAnalysis/Extensions/OperationBlocksExtensions.cs
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System.Collections.Immutable; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.FlowAnalysis; namespace Analyzer.Utilities.Extensions { internal static partial class OperationBlocksExtensions { public static ControlFlowGraph? GetControlFlowGraph(this ImmutableArray<IOperation> operationBlocks) { foreach (var operationRoot in operationBlocks) { if (operationRoot.TryGetEnclosingControlFlowGraph(out var cfg)) { return cfg; } } 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.Collections.Immutable; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.FlowAnalysis; using Microsoft.CodeAnalysis.Operations; namespace Analyzer.Utilities.Extensions { internal static partial class OperationBlocksExtensions { public static ControlFlowGraph? GetControlFlowGraph(this ImmutableArray<IOperation> operationBlocks) { foreach (var operationRoot in operationBlocks) { if (operationRoot.TryGetEnclosingControlFlowGraph(out var cfg)) { return cfg; } } return null; } } }
mit
C#
3d2eece7b1cf3cd69a9f2d9fba5403c3a7a80a37
Decrease allocations in List Serializer
gregsdennis/Manatee.Json,gregsdennis/Manatee.Json
Manatee.Json/Serialization/Internal/AutoRegistration/ListSerializationDelegateProvider.cs
Manatee.Json/Serialization/Internal/AutoRegistration/ListSerializationDelegateProvider.cs
using System; using System.Collections.Generic; using System.Linq; using System.Reflection; namespace Manatee.Json.Serialization.Internal.AutoRegistration { internal class ListSerializationDelegateProvider : SerializationDelegateProviderBase { public override bool CanHandle(Type type) { return type.GetTypeInfo().IsGenericType && type.GetGenericTypeDefinition() == typeof(List<>); } private static JsonValue _Encode<T>(List<T> list, JsonSerializer serializer) { var array = new JsonValue[list.Count]; for (int ii = 0; ii < array.Length; ++ii) { array[ii] = serializer.Serialize(list[ii]); } return new JsonArray(array); } private static List<T> _Decode<T>(JsonValue json, JsonSerializer serializer) { var array = json.Array; var list = new List<T>(array.Count); for (int ii = 0; ii < array.Count; ++ii) { list.Add(serializer.Deserialize<T>(array[ii])); } return list; } } }
using System; using System.Collections.Generic; using System.Linq; using System.Reflection; namespace Manatee.Json.Serialization.Internal.AutoRegistration { internal class ListSerializationDelegateProvider : SerializationDelegateProviderBase { public override bool CanHandle(Type type) { return type.GetTypeInfo().IsGenericType && type.GetGenericTypeDefinition() == typeof(List<>); } private static JsonValue _Encode<T>(List<T> list, JsonSerializer serializer) { var array = new JsonArray(); array.AddRange(list.Select(serializer.Serialize)); return array; } private static List<T> _Decode<T>(JsonValue json, JsonSerializer serializer) { var list = new List<T>(); list.AddRange(json.Array.Select(serializer.Deserialize<T>)); return list; } } }
mit
C#
c4ce5c41d686cdc1c9626a93d2ea429ec9e44651
Fix build
Catel/Catel.Fody
src/MethodTimeLogger.cs
src/MethodTimeLogger.cs
using System.Reflection; //using Catel.Logging; using System; /// <summary> /// Note: do not rename this class or put it inside a namespace. /// </summary> internal static class MethodTimeLogger { #region Methods public static void Log(MethodBase methodBase, long milliseconds, string message) { Log(methodBase.DeclaringType, methodBase.Name, milliseconds, message); } public static void Log(Type type, string methodName, long milliseconds, string message) { // if (type == null) // { // return; // } // var finalMessage = $"[METHODTIMER] {type.Name}.{methodName} took '{milliseconds}' ms"; // if (!string.IsNullOrWhiteSpace(message)) // { // finalMessage += $" | {message}"; // } // var logger = LogManager.GetLogger(type); // logger.Debug(finalMessage); } #endregion }
using System.Reflection; using Catel.Logging; using System; /// <summary> /// Note: do not rename this class or put it inside a namespace. /// </summary> internal static class MethodTimeLogger { #region Methods public static void Log(MethodBase methodBase, long milliseconds, string message) { Log(methodBase.DeclaringType, methodBase.Name, milliseconds, message); } public static void Log(Type type, string methodName, long milliseconds, string message) { if (type == null) { return; } var finalMessage = $"[METHODTIMER] {type.Name}.{methodName} took '{milliseconds}' ms"; if (!string.IsNullOrWhiteSpace(message)) { finalMessage += $" | {message}"; } var logger = LogManager.GetLogger(type); logger.Debug(finalMessage); } #endregion }
mit
C#
441c8de9172e4465aae463f583d8032cc6d73d96
Update ILineDisassembler.cs
informedcitizenry/6502.Net
6502.Net/ILineDisassembler.cs
6502.Net/ILineDisassembler.cs
//----------------------------------------------------------------------------- // Copyright (c) 2017 informedcitizenry <informedcitizenry@gmail.com> // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to // deal in the Software without restriction, including without limitation the // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or // sell copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS // IN THE SOFTWARE. //----------------------------------------------------------------------------- using System; using System.Text; namespace Asm6502.Net { /// <summary> /// Represents an interface for a line disassembler. /// </summary> public interface ILineDisassembler { /// <summary> /// Disassemble a line of 6502 source. /// </summary> /// <param name="line">The SourceLine.</param> /// <returns>A string representation of the source.</returns> string DisassembleLine(SourceLine line); /// <summary> /// Disassemble a line of 6502 source to a supplied /// System.Text.StringBuilder. /// </summary> /// <param name="line">The SourceLine to disassemble.</param> /// <param name="sb">A System.Text.StringBuilder to output disassembly.</param> void DisassembleLine(SourceLine line, StringBuilder sb); /// <summary> /// Gets a flag indicating if printing is on. /// </summary> bool PrintingOn { get; } } }
//----------------------------------------------------------------------------- // Copyright (c) 2017 informedcitizenry <informedcitizenry@gmail.com> // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to // deal in the Software without restriction, including without limitation the // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or // sell copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS // IN THE SOFTWARE. //----------------------------------------------------------------------------- using System; namespace Asm6502.Net { /// <summary> /// Represents an interface for a line disassembler. /// </summary> public interface ILineDisassembler { /// <summary> /// Disassemble a line of 6502 source. /// </summary> /// <param name="line">The SourceLine.</param> /// <returns>A string representation of the source.</returns> string DisassembleLine(SourceLine line); /// <summary> /// Disassemble a line of 6502 source to a supplied /// System.Text.StringBuilder. /// </summary> /// <param name="line">The SourceLine to disassemble.</param> /// <param name="sb">A System.Text.StringBuilder to output disassembly.</param> void DisassembleLine(SourceLine line, StringBuilder sb); /// <summary> /// Gets a flag indicating if printing is on. /// </summary> bool PrintingOn { get; } } }
mit
C#
a68d49c6ff6dcc9766366a35c601d214a125dd5c
Save assets more aggressively during playmode
JoeOsborn/SRPGCK,JoeOsborn/SRPGCK
Assets/Editor/SRPGKit/SRPGCKEditor.cs
Assets/Editor/SRPGKit/SRPGCKEditor.cs
using UnityEngine; using UnityEditor; using System.Linq; public abstract class SRPGCKEditor : Editor { public Formulae fdb; public bool listeningForGuiChanges; public bool guiChanged, guiChangedAtAll; public string[] formulaOptions; public string lastFocusedControl, newFocusedControl; protected bool useFormulae=true; protected virtual void UpdateFormulae() { if(!useFormulae) { return; } if(fdb != null && fdb.formulaNames != null) { formulaOptions = (new string[]{"Custom"}).Concat(fdb.formulaNames).ToArray(); } else { formulaOptions = new string[]{"Custom"}; } } void CheckFocus() { newFocusedControl = GUI.GetNameOfFocusedControl(); } public virtual void OnEnable() { guiChangedAtAll = false; guiChanged = false; if(!useFormulae) { return; } if(fdb == null) { fdb = Formulae.DefaultFormulae; } UpdateFormulae(); } public abstract void OnSRPGCKInspectorGUI(); public override void OnInspectorGUI() { CheckFocus(); CheckUndo(); if(useFormulae) { GUILayout.BeginHorizontal(); GUILayout.Label("Formulae", GUILayout.Width(60)); GUI.enabled=false; EditorGUILayout.TextField(fdb == null ? "null" : AssetDatabase.GetAssetPath(fdb)); GUI.enabled=true; GUILayout.EndHorizontal(); } OnSRPGCKInspectorGUI(); FinishOnGUI(); if((guiChangedAtAll || guiChanged) && EditorApplication.isPlayingOrWillChangePlaymode) { // Debug.Log("save before playmode change"); EditorUtility.SetDirty(target); guiChanged = false; guiChangedAtAll = false; } } public virtual bool FocusMovedFrom(string name) { return lastFocusedControl == name && newFocusedControl != name; } protected virtual void FinishOnGUI() { if(GUI.changed) { guiChanged = true; guiChangedAtAll = true; } lastFocusedControl = newFocusedControl; } protected virtual void OnDisable() { if(guiChanged || guiChangedAtAll) { // Debug.Log("disable "+target.name); EditorUtility.SetDirty(target); guiChanged = false; guiChangedAtAll = false; } } private void CheckUndo() { Event e = Event.current; if((e.type == EventType.MouseDown) || (e.type == EventType.KeyUp && e.keyCode == KeyCode.Tab) || (newFocusedControl != lastFocusedControl)) { listeningForGuiChanges = true; // Debug.Log("ready to store undo, changed="+guiChanged); } if(listeningForGuiChanges && guiChanged) { // Debug.Log("store undo"); // Some GUI value changed after pressing the mouse. // Register the previous snapshot as a valid undo. // Undo.SetSnapshotTarget(target, name+"InspectorUndo"); // Undo.CreateSnapshot(); // Undo.RegisterSnapshot(); // Undo.ClearSnapshotTarget(); listeningForGuiChanges = false; guiChanged = false; } } }
using UnityEngine; using UnityEditor; using System.Linq; public abstract class SRPGCKEditor : Editor { public Formulae fdb; public bool listeningForGuiChanges; public bool guiChanged, guiChangedAtAll; public string[] formulaOptions; public string lastFocusedControl, newFocusedControl; protected bool useFormulae=true; protected virtual void UpdateFormulae() { if(!useFormulae) { return; } if(fdb != null && fdb.formulaNames != null) { formulaOptions = (new string[]{"Custom"}).Concat(fdb.formulaNames).ToArray(); } else { formulaOptions = new string[]{"Custom"}; } } void CheckFocus() { newFocusedControl = GUI.GetNameOfFocusedControl(); } public virtual void OnEnable() { guiChangedAtAll = false; guiChanged = false; if(!useFormulae) { return; } if(fdb == null) { fdb = Formulae.DefaultFormulae; } UpdateFormulae(); } public abstract void OnSRPGCKInspectorGUI(); public override void OnInspectorGUI() { CheckFocus(); CheckUndo(); if(useFormulae) { GUILayout.BeginHorizontal(); GUILayout.Label("Formulae", GUILayout.Width(60)); GUI.enabled=false; EditorGUILayout.TextField(fdb == null ? "null" : AssetDatabase.GetAssetPath(fdb)); GUI.enabled=true; GUILayout.EndHorizontal(); } OnSRPGCKInspectorGUI(); FinishOnGUI(); if((guiChangedAtAll || guiChanged) && (EditorApplication.isPlayingOrWillChangePlaymode && !EditorApplication.isPlaying)) { // Debug.Log("save before playmode change"); EditorUtility.SetDirty(target); } } public virtual bool FocusMovedFrom(string name) { return lastFocusedControl == name && newFocusedControl != name; } protected virtual void FinishOnGUI() { if(GUI.changed) { guiChanged = true; guiChangedAtAll = true; } lastFocusedControl = newFocusedControl; } protected virtual void OnDisable() { if(guiChanged || guiChangedAtAll) { // Debug.Log("disable "+target.name); EditorUtility.SetDirty(target); guiChangedAtAll = false; } } private void CheckUndo() { Event e = Event.current; if((e.type == EventType.MouseDown) || (e.type == EventType.KeyUp && e.keyCode == KeyCode.Tab) || (newFocusedControl != lastFocusedControl)) { listeningForGuiChanges = true; // Debug.Log("ready to store undo, changed="+guiChanged); } if(listeningForGuiChanges && guiChanged) { // Debug.Log("store undo"); // Some GUI value changed after pressing the mouse. // Register the previous snapshot as a valid undo. // Undo.SetSnapshotTarget(target, name+"InspectorUndo"); // Undo.CreateSnapshot(); // Undo.RegisterSnapshot(); // Undo.ClearSnapshotTarget(); listeningForGuiChanges = false; guiChanged = false; } } }
lgpl-2.1
C#
126e5c6abbae99874f9801aead7648a347b663ce
DEBUG proper.
holycattle/strawberryjam,holycattle/strawberryjam
Assets/Scripts/Utils.cs
Assets/Scripts/Utils.cs
using UnityEngine; public class Utils { public const bool DEBUG = false; public Utils () { } static Vector3 ScreenSize = new Vector3(1280, 800, 0); public static Vector3 MousePosition(){ Ray ray = Camera.mainCamera.ScreenPointToRay(Input.mousePosition); RaycastHit hit = new RaycastHit(); Physics.Raycast(ray, out hit, float.MaxValue); return hit.point; } }
using UnityEngine; public class Utils { public const int DEBUG = false; public Utils () { } static Vector3 ScreenSize = new Vector3(1280, 800, 0); public static Vector3 MousePosition(){ Ray ray = Camera.mainCamera.ScreenPointToRay(Input.mousePosition); RaycastHit hit = new RaycastHit(); Physics.Raycast(ray, out hit, float.MaxValue); return hit.point; } }
mit
C#
ffe041d1aa58219bb2f533f21435dfc56e7de8c6
Fix to ShadowManager
CompProto/UnityGame
Assets/Scripts/ModeManager.cs
Assets/Scripts/ModeManager.cs
using UnityEngine; using System.Collections; public class ModeManager : MonoBehaviour { public AudioClip DayMusic, ShadowMusic; public GameObject[] gameObjects; public Material[] materials; // There must be 2 materials for each gameobject. First material is the white version, second material is dark version public bool isDarkMode = false; public float duration = 2.0f; // How long to swap between the materials private AudioSource source; private float timer = 1.0f; // Use this for initialization void Start() { if (gameObjects.Length * 2 != materials.Length) { Debug.Log("ERROR! There should be exactly 2 materials pr. gameobject in the ModeManager"); } source = GetComponent<AudioSource>(); PlayDayMusic(); } public void PlayDayMusic() { Play(DayMusic); } public void PlayShadowMusic() { Play(ShadowMusic); } private void Play(AudioClip sound) { if (source.clip == sound && source.isPlaying) return; if (source.isPlaying) { source.Stop(); } source.clip = sound; source.Play(); } public void ChangeMode() { if (timer < 0.0f) return; isDarkMode = !isDarkMode; Debug.Log("Changing materials and music."); if (isDarkMode) PlayShadowMusic(); else PlayDayMusic(); timer = -duration; } void Update() { if (timer < 0.0f) { float lerp = Mathf.PingPong(Time.time, 2.0f) / 2.0f; for (int i = 0; i < gameObjects.Length; i++) { if (isDarkMode) gameObjects[i].GetComponent<Renderer>().material.Lerp(materials[2 * i], materials[2 * i + 1], timer + 2); else gameObjects[i].GetComponent<Renderer>().material.Lerp(materials[2 * i + 1], materials[2 * i], timer + 2); } } timer += Time.deltaTime; } }
using UnityEngine; using System.Collections; public class ModeManager : MonoBehaviour { public AudioClip DayMusic, ShadowMusic; public GameObject[] gameObjects; public Material[] materials; // There must be 2 materials for each gameobject. First material is the white version, second material is dark version public bool isDarkMode = false; public float duration = 2.0f; // How long to swap between the materials private AudioSource source; private float timer = 1.0f; // Use this for initialization void Start() { if (gameObjects.Length * 2 != materials.Length) { Debug.Log("ERROR! There should be exactly 2 materials pr. gameobject in the ModeManager"); } source = GetComponent<AudioSource>(); PlayDayMusic(); } public void PlayDayMusic() { Play(DayMusic); } public void PlayShadowMusic() { Play(ShadowMusic); } private void Play(AudioClip sound) { if (source.clip == sound && source.isPlaying) return; if (source.isPlaying) { source.Stop(); } source.clip = sound; source.Play(); } public void ChangeMode() { isDarkMode = !isDarkMode; Debug.Log("Changing materials and music."); if (isDarkMode) PlayShadowMusic(); else PlayDayMusic(); timer = -duration; } void Update() { if (timer < 0.0f) { float lerp = Mathf.PingPong(Time.time, 2.0f) / 2.0f; for (int i = 0; i < gameObjects.Length; i++) { if (isDarkMode) gameObjects[i].GetComponent<Renderer>().material.Lerp(materials[2 * i], materials[2 * i + 1], timer + 2); else gameObjects[i].GetComponent<Renderer>().material.Lerp(materials[2 * i + 1], materials[2 * i], timer + 2); } } timer += Time.deltaTime; } }
apache-2.0
C#
0a1553fca5a720c883f5f6f764179d3c5cb9ed5b
add constructor for C# BaseLearnLogger class
GeneralizedLearningUtilities/SuperGLU,GeneralizedLearningUtilities/SuperGLU,GeneralizedLearningUtilities/SuperGLU,GeneralizedLearningUtilities/SuperGLU,GeneralizedLearningUtilities/SuperGLU
C#_module/SuperGLU/SuperGLU/Class1.cs
C#_module/SuperGLU/SuperGLU/Class1.cs
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace SuperGLU { public class BaseLearnLogger: BaseService { // BaseService not implemented /* Member variables Arguments: gateway -- the parent getway for this service (not implemented) userId -- unique id for the user classroomId -- unique id for the classroom cohort (optional), `null` if classroomId not specified taskId -- uuid string url -- the current base URL for the task that is being performed. This should not include situational parameters such as userId activityType -- the type of activity. This should be a unique system UUID (e.g. "AutoTutor_asdf2332gsa" or "www.autotutor.com/asdf2332gsa") This ID should be the same for all activities presented by this system, since it will be used to query their results. context -- 'registration' property, which is essentially xAPI's concept of session id. serviceId -- the uuid for this service. Use random uuid if not specified. startTime -- time of starting the logging service */ private MessagingGateway gateway; private string userId; private string classroomId; private string taskId; private string url; private ActivityType activityType; private Context context; private string serviceId; private DateTime startTime; // Constructor public BaseLearnLogger(MessagingGateway gateway, string userId, string name, string classroomId, string taskId, string url, ActivityType activityType, Context context, string serviceId) : base() { gateway = gateway; userId = userId; name = name; classroomId = classroomId; taskId = taskId; url = url; activityType = activityType; context = context; serviceId = serviceId; startTime = DateTime.Now; } } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace SuperGLU { public class Class1 { } }
mit
C#
c574f1cf9d45040fd917f5a00cdb094a671bc1e5
Update Movement.cs
daybson/LaserRaycast
Assets/Movement.cs
Assets/Movement.cs
/* * Copyright 2014 * author: Daybson B.S. Paisante * daybson.paisante@outlook.com * http://daybsonpaisante.wordpress.com/ */ using UnityEngine; using System.Collections; public class Movement : MonoBehaviour { public float speed; private void Update() { //rotate and translate by user input transform.Rotate(0, Input.GetAxis("Horizontal") * speed, 0); transform.Translate(0, 0, Input.GetAxis("Vertical") * speed * Time.deltaTime); } }
/* * Copyright 2014 * autor: Daybson B.S. Paisante * email: daybsonbsp@gmail.com * encontrado em: http://daybsonpaisante.wordpress.com/ */ using UnityEngine; using System.Collections; public class Movement : MonoBehaviour { //fator de movimentação public float speed; private void Update() { //rotaciona e translada de acordo com o input do usuário transform.Rotate(0, Input.GetAxis("Horizontal") * speed, 0); transform.Translate(0, 0, Input.GetAxis("Vertical") * speed * Time.deltaTime); } }
mit
C#
9dd07c860ff669c4a88bbba5a3c63c9384e4fa3a
add comment
bitzhuwei/CSharpGL,bitzhuwei/CSharpGL,bitzhuwei/CSharpGL
CSharpGL/Scene/Scene.cs
CSharpGL/Scene/Scene.cs
using System; using System.Collections.Generic; using System.ComponentModel; using System.Drawing; using System.Drawing.Design; using System.Windows.Forms; using System.Linq; namespace CSharpGL { /// <summary> /// Manages a scene to be rendered and updated. /// </summary> [Editor(typeof(PropertyGridEditor), typeof(UITypeEditor))] public partial class Scene { /// <summary> /// background color. /// </summary> public Color ClearColor { get; set; } /// <summary> /// camera of the scene. /// </summary> public Camera Camera { get; private set; } /// <summary> /// objects to be rendered. /// </summary> public SceneObjectList ObjectList { get; private set; } /// <summary> /// hosts all UI renderers. /// </summary> public UIRoot UIRoot { get; private set; } /// <summary> /// Manages a scene to be rendered and updated. /// </summary> /// <param name="camera">camera of the scene</param> /// <param name="objects">objects to be rendered</param> public Scene(Camera camera, params SceneObject[] objects) { if (camera == null) { throw new ArgumentNullException(); } this.Camera = camera; var list = new SceneObjectList(); list.AddRange(objects); this.ObjectList = list; this.UIRoot = new UIRoot(); } /// <summary> /// Please bind this method to Control.Resize event. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> public void Resize(object sender, EventArgs e) { Control control = sender as Control; if (control == null) { throw new ArgumentException(); } this.Camera.Resize(control.Width, control.Height); } public void Render(RenderModes renderMode, Rectangle clientRectangle) { var arg = new RenderEventArgs(renderMode, clientRectangle, this.Camera); var list = this.ObjectList.ToArray(); foreach (var item in list) { item.Render(arg); } this.UIRoot.Render(arg); } } }
using System; using System.Collections.Generic; using System.ComponentModel; using System.Drawing; using System.Drawing.Design; using System.Windows.Forms; using System.Linq; namespace CSharpGL { /// <summary> /// Manages a scene to be rendered and updated. /// </summary> [Editor(typeof(PropertyGridEditor), typeof(UITypeEditor))] public partial class Scene { /// <summary> /// background color. /// </summary> public Color ClearColor { get; set; } /// <summary> /// camera of the scene. /// </summary> public Camera Camera { get; private set; } /// <summary> /// objects to be rendered. /// </summary> public SceneObjectList ObjectList { get; private set; } /// <summary> /// hosts all UI renderers. /// </summary> public UIRoot UIRoot { get; private set; } /// <summary> /// Manages a scene to be rendered and updated. /// </summary> /// <param name="camera">camera of the scene</param> /// <param name="objects">objects to be rendered</param> public Scene(Camera camera, params SceneObject[] objects) { if (camera == null) { throw new ArgumentNullException(); } this.Camera = camera; var list = new SceneObjectList(); list.AddRange(objects); this.ObjectList = list; this.UIRoot = new UIRoot(); } public void Resize(object sender, EventArgs e) { Control control = sender as Control; if (control == null) { throw new ArgumentException(); } this.Camera.Resize(control.Width, control.Height); } public void Render(RenderModes renderMode, Rectangle clientRectangle) { var arg = new RenderEventArgs(renderMode, clientRectangle, this.Camera); var list = this.ObjectList.ToArray(); foreach (var item in list) { item.Render(arg); } this.UIRoot.Render(arg); } } }
mit
C#
c3cc82f689769b7a5829b3e1362b7f05f0d13739
Fix string.Format parameter indexes
mmoening/MatterControl,larsbrubaker/MatterControl,unlimitedbacon/MatterControl,jlewin/MatterControl,mmoening/MatterControl,jlewin/MatterControl,mmoening/MatterControl,unlimitedbacon/MatterControl,unlimitedbacon/MatterControl,jlewin/MatterControl,larsbrubaker/MatterControl,larsbrubaker/MatterControl,larsbrubaker/MatterControl,jlewin/MatterControl,unlimitedbacon/MatterControl
MatterControlLib/ConfigurationPage/PrintLeveling/LevelingStrings.cs
MatterControlLib/ConfigurationPage/PrintLeveling/LevelingStrings.cs
/* Copyright (c) 2018, Lars Brubaker, John Lewin All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. The views and conclusions contained in the software and documentation are those of the authors and should not be interpreted as representing official policies, either expressed or implied, of the FreeBSD Project. */ using MatterHackers.Agg; using MatterHackers.Localizations; namespace MatterHackers.MatterControl.ConfigurationPage.PrintLeveling { public class LevelingStrings { private int stepNumber = 1; public LevelingStrings() { } public string HomingPageInstructions(bool useZProbe, bool heatBed) { string line1 = "The printer should now be 'homing'.".Localize(); if (heatBed) { line1 += " Once it is finished homing we will heat the bed.".Localize(); } if (useZProbe) { return line1; } else { return string.Format( "{0}\n\n{1}:\n\n\t• {2}\n\n{3}\n\n{4}", line1, "To complete the next few steps you will need".Localize(), "A sheet of paper".Localize(), "We will use this paper to measure the distance between the nozzle and the bed.".Localize(), "Click 'Next' to continue.".Localize()); } } public string CoarseInstruction2 => string.Format( "\t• {0}\n\t• {1}\n{2}", "Place the paper under the extruder".Localize(), "Using the above controls".Localize(), this.FineInstruction2); public string FineInstruction2 => string.Format( "\t• {0}\n\t• {1}\n\n{2}", "Press [Z-] until there is resistance to moving the paper".Localize(), "Press [Z+] once to release the paper".Localize(), "Finally click 'Next' to continue.".Localize()); public string GetStepString(int totalSteps) { return $"{"Step".Localize()} {stepNumber++} {"of".Localize()} {totalSteps}:"; } } }
/* Copyright (c) 2018, Lars Brubaker, John Lewin All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. The views and conclusions contained in the software and documentation are those of the authors and should not be interpreted as representing official policies, either expressed or implied, of the FreeBSD Project. */ using MatterHackers.Agg; using MatterHackers.Localizations; namespace MatterHackers.MatterControl.ConfigurationPage.PrintLeveling { public class LevelingStrings { private int stepNumber = 1; public LevelingStrings() { } public string HomingPageInstructions(bool useZProbe, bool heatBed) { string line1 = "The printer should now be 'homing'.".Localize(); if (heatBed) { line1 += " Once it is finished homing we will heat the bed.".Localize(); } if (useZProbe) { return line1; } else { return string.Format( "{0}\n\n{1}:\n\n\t• {2}\n\n{3}\n\n{4}", line1, "To complete the next few steps you will need".Localize(), "A sheet of paper".Localize(), "We will use this paper to measure the distance between the nozzle and the bed.".Localize(), "Click 'Next' to continue.".Localize()); } } public string CoarseInstruction2 => string.Format( "\t• {0}\n\t• {1}\n{2}", "Place the paper under the extruder".Localize(), "Using the above controls".Localize(), this.FineInstruction2); public string FineInstruction2 => string.Format( "\t• {0}\n\t• {0}\n\n{0}", "Press [Z-] until there is resistance to moving the paper".Localize(), "Press [Z+] once to release the paper".Localize(), "Finally click 'Next' to continue.".Localize()); public string GetStepString(int totalSteps) { return $"{"Step".Localize()} {stepNumber++} {"of".Localize()} {totalSteps}:"; } } }
bsd-2-clause
C#
88f67bf90db38809da3f452c1055befd970dbc15
Bump version
nixxquality/WebMConverter,Yuisbean/WebMConverter,o11c/WebMConverter
Properties/AssemblyInfo.cs
Properties/AssemblyInfo.cs
using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("WebM for Retards")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("WebM for Retards")] [assembly: AssemblyCopyright("Copyright © 2014")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("88d1c5f0-e3e0-445a-8e11-a02441ab6ca8")] // 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.12.2")]
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("WebM for Retards")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("WebM for Retards")] [assembly: AssemblyCopyright("Copyright © 2014")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("88d1c5f0-e3e0-445a-8e11-a02441ab6ca8")] // 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.12.1")]
mit
C#
9d6f4732cea105211aa1e58623d1e339ec9a258b
Update assemblyinfo
hartez/PneumaticTube
Properties/AssemblyInfo.cs
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("PneumaticTube")] [assembly: AssemblyDescription("Command line Dropbox uploader for Windows")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Traceur LLC")] [assembly: AssemblyProduct("PneumaticTube")] [assembly: AssemblyCopyright("Copyright © Traceur LLC 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("2502610f-3a6b-45ab-816e-81e2347d4e33")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]
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("PneumaticTube")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Microsoft")] [assembly: AssemblyProduct("PneumaticTube")] [assembly: AssemblyCopyright("Copyright © Microsoft 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("2502610f-3a6b-45ab-816e-81e2347d4e33")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]
mit
C#
c74a436a965f561da0cabd072012e5bfb3035e58
Bump to version 2.3.0 (#17)
dreadnought-friends/support-tool,iltar/support-tool
Properties/AssemblyInfo.cs
Properties/AssemblyInfo.cs
using System.Reflection; 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("Dreadnought Community Support Tool")] [assembly: AssemblyDescription("This community made tool gathers information which the Dreadnought Customer Support might ask of you to assist with issues or bug reports.")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("support-tool")] [assembly: AssemblyCopyright("Copyright Anyone © 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)] //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("2.3.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]
using System.Reflection; 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("Dreadnought Community Support Tool")] [assembly: AssemblyDescription("This community made tool gathers information which the Dreadnought Customer Support might ask of you to assist with issues or bug reports.")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("support-tool")] [assembly: AssemblyCopyright("Copyright Anyone © 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)] //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("2.2.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]
mit
C#
602ea75b3fd25cb85305389916842172553c7784
Build script now writes the package name and version into the AssemblyDescription attibute. This allows the package information to be seen in Visual Studio avoiding confusion with the assembly version that remains at the major.
autofac/Autofac.Extras.Moq
Properties/AssemblyInfo.cs
Properties/AssemblyInfo.cs
using System.Reflection; using System.Runtime.InteropServices; [assembly: AssemblyTitle("Autofac.Extras.Moq")] [assembly: ComVisible(false)]
using System.Reflection; using System.Runtime.InteropServices; [assembly: AssemblyTitle("Autofac.Extras.Moq")] [assembly: AssemblyDescription("Autofac Moq Integration")] [assembly: ComVisible(false)]
mit
C#
42913adaadc49d51a9bc6214c9e324558216a07a
Add license to Language enum file
fredatgithub/WinFormTemplate
WinFormTemplate/Language.cs
WinFormTemplate/Language.cs
/* The MIT License(MIT) Copyright(c) 2015 Freddy Juhel Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ namespace WinFormTemplate { public enum Language { French, English } }
namespace WinFormTemplate { public enum Language { French, English } }
mit
C#
9f40da6b40262563d884cf8eea92748ca12bf677
Test on this feature
amenjosh/test
sources/Medication_Reminder/Program.cs
sources/Medication_Reminder/Program.cs
using System; using System.Collections.Generic; using System.Linq; using System.Windows.Forms; namespace Medication_Reminder { static class Program { /// <summary> /// The main entry point for the application. /// </summary> [STAThread] static void Main() { // This is only on Dev branch // Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new Form1()); } } }
using System; using System.Collections.Generic; using System.Linq; using System.Windows.Forms; namespace Medication_Reminder { static class Program { /// <summary> /// The main entry point for the application. /// </summary> [STAThread] static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new Form1()); } } }
mit
C#
9eb786d6764e08dc0310366c77430dac850532db
Hide indicator if no mouse activity
TroyHouston/AngryTrains
Assets/Scripts/TrainMovement.cs
Assets/Scripts/TrainMovement.cs
using UnityEngine; using System.Collections; public class TrainMovement : MonoBehaviour { public float turnSpeed = 100.0f; // Units per second public float moveSpeed = 100.0f; // Units per second public GameObject indicator; public Camera cam; private Rigidbody rigid; private Vector3 up = new Vector3(0, 1, 0); // Use this for initialization void Start() { rigid = GetComponent<Rigidbody>(); } void Update() { //Left click if (Input.GetMouseButton(0)) { //Find out what the mouse is pointing at //TODO make it so it only raycasts at the ground //TODO ignore 0,0,0 case if you click on the sky Ray ray = cam.ScreenPointToRay(Input.mousePosition); RaycastHit hit; Physics.Raycast(ray, out hit); Vector3 targetPos = hit.point - transform.position; //Maybe don't make it try to go up or down as this will probably make the physics weird targetPos.y = transform.position.y; targetPos = Vector3.ClampMagnitude(targetPos, 5); rigid.AddForce(targetPos * moveSpeed * Time.deltaTime); indicator.SetActive(true); indicator.transform.position = targetPos + transform.position; transform.forward = Vector3.Slerp(transform.forward, rigid.velocity.normalized, 10 * Time.deltaTime); } else { indicator.SetActive(false); } //Should dampen movement even if you stop clicking //rigid.velocity *= 1f - moveDampening * Time.deltaTime; Quaternion curAngle = rigid.rotation; } }
using UnityEngine; using System.Collections; public class TrainMovement : MonoBehaviour { public float turnSpeed = 100.0f; // Units per second public float moveSpeed = 100.0f; // Units per second public GameObject indicator; public Camera cam; private Rigidbody rigid; private Vector3 up = new Vector3(0, 1, 0); // Use this for initialization void Start() { rigid = GetComponent<Rigidbody>(); } void Update() { //Left click if (Input.GetMouseButton(0)) { //Find out what the mouse is pointing at //TODO make it so it only raycasts at the ground //TODO ignore 0,0,0 case if you click on the sky Ray ray = cam.ScreenPointToRay(Input.mousePosition); RaycastHit hit; Physics.Raycast(ray, out hit); Vector3 targetPos = hit.point - transform.position; //Maybe don't make it try to go up or down as this will probably make the physics weird targetPos.y = transform.position.y; targetPos = Vector3.ClampMagnitude(targetPos, 5); rigid.AddForce(targetPos * moveSpeed * Time.deltaTime); indicator.transform.position = targetPos + transform.position; transform.forward = Vector3.Slerp(transform.forward, rigid.velocity.normalized, 10 * Time.deltaTime); } //Should dampen movement even if you stop clicking //rigid.velocity *= 1f - moveDampening * Time.deltaTime; Quaternion curAngle = rigid.rotation; } }
mit
C#
8bd8a61142888faba20d41c8f9f5b22969dfa245
Throw if no matching property accessor found.
wieslawsoltes/Perspex,SuperJMN/Avalonia,SuperJMN/Avalonia,wieslawsoltes/Perspex,SuperJMN/Avalonia,wieslawsoltes/Perspex,wieslawsoltes/Perspex,jkoritzinsky/Perspex,wieslawsoltes/Perspex,jkoritzinsky/Avalonia,jkoritzinsky/Avalonia,jkoritzinsky/Avalonia,AvaloniaUI/Avalonia,SuperJMN/Avalonia,AvaloniaUI/Avalonia,jkoritzinsky/Avalonia,Perspex/Perspex,AvaloniaUI/Avalonia,SuperJMN/Avalonia,jkoritzinsky/Avalonia,Perspex/Perspex,jkoritzinsky/Avalonia,SuperJMN/Avalonia,jkoritzinsky/Avalonia,AvaloniaUI/Avalonia,AvaloniaUI/Avalonia,grokys/Perspex,akrisiun/Perspex,SuperJMN/Avalonia,grokys/Perspex,AvaloniaUI/Avalonia,AvaloniaUI/Avalonia,wieslawsoltes/Perspex,wieslawsoltes/Perspex
src/Avalonia.Base/Data/Core/PropertyAccessorNode.cs
src/Avalonia.Base/Data/Core/PropertyAccessorNode.cs
// Copyright (c) The Avalonia Project. All rights reserved. // Licensed under the MIT license. See licence.md file in the project root for full license information. using System; using System.Linq; using System.Reactive.Linq; using Avalonia.Data.Core.Plugins; namespace Avalonia.Data.Core { internal class PropertyAccessorNode : SettableNode { private readonly bool _enableValidation; private IPropertyAccessor _accessor; public PropertyAccessorNode(string propertyName, bool enableValidation) { PropertyName = propertyName; _enableValidation = enableValidation; } public override string Description => PropertyName; public string PropertyName { get; } public override Type PropertyType => _accessor?.PropertyType; protected override bool SetTargetValueCore(object value, BindingPriority priority) { if (_accessor != null) { try { return _accessor.SetValue(value, priority); } catch { } } return false; } protected override void StartListeningCore(WeakReference reference) { var plugin = ExpressionObserver.PropertyAccessors.FirstOrDefault(x => x.Match(reference.Target, PropertyName)); var accessor = plugin?.Start(reference, PropertyName); if (_enableValidation && Next == null) { foreach (var validator in ExpressionObserver.DataValidators) { if (validator.Match(reference, PropertyName)) { accessor = validator.Start(reference, PropertyName, accessor); } } } if (accessor == null) { throw new NotSupportedException( $"Could not find a matching property accessor for {PropertyName}."); } accessor.Subscribe(ValueChanged); _accessor = accessor; } protected override void StopListeningCore() { _accessor.Dispose(); _accessor = null; } } }
// Copyright (c) The Avalonia Project. All rights reserved. // Licensed under the MIT license. See licence.md file in the project root for full license information. using System; using System.Linq; using System.Reactive.Linq; using Avalonia.Data.Core.Plugins; namespace Avalonia.Data.Core { internal class PropertyAccessorNode : SettableNode { private readonly bool _enableValidation; private IPropertyAccessor _accessor; public PropertyAccessorNode(string propertyName, bool enableValidation) { PropertyName = propertyName; _enableValidation = enableValidation; } public override string Description => PropertyName; public string PropertyName { get; } public override Type PropertyType => _accessor?.PropertyType; protected override bool SetTargetValueCore(object value, BindingPriority priority) { if (_accessor != null) { try { return _accessor.SetValue(value, priority); } catch { } } return false; } protected override void StartListeningCore(WeakReference reference) { var plugin = ExpressionObserver.PropertyAccessors.FirstOrDefault(x => x.Match(reference.Target, PropertyName)); var accessor = plugin?.Start(reference, PropertyName); if (_enableValidation && Next == null) { foreach (var validator in ExpressionObserver.DataValidators) { if (validator.Match(reference, PropertyName)) { accessor = validator.Start(reference, PropertyName, accessor); } } } accessor.Subscribe(ValueChanged); _accessor = accessor; } protected override void StopListeningCore() { _accessor.Dispose(); _accessor = null; } } }
mit
C#
0f9ac40cd8e38a2af09cc8aef2fa1a5069b6c242
Update ScriptWindow.xaml.cs
wieslawsoltes/Core2D,Core2D/Core2D,wieslawsoltes/Core2D,wieslawsoltes/Core2D,wieslawsoltes/Core2D,Core2D/Core2D
src/Core2D/UI/Avalonia/Windows/ScriptWindow.xaml.cs
src/Core2D/UI/Avalonia/Windows/ScriptWindow.xaml.cs
// Copyright (c) Wiesław Šoltés. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. using Avalonia; using Avalonia.Markup.Xaml; using Dock.Avalonia.Controls; namespace Core2D.UI.Avalonia.Windows { /// <summary> /// Interaction logic for <see cref="ScriptWindow"/> xaml. /// </summary> public class ScriptWindow : MetroWindow { /// <summary> /// Initializes a new instance of the <see cref="ScriptWindow"/> class. /// </summary> public ScriptWindow() { InitializeComponent(); this.AttachDevTools(); App.Selector.EnableThemes(this); } /// <summary> /// Initialize the Xaml components. /// </summary> private void InitializeComponent() { AvaloniaXamlLoader.Load(this); } } }
// Copyright (c) Wiesław Šoltés. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. using Avalonia; using Avalonia.Markup.Xaml; using Avalonia.ThemeManager; using Dock.Avalonia.Controls; namespace Core2D.UI.Avalonia.Windows { /// <summary> /// Interaction logic for <see cref="ScriptWindow"/> xaml. /// </summary> public class ScriptWindow : MetroWindow { /// <summary> /// Initializes a new instance of the <see cref="ScriptWindow"/> class. /// </summary> public ScriptWindow() { InitializeComponent(); this.AttachDevTools(); App.Selector.EnableThemes(this); } /// <summary> /// Initialize the Xaml components. /// </summary> private void InitializeComponent() { AvaloniaXamlLoader.Load(this); } } }
mit
C#
6f9abd7bfbb7f031d7d7f0a804fc3e4db1efc4be
Add recently used items data
auz34/js-studio
src/Examples/MyStudio/ViewModels/RibbonViewModel.cs
src/Examples/MyStudio/ViewModels/RibbonViewModel.cs
namespace MyStudio.ViewModels { using System.Collections.Generic; using Catel; using Catel.MVVM; using MyStudio.Models; using MyStudio.Services; using Orchestra.Models; using Orchestra.Services; public class RibbonViewModel : ViewModelBase { private StudioStateModel model; private ICommandsService commandsService; private IRecentlyUsedItemsService recentlyUsedItemsService; public RibbonViewModel(StudioStateModel model, ICommandsService commandsService, IRecentlyUsedItemsService recentlyUsedItemsService) { Argument.IsNotNull(() => model); Argument.IsNotNull(() => commandsService); Argument.IsNotNull(() => recentlyUsedItemsService); this.model = model; this.commandsService = commandsService; this.recentlyUsedItemsService = recentlyUsedItemsService; this.RecentlyUsedItems = new List<RecentlyUsedItem>(this.recentlyUsedItemsService.Items); this.PinnedItems = new List<RecentlyUsedItem>(this.recentlyUsedItemsService.PinnedItems); } public Command StartCommand { get { return this.commandsService != null ? this.commandsService.StartCommand : null; } } public Command UndoCommand { get { return this.commandsService != null ? this.commandsService.UndoCommand : null; } } public Command RedoCommand { get { return this.commandsService != null ? this.commandsService.RedoCommand : null; } } public List<RecentlyUsedItem> RecentlyUsedItems { get; private set; } public List<RecentlyUsedItem> PinnedItems { get; private set; } } }
namespace MyStudio.ViewModels { using Catel; using Catel.MVVM; using MyStudio.Models; using MyStudio.Services; public class RibbonViewModel : ViewModelBase { private StudioStateModel model; private ICommandsService commandsService; public RibbonViewModel(StudioStateModel model, ICommandsService commandsService) { Argument.IsNotNull(() => model); Argument.IsNotNull(() => commandsService); this.model = model; this.commandsService = commandsService; } public Command StartCommand { get { return this.commandsService != null ? this.commandsService.StartCommand : null; } } public Command UndoCommand { get { return this.commandsService != null ? this.commandsService.UndoCommand : null; } } public Command RedoCommand { get { return this.commandsService != null ? this.commandsService.RedoCommand : null; } } } }
mit
C#
93115bcee7df1b1cc8bdf994832b04eaaae8c4a0
Fix displayed version in built-in version command
spectresystems/commandline
src/Spectre.Cli/Internal/Commands/VersionCommand.cs
src/Spectre.Cli/Internal/Commands/VersionCommand.cs
using System; using System.ComponentModel; using System.Diagnostics; using System.Diagnostics.CodeAnalysis; using System.Reflection; using Spectre.Console; namespace Spectre.Cli.Internal { [Description("Displays the CLI library version")] [SuppressMessage("Performance", "CA1812:AvoidUninstantiatedInternalClasses", Justification = "Injected")] internal sealed class VersionCommand : Command<VersionCommand.Settings> { private readonly IAnsiConsole _writer; public VersionCommand(IConfiguration configuration) { _writer = configuration?.Settings?.Console ?? AnsiConsole.Console; } public sealed class Settings : CommandSettings { } public override int Execute(CommandContext context, Settings settings) { _writer.MarkupLine( "[yellow]Spectre.Cli[/] version [aqua]{0}[/]", GetVersion(typeof(VersionCommand)?.Assembly)); _writer.MarkupLine( "[yellow]Spectre.Console[/] version [aqua]{0}[/]", GetVersion(typeof(IAnsiConsole)?.Assembly)); return 0; } [SuppressMessage("Design", "CA1031:Do not catch general exception types")] private static string GetVersion(Assembly? assembly) { if (assembly == null) { return "?"; } try { var info = FileVersionInfo.GetVersionInfo(assembly.Location); return info.ProductVersion ?? "?"; } catch { return "?"; } } } }
using System.ComponentModel; using System.Diagnostics.CodeAnalysis; using Spectre.Console; namespace Spectre.Cli.Internal { [Description("Displays the CLI library version")] [SuppressMessage("Performance", "CA1812:AvoidUninstantiatedInternalClasses", Justification = "Injected")] internal sealed class VersionCommand : Command<VersionCommand.Settings> { private readonly IAnsiConsole _writer; public VersionCommand(IConfiguration configuration) { _writer = configuration?.Settings?.Console ?? AnsiConsole.Console; } public sealed class Settings : CommandSettings { } public override int Execute(CommandContext context, Settings settings) { var version = typeof(VersionCommand)?.Assembly?.GetName()?.Version?.ToString(); version ??= "?"; _writer.Write($"Spectre.Cli version {version}"); return 0; } } }
mit
C#
9bac5de93fcdbf65b12324b685d0cbcc257f2d72
Bump version to 2.1.0.0
InfinniPlatform/InfinniPlatform,InfinniPlatform/InfinniPlatform,InfinniPlatform/InfinniPlatform
Files/Packaging/GlobalAssemblyInfo.cs
Files/Packaging/GlobalAssemblyInfo.cs
using System.Reflection; using System.Runtime.InteropServices; [assembly: AssemblyCompany("Infinnity Solutions")] [assembly: AssemblyProduct("InfinniPlatform")] [assembly: AssemblyCopyright("Copyright © Infinnity Solutions 2017")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] [assembly: ComVisible(false)] [assembly: AssemblyConfiguration("")] // TeamCity File Content Replacer: Add build number // Look in: */Packaging/GlobalAssemblyInfo.cs // Find what: ((AssemblyVersion|AssemblyFileVersion)\s*\(\s*@?\")(?<major>[0-9]+)\.(?<minor>[0-9]+)\.(?<patch>[0-9]+)\.(?<build>[0-9]+)(\"\s*\)) // Replace with: $1$3.$4.$5.\%build.number%$7 [assembly: AssemblyVersion("2.1.0.0")] [assembly: AssemblyFileVersion("2.1.0.0")] // TeamCity File Content Replacer: Add VCS hash // Look in: */Packaging/GlobalAssemblyInfo.cs // Find what: (AssemblyInformationalVersion\s*\(\s*@?\").*?(\"\s*\)) // Replace with: $1\%build.vcs.number%$2 [assembly: AssemblyInformationalVersion("")]
using System.Reflection; using System.Runtime.InteropServices; [assembly: AssemblyCompany("Infinnity Solutions")] [assembly: AssemblyProduct("InfinniPlatform")] [assembly: AssemblyCopyright("Copyright © Infinnity Solutions 2017")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] [assembly: ComVisible(false)] [assembly: AssemblyConfiguration("")] // TeamCity File Content Replacer: Add build number // Look in: */Packaging/GlobalAssemblyInfo.cs // Find what: ((AssemblyVersion|AssemblyFileVersion)\s*\(\s*@?\")(?<major>[0-9]+)\.(?<minor>[0-9]+)\.(?<patch>[0-9]+)\.(?<build>[0-9]+)(\"\s*\)) // Replace with: $1$3.$4.$5.\%build.number%$7 [assembly: AssemblyVersion("2.0.0.0")] [assembly: AssemblyFileVersion("2.0.0.0")] // TeamCity File Content Replacer: Add VCS hash // Look in: */Packaging/GlobalAssemblyInfo.cs // Find what: (AssemblyInformationalVersion\s*\(\s*@?\").*?(\"\s*\)) // Replace with: $1\%build.vcs.number%$2 [assembly: AssemblyInformationalVersion("")]
agpl-3.0
C#
dd1043503179a0f6dbae3510415ad6bb06b4e70b
Change enum UpdateInterval to class.
Midnight-Myth/Mitternacht-NEW,Midnight-Myth/Mitternacht-NEW,Midnight-Myth/Mitternacht-NEW,Midnight-Myth/Mitternacht-NEW
src/NadekoBot/Common/UpdateInterval.cs
src/NadekoBot/Common/UpdateInterval.cs
namespace Mitternacht.Common { public class UpdateInterval { public const int TeamUpdate = 1 * 60 * 1000; public const int Birthday = 1* 60 * 1000; } }
namespace Mitternacht.Common { public enum UpdateInterval : int { TeamUpdate = 1 * 60 * 1000, Birthday = 1* 60 * 1000 } }
mit
C#
23b32cbdf4e5658afec76c357c28826aa61e3aeb
Update baufile.csx
huoxudong125/bau,modulexcite/bau,modulexcite/bau,bau-build/bau,adamralph/bau,eatdrinksleepcode/bau,aarondandy/bau,eatdrinksleepcode/bau,bau-build/bau,eatdrinksleepcode/bau,modulexcite/bau,bau-build/bau,aarondandy/bau,bau-build/bau,adamralph/bau,eatdrinksleepcode/bau,aarondandy/bau,huoxudong125/bau,modulexcite/bau,adamralph/bau,huoxudong125/bau,huoxudong125/bau,aarondandy/bau,adamralph/bau
src/samples/baufile.csx
src/samples/baufile.csx
// usage: // scriptcs -install Bau -pre // scriptcs baufile.csx // // inspired by on http://jasonseifer.com/2010/04/06/rake-tutorial Require<BauPack>() .DependsOn("groom_myself", "walk_dog") .Task("turn_off_alarm") .Do(() => Console.WriteLine("Turned off alarm. Would have liked 5 more minutes, though.")) .Task("make_coffee") .DependsOn("turn_off_alarm") .Do(() => Console.WriteLine("Made coffee.")) .Task("groom_myself") .DependsOn("make_coffee") .Do(() => { Console.WriteLine("Brushed teeth."); Console.WriteLine("Showered."); Console.WriteLine("Shaved."); }) .Task("walk_dog") .DependsOn("make_coffee") .Do(() => Console.WriteLine("Walked the dog.")) .Execute();
// usage: // scriptcs -install Bau -pre // scriptcs baufile.csx // // inspired by on http://jasonseifer.com/2010/04/06/rake-tutorial Require<BauPack>() .DependsOn("groom_myself", "walk_dog") .Task("turn_off_alarm") .Do(() => Console.WriteLine("Turned off alarm. Would have liked 5 more minutes, though.")) .Task("make_coffee") .DependsOn("turn_off_alarm") .Do(() => Console.WriteLine("Made coffee.")) .Task("groom_myself") .DependsOn("make_coffee") .Do(() => { Console.WriteLine("Brushed teeth."); Console.WriteLine("Showered."); Console.WriteLine("Shaved."); }) .Task("walk_dog") .DependsOn("make_coffee") .Do(() => Console.WriteLine("Turned off alarm. Would have liked 5 more minutes, though.")) .Execute();
mit
C#
ffdd4b7ebdcf545df62fa08183e62a638bf0501d
Quit correctly if canceled
lmagder/TFV
TFV/Program.cs
TFV/Program.cs
using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using System.Windows.Forms; using System.Configuration; using System.Xml.Serialization; using Microsoft.TeamFoundation.Client; using Microsoft.TeamFoundation.VersionControl.Client; namespace TFV { static class Program { /// <summary> /// The main entry point for the application. /// </summary> [STAThread] static void Main() { ConfigurationManager.AppSettings.Set("EnableWindowsFormsHighDpiAutoResizing", "true"); Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Settings = Properties.Settings.Default; Settings.Reload(); if (Settings.SavedConnnections == null) Settings.SavedConnnections = new SavedConnectionList(); if (!OpenConnection(null)) return; Application.Run(); return; } public static bool OpenConnection(IWin32Window owner) { TfsTeamProjectCollection projectCollection = null; Workspace ws = null; using (OpenConnection ocDialog = new OpenConnection()) { ocDialog.ShowDialog(owner); if (ocDialog.DialogResult == DialogResult.OK) { projectCollection = ocDialog.OpenedCollection; ws = ocDialog.SelectedWorkspace; } } if (projectCollection == null || ws == null) return false; Settings.Save(); MainForm mf = new MainForm(projectCollection, ws); mf.Show(); return true; } public static TFV.Properties.Settings Settings { get; private set; } } }
using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using System.Windows.Forms; using System.Configuration; using System.Xml.Serialization; using Microsoft.TeamFoundation.Client; using Microsoft.TeamFoundation.VersionControl.Client; namespace TFV { static class Program { /// <summary> /// The main entry point for the application. /// </summary> [STAThread] static void Main() { ConfigurationManager.AppSettings.Set("EnableWindowsFormsHighDpiAutoResizing", "true"); Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Settings = Properties.Settings.Default; Settings.Reload(); if (Settings.SavedConnnections == null) Settings.SavedConnnections = new SavedConnectionList(); OpenConnection(null); Application.Run(); return; } public static void OpenConnection(IWin32Window owner) { TfsTeamProjectCollection projectCollection = null; Workspace ws = null; using (OpenConnection ocDialog = new OpenConnection()) { ocDialog.ShowDialog(owner); if (ocDialog.DialogResult == DialogResult.OK) { projectCollection = ocDialog.OpenedCollection; ws = ocDialog.SelectedWorkspace; } } if (projectCollection == null || ws == null) return; Settings.Save(); MainForm mf = new MainForm(projectCollection, ws); mf.Show(); } public static TFV.Properties.Settings Settings { get; private set; } } }
mit
C#
0fb27b97a09cca21a308e73fb38b1e9366e4edfd
Set the version to 1.3 since we're releasing.
SpectraLogic/ds3_net_powershell,RachelTucker/ds3_net_sdk,asomers/ds3_net_sdk,SpectraLogic/ds3_net_sdk,RachelTucker/ds3_net_sdk,rpmoore/ds3_net_sdk,shabtaisharon/ds3_net_sdk,SpectraLogic/ds3_net_sdk,RachelTucker/ds3_net_sdk,shabtaisharon/ds3_net_sdk,SpectraLogic/ds3_net_powershell,rpmoore/ds3_net_sdk,shabtaisharon/ds3_net_sdk,rpmoore/ds3_net_sdk,SpectraLogic/ds3_net_sdk
VersionInfo.cs
VersionInfo.cs
using System.Reflection; // 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.3.0.0")] [assembly: AssemblyFileVersion("1.3.0.0")]
using System.Reflection; // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.2.0.0")] [assembly: AssemblyFileVersion("1.2.0.0")]
apache-2.0
C#
c6aebc599285498e9d4878ae9884b057d24b51d9
change the version to 3.0.2
shabtaisharon/ds3_net_sdk,RachelTucker/ds3_net_sdk,rpmoore/ds3_net_sdk,rpmoore/ds3_net_sdk,SpectraLogic/ds3_net_sdk,RachelTucker/ds3_net_sdk,RachelTucker/ds3_net_sdk,shabtaisharon/ds3_net_sdk,SpectraLogic/ds3_net_sdk,SpectraLogic/ds3_net_sdk,shabtaisharon/ds3_net_sdk,rpmoore/ds3_net_sdk
VersionInfo.cs
VersionInfo.cs
/* * ****************************************************************************** * Copyright 2014 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * * http://www.apache.org/licenses/LICENSE-2.0 * * or in the "license" file accompanying this file. * This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR * CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. * **************************************************************************** */ using System.Reflection; // 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("3.0.2.0")] [assembly: AssemblyFileVersion("3.0.2.0")]
/* * ****************************************************************************** * Copyright 2014 Spectra Logic Corporation. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * * http://www.apache.org/licenses/LICENSE-2.0 * * or in the "license" file accompanying this file. * This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR * CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. * **************************************************************************** */ using System.Reflection; // 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("3.0.1.0")] [assembly: AssemblyFileVersion("3.0.1.0")]
apache-2.0
C#
349915f84021959df569907111177362285ad598
Add list of Transactions to OpenOrder
Gatecoin/api-gatecoin-dotnet,Gatecoin/API_client_csharp,Gatecoin/api-gatecoin-dotnet
Model/OpenOrder.cs
Model/OpenOrder.cs
using ServiceStack.ServiceInterface.ServiceModel; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using GatecoinServiceInterface.Model; namespace GatecoinServiceInterface.Model{ [Serializable] public class OpenOrder { public System.String Code {get; set; } public System.String ClOrderId {get; set; } public System.String OrigClOrderId {get; set; } public Byte Side {get; set; } public System.Decimal Price {get; set; } public System.Decimal InitialQuantity {get; set; } public System.Decimal RemainingQuantity {get; set; } public Byte Status {get; set; } public System.String StatusDesc {get; set; } public Int64 TranSeqNo {get; set; } public Byte Type {get; set; } public System.DateTime Date {get; set; } public List<TraderTransaction> Transactions {get; set; } } }
using ServiceStack.ServiceInterface.ServiceModel; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using GatecoinServiceInterface.Model; namespace GatecoinServiceInterface.Model{ [Serializable] public class OpenOrder { public System.String Code {get; set; } public System.String ClOrderId {get; set; } public System.String OrigClOrderId {get; set; } public Byte Side {get; set; } public System.Decimal Price {get; set; } public System.Decimal InitialQuantity {get; set; } public System.Decimal RemainingQuantity {get; set; } public Byte Status {get; set; } public System.String StatusDesc {get; set; } public Int64 TranSeqNo {get; set; } public Byte Type {get; set; } public System.DateTime Date {get; set; } } }
mit
C#