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
b543cc1feb20e985129756741985a555f798595a
Remove Obsolete attribute from undocumented members
mono/dbus-sharp,arfbtwn/dbus-sharp,arfbtwn/dbus-sharp,openmedicus/dbus-sharp,Tragetaschen/dbus-sharp,openmedicus/dbus-sharp,mono/dbus-sharp,Tragetaschen/dbus-sharp
src/DBus.cs
src/DBus.cs
// Copyright 2006 Alp Toker <alp@atoker.com> // This software is made available under the MIT License // See COPYING for details using System; using NDesk.DBus; //namespace org.freedesktop.DBus namespace org.freedesktop.DBus { /* //what's this for? public class DBusException : ApplicationException { } */ #if UNDOCUMENTED_IN_SPEC //TODO: maybe this should be mapped to its CLR counterpart directly? //not yet used [Interface ("org.freedesktop.DBus.Error.InvalidArgs")] public class InvalidArgsException : ApplicationException { } #endif [Flags] public enum NameFlag : uint { None = 0, AllowReplacement = 0x1, ReplaceExisting = 0x2, DoNotQueue = 0x4, } public enum RequestNameReply : uint { PrimaryOwner = 1, InQueue, Exists, AlreadyOwner, } public enum ReleaseNameReply : uint { Released = 1, NonExistent, NotOwner, } public enum StartReply : uint { //The service was successfully started. Success = 1, //A connection already owns the given name. AlreadyRunning, } public delegate void NameOwnerChangedHandler (string name, string old_owner, string new_owner); public delegate void NameAcquiredHandler (string name); public delegate void NameLostHandler (string name); [Interface ("org.freedesktop.DBus.Peer")] public interface Peer { void Ping (); [return: Argument ("machine_uuid")] string GetMachineId (); } [Interface ("org.freedesktop.DBus.Introspectable")] public interface Introspectable { [return: Argument ("data")] string Introspect (); } [Interface ("org.freedesktop.DBus.Properties")] public interface Properties { //TODO: some kind of indexer mapping? //object this [string propname] {get; set;} [return: Argument ("value")] object Get (string @interface, string propname); //void Get (string @interface, string propname, out object value); void Set (string @interface, string propname, object value); } [Interface ("org.freedesktop.DBus")] public interface IBus : Introspectable { RequestNameReply RequestName (string name, NameFlag flags); ReleaseNameReply ReleaseName (string name); string Hello (); string[] ListNames (); string[] ListActivatableNames (); bool NameHasOwner (string name); event NameOwnerChangedHandler NameOwnerChanged; event NameLostHandler NameLost; event NameAcquiredHandler NameAcquired; StartReply StartServiceByName (string name, uint flags); string GetNameOwner (string name); uint GetConnectionUnixUser (string connection_name); void AddMatch (string rule); void RemoveMatch (string rule); //undocumented in spec string[] ListQueuedOwners (string name); uint GetConnectionUnixProcessID (string connection_name); byte[] GetConnectionSELinuxSecurityContext (string connection_name); void ReloadConfig (); } }
// Copyright 2006 Alp Toker <alp@atoker.com> // This software is made available under the MIT License // See COPYING for details using System; using NDesk.DBus; //namespace org.freedesktop.DBus namespace org.freedesktop.DBus { /* //what's this for? public class DBusException : ApplicationException { } */ #if UNDOCUMENTED_IN_SPEC //TODO: maybe this should be mapped to its CLR counterpart directly? //not yet used [Interface ("org.freedesktop.DBus.Error.InvalidArgs")] public class InvalidArgsException : ApplicationException { } #endif [Flags] public enum NameFlag : uint { None = 0, AllowReplacement = 0x1, ReplaceExisting = 0x2, DoNotQueue = 0x4, } public enum RequestNameReply : uint { PrimaryOwner = 1, InQueue, Exists, AlreadyOwner, } public enum ReleaseNameReply : uint { Released = 1, NonExistent, NotOwner, } public enum StartReply : uint { //The service was successfully started. Success = 1, //A connection already owns the given name. AlreadyRunning, } public delegate void NameOwnerChangedHandler (string name, string old_owner, string new_owner); public delegate void NameAcquiredHandler (string name); public delegate void NameLostHandler (string name); [Interface ("org.freedesktop.DBus.Peer")] public interface Peer { void Ping (); [return: Argument ("machine_uuid")] string GetMachineId (); } [Interface ("org.freedesktop.DBus.Introspectable")] public interface Introspectable { [return: Argument ("data")] string Introspect (); } [Interface ("org.freedesktop.DBus.Properties")] public interface Properties { //TODO: some kind of indexer mapping? //object this [string propname] {get; set;} [return: Argument ("value")] object Get (string @interface, string propname); //void Get (string @interface, string propname, out object value); void Set (string @interface, string propname, object value); } [Interface ("org.freedesktop.DBus")] public interface IBus : Introspectable { RequestNameReply RequestName (string name, NameFlag flags); ReleaseNameReply ReleaseName (string name); string Hello (); string[] ListNames (); string[] ListActivatableNames (); bool NameHasOwner (string name); event NameOwnerChangedHandler NameOwnerChanged; event NameLostHandler NameLost; event NameAcquiredHandler NameAcquired; StartReply StartServiceByName (string name, uint flags); string GetNameOwner (string name); uint GetConnectionUnixUser (string connection_name); void AddMatch (string rule); void RemoveMatch (string rule); //undocumented in spec [Obsolete ("Undocumented in spec")] string[] ListQueuedOwners (string name); [Obsolete ("Undocumented in spec")] uint GetConnectionUnixProcessID (string connection_name); [Obsolete ("Undocumented in spec")] byte[] GetConnectionSELinuxSecurityContext (string connection_name); [Obsolete ("Undocumented in spec")] void ReloadConfig (); } }
mit
C#
f832b305afd11c63629edb01a0db67aac4733e73
Update AW-NF model to test #285
NakedObjectsGroup/NakedObjectsFramework,NakedObjectsGroup/NakedObjectsFramework,NakedObjectsGroup/NakedObjectsFramework,NakedObjectsGroup/NakedObjectsFramework
Test/AdventureWorksFunctionalModel/Production/Product_MenuFunctions.cs
Test/AdventureWorksFunctionalModel/Production/Product_MenuFunctions.cs
// Copyright Naked Objects Group Ltd, 45 Station Road, Henley on Thames, UK, RG9 1AT // 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.Linq; using NakedFunctions; using AW.Types; using static AW.Helpers; using System.Collections.Generic; namespace AW.Functions { [Named("Products")] public static class Product_MenuFunctions { [MemberOrder(1)] [TableView(true, nameof(Product.ProductNumber), nameof(Product.ProductSubcategory), nameof(Product.ListPrice))] public static IQueryable<Product> FindProductByName(string searchString, IContext context) => context.Instances<Product>().Where(x => x.Name.ToUpper().Contains(searchString.ToUpper())).OrderBy(x => x.Name); [MemberOrder(2)] public static Product RandomProduct(IContext context) => Random<Product>(context); [MemberOrder(3)] public static Product FindProductByNumber(string number, IContext context) => context.Instances<Product>().Where(x => x.ProductNumber == number).FirstOrDefault(); [MemberOrder(4)] public static IQueryable<Product> AllProducts(IContext context) => context.Instances<Product>(); [MemberOrder(5)] public static IQueryable<Product> ListProductsByCategory( ProductCategory category, [Optionally] ProductSubcategory subCategory, IContext context) { int catId = category.ProductCategoryID; int subId = subCategory is null ? 0 : subCategory.ProductSubcategoryID; return context.Instances<Product>().Where(p => p.ProductSubcategory.ProductCategoryID == catId && (subId == 0 || p.ProductSubcategoryID.Value == subId)); } public static List<ProductSubcategory> Choices1ListProductsByCategory(ProductCategory category) => category.ProductSubcategory.ToList(); [MemberOrder(5)] public static IQueryable<Product> ListBikes( [Disabled] ProductCategory category, [Optionally] ProductSubcategory subCategory, IContext context) { int catId = category.ProductCategoryID; int subId = subCategory is null ? 0 : subCategory.ProductSubcategoryID; return context.Instances<Product>().Where(p => p.ProductSubcategory.ProductCategoryID == catId && (subId == 0 || p.ProductSubcategoryID.Value == subId)); } public static ProductCategory Default0ListBikes(IContext context) => context.Instances<ProductCategory>().First(); } }
// Copyright Naked Objects Group Ltd, 45 Station Road, Henley on Thames, UK, RG9 1AT // 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.Linq; using NakedFunctions; using AW.Types; using static AW.Helpers; using System.Collections.Generic; namespace AW.Functions { [Named("Products")] public static class Product_MenuFunctions { [MemberOrder(1)] [TableView(true, nameof(Product.ProductNumber), nameof(Product.ProductSubcategory), nameof(Product.ListPrice))] public static IQueryable<Product> FindProductByName(string searchString, IContext context) => context.Instances<Product>().Where(x => x.Name.ToUpper().Contains(searchString.ToUpper())).OrderBy(x => x.Name); [MemberOrder(2)] public static Product RandomProduct(IContext context) => Random<Product>(context); [MemberOrder(3)] public static Product FindProductByNumber(string number, IContext context) => context.Instances<Product>().Where(x => x.ProductNumber == number).FirstOrDefault(); [MemberOrder(4)] public static IQueryable<Product> AllProducts(IContext context) => context.Instances<Product>(); [MemberOrder(5)] public static IQueryable<Product> ListProductsByCategory( ProductCategory category, [Optionally] ProductSubcategory subCategory, IContext context) { int catId = category.ProductCategoryID; int subId = subCategory is null ? 0 : subCategory.ProductSubcategoryID; return context.Instances<Product>().Where(p => p.ProductSubcategory.ProductCategoryID == catId && (subId == 0 || p.ProductSubcategoryID.Value == subId)); } public static List<ProductSubcategory> Choices1ListProductsByCategory(ProductCategory category) => category.ProductSubcategory.ToList(); } }
apache-2.0
C#
88aab376849a1cf35360b258e6ec24c55262669c
Set SharedDownloader to Mock instance when creating SUT
milkshakesoftware/PreMailer.Net
PreMailer.Net/PreMailer.Net.Tests/LinkTagCssSourceTests.cs
PreMailer.Net/PreMailer.Net.Tests/LinkTagCssSourceTests.cs
using AngleSharp.Html.Parser; using Xunit; using Moq; using PreMailer.Net.Downloaders; using PreMailer.Net.Sources; using System; namespace PreMailer.Net.Tests { public class LinkTagCssSourceTests { private readonly Mock<IWebDownloader> _webDownloader = new Mock<IWebDownloader>(); [Fact] public void ImplementsInterface() { LinkTagCssSource sut = CreateSUT(); Assert.IsAssignableFrom<ICssSource>(sut); } [Fact] public void GetCSS_CallsWebDownloader_WithSpecifiedDomain() { string baseUrl = "http://a.co"; LinkTagCssSource sut = CreateSUT(baseUrl: baseUrl); sut.GetCss(); _webDownloader.Verify(w => w.DownloadString(It.Is<Uri>(u => u.Scheme == "http" && u.Host == "a.co"))); } [Fact] public void GetCSS_CallsWebDownloader_WithSpecifiedPath() { string path = "b.css"; LinkTagCssSource sut = CreateSUT(path: path); sut.GetCss(); _webDownloader.Verify(w => w.DownloadString(It.Is<Uri>(u => u.PathAndQuery == "/" + path))); } [Fact] public void GetCSS_CallsWebDownloader_WithSpecifiedBundle() { string path = "/Content/css?v=7V7TZzP9Wo7LiH9_q-r5mRBdC_N0lA_YJpRL_1V424E1"; LinkTagCssSource sut = CreateSUT(path: path, link: "<link href=\"{0}\" rel=\"stylesheet\"/>"); sut.GetCss(); _webDownloader.Verify(w => w.DownloadString(It.Is<Uri>(u => u.PathAndQuery == path))); } [Fact] public void GetCSS_AbsoluteUrlInHref_CallsWebDownloader_WithSpecifiedPath() { string path = "http://b.co/a.css"; LinkTagCssSource sut = CreateSUT(path: path); sut.GetCss(); _webDownloader.Verify(w => w.DownloadString(new Uri(path))); } [Fact] public void GetCSS_DoesNotCallWebDownloader_WhenSchemeNotSupported() { string path = "chrome-extension://fcdjadjbdihbaodagojiomdljhjhjfho/css/atd.css"; LinkTagCssSource sut = CreateSUT(path: path); sut.GetCss(); _webDownloader.Verify(w => w.DownloadString(new Uri(path)), Times.Never); } private LinkTagCssSource CreateSUT(string baseUrl = "http://a.com", string path = "a.css", string link = "<link href=\"{0}\" />") { WebDownloader.SharedDownloader = _webDownloader.Object; var node = new HtmlParser().ParseDocument(String.Format(link, path)); var sut = new LinkTagCssSource(node.Head.FirstElementChild, new Uri(baseUrl)); return sut; } } }
using AngleSharp.Html.Parser; using Xunit; using Moq; using PreMailer.Net.Downloaders; using PreMailer.Net.Sources; using System; namespace PreMailer.Net.Tests { public class LinkTagCssSourceTests { private readonly Mock<IWebDownloader> _webDownloader = new Mock<IWebDownloader>(); public LinkTagCssSourceTests() { WebDownloader.SharedDownloader = _webDownloader.Object; } [Fact] public void ImplementsInterface() { LinkTagCssSource sut = CreateSUT(); Assert.IsAssignableFrom<ICssSource>(sut); } [Fact] public void GetCSS_CallsWebDownloader_WithSpecifiedDomain() { string baseUrl = "http://a.co"; LinkTagCssSource sut = CreateSUT(baseUrl: baseUrl); sut.GetCss(); _webDownloader.Verify(w => w.DownloadString(It.Is<Uri>(u => u.Scheme == "http" && u.Host == "a.co"))); } [Fact] public void GetCSS_CallsWebDownloader_WithSpecifiedPath() { string path = "b.css"; LinkTagCssSource sut = CreateSUT(path: path); sut.GetCss(); _webDownloader.Verify(w => w.DownloadString(It.Is<Uri>(u => u.PathAndQuery == "/" + path))); } [Fact] public void GetCSS_CallsWebDownloader_WithSpecifiedBundle() { string path = "/Content/css?v=7V7TZzP9Wo7LiH9_q-r5mRBdC_N0lA_YJpRL_1V424E1"; LinkTagCssSource sut = CreateSUT(path: path, link: "<link href=\"{0}\" rel=\"stylesheet\"/>"); sut.GetCss(); _webDownloader.Verify(w => w.DownloadString(It.Is<Uri>(u => u.PathAndQuery == path))); } [Fact] public void GetCSS_AbsoluteUrlInHref_CallsWebDownloader_WithSpecifiedPath() { string path = "http://b.co/a.css"; LinkTagCssSource sut = CreateSUT(path: path); sut.GetCss(); _webDownloader.Verify(w => w.DownloadString(new Uri(path))); } [Fact] public void GetCSS_DoesNotCallWebDownloader_WhenSchemeNotSupported() { string path = "chrome-extension://fcdjadjbdihbaodagojiomdljhjhjfho/css/atd.css"; LinkTagCssSource sut = CreateSUT(path: path); sut.GetCss(); _webDownloader.Verify(w => w.DownloadString(new Uri(path)), Times.Never); } private LinkTagCssSource CreateSUT(string baseUrl = "http://a.com", string path = "a.css", string link = "<link href=\"{0}\" />") { var node = new HtmlParser().ParseDocument(String.Format(link, path)); var sut = new LinkTagCssSource(node.Head.FirstElementChild, new Uri(baseUrl)); return sut; } } }
mit
C#
d7a55b087575f9412d04666f7870ec5d180a5a9a
Add command line parsing (for "Open With...")
nitroxis/bz2terraineditor
BZ2TerrainEditor/Program.cs
BZ2TerrainEditor/Program.cs
using System; using System.Windows.Forms; namespace BZ2TerrainEditor { /// <summary> /// Main class. /// </summary> public static class Program { private static int editorInstances; /// <summary> /// Gets or sets the number of editor instances. /// The application will exit when the number of instaces equals 0. /// </summary> public static int EditorInstances { get { return editorInstances; } set { editorInstances = value; if (editorInstances == 0) { Application.Exit(); } } } /// <summary> /// Entry point. /// </summary> [STAThread] public static void Main(string[] args) { Application.EnableVisualStyles(); Editor editor; if (args.Length > 0) editor = new Editor(args[0]); else editor = new Editor(); editor.Show(); Application.Run(); } } }
using System; using System.Windows.Forms; namespace BZ2TerrainEditor { /// <summary> /// Main class. /// </summary> public static class Program { private static int editorInstances; /// <summary> /// Gets or sets the number of editor instances. /// The application will exit when the number of instaces equals 0. /// </summary> public static int EditorInstances { get { return editorInstances; } set { editorInstances = value; if (editorInstances == 0) { Application.Exit(); } } } /// <summary> /// Entry point. /// </summary> [STAThread] public static void Main() { Application.EnableVisualStyles(); Editor editor = new Editor(); editor.Show(); Application.Run(); } } }
mit
C#
d44a9cf8ce95c2fea34600b1cb4bcf9c93ec4af8
Update to griddly 1.0.85
jehhynes/griddly,nickdevore/griddly,programcsharp/griddly,programcsharp/griddly,jehhynes/griddly,programcsharp/griddly,nickdevore/griddly
Build/CommonAssemblyInfo.cs
Build/CommonAssemblyInfo.cs
using System.Reflection; using System.Runtime.InteropServices; [assembly: AssemblyProduct("Griddly")] [assembly: AssemblyCopyright("Copyright © 2015 Chris Hynes and Data Research Group")] [assembly: ComVisible(false)] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Revision and Build Numbers // by using the '*' as shown below: [assembly: AssemblyVersion("1.0.85.0")] [assembly: AssemblyFileVersion("1.0.85.0")]
using System.Reflection; using System.Runtime.InteropServices; [assembly: AssemblyProduct("Griddly")] [assembly: AssemblyCopyright("Copyright © 2015 Chris Hynes and Data Research Group")] [assembly: ComVisible(false)] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Revision and Build Numbers // by using the '*' as shown below: [assembly: AssemblyVersion("1.0.84.3")] [assembly: AssemblyFileVersion("1.0.84.3")]
mit
C#
ba5f70228c2d412712fced35cd721e91741caf0c
Update SpaceFolder.cs
KerbaeAdAstra/KerbalFuture
KerbalFuture/SpaceFolder.cs
KerbalFuture/SpaceFolder.cs
using System; using System.Collections; using System.Collections.Generic; using System.Linq; using UnityEngine; using KSP; namespace KerbalFuture { class SpaceFolderData : MonoBehavior { public static string path() { return System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location); } public bool partContainsModule(string miPart, string moduleName) { List<partDatabase> = GameDatabase.GetConfigNodes("PART"); partDatabase[] = GameDatabase.GetConfigNodes(" if( { return true; } else { return false; } } } class SpaceFolderVslChecks : MonoBehavior { public bool SpaceFolderWarpCheck() { List<Part> vslParts = this.Vessel.Parts; for(vslParts[i]) { if(partContainsModule(vslParts[i], "SpaceFolderDrive")) { } } } } class FlightDrive : VesselModule { Vector3 vslObtVel; public void FixedUpdate() { if((HighLogic.LoadedSceneIsFlight) && (SpaceFolderWarpCheck())) { vslObtVel = Vessel.GetObtVelocity(); if (SpacefolderWarpCheck(true)) } } } class SpaceFolderEngine : PartModule { double holeDiameter; } }
using System; using System.Collections; using System.Collections.Generic; using System.Linq; using UnityEngine; using KSP; namespace KerbalFuture { class SpaceFolderData : MonoBehavior { public static string path() { return System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location); } public bool partContainsModule(string miPart, string moduleName) { ConfigNode.Load } } class SpaceFolderVslChecks : MonoBehavior { public bool SpaceFolderWarpCheck() { List<Part> vslParts = this.Vessel.Parts; for(vslParts[i]) { if(vslParts[i].Contains("SFD"+*) { } } } } class FlightDrive : VesselModule { Vector3 vslObtVel; public void FixedUpdate() { if((HighLogic.LoadedSceneIsFlight) && (SpaceFolderWarpCheck())) { vslObtVel = Vessel.GetObtVelocity(); if (SpacefolderWarpCheck(true)) } } } class SpaceFolderEngine : PartModule { double holeDiameter; } }
mit
C#
95f0ff94b474f08a90583255053b7857532259a0
Fix reset ball ui for local and multiplayer
Double-Fine-Game-Club/pongball
Assets/scripts/ui/ResetBallUI.cs
Assets/scripts/ui/ResetBallUI.cs
using System; using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.Networking; using UnityEngine.Networking.NetworkSystem; public class ResetBallUI : NetworkBehaviour { // Message handle for the client id message private short RESPAWN_MESSAGE = 1003; void OnServerStart() { NetworkServer.RegisterHandler(RESPAWN_MESSAGE, OnResetBallPosition); } private void OnGUI() { GUILayout.BeginArea(new Rect(Screen.width - 150, 10, 140, 40)); if (GUILayout.Button("Reset Ball Position")) { ResetBallPosition(); } GUILayout.EndArea(); } [Server] private void OnResetBallPosition(NetworkMessage netMsg) { ResetBallPosition(); } private void ResetBallPosition() { if (NetworkServer.connections.Count > 0 || !NetworkManager.singleton.isNetworkActive) { // If local or the server reset the ball position var ball = GameObject.FindGameObjectWithTag("Ball"); if(ball != null) { ball.GetComponent<Ball>().ResetPosition(); } } else { // Send an empty message of type respawn message NetworkManager.singleton.client.connection.Send(RESPAWN_MESSAGE, new EmptyMessage()); } } }
using System; using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.Networking; public class ResetBallUI : NetworkBehaviour { private void OnGUI() { GUILayout.BeginArea(new Rect(Screen.width - 150, 10, 140, 40)); if (GUILayout.Button("Reset Ball Position")) { CmdResetBallPosition(); } GUILayout.EndArea(); } [Command] private void CmdResetBallPosition() { var ball = GameObject.FindGameObjectWithTag("Ball"); if(ball != null) { ball.GetComponent<Ball>().ResetPosition(); } } }
mit
C#
4ab797811bd286a824ac1166cbe85921a14940c3
Change still image capture parameters.
zhen08/PiDashcam,zhen08/PiDashcam
PiDashcam/PiDashcam/StillCam.cs
PiDashcam/PiDashcam/StillCam.cs
using System; using System.Timers; using Shell.Execute; namespace PiDashcam { public class StillCam { Timer timer; int imgcounter; public StillCam() { timer = new Timer(6000); timer.Elapsed += Timer_Elapsed; timer.Start(); imgcounter = 1; } public void Stop() { timer.Stop(); } void Timer_Elapsed(object sender, ElapsedEventArgs e) { ProgramLauncher.Execute("raspistill", String.Format("-h 1920 -v 1080 -n -o {0}.jpg",imgcounter++)); } } }
using System; using System.Timers; using Shell.Execute; namespace PiDashcam { public class StillCam { Timer timer; int imgcounter; public StillCam() { timer = new Timer(10000); timer.Elapsed += Timer_Elapsed; timer.Start(); imgcounter = 1; } public void Stop() { timer.Stop(); } void Timer_Elapsed(object sender, ElapsedEventArgs e) { ProgramLauncher.Execute("raspistill", String.Format("-o {0}.jpg",imgcounter++)); } } }
mit
C#
4be9583f5497656532727361089ad2e0bd43b467
Remove unnecessary supressions.
GGG-KILLER/GUtils.NET
GUtils.CLI/GlobalSuppressions.cs
GUtils.CLI/GlobalSuppressions.cs
/* * Copyright © 2019 GGG KILLER <gggkiller2@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. */ // This file is used by Code Analysis to maintain SuppressMessage // attributes that are applied to this project. Project-level // suppressions either have no target or are given a specific // target and scoped to a namespace, type, member, etc. [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage ( "Design", "CA1032:Implement standard exception constructors", Justification = "<Pending>", Scope = "type", Target = "~T:GUtils.CLI.Commands.Errors.CommandDefinitionException" )]
/* * Copyright © 2019 GGG KILLER <gggkiller2@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. */ // This file is used by Code Analysis to maintain SuppressMessage // attributes that are applied to this project. Project-level // suppressions either have no target or are given a specific // target and scoped to a namespace, type, member, etc. [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage ( "Style", "IDE0018:Inline variable declaration", Justification = "<Pending>", Scope = "member", Target = "~M:GUtils.CLI.Commands.CommandManager.Execute(System.String)" )] [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage ( "Style", "IDE0045:Convert to conditional expression", Justification = "<Pending>", Scope = "member", Target = "~M:GUtils.CLI.Commands.CommandManager.Execute(System.String)" )] [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage ( "Style", "CC0014:Use ternary operator", Justification = "<Pending>", Scope = "member", Target = "~M:GUtils.CLI.Commands.CommandManager.Execute(System.String)" )] [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage ( "Design", "CA1032:Implement standard exception constructors", Justification = "<Pending>", Scope = "type", Target = "~T:GUtils.CLI.Commands.Errors.CommandDefinitionException" )]
mit
C#
2e3aca1fbe3ea2714fae606ca49d87eeeb0bf835
Tweak tests to reflect new interface for log timing
mattgwagner/CertiPay.Common
CertiPay.Common.Tests/Logging/MetricLoggingExtensionsTests.cs
CertiPay.Common.Tests/Logging/MetricLoggingExtensionsTests.cs
using CertiPay.Common.Logging; using NUnit.Framework; using System; using System.Threading; namespace CertiPay.Common.Tests.Logging { public class MetricLoggingExtensionsTests { private static readonly ILog Log = LogManager.GetLogger<MetricLoggingExtensionsTests>(); [Test] public void Use_Log_Timer_No_Identifier() { using (Log.Timer("Use_Log_Timer")) { // Cool stuff happens here } } [Test] public void Takes_Longer_Than_Threshold() { using (Log.Timer("Takes_Longer_Than_Threshold", warnIfExceeds: TimeSpan.FromMilliseconds(100))) { Thread.Sleep(TimeSpan.FromMilliseconds(150)); } } [Test] public void Object_Context_Provided() { using (Log.Timer("Object_Context_Provided {id} {userId}", new { id = 10, userId = 12 })) { // Cool stuff happens here } } } }
using CertiPay.Common.Logging; using NUnit.Framework; using System; using System.Threading; namespace CertiPay.Common.Tests.Logging { public class MetricLoggingExtensionsTests { private static readonly ILog Log = LogManager.GetLogger<MetricLoggingExtensionsTests>(); [Test] public void Use_Log_Timer_No_Identifier() { using (Log.Timer("Use_Log_Timer")) { // Cool stuff happens here } } [Test] public void Use_Log_Timer_With_Debug() { using (Log.Timer("Use_Log_Timer_With_Debug", level: LogLevel.Debug)) { // Debug tracking happens here } } [Test] public void Takes_Longer_Than_Threshold() { using (Log.Timer("Takes_Longer_Than_Threshold", warnIfExceeds: TimeSpan.FromMilliseconds(100))) { Thread.Sleep(TimeSpan.FromMilliseconds(150)); } } [Test] public void Object_Context_Provided() { using (Log.Timer("Object_Context_Provided", new { id = 10, userId = 12 })) { // Cool stuff happens here } } } }
mit
C#
7aea5832db354e0b41672d0f3146d06f9fe6ef18
Update CoreXamlReader.cs
wieslawsoltes/Core2D,wieslawsoltes/Core2D,wieslawsoltes/Core2D,wieslawsoltes/Core2D,Core2D/Core2D,Core2D/Core2D
src/Core2D/Serializer/Xaml/CoreXamlReader.cs
src/Core2D/Serializer/Xaml/CoreXamlReader.cs
// Copyright (c) Wiesław Šoltés. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. using System.IO; using System.Xml; using Portable.Xaml; namespace Core2D.Serializer.Xaml { internal static class CoreXamlReader { internal static readonly XamlSchemaContext s_context = new CoreXamlSchemaContext(); private static object Load(XamlXmlReader reader) { using (var writer = new XamlObjectWriter(s_context, new XamlObjectWriterSettings())) { XamlServices.Transform(reader, writer); return writer.Result; } } public static object Load(Stream stream) { using (var reader = new XamlXmlReader(stream, s_context)) { return Load(reader); } } public static object Load(string path) { using (var reader = new XamlXmlReader(path, s_context)) { return Load(reader); } } public static object Load(TextReader textReader) { using (var reader = new XamlXmlReader(textReader, s_context)) { return Load(reader); } } public static object Load(XmlReader xmlReader) { using (var reader = new XamlXmlReader(xmlReader, s_context)) { return Load(reader); } } } }
// 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 Portable.Xaml; using System.IO; using System.Xml; namespace Core2D.Serializer.Xaml { internal static class CoreXamlReader { internal static readonly XamlSchemaContext s_context = new CoreXamlSchemaContext(); private static object Load(XamlXmlReader reader) { using (var writer = new XamlObjectWriter(s_context, new XamlObjectWriterSettings())) { XamlServices.Transform(reader, writer); return writer.Result; } } public static object Load(Stream stream) { using (var reader = new XamlXmlReader(stream, s_context)) { return Load(reader); } } public static object Load(string path) { using (var reader = new XamlXmlReader(path, s_context)) { return Load(reader); } } public static object Load(TextReader textReader) { using (var reader = new XamlXmlReader(textReader, s_context)) { return Load(reader); } } public static object Load(XmlReader xmlReader) { using (var reader = new XamlXmlReader(xmlReader, s_context)) { return Load(reader); } } } }
mit
C#
57bddcf8b1c224850643d4f99a5f32c2767ab726
Add link
tlbdk/SQLServerCDCSync,tlbdk/SQLServerCDCSync
SQLServerCDCSync/Program.cs
SQLServerCDCSync/Program.cs
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace SQLServerCDCSync { class Program { static void Main(string[] args) { // http://www.codeproject.com/Articles/547311/ProgrammaticallyplusCreateplusandplusDeployplusSSI string sourceconn = "user id=sa;password=Qwerty1234;server=localhost;Trusted_Connection=yes;database=SQLServerCDCSync;connection timeout=30"; string destinationconn = "user id=sa;password=Qwerty1234;server=localhost;Trusted_Connection=yes;database=SQLServerCDCSyncDestination;connection timeout=30"; string cdcdatabase = "SQLServerCDCSync"; string[] tables = new string[] { "Test1", "Test2" }; // Make sure external dependencies such as environment variables are initialized SQLServerCDCSync.InitializeEnvironment(); // Generate initial sync package SQLServerCDCSync.GenerateInitialLoadSSISPackage(@"C:\repos\SQLServerCDCSync\SQLServerCDCSync.SSISSample\InitialLoadTest1.dtsx", "System.Data.OracleClient", sourceconn, destinationconn, cdcdatabase, tables ); SQLServerCDCSync.GenerateMergeLoadSSISPackage(@"C:\repos\SQLServerCDCSync\SQLServerCDCSync.SSISSample\MergeLoadTest1.dtsx", destinationconn, cdcdatabase, tables ); } } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace SQLServerCDCSync { class Program { static void Main(string[] args) { string sourceconn = "user id=sa;password=Qwerty1234;server=localhost;Trusted_Connection=yes;database=SQLServerCDCSync;connection timeout=30"; string destinationconn = "user id=sa;password=Qwerty1234;server=localhost;Trusted_Connection=yes;database=SQLServerCDCSyncDestination;connection timeout=30"; string cdcdatabase = "SQLServerCDCSync"; string[] tables = new string[] { "Test1", "Test2" }; // Make sure external dependencies such as environment variables are initialized SQLServerCDCSync.InitializeEnvironment(); // Generate initial sync package SQLServerCDCSync.GenerateInitialLoadSSISPackage(@"C:\repos\SQLServerCDCSync\SQLServerCDCSync.SSISSample\InitialLoadTest1.dtsx", "System.Data.OracleClient", sourceconn, destinationconn, cdcdatabase, tables ); SQLServerCDCSync.GenerateMergeLoadSSISPackage(@"C:\repos\SQLServerCDCSync\SQLServerCDCSync.SSISSample\MergeLoadTest1.dtsx", destinationconn, cdcdatabase, tables ); } } }
mit
C#
54f0f58c96385128609bef6d25ea59453e5f8d83
send list of all users to newly registered one
pako1337/Arena,pako1337/Arena
Arena/Hubs/FightArenaHub.cs
Arena/Hubs/FightArenaHub.cs
using System; using System.Collections.Generic; using System.Linq; using System.Web; using Microsoft.AspNet.SignalR; using System.Collections.Concurrent; using System.Threading; namespace Arena.Hubs { public class FightArenaHub : Hub { private SpinLock _lock = new SpinLock(); private static List<string> _users = new List<string>(); public void Register() { List<string> presentUsers = null; bool lockTaken = false; try { _lock.Enter(ref lockTaken); presentUsers = _users.ToList(); _users.Add(Context.ConnectionId); } finally { if (lockTaken) _lock.Exit(); } if (presentUsers != null) { presentUsers.ForEach(u => Clients.Client(Context.ConnectionId).NewUser(u)); } Clients.AllExcept(Context.ConnectionId).NewUser(Context.ConnectionId); } public void MoveUser(int x, int y) { Clients.AllExcept(Context.ConnectionId).MoveUser(Context.ConnectionId, x, y); } public override System.Threading.Tasks.Task OnDisconnected(bool stopCalled) { bool lockTaken = false; try { _lock.Enter(ref lockTaken); if (_users.Contains(Context.ConnectionId)) _users.Remove(Context.ConnectionId); } finally { if (lockTaken) _lock.Exit(); } Clients.All.UserExit(Context.ConnectionId); return base.OnDisconnected(stopCalled); } } }
using System; using System.Collections.Generic; using System.Linq; using System.Web; using Microsoft.AspNet.SignalR; using System.Collections.Concurrent; using System.Threading; namespace Arena.Hubs { public class FightArenaHub : Hub { private SpinLock _lock = new SpinLock(); private static List<string> _users = new List<string>(); public void Register() { bool lockTaken = false; try { _lock.Enter(ref lockTaken); _users.Add(Context.ConnectionId); } finally { if (lockTaken) _lock.Exit(); } Clients.AllExcept(Context.ConnectionId).NewUser(Context.ConnectionId); } public void MoveUser(int x, int y) { Clients.AllExcept(Context.ConnectionId).MoveUser(Context.ConnectionId, x, y); } public override System.Threading.Tasks.Task OnDisconnected(bool stopCalled) { bool lockTaken = false; try { _lock.Enter(ref lockTaken); if (_users.Contains(Context.ConnectionId)) _users.Remove(Context.ConnectionId); } finally { if (lockTaken) _lock.Exit(); } Clients.All.UserExit(Context.ConnectionId); return base.OnDisconnected(stopCalled); } } }
mit
C#
e4dbe3f83616f9f98242366f3b0e894241c128d6
Set targetGameObject = null on ReturnToHive state exit as this target was overriding the target position when the boids switched back to exploring
kevindoyle93/GAI-LabTest-2
Assets/ReturnToHiveState.cs
Assets/ReturnToHiveState.cs
using UnityEngine; public class ReturnToHiveState : State { Arrive arrive; public ReturnToHiveState(GameObject gameObject) : base(gameObject) { this.gameObject = gameObject; } public override void Enter() { arrive = gameObject.GetComponent<Arrive>(); arrive.targetGameObject = gameObject.transform.parent.gameObject; } public override void Exit() { arrive.targetGameObject = null; } public override void Update() { if (Vector3.Distance(gameObject.transform.position, gameObject.transform.parent.transform.position) < 1.0f) { gameObject.transform.parent.GetComponent<BeeSpawner>().pollenCount += gameObject.GetComponent<Bee>().collectedPollen; gameObject.GetComponent<Bee>().collectedPollen = 0.0f; gameObject.GetComponent<StateMachine>().SwitchState(new ExploreState(gameObject)); } } }
using UnityEngine; public class ReturnToHiveState : State { Arrive arrive; public ReturnToHiveState(GameObject gameObject) : base(gameObject) { this.gameObject = gameObject; } public override void Enter() { arrive = gameObject.GetComponent<Arrive>(); arrive.targetGameObject = gameObject.transform.parent.gameObject; } public override void Exit() { } public override void Update() { if (Vector3.Distance(gameObject.transform.position, gameObject.transform.parent.transform.position) < 1.0f) { gameObject.transform.parent.GetComponent<BeeSpawner>().pollenCount += gameObject.GetComponent<Bee>().collectedPollen; gameObject.GetComponent<Bee>().collectedPollen = 0.0f; gameObject.GetComponent<StateMachine>().SwitchState(new ExploreState(gameObject)); } } }
mit
C#
d212a844a38fcca956f9ed88cc2bf473c32f0cb5
Tidy up error handling in WriteExpression
csainty/Veil,csainty/Veil
Src/Veil/Compiler/VeilTemplateCompiler.EmitWriteExpression.cs
Src/Veil/Compiler/VeilTemplateCompiler.EmitWriteExpression.cs
using System.Reflection; namespace Veil.Compiler { internal partial class VeilTemplateCompiler { private static MethodInfo htmlEncodeMethod = typeof(Helpers).GetMethod("HtmlEncode"); private static void EmitWriteExpression<T>(VeilCompilerState<T> state, SyntaxTreeNode.WriteExpressionNode node) { state.Emitter.LoadWriterToStack(); state.PushExpressionScopeOnStack(node.Expression); state.Emitter.LoadExpressionFromCurrentModelOnStack(node.Expression); if (node.HtmlEncode) { if (node.Expression.ResultType != typeof(string)) throw new VeilCompilerException("Tried to HtmlEncode an expression that does not evaluate to a string"); state.Emitter.Call(htmlEncodeMethod); } else { state.Emitter.CallWriteFor(node.Expression.ResultType); } } } }
namespace Veil.Compiler { internal partial class VeilTemplateCompiler { private static void EmitWriteExpression<T>(VeilCompilerState<T> state, SyntaxTreeNode.WriteExpressionNode node) { state.Emitter.LoadWriterToStack(); state.PushExpressionScopeOnStack(node.Expression); state.Emitter.LoadExpressionFromCurrentModelOnStack(node.Expression); if (node.HtmlEncode && node.Expression.ResultType == typeof(string)) { var method = typeof(Helpers).GetMethod("HtmlEncode"); state.Emitter.Call(method); } else { state.Emitter.CallWriteFor(node.Expression.ResultType); } } } }
mit
C#
3cb5bdbf602f86381efd6394f4f295f947fa0567
bump version v2.53.1-2016.07.02
dzharii/swd-recorder,dzharii/swd-recorder,dzharii/swd-recorder
SwdPageRecorder/SwdPageRecorder.UI/Properties/AssemblyInfo.cs
SwdPageRecorder/SwdPageRecorder.UI/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("SWD.Page.Recorder")] [assembly: AssemblyDescription("SWD Page Recorder")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("SWD Page Recorder")] [assembly: AssemblyCopyright("Dmytro Zharii 2013 - 2016; License: MIT")] [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("e9df8048-bebd-4007-8c9d-3d2a6fed2de8")] // 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(Build.Version)] [assembly: AssemblyFileVersion(Build.Version)] public class Build { public const string Version = "2016.07.02"; public const string WebDriverVersion = "v2.53.1"; }
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("SWD.Page.Recorder")] [assembly: AssemblyDescription("SWD Page Recorder")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("SWD Page Recorder")] [assembly: AssemblyCopyright("Dmytro Zharii 2013 - 2016; License: MIT")] [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("e9df8048-bebd-4007-8c9d-3d2a6fed2de8")] // 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(Build.Version)] [assembly: AssemblyFileVersion(Build.Version)] public class Build { public const string Version = "2016.07.01"; public const string WebDriverVersion = "v2.53"; }
mit
C#
88d2658fca4a631008f576fd969b600bed82c6bc
Add short term caching to sandbox html response to avoid repeated download by the browser.
andrewdavey/witness,andrewdavey/witness,andrewdavey/witness
src/Witness/Controllers/SandboxController.cs
src/Witness/Controllers/SandboxController.cs
using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; namespace Witness.Controllers { public class SandboxController : Controller { public ActionResult Index() { Response.Cache.SetExpires(DateTime.UtcNow.AddMinutes(1)); return View(); } } }
using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; namespace Witness.Controllers { public class SandboxController : Controller { public ActionResult Index() { return View(); } } }
bsd-2-clause
C#
75b3a6b1e39af23c4f6a5657751a31ca29ad660b
fix visibility
PKRoma/refit
Refit/AuthenticatedParameterizedHttpClientHandler.cs
Refit/AuthenticatedParameterizedHttpClientHandler.cs
using System; using System.Net.Http; using System.Net.Http.Headers; using System.Threading; using System.Threading.Tasks; namespace Refit { class AuthenticatedParameterizedHttpClientHandler : DelegatingHandler { readonly Func<HttpRequestMessage, Task<string>> getToken; public AuthenticatedParameterizedHttpClientHandler(Func<HttpRequestMessage, Task<string>> getToken, HttpMessageHandler innerHandler = null) : base(innerHandler ?? new HttpClientHandler()) { this.getToken = getToken ?? throw new ArgumentNullException(nameof(getToken)); } protected override async Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) { // See if the request has an authorize header var auth = request.Headers.Authorization; if (auth != null) { var token = await getToken(request).ConfigureAwait(false); request.Headers.Authorization = new AuthenticationHeaderValue(auth.Scheme, token); } return await base.SendAsync(request, cancellationToken).ConfigureAwait(false); } } }
using System; using System.Net.Http; using System.Net.Http.Headers; using System.Threading; using System.Threading.Tasks; namespace Refit { public class AuthenticatedParameterizedHttpClientHandler : DelegatingHandler { readonly Func<HttpRequestMessage, Task<string>> getToken; public AuthenticatedParameterizedHttpClientHandler(Func<HttpRequestMessage, Task<string>> getToken, HttpMessageHandler innerHandler = null) : base(innerHandler ?? new HttpClientHandler()) { this.getToken = getToken ?? throw new ArgumentNullException(nameof(getToken)); } protected override async Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) { // See if the request has an authorize header var auth = request.Headers.Authorization; if (auth != null) { var token = await getToken(request).ConfigureAwait(false); request.Headers.Authorization = new AuthenticationHeaderValue(auth.Scheme, token); } return await base.SendAsync(request, cancellationToken).ConfigureAwait(false); } } }
mit
C#
65d8e8c91c6cd33b2a81e833f03f4ba0f6e44e4d
Fix GCode regression, restore required base call
larsbrubaker/MatterControl,jlewin/MatterControl,mmoening/MatterControl,larsbrubaker/MatterControl,jlewin/MatterControl,unlimitedbacon/MatterControl,unlimitedbacon/MatterControl,unlimitedbacon/MatterControl,jlewin/MatterControl,unlimitedbacon/MatterControl,larsbrubaker/MatterControl,mmoening/MatterControl,larsbrubaker/MatterControl,mmoening/MatterControl,jlewin/MatterControl
SlicerConfiguration/UIFields/MultilineStringField.cs
SlicerConfiguration/UIFields/MultilineStringField.cs
/* Copyright (c) 2017, 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 System; using MatterHackers.Agg.UI; namespace MatterHackers.MatterControl.SlicerConfiguration { public class MultilineStringField : UIField { private MHTextEditWidget editWidget; public override void Initialize(int tabIndex) { editWidget = new MHTextEditWidget("", pixelWidth: 320, multiLine: true, tabIndex: tabIndex, typeFace: ApplicationController.GetTypeFace(NamedTypeFace.Liberation_Mono)) { HAnchor = HAnchor.Stretch, VAnchor = VAnchor.Fit, Name = this.Name }; editWidget.DrawFromHintedCache(); editWidget.ActualTextEditWidget.EditComplete += (sender, e) => { if (sender is TextEditWidget textEditWidget) { this.SetValue( textEditWidget.Text.Replace("\n", "\\n"), userInitiated: true); } }; editWidget.ActualTextEditWidget.TextChanged += (s, e) => { UiThread.RunOnIdle(() => { editWidget.ActualTextEditWidget.Height = Math.Min(editWidget.ActualTextEditWidget.Printer.LocalBounds.Height, 500); }); }; this.Content = editWidget; } protected override void OnValueChanged(FieldChangedEventArgs fieldChangedEventArgs) { editWidget.Text = this.Value.Replace("\\n", "\n"); editWidget.ActualTextEditWidget.Height = Math.Min(editWidget.ActualTextEditWidget.Printer.LocalBounds.Height, 500); base.OnValueChanged(fieldChangedEventArgs); } } }
/* Copyright (c) 2017, 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 System; using MatterHackers.Agg.UI; namespace MatterHackers.MatterControl.SlicerConfiguration { public class MultilineStringField : UIField { private MHTextEditWidget editWidget; public override void Initialize(int tabIndex) { editWidget = new MHTextEditWidget("", pixelWidth: 320, multiLine: true, tabIndex: tabIndex, typeFace: ApplicationController.GetTypeFace(NamedTypeFace.Liberation_Mono)) { HAnchor = HAnchor.Stretch, VAnchor = VAnchor.Fit, Name = this.Name }; editWidget.DrawFromHintedCache(); editWidget.ActualTextEditWidget.EditComplete += (sender, e) => { if (sender is TextEditWidget textEditWidget) { this.SetValue( textEditWidget.Text.Replace("\n", "\\n"), userInitiated: true); } }; editWidget.ActualTextEditWidget.TextChanged += (s, e) => { UiThread.RunOnIdle(() => { editWidget.ActualTextEditWidget.Height = Math.Min(editWidget.ActualTextEditWidget.Printer.LocalBounds.Height, 500); }); }; this.Content = editWidget; } protected override void OnValueChanged(FieldChangedEventArgs fieldChangedEventArgs) { editWidget.Text = this.Value.Replace("\\n", "\n"); editWidget.ActualTextEditWidget.Height = Math.Min(editWidget.ActualTextEditWidget.Printer.LocalBounds.Height, 500); } } }
bsd-2-clause
C#
610d608c237b3fa0a41c2f795d257df5e2597140
Make the generic type self-documenting.
allansson/git-tfs,irontoby/git-tfs,bleissem/git-tfs,bleissem/git-tfs,steveandpeggyb/Public,modulexcite/git-tfs,guyboltonking/git-tfs,jeremy-sylvis-tmg/git-tfs,allansson/git-tfs,vzabavnov/git-tfs,codemerlin/git-tfs,NathanLBCooper/git-tfs,allansson/git-tfs,modulexcite/git-tfs,spraints/git-tfs,guyboltonking/git-tfs,codemerlin/git-tfs,WolfVR/git-tfs,jeremy-sylvis-tmg/git-tfs,kgybels/git-tfs,NathanLBCooper/git-tfs,spraints/git-tfs,kgybels/git-tfs,adbre/git-tfs,git-tfs/git-tfs,TheoAndersen/git-tfs,andyrooger/git-tfs,irontoby/git-tfs,NathanLBCooper/git-tfs,modulexcite/git-tfs,steveandpeggyb/Public,irontoby/git-tfs,TheoAndersen/git-tfs,spraints/git-tfs,TheoAndersen/git-tfs,codemerlin/git-tfs,WolfVR/git-tfs,jeremy-sylvis-tmg/git-tfs,WolfVR/git-tfs,PKRoma/git-tfs,pmiossec/git-tfs,adbre/git-tfs,kgybels/git-tfs,allansson/git-tfs,hazzik/git-tfs,steveandpeggyb/Public,hazzik/git-tfs,bleissem/git-tfs,hazzik/git-tfs,adbre/git-tfs,TheoAndersen/git-tfs,hazzik/git-tfs,guyboltonking/git-tfs
GitTfs/Core/TfsInterop/WrapperFor.cs
GitTfs/Core/TfsInterop/WrapperFor.cs
namespace Sep.Git.Tfs.Core.TfsInterop { public class WrapperFor<TFS_TYPE> { private readonly TFS_TYPE _wrapped; public WrapperFor(TFS_TYPE wrapped) { _wrapped = wrapped; } public TFS_TYPE Unwrap() { return _wrapped; } public static TFS_TYPE Unwrap(object wrapper) { return ((WrapperFor<TFS_TYPE>)wrapper).Unwrap(); } } }
namespace Sep.Git.Tfs.Core.TfsInterop { public class WrapperFor<T> { private readonly T _wrapped; public WrapperFor(T wrapped) { _wrapped = wrapped; } public T Unwrap() { return _wrapped; } public static T Unwrap(object wrapper) { return ((WrapperFor<T>)wrapper).Unwrap(); } } }
apache-2.0
C#
e3ebc849c5a1be4005aba98568774c021292cbbe
Remove not removed comment
UselessToucan/osu,2yangk23/osu,smoogipoo/osu,peppy/osu,EVAST9919/osu,NeoAdonis/osu,DrabWeb/osu,ppy/osu,EVAST9919/osu,johnneijzen/osu,2yangk23/osu,naoey/osu,ppy/osu,naoey/osu,johnneijzen/osu,UselessToucan/osu,ZLima12/osu,ppy/osu,peppy/osu,smoogipoo/osu,smoogipoo/osu,NeoAdonis/osu,smoogipooo/osu,NeoAdonis/osu,naoey/osu,DrabWeb/osu,peppy/osu,peppy/osu-new,ZLima12/osu,UselessToucan/osu,DrabWeb/osu
osu.Game/Graphics/DrawableDate.cs
osu.Game/Graphics/DrawableDate.cs
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>. // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; using Humanizer; using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Framework.Graphics.Cursor; using osu.Game.Graphics.Sprites; namespace osu.Game.Graphics { public class DrawableDate : OsuSpriteText, IHasTooltip { private readonly DateTimeOffset date; public DrawableDate(DateTimeOffset date) { AutoSizeAxes = Axes.Both; Font = "Exo2.0-RegularItalic"; this.date = date.ToLocalTime(); } [BackgroundDependencyLoader] private void load() { updateTime(); } protected override void LoadComplete() { base.LoadComplete(); Scheduler.Add(updateTimeWithReschedule); } private void updateTimeWithReschedule() { updateTime(); var diffToNow = DateTimeOffset.Now.Subtract(date); double timeUntilNextUpdate = 1000; if (diffToNow.TotalSeconds > 60) { timeUntilNextUpdate *= 60; if (diffToNow.TotalMinutes > 60) { timeUntilNextUpdate *= 60; if (diffToNow.TotalHours > 24) timeUntilNextUpdate *= 24; } } Scheduler.AddDelayed(updateTimeWithReschedule, timeUntilNextUpdate); } public override bool HandleMouseInput => true; protected virtual string Format() => Text = date.Humanize(); private void updateTime() => Format(); public virtual string TooltipText => string.Format("{0:d MMMM yyyy H:mm \"UTC\"z}", date); } }
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>. // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; using Humanizer; using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Framework.Graphics.Cursor; using osu.Game.Graphics.Sprites; namespace osu.Game.Graphics { public class DrawableDate : OsuSpriteText, IHasTooltip { private readonly DateTimeOffset date; /// <param name="dateFormat">The string to format the date text with. /// May be null if the humanized format should be used.</param> public DrawableDate(DateTimeOffset date) { AutoSizeAxes = Axes.Both; Font = "Exo2.0-RegularItalic"; this.date = date.ToLocalTime(); } [BackgroundDependencyLoader] private void load() { updateTime(); } protected override void LoadComplete() { base.LoadComplete(); Scheduler.Add(updateTimeWithReschedule); } private void updateTimeWithReschedule() { updateTime(); var diffToNow = DateTimeOffset.Now.Subtract(date); double timeUntilNextUpdate = 1000; if (diffToNow.TotalSeconds > 60) { timeUntilNextUpdate *= 60; if (diffToNow.TotalMinutes > 60) { timeUntilNextUpdate *= 60; if (diffToNow.TotalHours > 24) timeUntilNextUpdate *= 24; } } Scheduler.AddDelayed(updateTimeWithReschedule, timeUntilNextUpdate); } public override bool HandleMouseInput => true; protected virtual string Format() => Text = date.Humanize(); private void updateTime() => Format(); public virtual string TooltipText => string.Format("{0:d MMMM yyyy H:mm \"UTC\"z}", date); } }
mit
C#
5288b5cd7b60367cea012787c1e516c2feecb9be
Update tests.
cube-soft/Cube.Net,cube-soft/Cube.Net,cube-soft/Cube.Net
Tests/Rss/RssMonitorTest.cs
Tests/Rss/RssMonitorTest.cs
/* ------------------------------------------------------------------------- */ // // Copyright (c) 2010 CubeSoft, Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // /* ------------------------------------------------------------------------- */ using System; using System.Threading.Tasks; using NUnit.Framework; namespace Cube.Net.Tests.Rss { /* --------------------------------------------------------------------- */ /// /// RssMonitorTest /// /// <summary> /// RssMonitor のテスト用クラスです。 /// </summary> /// /* --------------------------------------------------------------------- */ [TestFixture] class RssMonitorTest : FileHelper { /* ----------------------------------------------------------------- */ /// /// Start /// /// <summary> /// 監視テストを実行します。 /// </summary> /// /* ----------------------------------------------------------------- */ [Test] public async Task Start() { var uri = new Uri("http://blog.cube-soft.jp/?feed=rss2"); using (var mon = new Cube.Net.Rss.RssMonitor()) { mon.Timeout = TimeSpan.FromMilliseconds(1000); mon.CacheDirectory = Results; mon.Add(uri); mon.Start(); await Task.Delay(2000); mon.Stop(); } Assert.That(IO.Exists(Result("722a6df5a86c7464e1eeaeb691ba50be")), Is.True); } } }
/* ------------------------------------------------------------------------- */ // // Copyright (c) 2010 CubeSoft, Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // /* ------------------------------------------------------------------------- */ using System; using System.Security.Cryptography; using System.Text; using System.Threading.Tasks; using NUnit.Framework; namespace Cube.Net.Tests.Rss { /* --------------------------------------------------------------------- */ /// /// RssMonitorTest /// /// <summary> /// RssMonitor のテスト用クラスです。 /// </summary> /// /* --------------------------------------------------------------------- */ [TestFixture] class RssMonitorTest : FileHelper { /* ----------------------------------------------------------------- */ /// /// Start /// /// <summary> /// 監視テストを実行します。 /// </summary> /// /* ----------------------------------------------------------------- */ [Test] public async Task Start() { var uri = new Uri("http://blog.cube-soft.jp/?feed=rss2"); using (var mon = new Cube.Net.Rss.RssMonitor()) { mon.Timeout = TimeSpan.FromMilliseconds(1000); mon.CacheDirectory = Results; mon.Add(uri); mon.Start(); await Task.Delay(2000); mon.Stop(); } var path = GetPath(uri, Results); Assert.That(IO.Exists(path), Is.True); } /* ----------------------------------------------------------------- */ /// /// GetPath /// /// <summary> /// 保存用パスを取得します。 /// </summary> /// /* ----------------------------------------------------------------- */ private string GetPath(Uri uri, string directory) { var md5 = new MD5CryptoServiceProvider(); var data = Encoding.UTF8.GetBytes(uri.ToString()); var hash = md5.ComputeHash(data); var name = BitConverter.ToString(hash).ToLower().Replace("-", ""); return IO.Combine(directory, name); } } }
apache-2.0
C#
93072374a33914a840020ed18cf9d7b57c2b714f
Refactor `LogNUnitErrorOnCleanUpEventHandler`
atata-framework/atata,atata-framework/atata
src/Atata/EventHandlers/LogNUnitErrorOnCleanUpEventHandler.cs
src/Atata/EventHandlers/LogNUnitErrorOnCleanUpEventHandler.cs
namespace Atata { public class LogNUnitErrorOnCleanUpEventHandler : IEventHandler<AtataContextCleanUpEvent> { public void Handle(AtataContextCleanUpEvent eventData, AtataContext context) { dynamic testResult = NUnitAdapter.GetCurrentTestResultAdapter(); if (NUnitAdapter.IsTestResultAdapterFailed(testResult)) context.Log.Error((string)testResult.Message, (string)testResult.StackTrace); } } }
namespace Atata { public class LogNUnitErrorOnCleanUpEventHandler : IConditionalEventHandler<AtataContextCleanUpEvent> { public bool CanHandle(AtataContextCleanUpEvent eventData, AtataContext context) { dynamic testResult = NUnitAdapter.GetCurrentTestResultAdapter(); return NUnitAdapter.IsTestResultAdapterFailed(testResult); } public void Handle(AtataContextCleanUpEvent eventData, AtataContext context) { dynamic testResult = NUnitAdapter.GetCurrentTestResultAdapter(); context.Log.Error((string)testResult.Message, (string)testResult.StackTrace); } } }
apache-2.0
C#
e5a367b4ff411340e03ab210e0e78eb5d1363046
Handle icons not being located by Windows
canton7/SyncTrayzor,canton7/SyncTrayzor,canton7/SyncTrayzor
src/SyncTrayzor/Pages/ConflictResolution/ConflictViewModel.cs
src/SyncTrayzor/Pages/ConflictResolution/ConflictViewModel.cs
using Stylet; using SyncTrayzor.Services.Conflicts; using System; using System.Linq; using Pri.LongPath; using SyncTrayzor.Utils; using System.Windows.Media.Imaging; using System.Windows.Media; using System.Windows.Interop; using System.Windows; namespace SyncTrayzor.Pages.ConflictResolution { public class ConflictViewModel : PropertyChangedBase { public ConflictSet ConflictSet { get; } public string FilePath => this.ConflictSet.File.FilePath; public string FileName => Path.GetFileName(this.ConflictSet.File.FilePath); public DateTime LastModified => this.ConflictSet.File.LastModified; public string Folder => Path.GetDirectoryName(this.ConflictSet.File.FilePath); public string InnerFolder => Path.GetFileName(this.Folder); public string FolderLabel { get; } public BindableCollection<ConflictOptionViewModel> ConflictOptions { get; } public ImageSource Icon { get; } public string Size => FormatUtils.BytesToHuman(this.ConflictSet.File.SizeBytes, 1); public ConflictViewModel(ConflictSet conflictSet, string folderName) { this.ConflictSet = conflictSet; this.FolderLabel = folderName; this.ConflictOptions = new BindableCollection<ConflictOptionViewModel>(this.ConflictSet.Conflicts.Select(x => new ConflictOptionViewModel(x))); // These bindings aren't called lazilly, so don't bother being lazy using (var icon = ShellTools.GetIcon(this.ConflictSet.File.FilePath, isFile: true)) { if (icon != null) { var bs = Imaging.CreateBitmapSourceFromHIcon(icon.Handle, Int32Rect.Empty, BitmapSizeOptions.FromEmptyOptions()); bs.Freeze(); this.Icon = bs; } } } } }
using Stylet; using SyncTrayzor.Services.Conflicts; using System; using System.Linq; using Pri.LongPath; using SyncTrayzor.Utils; using System.Windows.Media.Imaging; using System.Windows.Media; using System.Windows.Interop; using System.Windows; namespace SyncTrayzor.Pages.ConflictResolution { public class ConflictViewModel : PropertyChangedBase { public ConflictSet ConflictSet { get; } public string FilePath => this.ConflictSet.File.FilePath; public string FileName => Path.GetFileName(this.ConflictSet.File.FilePath); public DateTime LastModified => this.ConflictSet.File.LastModified; public string Folder => Path.GetDirectoryName(this.ConflictSet.File.FilePath); public string InnerFolder => Path.GetFileName(this.Folder); public string FolderLabel { get; } public BindableCollection<ConflictOptionViewModel> ConflictOptions { get; } public ImageSource Icon { get; } public string Size => FormatUtils.BytesToHuman(this.ConflictSet.File.SizeBytes, 1); public ConflictViewModel(ConflictSet conflictSet, string folderName) { this.ConflictSet = conflictSet; this.FolderLabel = folderName; this.ConflictOptions = new BindableCollection<ConflictOptionViewModel>(this.ConflictSet.Conflicts.Select(x => new ConflictOptionViewModel(x))); // These bindings aren't called lazilly, so don't bother being lazy using (var icon = ShellTools.GetIcon(this.ConflictSet.File.FilePath, isFile: true)) { var bs = Imaging.CreateBitmapSourceFromHIcon(icon.Handle, Int32Rect.Empty, BitmapSizeOptions.FromEmptyOptions()); bs.Freeze(); this.Icon = bs; } } } }
mit
C#
86ed329886ff43a244b0cd1fbc1ee96322c1e5a6
Update Reprompt.cs
AreYouFreeBusy/AlexaSkillsKit.NET,dg-racing/AlexaSkillsKit.NET,dg-racing/AlexaSkillsKit.NET,AreYouFreeBusy/AlexaSkillsKit.NET,dg-racing/AlexaSkillsKit.NET,AreYouFreeBusy/AlexaSkillsKit.NET
AlexaSkillsKit.Lib/UI/Reprompt.cs
AlexaSkillsKit.Lib/UI/Reprompt.cs
// Copyright 2015 Stefan Negritoiu (FreeBusy). See LICENSE file for more information. using System; using System.Collections.Generic; namespace AlexaSkillsKit.UI { public class Reprompt { public OutputSpeech OutputSpeech { get; set; } } }
// Copyright 2015 Stefan Negritoiu (FreeBusy). See LICENSE file for more information. using System; using System.Collections.Generic; namespace AlexaSkillsKit.UI { public class Reprompt { public PlainTextOutputSpeech OutputSpeech { get; set; } } }
mit
C#
237cd48fffe065d6b9b2c4aed905e4da647574e8
Update Index.cshtml
ucdavis/Anlab,ucdavis/Anlab,ucdavis/Anlab,ucdavis/Anlab
Anlab.Mvc/Views/Home/Index.cshtml
Anlab.Mvc/Views/Home/Index.cshtml
@{ ViewData["Title"] = "Home Page"; } <div class="col-8"> <div class="alert alert-info"> <button type="button" class="close" data-dismiss="alert">×</button> Update posted: November 12, 2020<br /><br /> In response to the emergency need for the analysis of wine for smoke taint, the UC Davis Department of Viticulture and Enology is partnering with the UC Davis Analytical Lab to offer testing<br /><br /> Please click <a href="/media/pdf/anlab_smoke-taint_instructions_v2.pdf" target="_blank"><strong>here</strong> for more information on <strong> Wine Testing for Smoke Taint</strong></a>.<br /><br /> Please Note Receiving Hours: M - F, 8 - 5.<br /><br /> <strong>Please Note Important Dates<br /><br /> Wine samples will <i>not</i> be accepted during Thanksgiving week (November 23 through 27).<br /><br /> The emergency arrangement for wine testing will end in December with samples accepted through December 8th.</strong> </div> <p class="lead">The UC Davis Analytical Laboratory is a core support facility of the UC Davis College of Agriculture and Environmental Sciences.</p> <p>The laboratory is located in Hoagland Hall with a Sample Receiving area in nearby Hoagland Annex. </p> <p>The laboratory performs analyses on selected chemical constituents of soil, plant, water and waste water, and feed in support of agricultural and environmental research.</p> <p>For new clients, please note the drop-down menu under “Lab Information” which contains an “Order Completion Help” section to help guide you in creating a work order. Also helpful under the “Lab Information” drop-down menu is the “Methods of Analysis” section which provides brief descriptions of our current methods.</p> <p>Please feel free to contact the lab with any questions.</p> </div> <div class="col-4"> <address> <p>UC Davis Analytical Lab<br> University of California Davis, California <br> 95616-5270 <br> Phone: <span style="white-space: nowrap">(530) 752-0147</span> <br> Fax: <span style="white-space: nowrap">(530) 752-9892</span> <br> Email: <a href="mailto:anlab@ucdavis.edu">anlab@ucdavis.edu</a></p> <p>Receiving Hours: 8am - 5pm M - F, </br> except University holidays </br> Sample Receiving Area: Hoagland Annex, </br>Phone: 530-752-0266</p> </address> </div>
@{ ViewData["Title"] = "Home Page"; } <div class="col-8"> <div class="alert alert-info"> <button type="button" class="close" data-dismiss="alert">×</button> Update posted: September 30, 2020<br /><br /> In response to the emergency need for the analysis of wine for smoke taint, the UC Davis Department of Viticulture and Enology is partnering with the UC Davis Analytical Lab to offer testing<br /><br /> Please click <a href="/media/pdf/anlab_smoke-taint_instructions_v2.pdf" target="_blank"><strong>here</strong> for more information on <strong> Wine Testing for Smoke Taint</strong></a>.<br /><br /> Please Note Receiving Hours: M - F, 8 - 5.<br /><br /> <strong>Please Note Important Dates<br /><br /> Wine samples will <i>not</i> be accepted during Thanksgiving week (November 23 through 27).<br /><br /> The emergency arrangement for wine testing will end in December with samples accepted through December 8th.</strong> </div> <p class="lead">The UC Davis Analytical Laboratory is a core support facility of the UC Davis College of Agriculture and Environmental Sciences.</p> <p>The laboratory is located in Hoagland Hall with a Sample Receiving area in nearby Hoagland Annex. </p> <p>The laboratory performs analyses on selected chemical constituents of soil, plant, water and waste water, and feed in support of agricultural and environmental research.</p> <p>For new clients, please note the drop-down menu under “Lab Information” which contains an “Order Completion Help” section to help guide you in creating a work order. Also helpful under the “Lab Information” drop-down menu is the “Methods of Analysis” section which provides brief descriptions of our current methods.</p> <p>Please feel free to contact the lab with any questions.</p> </div> <div class="col-4"> <address> <p>UC Davis Analytical Lab<br> University of California Davis, California <br> 95616-5270 <br> Phone: <span style="white-space: nowrap">(530) 752-0147</span> <br> Fax: <span style="white-space: nowrap">(530) 752-9892</span> <br> Email: <a href="mailto:anlab@ucdavis.edu">anlab@ucdavis.edu</a></p> <p>Receiving Hours: 8am - 5pm M - F, </br> except University holidays </br> Sample Receiving Area: Hoagland Annex, </br>Phone: 530-752-0266</p> </address> </div>
mit
C#
b06cbbb78d06d577eba7d58c4e7bb2b3ce84dda3
format file
kevbite/CompaniesHouse.NET,LiberisLabs/CompaniesHouse.NET
src/LiberisLabs.CompaniesHouse.Tests/ResourceBuilders/FilingHistoryItem.cs
src/LiberisLabs.CompaniesHouse.Tests/ResourceBuilders/FilingHistoryItem.cs
using System; using System.Collections.Generic; namespace LiberisLabs.CompaniesHouse.Tests.ResourceBuilders { public class FilingHistoryItem { public string Category { get; set; } public string Subcategory { get; set; } public string TransactionId { get; set; } public string FilingType { get; set; } public string Barcode { get; set; } public DateTime DateOfProcessing { get; set; } public string Description { get; set; } public Dictionary<string, string> DescriptionValues { get; set; } public int PageCount { get; set; } public bool PaperFiled { get; set; } public FilingHistoryItemAnnotation[] Annotations { get; set; } public FilingHistoryItemAssociatedFiling[] AssociatedFilings { get; set; } public FilingHistoryItemResolution[] Resolutions { get; set; } public CompanyFillingLinks Links { get; set; } } }
using System; using System.Collections.Generic; namespace LiberisLabs.CompaniesHouse.Tests.ResourceBuilders { public class FilingHistoryItem { public string Category { get; set; } public string Subcategory { get; set; } public string TransactionId { get; set; } public string FilingType { get; set; } public string Barcode { get; set; } public DateTime DateOfProcessing { get; set; } public string Description { get; set; } public Dictionary<string,string> DescriptionValues { get; set; } public int PageCount { get; set; } public bool PaperFiled { get; set; } public FilingHistoryItemAnnotation[] Annotations { get; set; } public FilingHistoryItemAssociatedFiling[] AssociatedFilings { get; set; } public FilingHistoryItemResolution[] Resolutions { get; set; } public CompanyFillingLinks Links { get; set; } } }
mit
C#
bb1b49cc1c8fc21b7d1d6fac44d59b39dad46950
Fix PoliCheck violations.
aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore
src/Microsoft.AspNet.DataProtection/Repositories/EphemeralXmlRepository.cs
src/Microsoft.AspNet.DataProtection/Repositories/EphemeralXmlRepository.cs
// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; using System.Collections.Generic; using System.Linq; using System.Xml.Linq; using Microsoft.Framework.Internal; using Microsoft.Framework.Logging; namespace Microsoft.AspNet.DataProtection.Repositories { /// <summary> /// An ephemeral XML repository backed by process memory. This class must not be used for /// anything other than dev scenarios as the keys will not be persisted to storage. /// </summary> internal class EphemeralXmlRepository : IXmlRepository { private readonly List<XElement> _storedElements = new List<XElement>(); public EphemeralXmlRepository(IServiceProvider services) { var logger = services?.GetLogger<EphemeralXmlRepository>(); if (logger.IsWarningLevelEnabled()) { logger.LogWarning("Using an in-memory repository. Keys will not be persisted to storage."); } } public virtual IReadOnlyCollection<XElement> GetAllElements() { // force complete enumeration under lock for thread safety lock (_storedElements) { return GetAllElementsCore().ToList().AsReadOnly(); } } private IEnumerable<XElement> GetAllElementsCore() { // this method must be called under lock foreach (XElement element in _storedElements) { yield return new XElement(element); // makes a deep copy so caller doesn't inadvertently modify it } } public virtual void StoreElement([NotNull] XElement element, string friendlyName) { XElement cloned = new XElement(element); // makes a deep copy so caller doesn't inadvertently modify it // under lock for thread safety lock (_storedElements) { _storedElements.Add(cloned); } } } }
// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; using System.Collections.Generic; using System.Linq; using System.Xml.Linq; using Microsoft.Framework.Internal; using Microsoft.Framework.Logging; namespace Microsoft.AspNet.DataProtection.Repositories { /// <summary> /// An ephemeral XML repository backed by process memory. This class must not be used for /// anything other than dev scenarios as the keys will not be persisted to storage. /// </summary> internal class EphemeralXmlRepository : IXmlRepository { private readonly List<XElement> _storedElements = new List<XElement>(); public EphemeralXmlRepository(IServiceProvider services) { var logger = services?.GetLogger<EphemeralXmlRepository>(); if (logger.IsWarningLevelEnabled()) { logger.LogWarning("Using an in-memory repository. Keys will not be persisted to storage."); } } public virtual IReadOnlyCollection<XElement> GetAllElements() { // force complete enumeration under lock to avoid races lock (_storedElements) { return GetAllElementsCore().ToList().AsReadOnly(); } } private IEnumerable<XElement> GetAllElementsCore() { // this method must be called under lock foreach (XElement element in _storedElements) { yield return new XElement(element); // makes a deep copy so caller doesn't inadvertently modify it } } public virtual void StoreElement([NotNull] XElement element, string friendlyName) { XElement cloned = new XElement(element); // makes a deep copy so caller doesn't inadvertently modify it // under lock to avoid races lock (_storedElements) { _storedElements.Add(cloned); } } } }
apache-2.0
C#
721bf1ca24d7e84fd58d77185fb49339f3021b74
Update version.
Grabacr07/KanColleViewer
source/Grabacr07.KanColleViewer/Properties/AssemblyInfo.cs
source/Grabacr07.KanColleViewer/Properties/AssemblyInfo.cs
using System.Reflection; using System.Runtime.InteropServices; using System.Windows; [assembly: AssemblyTitle("提督業も忙しい!")] [assembly: AssemblyDescription("提督業も忙しい!")] [assembly: AssemblyCompany("grabacr.net")] [assembly: AssemblyProduct("KanColleViewer")] [assembly: AssemblyCopyright("Copyright © 2013 Grabacr07")] [assembly: ComVisible(false)] [assembly: Guid("101B49A6-7E7B-422D-95FF-500F9EF483A8")] [assembly: ThemeInfo( ResourceDictionaryLocation.None, ResourceDictionaryLocation.SourceAssembly)] [assembly: AssemblyVersion("4.2.11.0")]
using System.Reflection; using System.Runtime.InteropServices; using System.Windows; [assembly: AssemblyTitle("提督業も忙しい!")] [assembly: AssemblyDescription("提督業も忙しい!")] [assembly: AssemblyCompany("grabacr.net")] [assembly: AssemblyProduct("KanColleViewer")] [assembly: AssemblyCopyright("Copyright © 2013 Grabacr07")] [assembly: ComVisible(false)] [assembly: Guid("101B49A6-7E7B-422D-95FF-500F9EF483A8")] [assembly: ThemeInfo( ResourceDictionaryLocation.None, ResourceDictionaryLocation.SourceAssembly)] [assembly: AssemblyVersion("4.2.10.0")]
mit
C#
a8e00a9675e912a57bb494c028e5d48f10bd0d5b
Disable logging for shutdown of dotnet process by default
nuke-build/nuke,nuke-build/nuke,nuke-build/nuke,nuke-build/nuke
source/Nuke.Common/CI/ShutdownDotNetBuildServerOnFinish.cs
source/Nuke.Common/CI/ShutdownDotNetBuildServerOnFinish.cs
// Copyright 2020 Maintainers of NUKE. // Distributed under the MIT License. // https://github.com/nuke-build/nuke/blob/master/LICENSE using System; using System.Linq; using JetBrains.Annotations; using Nuke.Common.Execution; using Nuke.Common.Tools.DotNet; namespace Nuke.Common.CI { [PublicAPI] [AttributeUsage(AttributeTargets.Class)] public class ShutdownDotNetBuildServerOnFinish : Attribute, IOnBuildFinished { public bool EnableLogging { get; set; } public void OnBuildFinished(NukeBuild build) { // Note https://github.com/dotnet/cli/issues/11424 DotNetTasks.DotNet("build-server shutdown", logInvocation: EnableLogging, logOutput: EnableLogging); } } }
// Copyright 2020 Maintainers of NUKE. // Distributed under the MIT License. // https://github.com/nuke-build/nuke/blob/master/LICENSE using System; using System.Linq; using JetBrains.Annotations; using Nuke.Common.Execution; using Nuke.Common.Tools.DotNet; namespace Nuke.Common.CI { [PublicAPI] [AttributeUsage(AttributeTargets.Class)] public class ShutdownDotNetBuildServerOnFinish : Attribute, IOnBuildFinished { public void OnBuildFinished(NukeBuild build) { // Note https://github.com/dotnet/cli/issues/11424 DotNetTasks.DotNet("build-server shutdown"); } } }
mit
C#
698034f36b9820341eb8c43cebb7505190867198
remove redundant #if
xbehave/xbehave.net,mvalipour/xbehave.net,hitesh97/xbehave.net,adamralph/xbehave.net,modulexcite/xbehave.net,modulexcite/xbehave.net,mvalipour/xbehave.net,hitesh97/xbehave.net
src/Xbehave.2.Execution.desktop/ScenarioOutlineTestCase.cs
src/Xbehave.2.Execution.desktop/ScenarioOutlineTestCase.cs
// <copyright file="ScenarioOutlineTestCase.cs" company="xBehave.net contributors"> // Copyright (c) xBehave.net contributors. All rights reserved. // </copyright> namespace Xbehave.Execution { using System; using System.ComponentModel; using System.Threading; using System.Threading.Tasks; using Xunit.Abstractions; using Xunit.Sdk; [Serializable] public class ScenarioOutlineTestCase : XunitTestCase { public ScenarioOutlineTestCase( IMessageSink diagnosticMessageSink, TestMethodDisplay defaultMethodDisplay, ITestMethod testMethod) : base(diagnosticMessageSink, defaultMethodDisplay, testMethod, null) { } [EditorBrowsable(EditorBrowsableState.Never)] [Obsolete("Called by the de-serializer", true)] public ScenarioOutlineTestCase() { } public override async Task<RunSummary> RunAsync( IMessageSink diagnosticMessageSink, IMessageBus messageBus, object[] constructorArguments, ExceptionAggregator aggregator, CancellationTokenSource cancellationTokenSource) { return await new ScenarioOutlineTestCaseRunner( diagnosticMessageSink, this, this.DisplayName, this.SkipReason, constructorArguments, messageBus, aggregator, cancellationTokenSource) .RunAsync(); } } }
// <copyright file="ScenarioOutlineTestCase.cs" company="xBehave.net contributors"> // Copyright (c) xBehave.net contributors. All rights reserved. // </copyright> namespace Xbehave.Execution { using System; using System.ComponentModel; using System.Threading; using System.Threading.Tasks; #if WPA81 || WINDOWS_PHONE using Xbehave.Execution.Shims; using Xunit; #endif using Xunit.Abstractions; using Xunit.Sdk; [Serializable] public class ScenarioOutlineTestCase : XunitTestCase { public ScenarioOutlineTestCase( IMessageSink diagnosticMessageSink, TestMethodDisplay defaultMethodDisplay, ITestMethod testMethod) : base(diagnosticMessageSink, defaultMethodDisplay, testMethod, null) { } [EditorBrowsable(EditorBrowsableState.Never)] [Obsolete("Called by the de-serializer", true)] public ScenarioOutlineTestCase() { } public override async Task<RunSummary> RunAsync( IMessageSink diagnosticMessageSink, IMessageBus messageBus, object[] constructorArguments, ExceptionAggregator aggregator, CancellationTokenSource cancellationTokenSource) { return await new ScenarioOutlineTestCaseRunner( diagnosticMessageSink, this, this.DisplayName, this.SkipReason, constructorArguments, messageBus, aggregator, cancellationTokenSource) .RunAsync(); } } }
mit
C#
65346441a82248c4189fc1415d0ea9d4cb8e7b25
clean up WD factory tests
rcasady616/Selenium.WeDriver.Equip,rcasady616/Selenium.WeDriver.Equip
Selenium.WebDriver.Equip.Tests/IWebDriverFactoryRemoteTests.cs
Selenium.WebDriver.Equip.Tests/IWebDriverFactoryRemoteTests.cs
using NUnit.Framework; using NUnit.Framework.Interfaces; using OpenQA.Selenium; using OpenQA.Selenium.Remote; using System; namespace Selenium.WebDriver.Equip.Tests { [TestFixture] public class IWebDriverFactoryRemoteTests { private IWebDriver _driver; [SetUp] public void SetupTest() { } [TearDown] public void TearDown() { if (_driver != null) { var passed = (TestContext.CurrentContext.Result.Outcome == ResultState.Success); try { ((IJavaScriptExecutor)_driver).ExecuteScript("sauce:job-result=" + (passed ? "passed" : "failed")); } finally { if (_driver != null) _driver.Quit(); } } } [Test] public void GetRemoteWebDriverFirefoxTest() { try { EnvironmentManager.Instance.RemoteServer.Start(); _driver = WebDriverFactory.GetRemoteWebDriver("Firefox", "http://rickcasady.blogspot.com/"); Assert.AreEqual(typeof(RemoteWebDriver), _driver.GetType()); } catch (Exception ex) { throw ex; } finally { _driver.Quit(); EnvironmentManager.Instance.RemoteServer.Stop(); } } [Test] public void GetSauceTest() { _driver = WebDriverFactory.GetSauceDriver(TestContext.CurrentContext.Test.Name, url: "http://rickcasady.blogspot.com/"); Assert.AreEqual(typeof(RemoteWebDriver), _driver.GetType()); } } }
using NUnit.Framework; using NUnit.Framework.Interfaces; using OpenQA.Selenium; using OpenQA.Selenium.Remote; namespace Selenium.WebDriver.Equip.Tests { [TestFixture] public class IWebDriverFactoryRemoteTests { private IWebDriver _driver; [SetUp] public void SetupTest() { } [TearDown] public void TearDown() { if (_driver != null) { var passed = (TestContext.CurrentContext.Result.Outcome == ResultState.Success); try { ((IJavaScriptExecutor) _driver).ExecuteScript("sauce:job-result=" + (passed ? "passed" : "failed")); } finally { if (_driver != null) _driver.Quit(); } } } [Test] public void GetRemoteWebDriverFirefoxTest() { _driver = WebDriverFactory.GetRemoteWebDriver("firefox", "http://rickcasady.blogspot.com/"); Assert.AreEqual(typeof(RemoteWebDriver), _driver.GetType()); } [Test] public void GetSauceTest() { _driver = WebDriverFactory.GetSauceDriver(TestContext.CurrentContext.Test.Name, url: "http://rickcasady.blogspot.com/"); Assert.AreEqual(typeof(RemoteWebDriver), _driver.GetType()); } } }
mit
C#
ce7a7c7041096b65dcdbce8f7f7daf2978043c5d
change container.Register to container.Collection.Register
jbogard/MediatR
samples/MediatR.Examples.SimpleInjector/Program.cs
samples/MediatR.Examples.SimpleInjector/Program.cs
using System.IO; using System.Threading.Tasks; using MediatR.Pipeline; namespace MediatR.Examples.SimpleInjector { using System; using System.Collections.Generic; using System.Linq; using System.Reflection; using global::SimpleInjector; internal class Program { private static Task Main(string[] args) { var writer = new WrappingWriter(Console.Out); var mediator = BuildMediator(writer); return Runner.Run(mediator, writer, "SimpleInjector"); } private static IMediator BuildMediator(WrappingWriter writer) { var container = new Container(); var assemblies = GetAssemblies().ToArray(); container.RegisterSingleton<IMediator, Mediator>(); container.Register(typeof(IRequestHandler<,>), assemblies); // we have to do this because by default, generic type definitions (such as the Constrained Notification Handler) won't be registered var notificationHandlerTypes = container.GetTypesToRegister(typeof(INotificationHandler<>), assemblies, new TypesToRegisterOptions { IncludeGenericTypeDefinitions = true, IncludeComposites = false, }); container.Register(typeof(INotificationHandler<>), notificationHandlerTypes); container.Register(() => (TextWriter)writer, Lifestyle.Singleton); //Pipeline container.Collection.Register(typeof(IPipelineBehavior<,>), new [] { typeof(RequestPreProcessorBehavior<,>), typeof(RequestPostProcessorBehavior<,>), typeof(GenericPipelineBehavior<,>) }); container.Collection.Register(typeof(IRequestPreProcessor<>), new [] { typeof(GenericRequestPreProcessor<>) }); container.Collection.Register(typeof(IRequestPostProcessor<,>), new[] { typeof(GenericRequestPostProcessor<,>), typeof(ConstrainedRequestPostProcessor<,>) }); container.Register(() => new ServiceFactory(container.GetInstance), Lifestyle.Singleton); container.Verify(); var mediator = container.GetInstance<IMediator>(); return mediator; } private static IEnumerable<Assembly> GetAssemblies() { yield return typeof(IMediator).GetTypeInfo().Assembly; yield return typeof(Ping).GetTypeInfo().Assembly; } } }
using System.IO; using System.Threading.Tasks; using MediatR.Pipeline; namespace MediatR.Examples.SimpleInjector { using System; using System.Collections.Generic; using System.Linq; using System.Reflection; using global::SimpleInjector; internal class Program { private static Task Main(string[] args) { var writer = new WrappingWriter(Console.Out); var mediator = BuildMediator(writer); return Runner.Run(mediator, writer, "SimpleInjector"); } private static IMediator BuildMediator(WrappingWriter writer) { var container = new Container(); var assemblies = GetAssemblies().ToArray(); container.RegisterSingleton<IMediator, Mediator>(); container.Register(typeof(IRequestHandler<,>), assemblies); // we have to do this because by default, generic type definitions (such as the Constrained Notification Handler) won't be registered var notificationHandlerTypes = container.GetTypesToRegister(typeof(INotificationHandler<>), assemblies, new TypesToRegisterOptions { IncludeGenericTypeDefinitions = true, IncludeComposites = false, }); container.Register(typeof(INotificationHandler<>), notificationHandlerTypes); container.Register(() => (TextWriter)writer, Lifestyle.Singleton); //Pipeline container.Register(typeof(IPipelineBehavior<,>), new [] { typeof(RequestPreProcessorBehavior<,>), typeof(RequestPostProcessorBehavior<,>), typeof(GenericPipelineBehavior<,>) }); container.Register(typeof(IRequestPreProcessor<>), new [] { typeof(GenericRequestPreProcessor<>) }); container.Register(typeof(IRequestPostProcessor<,>), new[] { typeof(GenericRequestPostProcessor<,>), typeof(ConstrainedRequestPostProcessor<,>) }); container.Register(() => new ServiceFactory(container.GetInstance), Lifestyle.Singleton); container.Verify(); var mediator = container.GetInstance<IMediator>(); return mediator; } private static IEnumerable<Assembly> GetAssemblies() { yield return typeof(IMediator).GetTypeInfo().Assembly; yield return typeof(Ping).GetTypeInfo().Assembly; } } }
apache-2.0
C#
739a54a41b667aa5aa54f1135fb46ce7ee27944d
Split WCF functionality out of Autofac.Extras.Multitenant into a separate assembly/package, Autofac.Extras.Multitenant.Wcf. Both packages are versioned 3.1.0.
autofac/Autofac.Extras.NHibernate
Properties/VersionAssemblyInfo.cs
Properties/VersionAssemblyInfo.cs
//------------------------------------------------------------------------------ // <auto-generated> // This code was generated by a tool. // Runtime Version:4.0.30319.18051 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. // </auto-generated> //------------------------------------------------------------------------------ using System; using System.Reflection; using System.Resources; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; [assembly: AssemblyVersion("3.0.0.0")] [assembly: AssemblyFileVersion("3.0.0.0")] [assembly: AssemblyConfiguration("Release built on 2013-12-03 10:23")] [assembly: AssemblyCopyright("Copyright © 2013 Autofac Contributors")] [assembly: AssemblyDescription("Autofac.Extras.NHibernate 3.0.0")]
//------------------------------------------------------------------------------ // <auto-generated> // This code was generated by a tool. // Runtime Version:4.0.30319.34003 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. // </auto-generated> //------------------------------------------------------------------------------ using System; using System.Reflection; using System.Resources; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; [assembly: AssemblyVersion("3.0.0.0")] [assembly: AssemblyFileVersion("3.0.0.0")] [assembly: AssemblyConfiguration("Release built on 2013-10-23 22:48")] [assembly: AssemblyCopyright("Copyright © 2013 Autofac Contributors")] [assembly: AssemblyDescription("Autofac.Extras.NHibernate 3.0.0")]
mit
C#
64dba8130e09cbb9444ad2940b6a683504e70991
Fix HtmlBlockPage namespaces.
janabimustafa/waslibs,pellea/waslibs,wasteam/waslibs,wasteam/waslibs,janabimustafa/waslibs,pellea/waslibs,janabimustafa/waslibs,wasteam/waslibs,pellea/waslibs
samples/AppStudio.Uwp.Samples/Pages/HtmlBlock/HtmlBlockSettings.xaml.cs
samples/AppStudio.Uwp.Samples/Pages/HtmlBlock/HtmlBlockSettings.xaml.cs
using Windows.UI.Xaml.Controls; namespace AppStudio.Uwp.Samples { sealed partial class HtmlBlockSettings : UserControl { public HtmlBlockSettings() { this.InitializeComponent(); } } }
using AppStudio.Uwp.Controls; using AppStudio.Uwp.Samples.Pages.HtmlBlock; using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Runtime.InteropServices.WindowsRuntime; using Windows.Foundation; using Windows.Foundation.Collections; using Windows.UI.Xaml; using Windows.UI.Xaml.Controls; using Windows.UI.Xaml.Controls.Primitives; using Windows.UI.Xaml.Data; using Windows.UI.Xaml.Input; using Windows.UI.Xaml.Media; using Windows.UI.Xaml.Navigation; namespace AppStudio.Uwp.Samples { sealed partial class HtmlBlockSettings : UserControl { public HtmlBlockSettings() { this.InitializeComponent(); } } }
mit
C#
64bf571fb3559bf2d471eda774d762e1da65d081
Update Genre Create View to use GenreCreateViewModel.
Programazing/Open-School-Library,Programazing/Open-School-Library
src/Open-School-Library/Views/Genres/Create.cshtml
src/Open-School-Library/Views/Genres/Create.cshtml
@model Open_School_Library.Models.GenreViewModels.GenreCreateViewModel @{ ViewData["Title"] = "Create"; } <h2>Create</h2> <form asp-action="Create"> <div class="form-horizontal"> <h4>Genre</h4> <hr /> <div asp-validation-summary="ModelOnly" class="text-danger"></div> <div class="form-group"> <label asp-for="Name" class="col-md-2 control-label"></label> <div class="col-md-10"> <input asp-for="Name" class="form-control" /> <span asp-validation-for="Name" class="text-danger" /> </div> </div> <div class="form-group"> <div class="col-md-offset-2 col-md-10"> <input type="submit" value="Create" class="btn btn-default" /> </div> </div> </div> </form> <div> <a asp-action="Index">Back to List</a> </div> @section Scripts { @{await Html.RenderPartialAsync("_ValidationScriptsPartial");} }
@model Open_School_Library.Models.DatabaseModels.Genre @{ ViewData["Title"] = "Create"; } <h2>Create</h2> <form asp-action="Create"> <div class="form-horizontal"> <h4>Genre</h4> <hr /> <div asp-validation-summary="ModelOnly" class="text-danger"></div> <div class="form-group"> <label asp-for="Name" class="col-md-2 control-label"></label> <div class="col-md-10"> <input asp-for="Name" class="form-control" /> <span asp-validation-for="Name" class="text-danger" /> </div> </div> <div class="form-group"> <div class="col-md-offset-2 col-md-10"> <input type="submit" value="Create" class="btn btn-default" /> </div> </div> </div> </form> <div> <a asp-action="Index">Back to List</a> </div> @section Scripts { @{await Html.RenderPartialAsync("_ValidationScriptsPartial");} }
mit
C#
900e37132abb26d87d51552cac4e3678dc1498af
Edit Homepage
stefanatoader/TeaSk,stefanatoader/TeaSk,stefanatoader/TeaSk
TeaSk.Web/Views/Home/Index.cshtml
TeaSk.Web/Views/Home/Index.cshtml
@{ ViewBag.Title = "Home page"; } <div> <div class="jumbotron"> <h1>TeaSk</h1> <p class="lead"> TeaSk is a Corporate Training & Consulting site. Our unique approach that takes into account, your technology roadmap, knowledge goals and our unparalleled domain strength makes us your best choice for Learning things. </p> </div> <div class="row"> <div class="col-md-4"> <h2>Getting started</h2> <p> We believe in customizing and developing specific skills through a collaborative events designed to identify your needs, requirements and objectives. </p> <p><a class="btn btn-default" href="/account/login">Edit your skills &raquo;</a></p> </div> <div class="col-md-4"> <h2>Calendar</h2> <p>An easy way that makes it easy to add, remove, and update your preferences and tools in Visual Studio projects.</p> <p><a class="btn btn-default" href="/home/events">See the calendar &raquo;</a></p> </div> <div class="col-md-4"> <h2>What WE offer</h2> <p>You can easily find a company event that offers the right mix of good information for your needs.</p> <p><a class="btn btn-default" href="/home/events">Learn more &raquo;</a></p> </div> </div> </div>
@{ ViewBag.Title = "Home page"; } <div> <div class="jumbotron"> <h1>TeaSk</h1> <p class="lead"> TeaSk is a Corporate Training & Consulting site. Our unique approach that takes into account, your technology roadmap, knowledge goals and our unparalleled domain strength makes us your best choice for Learning things. </p> </div> <div class="row"> <div class="col-md-4"> <h2>Getting started</h2> <p> We believe in customizing and developing specific skills through a collaborative events designed to identify your needs, requirements and objectives. </p> <p><a class="btn btn-default" href="/home/login">Edit your skills &raquo;</a></p> </div> <div class="col-md-4"> <h2>Calendar</h2> <p>An easy way that makes it easy to add, remove, and update your preferences and tools in Visual Studio projects.</p> <p><a class="btn btn-default" href="/home/events">See the calendar &raquo;</a></p> </div> <div class="col-md-4"> <h2>What WE offer</h2> <p>You can easily find a company event that offers the right mix of good information for your needs.</p> <p><a class="btn btn-default" href="/home/events">Learn more &raquo;</a></p> </div> </div> </div>
mit
C#
059e1143f783a2948035f56165df0ab15a930a8c
Add tagging capability to Dinamico news page
nicklv/n2cms,SntsDev/n2cms,VoidPointerAB/n2cms,n2cms/n2cms,nimore/n2cms,DejanMilicic/n2cms,EzyWebwerkstaden/n2cms,DejanMilicic/n2cms,EzyWebwerkstaden/n2cms,nicklv/n2cms,n2cms/n2cms,EzyWebwerkstaden/n2cms,nicklv/n2cms,nimore/n2cms,bussemac/n2cms,n2cms/n2cms,SntsDev/n2cms,EzyWebwerkstaden/n2cms,VoidPointerAB/n2cms,bussemac/n2cms,bussemac/n2cms,n2cms/n2cms,SntsDev/n2cms,EzyWebwerkstaden/n2cms,bussemac/n2cms,nicklv/n2cms,nimore/n2cms,DejanMilicic/n2cms,SntsDev/n2cms,nicklv/n2cms,VoidPointerAB/n2cms,VoidPointerAB/n2cms,DejanMilicic/n2cms,bussemac/n2cms,nimore/n2cms
src/Mvc/Dinamico/Dinamico/Themes/Default/Views/ContentPages/News.cshtml
src/Mvc/Dinamico/Dinamico/Themes/Default/Views/ContentPages/News.cshtml
@model Dinamico.Models.ContentPage @{ Content.Define(re => { re.Title = "News page"; re.IconUrl = "{IconsUrl}/newspaper.png"; re.DefaultValue("Visible", false); re.RestrictParents("Container"); re.Sort(N2.Definitions.SortBy.PublishedDescending); re.Tags("Tags"); }); } @Html.Partial("LayoutPartials/BlogContent") @using (Content.BeginScope(Content.Traverse.Parent())) { @Content.Render.Tokens("NewsFooter") }
@model Dinamico.Models.ContentPage @{ Content.Define(re => { re.Title = "News page"; re.IconUrl = "{IconsUrl}/newspaper.png"; re.DefaultValue("Visible", false); re.RestrictParents("Container"); re.Sort(N2.Definitions.SortBy.PublishedDescending); }); } @Html.Partial("LayoutPartials/BlogContent") @using (Content.BeginScope(Content.Traverse.Parent())) { @Content.Render.Tokens("NewsFooter") }
lgpl-2.1
C#
9e1ec70e2dbd79724f074a651c0bcca0bd27d9d6
Fix DreamDaemonLaunchParameters matching.
tgstation/tgstation-server-tools,tgstation/tgstation-server,tgstation/tgstation-server
src/Tgstation.Server.Api/Models/Internal/DreamDaemonLaunchParameters.cs
src/Tgstation.Server.Api/Models/Internal/DreamDaemonLaunchParameters.cs
using System; using System.ComponentModel.DataAnnotations; namespace Tgstation.Server.Api.Models.Internal { /// <summary> /// Launch settings for DreamDaemon /// </summary> public class DreamDaemonLaunchParameters { /// <summary> /// If the BYOND web client can be used to connect to the game server /// </summary> [Required] public bool? AllowWebClient { get; set; } /// <summary> /// The <see cref="DreamDaemonSecurity"/> level of <see cref="DreamDaemon"/> /// </summary> [Required] [EnumDataType(typeof(DreamDaemonSecurity))] public DreamDaemonSecurity? SecurityLevel { get; set; } /// <summary> /// The first port <see cref="DreamDaemon"/> uses. This should be the publically advertised port /// </summary> [Required] [Range(1, 65535)] public ushort? PrimaryPort { get; set; } /// <summary> /// The second port <see cref="DreamDaemon"/> uses /// </summary> [Required] [Range(1, 65535)] public ushort? SecondaryPort { get; set; } /// <summary> /// The DreamDaemon startup timeout in seconds /// </summary> [Required] public uint? StartupTimeout { get; set; } /// <summary> /// The number of seconds between each watchdog heartbeat. 0 disables. /// </summary> [Required] public uint? HeartbeatSeconds { get; set; } /// <summary> /// Check if we match a given set of <paramref name="otherParameters"/> /// </summary> /// <param name="otherParameters">The <see cref="DreamDaemonLaunchParameters"/> to compare against</param> /// <returns><see langword="true"/> if they match, <see langword="false"/> otherwise</returns> public bool Match(DreamDaemonLaunchParameters otherParameters) => AllowWebClient == (otherParameters?.AllowWebClient ?? throw new ArgumentNullException(nameof(otherParameters))) && SecurityLevel == otherParameters.SecurityLevel && PrimaryPort == otherParameters.PrimaryPort && SecondaryPort == otherParameters.SecondaryPort && StartupTimeout == otherParameters.StartupTimeout && HeartbeatSeconds == otherParameters.HeartbeatSeconds; } }
using System; using System.ComponentModel.DataAnnotations; namespace Tgstation.Server.Api.Models.Internal { /// <summary> /// Launch settings for DreamDaemon /// </summary> public class DreamDaemonLaunchParameters { /// <summary> /// If the BYOND web client can be used to connect to the game server /// </summary> [Required] public bool? AllowWebClient { get; set; } /// <summary> /// The <see cref="DreamDaemonSecurity"/> level of <see cref="DreamDaemon"/> /// </summary> [Required] [EnumDataType(typeof(DreamDaemonSecurity))] public DreamDaemonSecurity? SecurityLevel { get; set; } /// <summary> /// The first port <see cref="DreamDaemon"/> uses. This should be the publically advertised port /// </summary> [Required] [Range(1, 65535)] public ushort? PrimaryPort { get; set; } /// <summary> /// The second port <see cref="DreamDaemon"/> uses /// </summary> [Required] [Range(1, 65535)] public ushort? SecondaryPort { get; set; } /// <summary> /// The DreamDaemon startup timeout in seconds /// </summary> [Required] public uint? StartupTimeout { get; set; } /// <summary> /// The number of seconds between each watchdog heartbeat. 0 disables. /// </summary> [Required] public uint? HeartbeatSeconds { get; set; } /// <summary> /// Check if we match a given set of <paramref name="otherParameters"/> /// </summary> /// <param name="otherParameters">The <see cref="DreamDaemonLaunchParameters"/> to compare against</param> /// <returns><see langword="true"/> if they match, <see langword="false"/> otherwise</returns> public bool Match(DreamDaemonLaunchParameters otherParameters) => AllowWebClient == (otherParameters?.AllowWebClient ?? throw new ArgumentNullException(nameof(otherParameters))) && SecurityLevel == otherParameters.SecurityLevel && PrimaryPort == otherParameters.PrimaryPort && SecondaryPort == otherParameters.SecondaryPort && StartupTimeout == otherParameters.StartupTimeout; } }
agpl-3.0
C#
1da70343b1b50633dc888c1af5eb91260d36f169
添加框架版本实例!
Mozlite/Mozlite.Core,Mozlite/Mozlite.Core
src/Mozlite.Core/CoreInfo.cs
src/Mozlite.Core/CoreInfo.cs
using System; using System.Reflection; using System.Runtime.Versioning; using Microsoft.Extensions.PlatformAbstractions; namespace Mozlite { /// <summary> /// 核心信息。 /// </summary> public class CoreInfo { private CoreInfo() { Version = Assembly.GetEntryAssembly().GetName().Version; FrameworkName = PlatformServices.Default.Application.RuntimeFramework; } /// <summary> /// 获取环境变量。 /// </summary> public static CoreInfo Default { get; } = new CoreInfo(); /// <summary> /// 版本。 /// </summary> public Version Version { get; } /// <summary> /// 框架版本。 /// </summary> public FrameworkName FrameworkName { get; } } }
using System; using System.Reflection; namespace Mozlite { /// <summary> /// 核心信息。 /// </summary> public class CoreInfo { private CoreInfo() { Version = Assembly.GetEntryAssembly().GetName().Version; } /// <summary> /// 获取环境变量。 /// </summary> public static CoreInfo Default { get; } = new CoreInfo(); /// <summary> /// 版本。 /// </summary> public Version Version { get; } } }
bsd-2-clause
C#
a93fb305664b16cedaca11a91a50c1dbadaa259a
Test list insert, remove in stdlib-list test
jonathanvdc/flame-llvm,jonathanvdc/flame-llvm,jonathanvdc/flame-llvm
tests/stdlib-list/stdlib-list.cs
tests/stdlib-list/stdlib-list.cs
using System; using System.Collections.Generic; public static class Program { public static void Main() { var list = new List<int>(); list.Add(10); list.Add(42); list.Insert(0, 90); list.Remove(90); Console.Write(list[0]); for (int i = 1; i < list.Count; i++) { Console.Write(' '); Console.Write(list[i]); } Console.WriteLine(); } }
using System; using System.Collections.Generic; public static class Program { public static void Main() { var list = new List<int>(); list.Add(10); list.Add(42); Console.Write(list[0]); for (int i = 1; i < list.Count; i++) { Console.Write(' '); Console.Write(list[i]); } Console.WriteLine(); } }
mit
C#
fbbec50a34e54968694af72b130718ec5b80ebfa
update db initializer with new categories
noordwind/Coolector.Services.Remarks,noordwind/Collectively.Services.Remarks,noordwind/Collectively.Services.Remarks,noordwind/Coolector.Services.Remarks
Coolector.Services.Remarks/Framework/DatabaseInitializer.cs
Coolector.Services.Remarks/Framework/DatabaseInitializer.cs
using System.Collections.Generic; using System.Threading.Tasks; using Coolector.Common.Mongo; using Coolector.Services.Remarks.Domain; using Coolector.Services.Remarks.Repositories.Queries; using MongoDB.Driver; using Tag = Coolector.Services.Remarks.Domain.Tag; namespace Coolector.Services.Remarks.Framework { public class DatabaseSeeder : IDatabaseSeeder { private readonly IMongoDatabase _database; public DatabaseSeeder(IMongoDatabase database) { _database = database; } public async Task SeedAsync() { if (await _database.Remarks().AsQueryable().AnyAsync() == false) { var index = new IndexKeysDefinitionBuilder<Remark>().Geo2DSphere(x => x.Location); await _database.Remarks().Indexes.CreateOneAsync(index); } if (await _database.Categories().AsQueryable().AnyAsync()) return; await _database.Categories().InsertOneAsync(new Category("defect")); await _database.Categories().InsertOneAsync(new Category("issue")); await _database.Categories().InsertOneAsync(new Category("suggestion")); await _database.Categories().InsertOneAsync(new Category("praise")); await _database.LocalizedResources().InsertOneAsync(new LocalizedResource("facebook:new_remark", "en-gb", "I've just sent a new remark using Coolector. You can see it here: {0}")); await _database.LocalizedResources().InsertOneAsync(new LocalizedResource("facebook:new_remark", "pl-pl", "Nowe zgłoszenie zostało przeze mnie dodane za pomocą Coolector. Możesz je zobaczyć tutaj: {0}")); var tags = new List<Tag> { new Tag("junk"), new Tag("small"), new Tag("medium"), new Tag("big"), new Tag("crash"), new Tag("stink"), new Tag("dirty"), new Tag("glass"), new Tag("plastic") }; await _database.Tags().InsertManyAsync(tags); } } }
using System.Collections.Generic; using System.Threading.Tasks; using Coolector.Common.Mongo; using Coolector.Services.Remarks.Domain; using Coolector.Services.Remarks.Repositories.Queries; using MongoDB.Driver; using Tag = Coolector.Services.Remarks.Domain.Tag; namespace Coolector.Services.Remarks.Framework { public class DatabaseSeeder : IDatabaseSeeder { private readonly IMongoDatabase _database; public DatabaseSeeder(IMongoDatabase database) { _database = database; } public async Task SeedAsync() { if (await _database.Remarks().AsQueryable().AnyAsync() == false) { var index = new IndexKeysDefinitionBuilder<Remark>().Geo2DSphere(x => x.Location); await _database.Remarks().Indexes.CreateOneAsync(index); } if (await _database.Categories().AsQueryable().AnyAsync()) return; await _database.Categories().InsertOneAsync(new Category("litter")); await _database.Categories().InsertOneAsync(new Category("damages")); await _database.Categories().InsertOneAsync(new Category("accidents")); await _database.LocalizedResources().InsertOneAsync(new LocalizedResource("facebook:new_remark", "en-gb", "I've just sent a new remark using Coolector. You can see it here: {0}")); await _database.LocalizedResources().InsertOneAsync(new LocalizedResource("facebook:new_remark", "pl-pl", "Nowe zgłoszenie zostało przeze mnie dodane za pomocą Coolector. Możesz je zobaczyć tutaj: {0}")); var tags = new List<Tag> { new Tag("junk"), new Tag("small"), new Tag("medium"), new Tag("big"), new Tag("crash"), new Tag("stink"), new Tag("dirty"), new Tag("glass"), new Tag("plastic") }; await _database.Tags().InsertManyAsync(tags); } } }
mit
C#
2af7e20d244494c158fb456dc2f3c0bbaeeb3ee0
Make static mutable direction fields into immutable properties
ParagonTruss/GeometryClassLibrary
GeometryClassLibrary/Coordinates/Direction/DirectionFactoryProperties.cs
GeometryClassLibrary/Coordinates/Direction/DirectionFactoryProperties.cs
/* This file is part of Geometry Class Library. Copyright (C) 2017 Paragon Component Systems, LLC. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ namespace GeometryClassLibrary { public partial class Direction { public static Direction NoDirection { get; } = new Direction(0, 0, 0); /// <summary> /// A staticly defined Direction that is positive in the X direction. /// Extends to the right in the XY plane. /// </summary> public static Direction Right {get; } = new Direction(1, 0, 0); /// <summary> /// A staticly defined Direction that is negative in the X direction. /// Extends to the left in the XY plane. /// </summary> public static Direction Left {get; } = new Direction(-1, 0, 0); /// <summary> /// A staticly defined Direction that is positive in the Y direction. /// Extends upward in the XY plane. /// </summary> public static Direction Up {get; } = new Direction(0, 1, 0); /// <summary> /// A staticly defined Direction that is negative in the Y direction. /// Extends downward in the XY plane. /// </summary> public static Direction Down {get; } = new Direction(0, -1, 0); /// <summary> /// A staticly defined Direction that is positive in the Z direction. /// Extends towards the viewer when looking at the XY plane. /// </summary> public static Direction Out {get; } = new Direction(0, 0, 1); /// <summary> /// A staticly defined Direction that is negative in the Z direction. /// Extends away from the viewer when looking at the XY plane. /// </summary> public static Direction Back {get; } = new Direction(0, 0, -1); } }
/* This file is part of Geometry Class Library. Copyright (C) 2017 Paragon Component Systems, LLC. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ namespace GeometryClassLibrary { public partial class Direction { public static Direction NoDirection = new Direction(0, 0, 0); /// <summary> /// A staticly defined Direction that is positive in the X direction. /// Extends to the right in the XY plane. /// </summary> public static Direction Right = new Direction(1, 0, 0); /// <summary> /// A staticly defined Direction that is negative in the X direction. /// Extends to the left in the XY plane. /// </summary> public static Direction Left = new Direction(-1, 0, 0); /// <summary> /// A staticly defined Direction that is positive in the Y direction. /// Extends upward in the XY plane. /// </summary> public static Direction Up = new Direction(0, 1, 0); /// <summary> /// A staticly defined Direction that is negative in the Y direction. /// Extends downward in the XY plane. /// </summary> public static Direction Down = new Direction(0, -1, 0); /// <summary> /// A staticly defined Direction that is positive in the Z direction. /// Extends towards the viewer when looking at the XY plane. /// </summary> public static Direction Out = new Direction(0, 0, 1); /// <summary> /// A staticly defined Direction that is negative in the Z direction. /// Extends away from the viewer when looking at the XY plane. /// </summary> public static Direction Back = new Direction(0, 0, -1); } }
lgpl-2.1
C#
7ac08620b80e335f747be668dfe5eaeae2a78703
Add a user object for now
UselessToucan/osu,smoogipooo/osu,ppy/osu,ppy/osu,smoogipoo/osu,UselessToucan/osu,NeoAdonis/osu,peppy/osu-new,peppy/osu,peppy/osu,smoogipoo/osu,ppy/osu,NeoAdonis/osu,smoogipoo/osu,NeoAdonis/osu,peppy/osu,UselessToucan/osu
osu.Game/Online/API/RoomScore.cs
osu.Game/Online/API/RoomScore.cs
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. using System; using System.Collections.Generic; using System.Linq; using Newtonsoft.Json; using Newtonsoft.Json.Converters; using osu.Game.Online.Multiplayer; using osu.Game.Rulesets.Scoring; using osu.Game.Scoring; using osu.Game.Users; namespace osu.Game.Online.API { public class RoomScore { [JsonProperty("id")] public int ID { get; set; } [JsonProperty("user")] public User User { get; set; } [JsonProperty("rank")] [JsonConverter(typeof(StringEnumConverter))] public ScoreRank Rank { get; set; } [JsonProperty("total_score")] public long TotalScore { get; set; } [JsonProperty("accuracy")] public double Accuracy { get; set; } [JsonProperty("max_combo")] public int MaxCombo { get; set; } [JsonProperty("mods")] public APIMod[] Mods { get; set; } [JsonProperty("statistics")] public Dictionary<HitResult, int> Statistics = new Dictionary<HitResult, int>(); [JsonProperty("passed")] public bool Passed { get; set; } [JsonProperty("ended_at")] public DateTimeOffset EndedAt { get; set; } public ScoreInfo CreateScoreInfo(PlaylistItem playlistItem) { var scoreInfo = new ScoreInfo { OnlineScoreID = ID, TotalScore = TotalScore, MaxCombo = MaxCombo, Beatmap = playlistItem.Beatmap.Value, BeatmapInfoID = playlistItem.BeatmapID, Ruleset = playlistItem.Ruleset.Value, RulesetID = playlistItem.RulesetID, User = User, Accuracy = Accuracy, Date = EndedAt, Hash = string.Empty, // todo: temporary? Rank = Rank, Mods = Mods.Select(m => m.ToMod(playlistItem.Ruleset.Value.CreateInstance())).ToArray() }; return scoreInfo; } } }
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. using System; using System.Collections.Generic; using System.Linq; using Newtonsoft.Json; using Newtonsoft.Json.Converters; using osu.Game.Online.Multiplayer; using osu.Game.Rulesets.Mods; using osu.Game.Rulesets.Scoring; using osu.Game.Scoring; namespace osu.Game.Online.API { public class RoomScore { [JsonProperty("id")] public int ID { get; set; } [JsonProperty("user_id")] public int UserID { get; set; } [JsonProperty("rank")] [JsonConverter(typeof(StringEnumConverter))] public ScoreRank Rank { get; set; } [JsonProperty("total_score")] public long TotalScore { get; set; } [JsonProperty("accuracy")] public double Accuracy { get; set; } [JsonProperty("max_combo")] public int MaxCombo { get; set; } [JsonProperty("mods")] public APIMod[] Mods { get; set; } [JsonProperty("statistics")] public Dictionary<HitResult, int> Statistics = new Dictionary<HitResult, int>(); [JsonProperty("passed")] public bool Passed { get; set; } [JsonProperty("ended_at")] public DateTimeOffset EndedAt { get; set; } public ScoreInfo CreateScoreInfo(PlaylistItem playlistItem) { var scoreInfo = new ScoreInfo { OnlineScoreID = ID, TotalScore = TotalScore, MaxCombo = MaxCombo, Beatmap = playlistItem.Beatmap.Value, BeatmapInfoID = playlistItem.BeatmapID, Ruleset = playlistItem.Ruleset.Value, RulesetID = playlistItem.RulesetID, User = null, // todo: do we have a user object? Accuracy = Accuracy, Date = EndedAt, Hash = string.Empty, // todo: temporary? Rank = Rank, Mods = Mods.Select(m => m.ToMod(playlistItem.Ruleset.Value.CreateInstance())).ToArray() }; return scoreInfo; } } }
mit
C#
ca3186f34c7b2507fef6e0900e61e5c7e9746c82
Create dependencies before children are loaded
ppy/osu,DrabWeb/osu,UselessToucan/osu,peppy/osu,smoogipoo/osu,peppy/osu,ppy/osu,ppy/osu,NeoAdonis/osu,ZLima12/osu,DrabWeb/osu,johnneijzen/osu,smoogipooo/osu,NeoAdonis/osu,naoey/osu,UselessToucan/osu,EVAST9919/osu,johnneijzen/osu,DrabWeb/osu,naoey/osu,peppy/osu-new,naoey/osu,NeoAdonis/osu,ZLima12/osu,EVAST9919/osu,smoogipoo/osu,2yangk23/osu,UselessToucan/osu,smoogipoo/osu,2yangk23/osu,peppy/osu
osu.Game/Tests/Visual/EditorClockTestCase.cs
osu.Game/Tests/Visual/EditorClockTestCase.cs
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>. // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Allocation; using osu.Framework.Input; using osu.Framework.Timing; using osu.Game.Beatmaps; using osu.Game.Beatmaps.ControlPoints; using osu.Game.Screens.Edit; using osu.Game.Screens.Edit.Screens.Compose; namespace osu.Game.Tests.Visual { /// <summary> /// Provides a clock, beat-divisor, and scrolling capability for test cases of editor components that /// are preferrably tested within the presence of a clock and seek controls. /// </summary> public abstract class EditorClockTestCase : OsuTestCase { protected readonly BindableBeatDivisor BeatDivisor = new BindableBeatDivisor(); protected readonly EditorClock Clock; protected EditorClockTestCase() { Clock = new EditorClock(new ControlPointInfo(), 5000, BeatDivisor) { IsCoupled = false }; } protected override IReadOnlyDependencyContainer CreateLocalDependencies(IReadOnlyDependencyContainer parent) { var dependencies = new DependencyContainer(base.CreateLocalDependencies(parent)); dependencies.Cache(BeatDivisor); dependencies.CacheAs<IFrameBasedClock>(Clock); dependencies.CacheAs<IAdjustableClock>(Clock); return dependencies; } [BackgroundDependencyLoader] private void load() { Beatmap.BindValueChanged(beatmapChanged, true); } private void beatmapChanged(WorkingBeatmap working) { Clock.ControlPointInfo = working.Beatmap.ControlPointInfo; Clock.ChangeSource((IAdjustableClock)working.Track ?? new StopwatchClock()); Clock.ProcessFrame(); } protected override void Update() { base.Update(); Clock.ProcessFrame(); } protected override bool OnScroll(InputState state) { if (state.Mouse.ScrollDelta.Y > 0) Clock.SeekBackward(true); else Clock.SeekForward(true); return true; } } }
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>. // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Allocation; using osu.Framework.Input; using osu.Framework.Timing; using osu.Game.Beatmaps; using osu.Game.Beatmaps.ControlPoints; using osu.Game.Screens.Edit; using osu.Game.Screens.Edit.Screens.Compose; namespace osu.Game.Tests.Visual { /// <summary> /// Provides a clock, beat-divisor, and scrolling capability for test cases of editor components that /// are preferrably tested within the presence of a clock and seek controls. /// </summary> public abstract class EditorClockTestCase : OsuTestCase { protected readonly BindableBeatDivisor BeatDivisor = new BindableBeatDivisor(); protected readonly EditorClock Clock; protected EditorClockTestCase() { Clock = new EditorClock(new ControlPointInfo(), 5000, BeatDivisor) { IsCoupled = false }; } [BackgroundDependencyLoader] private void load() { Dependencies.Cache(BeatDivisor); Dependencies.CacheAs<IFrameBasedClock>(Clock); Dependencies.CacheAs<IAdjustableClock>(Clock); Beatmap.BindValueChanged(beatmapChanged, true); } private void beatmapChanged(WorkingBeatmap working) { Clock.ControlPointInfo = working.Beatmap.ControlPointInfo; Clock.ChangeSource((IAdjustableClock)working.Track ?? new StopwatchClock()); Clock.ProcessFrame(); } protected override void Update() { base.Update(); Clock.ProcessFrame(); } protected override bool OnScroll(InputState state) { if (state.Mouse.ScrollDelta.Y > 0) Clock.SeekBackward(true); else Clock.SeekForward(true); return true; } } }
mit
C#
267414e0f14c458dd96528a70b00de0bf50f1e10
Remove C# helper library from REST call example
teoreteetik/api-snippets,teoreteetik/api-snippets,TwilioDevEd/api-snippets,TwilioDevEd/api-snippets,TwilioDevEd/api-snippets,teoreteetik/api-snippets,TwilioDevEd/api-snippets,TwilioDevEd/api-snippets,teoreteetik/api-snippets,teoreteetik/api-snippets,teoreteetik/api-snippets,TwilioDevEd/api-snippets,TwilioDevEd/api-snippets,TwilioDevEd/api-snippets,teoreteetik/api-snippets,TwilioDevEd/api-snippets,teoreteetik/api-snippets,TwilioDevEd/api-snippets,TwilioDevEd/api-snippets,teoreteetik/api-snippets,TwilioDevEd/api-snippets
lookups/lookup-get-addon-payfone-example-1/lookup-get-addon-payfone-1.cs
lookups/lookup-get-addon-payfone-example-1/lookup-get-addon-payfone-1.cs
using Newtonsoft.Json; using RestSharp; using RestSharp.Authenticators; using Newtonsoft.Json.Serialization; using System; class Example { static void Main(string[] args) { // The C# helper library will support Add-ons in June 2016, for now we'll use a simple RestSharp HTTP client var client = new RestClient("https://lookups.twilio.com/v1/PhoneNumbers/+16502530000/?AddOns=payfone_tcpa_compliance&AddOns.payfone_tcpa_compliance.RightPartyContactedDate=20160101"); // Find your Account Sid and Auth Token at twilio.com/user/account client.Authenticator = new HttpBasicAuthenticator("{{ account_sid }}", "{{ auth_token }}"); var request = new RestRequest(Method.GET); request.AddHeader("content-type", "application/json"); request.AddHeader("accept", "application/json"); IRestResponse response = client.Execute(request); dynamic result = JsonConvert.DeserializeObject(response.Content, new JsonSerializerSettings { ContractResolver = new SnakeCaseContractResolver() }); Console.WriteLine(result.add_ons.results.payfone_tcpa_compliance.result.Description); Console.WriteLine(result.add_ons.results.payfone_tcpa_compliance.result.Response.NumberMatch); } public class SnakeCaseContractResolver : DefaultContractResolver { protected override string ResolvePropertyName(string propertyName) { return GetSnakeCase(propertyName); } private string GetSnakeCase(string input) { if (string.IsNullOrEmpty(input)) return input; var buffer = ""; for (var i = 0; i < input.Length; i++) { var isLast = (i == input.Length - 1); var isSecondFromLast = (i == input.Length - 2); var curr = input[i]; var next = !isLast ? input[i + 1] : '\0'; var afterNext = !isSecondFromLast && !isLast ? input[i + 2] : '\0'; buffer += char.ToLower(curr); if (!char.IsDigit(curr) && char.IsUpper(next)) { if (char.IsUpper(curr)) { if (!isLast && !isSecondFromLast && !char.IsUpper(afterNext)) buffer += "_"; } else buffer += "_"; } if (!char.IsDigit(curr) && char.IsDigit(next)) buffer += "_"; if (char.IsDigit(curr) && !char.IsDigit(next) && !isLast) buffer += "_"; } return buffer; } } }
// Download the twilio-csharp library from twilio.com/docs/csharp/install using Newtonsoft.Json; using RestSharp; using RestSharp.Authenticators; using Newtonsoft.Json.Serialization; using System; class Example { static void Main(string[] args) { // The C# helper library will support Add-ons in June 2016, for now we'll use a simple RestSharp HTTP client var client = new RestClient("https://lookups.twilio.com/v1/PhoneNumbers/+16502530000/?AddOns=payfone_tcpa_compliance&AddOns.payfone_tcpa_compliance.RightPartyContactedDate=20160101"); // Find your Account Sid and Auth Token at twilio.com/user/account client.Authenticator = new HttpBasicAuthenticator("{{ account_sid }}", "{{ auth_token }}"); var request = new RestRequest(Method.GET); request.AddHeader("content-type", "application/json"); request.AddHeader("accept", "application/json"); IRestResponse response = client.Execute(request); dynamic result = JsonConvert.DeserializeObject(response.Content, new JsonSerializerSettings { ContractResolver = new SnakeCaseContractResolver() }); Console.WriteLine(result.add_ons.results.payfone_tcpa_compliance.result.Description); Console.WriteLine(result.add_ons.results.payfone_tcpa_compliance.result.Response.NumberMatch); } public class SnakeCaseContractResolver : DefaultContractResolver { protected override string ResolvePropertyName(string propertyName) { return GetSnakeCase(propertyName); } private string GetSnakeCase(string input) { if (string.IsNullOrEmpty(input)) return input; var buffer = ""; for (var i = 0; i < input.Length; i++) { var isLast = (i == input.Length - 1); var isSecondFromLast = (i == input.Length - 2); var curr = input[i]; var next = !isLast ? input[i + 1] : '\0'; var afterNext = !isSecondFromLast && !isLast ? input[i + 2] : '\0'; buffer += char.ToLower(curr); if (!char.IsDigit(curr) && char.IsUpper(next)) { if (char.IsUpper(curr)) { if (!isLast && !isSecondFromLast && !char.IsUpper(afterNext)) buffer += "_"; } else buffer += "_"; } if (!char.IsDigit(curr) && char.IsDigit(next)) buffer += "_"; if (char.IsDigit(curr) && !char.IsDigit(next) && !isLast) buffer += "_"; } return buffer; } } }
mit
C#
fe568a415ad0dce844e5f9cd6e31ef1f10f08238
Save (path): Saves a file to a path on the machine. Save (TextWriter): Saves a file to a TextWriter.
bmatzelle/nini,bmatzelle/nini,rwhitworth/nini
Nini/Source/Config/IConfigSource.cs
Nini/Source/Config/IConfigSource.cs
#region Copyright // // Nini Configuration Project. // Copyright (C) 2004 Brent R. Matzelle. All rights reserved. // // This software is published under the terms of the MIT X11 license, a copy of // which has been included with this distribution in the LICENSE.txt file. // #endregion using System; using System.IO; namespace Nini.Config { /// <include file='IConfigSource.xml' path='//Interface[@name="IConfigSource"]/docs/*' /> public interface IConfigSource { /// <include file='IConfigSource.xml' path='//Property[@name="Configs"]/docs/*' /> ConfigCollection Configs { get; } /// <include file='IConfigSource.xml' path='//Property[@name="IsReadOnly"]/docs/*' /> bool IsReadOnly { get; } /// <include file='IConfigSource.xml' path='//Property[@name="AutoSave"]/docs/*' /> bool AutoSave { get; set; } /// <include file='IConfigSource.xml' path='//Method[@name="Merge"]/docs/*' /> void Merge (IConfigSource source); /// <include file='IConfigSource.xml' path='//Method[@name="Save"]/docs/*' /> void Save (); /// <include file='IConfigSource.xml' path='//Method[@name="SavePath"]/docs/*' /> void Save (string path); /// <include file='IConfigSource.xml' path='//Method[@name="SaveTextWriter"]/docs/*' /> void Save (TextWriter writer); /// <include file='IConfigSource.xml' path='//Method[@name="SetGlobalAlias"]/docs/*' /> void SetGlobalAlias (AliasText alias); /// <include file='IConfigSource.xml' path='//Method[@name="AddConfig"]/docs/*' /> IConfig AddConfig (string name); } }
#region Copyright // // Nini Configuration Project. // Copyright (C) 2004 Brent R. Matzelle. All rights reserved. // // This software is published under the terms of the MIT X11 license, a copy of // which has been included with this distribution in the LICENSE.txt file. // #endregion using System; namespace Nini.Config { /// <include file='IConfigSource.xml' path='//Interface[@name="IConfigSource"]/docs/*' /> public interface IConfigSource { /// <include file='IConfigSource.xml' path='//Property[@name="Configs"]/docs/*' /> ConfigCollection Configs { get; } /// <include file='IConfigSource.xml' path='//Property[@name="IsReadOnly"]/docs/*' /> bool IsReadOnly { get; } /// <include file='IConfigSource.xml' path='//Property[@name="AutoSave"]/docs/*' /> bool AutoSave { get; set; } /// <include file='IConfigSource.xml' path='//Method[@name="Merge"]/docs/*' /> void Merge (IConfigSource source); /// <include file='IConfigSource.xml' path='//Method[@name="Save"]/docs/*' /> void Save (); /// <include file='IConfigSource.xml' path='//Method[@name="SetGlobalAlias"]/docs/*' /> void SetGlobalAlias (AliasText alias); /// <include file='IConfigSource.xml' path='//Method[@name="AddConfig"]/docs/*' /> IConfig AddConfig (string name); } }
mit
C#
c461e02e501c96fec8cd2193a52453af64f67637
Bump version to 1.5.1
milkshakesoftware/PreMailer.Net,kendallb/PreMailer.Net
PreMailer.Net/GlobalAssemblyInfo.cs
PreMailer.Net/GlobalAssemblyInfo.cs
using System; using System.Reflection; using System.Runtime.InteropServices; [assembly: ComVisible(false)] [assembly: CLSCompliant(true)] [assembly: AssemblyProduct("PreMailer.Net")] [assembly: AssemblyCompany("Milkshake Software")] [assembly: AssemblyCopyright("Copyright © Milkshake Software 2016")] [assembly: AssemblyVersion("1.5.1.0")] [assembly: AssemblyFileVersion("1.5.1.0")] #if DEBUG [assembly: AssemblyConfiguration("Debug")] #else [assembly: AssemblyConfiguration("Release")] #endif
using System; using System.Reflection; using System.Runtime.InteropServices; [assembly: ComVisible(false)] [assembly: CLSCompliant(true)] [assembly: AssemblyProduct("PreMailer.Net")] [assembly: AssemblyCompany("Milkshake Software")] [assembly: AssemblyCopyright("Copyright © Milkshake Software 2016")] [assembly: AssemblyVersion("1.5.0.0")] [assembly: AssemblyFileVersion("1.5.0.0")] #if DEBUG [assembly: AssemblyConfiguration("Debug")] #else [assembly: AssemblyConfiguration("Release")] #endif
mit
C#
069fbf5f25e5a9db2fc8e87b2d6226025128394a
add if/else/for sample
nicogiddev/myFirstProgramCSharp
myFirstProgramCSharp/myFirstProgramCSharp/Program.cs
myFirstProgramCSharp/myFirstProgramCSharp/Program.cs
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace myFirstProgramCSharp { class Program { static void Main(string[] args) { Console.ForegroundColor = ConsoleColor.Blue; Console.BackgroundColor = ConsoleColor.Yellow; // Jouer avec des For for (int x = 0; x <= 10; x++) { Console.WriteLine("La valeur de x : " + x.ToString()); if (x == 7) { Console.WriteLine("Trouvé la valeur 7"); break; } } // Jouer avec des If/Else Console.WriteLine("Saisissez le type d'opération Multiplier (m) ou Diviser (d) : "); String decision = Console.ReadLine(); Console.WriteLine("Saisisez un chiffre"); String chaineChiffre = Console.ReadLine(); int chiffre = Convert.ToInt32(chaineChiffre); if (decision == "m") { chiffre *= chiffre; Console.WriteLine(" Résultat de la multilication = " + chiffre.ToString()); } else if (decision == "d") { chiffre /= chiffre; Console.WriteLine(" Résultat de la division = " + chiffre.ToString()); } else { Console.WriteLine("Vous n'avez pas saissi une information correcte."); } Console.Read(); } } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace myFirstProgramCSharp { class Program { static void Main(string[] args) { Console.ForegroundColor = ConsoleColor.Blue; Console.BackgroundColor = ConsoleColor.Yellow; string name = Console.ReadLine(); Console.WriteLine("Hello World !" + name); Console.Read(); } } }
mit
C#
84716605ecbdfe2fa6d8eebe2b42d6979ff47c37
Add missing properties
davek17/SurveyMonkeyApi-v3,bcemmett/SurveyMonkeyApi-v3
SurveyMonkey/Containers/Response.cs
SurveyMonkey/Containers/Response.cs
using System; using System.Collections.Generic; using Newtonsoft.Json; using SurveyMonkey.Enums; namespace SurveyMonkey.Containers { [JsonConverter(typeof(LaxPropertyNameJsonConverter))] public class Response { public long? Id { get; set; } public long? SurveyId { get; set; } public long? CollectorId { get; set; } public string Href { get; set; } public Dictionary<string, string> CustomVariables { get; set; } public int? TotalTime { get; set; } public string CustomValue { get; set; } public string EditUrl { get; set; } public string AnalyzeUrl { get; set; } public object LogicPath { get; set; } //TODO this structure isn't documented public object Metadata { get; set; } //TODO this structure isn't documented public List<object> PagePath { get; set; } //TODO this structure isn't documented public DateTime? DateCreated { get; set; } public DateTime? DateModified { get; set; } public ResponseStatus? ResponseStatus { get; set; } public CollectionMode? CollectionMode { get; set; } public string IpAddress { get; set; } public long? RecipientId { get; set; } public List<ResponsePage> Pages { get; set; } } }
using System; using System.Collections.Generic; using Newtonsoft.Json; using SurveyMonkey.Enums; namespace SurveyMonkey.Containers { [JsonConverter(typeof(LaxPropertyNameJsonConverter))] public class Response { public long? Id { get; set; } public string Href { get; set; } public Dictionary<string, string> CustomVariables { get; set; } public int? TotalTime { get; set; } public string CustomValue { get; set; } public string EditUrl { get; set; } public string AnalyzeUrl { get; set; } public object LogicPath { get; set; } //TODO this structure isn't documented public object Metadata { get; set; } //TODO this structure isn't documented //public List<PagePath> PagePath { get; set; } //TODO this structure isn't documented public DateTime? DateCreated { get; set; } public DateTime? DateModified { get; set; } public ResponseStatus? ResponseStatus { get; set; } public CollectionMode? CollectionMode { get; set; } public string IpAddress { get; set; } public long? RecipientId { get; set; } public List<ResponsePage> Pages { get; set; } } }
mit
C#
11a265d3d4b54b213a9f6df642c89f2ee8302474
Update DependenciesModule.cs
Core2D/Core2D,wieslawsoltes/Core2D,wieslawsoltes/Core2D,wieslawsoltes/Core2D,Core2D/Core2D,wieslawsoltes/Core2D
apps/Core2D.Avalonia.Direct2D/Modules/DependenciesModule.cs
apps/Core2D.Avalonia.Direct2D/Modules/DependenciesModule.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 Autofac; using Core2D.Data.Database; using Core2D.Interfaces; using Core2D.Renderer; using FileSystem.DotNetFx; using FileWriter.Dxf; using FileWriter.Emf; using FileWriter.PdfSharp; using FileWriter.PdfSkiaSharp; using FileWriter.SvgSkiaSharp; using Log.Trace; using Renderer.Avalonia; using ScriptRunner.Roslyn; using Serializer.Newtonsoft; using Serializer.Xaml; using TextFieldReader.CsvHelper; using TextFieldWriter.CsvHelper; using Utilities.Avalonia; namespace Core2D.Avalonia.Direct2D.Modules { /// <summary> /// Dependencies components module. /// </summary> public class DependenciesModule : Module { /// <inheritdoc/> protected override void Load(ContainerBuilder builder) { builder.RegisterType<AvaloniaRenderer>().As<ShapeRenderer>().InstancePerDependency(); builder.RegisterType<AvaloniaTextClipboard>().As<ITextClipboard>().InstancePerLifetimeScope(); builder.RegisterType<TraceLog>().As<ILog>().SingleInstance(); builder.RegisterType<DotNetFxFileSystem>().As<IFileSystem>().InstancePerLifetimeScope(); builder.RegisterType<RoslynScriptRunner>().As<IScriptRunner>().InstancePerLifetimeScope(); builder.RegisterType<NewtonsoftJsonSerializer>().As<IJsonSerializer>().InstancePerLifetimeScope(); builder.RegisterType<PortableXamlSerializer>().As<IXamlSerializer>().InstancePerLifetimeScope(); builder.RegisterType<PdfSharpWriter>().As<IFileWriter>().InstancePerLifetimeScope(); builder.RegisterType<PdfSkiaSharpWriter>().As<IFileWriter>().InstancePerLifetimeScope(); builder.RegisterType<SvgSkiaSharpWriter>().As<IFileWriter>().InstancePerLifetimeScope(); builder.RegisterType<EmfWriter>().As<IFileWriter>().InstancePerLifetimeScope(); builder.RegisterType<DxfWriter>().As<IFileWriter>().InstancePerLifetimeScope(); builder.RegisterType<CsvHelperReader>().As<ITextFieldReader<XDatabase>>().InstancePerLifetimeScope(); builder.RegisterType<CsvHelperWriter>().As<ITextFieldWriter<XDatabase>>().InstancePerLifetimeScope(); } } }
// 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 Autofac; using Core2D.Data.Database; using Core2D.Interfaces; using Core2D.Renderer; using FileSystem.DotNetFx; using FileWriter.Dxf; using FileWriter.Emf; using FileWriter.PdfSharp; using Log.Trace; using Renderer.Avalonia; using ScriptRunner.Roslyn; using Serializer.Newtonsoft; using Serializer.Xaml; using TextFieldReader.CsvHelper; using TextFieldWriter.CsvHelper; using Utilities.Avalonia; namespace Core2D.Avalonia.Direct2D.Modules { /// <summary> /// Dependencies components module. /// </summary> public class DependenciesModule : Module { /// <inheritdoc/> protected override void Load(ContainerBuilder builder) { builder.RegisterType<AvaloniaRenderer>().As<ShapeRenderer>().InstancePerDependency(); builder.RegisterType<AvaloniaTextClipboard>().As<ITextClipboard>().InstancePerLifetimeScope(); builder.RegisterType<TraceLog>().As<ILog>().SingleInstance(); builder.RegisterType<DotNetFxFileSystem>().As<IFileSystem>().InstancePerLifetimeScope(); builder.RegisterType<RoslynScriptRunner>().As<IScriptRunner>().InstancePerLifetimeScope(); builder.RegisterType<NewtonsoftJsonSerializer>().As<IJsonSerializer>().InstancePerLifetimeScope(); builder.RegisterType<PortableXamlSerializer>().As<IXamlSerializer>().InstancePerLifetimeScope(); builder.RegisterType<PdfSharpWriter>().As<IFileWriter>().InstancePerLifetimeScope(); builder.RegisterType<PdfSkiaSharpWriter>().As<IFileWriter>().InstancePerLifetimeScope(); builder.RegisterType<SvgSkiaSharpWriter>().As<IFileWriter>().InstancePerLifetimeScope(); builder.RegisterType<EmfWriter>().As<IFileWriter>().InstancePerLifetimeScope(); builder.RegisterType<DxfWriter>().As<IFileWriter>().InstancePerLifetimeScope(); builder.RegisterType<CsvHelperReader>().As<ITextFieldReader<XDatabase>>().InstancePerLifetimeScope(); builder.RegisterType<CsvHelperWriter>().As<ITextFieldWriter<XDatabase>>().InstancePerLifetimeScope(); } } }
mit
C#
262446971419788d855209d300f77c1d3135b226
read data from GetAssignment id 3
Bargsteen/ADL,Bargsteen/ADL,Bargsteen/ADL
AppCode/ADLApp/ADLApp/ADLApp/HomePage.xaml.cs
AppCode/ADLApp/ADLApp/ADLApp/HomePage.xaml.cs
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Xamarin.Forms; using System.Net; using ADLApp.Model; using RestSharp; namespace ADLApp { public partial class HomePage : ContentPage { public HomePage() { InitializeComponent(); } private RestClient rClient; private Uri rURL; private async void OnScanButtonClicked(object sender, EventArgs e) { rClient = new RestClient("localhost:5000/api/"); var request = new RestRequest("/GetAssignment/1"); rClient.ExecuteAsync<Item>(request, response => { ScanButton.Text = response.Data.question; }); //await Navigation.PushAsync(new SolvePage()); } } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Xamarin.Forms; using System.Net; using ADLApp.Model; using RestSharp; namespace ADLApp { public partial class HomePage : ContentPage { public HomePage() { InitializeComponent(); } private RestClient rClient; private Uri rURL; private async void OnScanButtonClicked(object sender, EventArgs e) { rClient = new RestClient("localhost:5000/api/"); var request = new RestRequest("/GetAssignment/1"); var response = rClient.Execute<Item>(request); ScanButton.Text = response.Data.question; //await Navigation.PushAsync(new SolvePage()); } } }
apache-2.0
C#
50e7619fa328556fcc3e8474b68cac553693e3ea
make the arg length check a little better
kangaroo/scsharp,kangaroo/scsharp,kangaroo/scsharp
tools/lsmpq.cs
tools/lsmpq.cs
using System; using System.IO; using SCSharp; using System.Reflection; public class ListMpq { public static void Main (string[] args) { if (args.Length != 1) { Console.WriteLine ("usage: lsmpq.exe <mpq-file>"); Environment.Exit (0); } Mpq mpq = new MpqArchive (args[0]); StreamReader sr = new StreamReader (Assembly.GetExecutingAssembly().GetManifestResourceStream ("list.txt")); string entry; while ((entry = sr.ReadLine()) != null) { entry = entry.ToLower (); Stream mpq_stream = mpq.GetStreamForResource (entry); if (mpq_stream == null) continue; Console.WriteLine ("{0} {1}", entry, mpq_stream.Length); mpq_stream.Dispose(); } } }
using System; using System.IO; using SCSharp; using System.Reflection; public class ListMpq { public static void Main (string[] args) { if (args.Length == 0) { Console.WriteLine ("usage: lsmpq.exe <mpq-file>"); Environment.Exit (0); } Mpq mpq = new MpqArchive (args[0]); StreamReader sr = new StreamReader (Assembly.GetExecutingAssembly().GetManifestResourceStream ("list.txt")); string entry; while ((entry = sr.ReadLine()) != null) { entry = entry.ToLower (); Stream mpq_stream = mpq.GetStreamForResource (entry); if (mpq_stream == null) continue; Console.WriteLine ("{0} {1}", entry, mpq_stream.Length); mpq_stream.Dispose(); } } }
mit
C#
7ef3c87be3cac6f4ef0a25eac947be09db00f1ba
Apply nameof operators
occar421/OpenTKAnalyzer
src/OpenTKAnalyzer/OpenTKAnalyzer/OpenTK_/RotationValueOpenTKMathAnalyzer.cs
src/OpenTKAnalyzer/OpenTKAnalyzer/OpenTK_/RotationValueOpenTKMathAnalyzer.cs
using System; using System.Collections.Generic; using System.Collections.Immutable; using System.Linq; using System.Text; using System.Threading.Tasks; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CSharp; using Microsoft.CodeAnalysis.CSharp.Syntax; using Microsoft.CodeAnalysis.Diagnostics; using OpenTK; namespace OpenTKAnalyzer.OpenTK_ { [DiagnosticAnalyzer(LanguageNames.CSharp)] class RotationValueOpenTKMathAnalyzer : DiagnosticAnalyzer { public const string DiagnosticId = "RotatinoValueOpenTKMath"; private const string Title = "Rotation value(OpenTK Math)"; private const string MessageFormat = "{0} accepts {1} values."; private const string Description = "Warm on literal in argument seems invalid style(radian or degree)."; private const string Category = nameof(OpenTKAnalyzer) + ":" + nameof(OpenTK); private const string RadianString = "radian"; private const string DegreeString = "degree"; internal static DiagnosticDescriptor Rule = new DiagnosticDescriptor( id: DiagnosticId, title: Title, messageFormat: MessageFormat, category: Category, defaultSeverity: DiagnosticSeverity.Warning, isEnabledByDefault: true, description: Description); public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics => ImmutableArray.Create(Rule); public override void Initialize(AnalysisContext context) { context.RegisterSyntaxNodeAction(Analyze, SyntaxKind.InvocationExpression); } private static void Analyze(SyntaxNodeAnalysisContext context) { var invotation = context.Node as InvocationExpressionSyntax; // MathHelper if (invotation.GetFirstToken().ValueText == nameof(MathHelper)) { // check method switch (invotation.Expression.GetLastToken().ValueText) { default: break; } return; } // Matrix2, Matrix3x4 etc... if (invotation.GetFirstToken().ValueText.StartsWith("Matrix")) { // check method switch (invotation.Expression.GetLastToken().ValueText) { default: break; } return; } } } }
using System; using System.Collections.Generic; using System.Collections.Immutable; using System.Linq; using System.Text; using System.Threading.Tasks; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CSharp; using Microsoft.CodeAnalysis.CSharp.Syntax; using Microsoft.CodeAnalysis.Diagnostics; namespace OpenTKAnalyzer.OpenTK_ { [DiagnosticAnalyzer(LanguageNames.CSharp)] class RotationValueOpenTKMathAnalyzer : DiagnosticAnalyzer { public const string DiagnosticId = "RotatinoValueOpenTKMath"; private const string Title = "Rotation value(OpenTK Math)"; private const string MessageFormat = "{0} accepts {1} values."; private const string Description = "Warm on literal in argument seems invalid style(radian or degree)."; private const string Category = "OpenTKAnalyzer:OpenTK"; private const string RadianString = "radian"; private const string DegreeString = "degree"; internal static DiagnosticDescriptor Rule = new DiagnosticDescriptor( id: DiagnosticId, title: Title, messageFormat: MessageFormat, category: Category, defaultSeverity: DiagnosticSeverity.Warning, isEnabledByDefault: true, description: Description); public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics => ImmutableArray.Create(Rule); public override void Initialize(AnalysisContext context) { context.RegisterSyntaxNodeAction(Analyze, SyntaxKind.InvocationExpression); } private static void Analyze(SyntaxNodeAnalysisContext context) { var invotation = context.Node as InvocationExpressionSyntax; // MathHelper if (invotation.GetFirstToken().ValueText == "MathHelper") { switch (invotation.Expression.GetLastToken().ValueText) { default: break; } return; } // Matrix2, Matrix3x4 etc... if (invotation.GetFirstToken().ValueText.StartsWith("Matrix")) { switch (invotation.Expression.GetLastToken().ValueText) { default: break; } return; } } } }
mit
C#
18b23eb6a494fc7cc5bd61273b829887ade04de1
Update Assembly Version
Jarga/Alias,Jarga/Automation.PageObject
Aliases.Drivers.Selenium/Properties/AssemblyInfo.cs
Aliases.Drivers.Selenium/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("Aliases.Drivers.Selenium")] [assembly: AssemblyDescription("Selenium driver implementation for the Alias framework.")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Sean McAdams")] [assembly: AssemblyProduct("Aliases.Drivers.Selenium")] [assembly: AssemblyCopyright("Copyright © Sean McAdams 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("600b2b56-cbde-4394-aa46-37a75c266278")] // 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.0.1.4")]
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("Aliases.Drivers.Selenium")] [assembly: AssemblyDescription("Selenium driver implementation for the Alias framework.")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Sean McAdams")] [assembly: AssemblyProduct("Aliases.Drivers.Selenium")] [assembly: AssemblyCopyright("Copyright © Sean McAdams 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("600b2b56-cbde-4394-aa46-37a75c266278")] // 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.0.1.3")]
mit
C#
d4181852bfd9a9cabe778defa71b005de98b1f4e
Set error code in RrpcException
LibertyLocked/RestRPC,LibertyLocked/RestRPC,LibertyLocked/RestRPC,LibertyLocked/RestRPC
RestRPC.Framework/Exceptions/RrpcException.cs
RestRPC.Framework/Exceptions/RrpcException.cs
using RestRPC.Framework.Messages.Outputs; using System; namespace RestRPC.Framework.Exceptions { abstract class RrpcException : Exception { public int Code { get; private set; } public RrpcException(int code, string message) : this(code, message, null) { } public RrpcException(int code, string message, Exception innerException) : base(message, innerException) { this.Code = code; } internal ErrorObject ToErrorObject() { return new ErrorObject(Code, Message, ToString()); } } }
using RestRPC.Framework.Messages.Outputs; using System; namespace RestRPC.Framework.Exceptions { abstract class RrpcException : Exception { public int Code { get; private set; } public RrpcException(int code, string message) : base(message) { } public RrpcException(int code, string message, Exception innerException) : base(message, innerException) { } internal ErrorObject ToErrorObject() { return new ErrorObject(Code, Message, ToString()); } } }
mit
C#
cd618344b82d479992ece0007858b55d52273aea
Set only Razor view Engine
NikitoG/WarehouseSystem,NikitoG/WarehouseSystem
Source/Web/WarehouseSystem.Web/Global.asax.cs
Source/Web/WarehouseSystem.Web/Global.asax.cs
namespace WarehouseSystem.Web { using System.Web.Mvc; using System.Web.Optimization; using System.Web.Routing; using WarehouseSystem.Web.App_Start; public class MvcApplication : System.Web.HttpApplication { protected void Application_Start() { ViewEngines.Engines.Clear(); ViewEngines.Engines.Add(new RazorViewEngine()); AreaRegistration.RegisterAllAreas(); FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters); RouteConfig.RegisterRoutes(RouteTable.Routes); BundleConfig.RegisterBundles(BundleTable.Bundles); DbConfig.Initialize(); AutoMapperConfig.Execute(); } } }
namespace WarehouseSystem.Web { using System.Web.Mvc; using System.Web.Optimization; using System.Web.Routing; using WarehouseSystem.Web.App_Start; public class MvcApplication : System.Web.HttpApplication { protected void Application_Start() { AreaRegistration.RegisterAllAreas(); FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters); RouteConfig.RegisterRoutes(RouteTable.Routes); BundleConfig.RegisterBundles(BundleTable.Bundles); DbConfig.Initialize(); AutoMapperConfig.Execute(); } } }
mit
C#
a3e3aa99af238c331eb8e7fc6c89d4c81c31cedd
Update documentation
whampson/bft-spec,whampson/cascara
Src/WHampson.Cascara/Types/ICascaraPointer.cs
Src/WHampson.Cascara/Types/ICascaraPointer.cs
#region License /* Copyright (c) 2017 Wes Hampson * * 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; namespace WHampson.Cascara.Types { /// <summary> /// Provides a framework for defining a pointer to some data type in memory. /// </summary> public interface ICascaraPointer : IConvertible { /// <summary> /// Gets the absolute memory address pointed to. /// </summary> IntPtr Address { get; } /// <summary> /// Gets a value indicating whether this pointer refers to a valid object. /// </summary> /// <remarks> /// It is possible for a pointer to not be null, but still not refer to a /// valid object. Take care to ensure that the address pointed to is /// usable by the current process. /// </remarks> /// <returns> /// <code>True</code> if the pointer is a null pointer, /// <code>False</code> otherwise. /// </returns> bool IsNull(); /// <summary> /// Gets the value that this pointer points to. /// </summary> /// <typeparam name="T"> /// The type of the value to get. /// </typeparam> /// <returns> /// The value that this pointer points to in terms of /// the generic type <typeparamref name="T"/>. /// </returns> T GetValue<T>() where T : struct; /// <summary> /// Sets the value that this pointer points to. /// </summary> /// <typeparam name="T"> /// The type of the value to set. /// </typeparam> /// <param name="value"> /// The value to store at the address pointed to by this pointer. /// </param> void SetValue<T>(T value) where T : struct; } }
#region License /* Copyright (c) 2017 Wes Hampson * * 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; namespace WHampson.Cascara.Types { /// <summary> /// Provides a framework for creating a pointer to an <see cref="ICascaraType"/>. /// </summary> public interface ICascaraPointer : IConvertible { /// <summary> /// Gets the absolute memory address pointed to. /// </summary> IntPtr Address { get; } /// <summary> /// Gets a value indicating whether this pointer is zero. /// </summary> /// <remarks> /// A pointer that is not <code>null</code> does not necessarily /// mean that is usable. /// </remarks> /// <returns> /// <code>True</code> if the pointer points to zero, /// <code>False</code> othwewise. /// </returns> bool IsNull(); T GetValue<T>() where T : struct; void SetValue<T>(T value) where T : struct; } }
mit
C#
4ddf2ed61cdb78f141590942ec1fb51d73d826c4
Fix TeamCityOutputSink to not report errors as build problems (#401)
nuke-build/nuke,nuke-build/nuke,nuke-build/nuke,nuke-build/nuke
source/Nuke.Common/CI/TeamCity/TeamCityOutputSink.cs
source/Nuke.Common/CI/TeamCity/TeamCityOutputSink.cs
// Copyright 2019 Maintainers of NUKE. // Distributed under the MIT License. // https://github.com/nuke-build/nuke/blob/master/LICENSE using System; using System.Diagnostics; using System.Diagnostics.CodeAnalysis; using System.Linq; using System.Text; using JetBrains.Annotations; using Nuke.Common.OutputSinks; using Nuke.Common.Utilities; namespace Nuke.Common.CI.TeamCity { [UsedImplicitly] [ExcludeFromCodeCoverage] internal class TeamCityOutputSink : AnsiColorOutputSink { private readonly TeamCity _teamCity; public TeamCityOutputSink(TeamCity teamCity) { _teamCity = teamCity; Console.OutputEncoding = Encoding.UTF8; } protected override string TraceCode => "37"; protected override string InformationCode => "36"; protected override string WarningCode => "33"; protected override string ErrorCode => "31"; protected override string SuccessCode => "32"; internal override IDisposable WriteBlock(string text) { var stopWatch = new Stopwatch(); return DelegateDisposable.CreateBracket( () => { _teamCity.OpenBlock(text); stopWatch.Start(); }, () => { _teamCity.CloseBlock(text); _teamCity.AddStatisticValue( $"NUKE_DURATION_{text.SplitCamelHumpsWithSeparator("_").ToUpper()}", stopWatch.ElapsedMilliseconds.ToString()); stopWatch.Stop(); }); } protected override bool EnableWriteErrors => false; protected override void WriteWarning(string text, string details = null) { _teamCity.WriteWarning(text); if (details != null) _teamCity.WriteWarning(details); } protected override void ReportError(string text, string details = null) { _teamCity.WriteError(text); if (details != null) _teamCity.WriteError(details); } } }
// Copyright 2019 Maintainers of NUKE. // Distributed under the MIT License. // https://github.com/nuke-build/nuke/blob/master/LICENSE using System; using System.Diagnostics; using System.Diagnostics.CodeAnalysis; using System.Linq; using System.Text; using JetBrains.Annotations; using Nuke.Common.OutputSinks; using Nuke.Common.Utilities; namespace Nuke.Common.CI.TeamCity { [UsedImplicitly] [ExcludeFromCodeCoverage] internal class TeamCityOutputSink : AnsiColorOutputSink { private readonly TeamCity _teamCity; public TeamCityOutputSink(TeamCity teamCity) { _teamCity = teamCity; Console.OutputEncoding = Encoding.UTF8; } protected override string TraceCode => "37"; protected override string InformationCode => "36"; protected override string WarningCode => "33"; protected override string ErrorCode => "31"; protected override string SuccessCode => "32"; internal override IDisposable WriteBlock(string text) { var stopWatch = new Stopwatch(); return DelegateDisposable.CreateBracket( () => { _teamCity.OpenBlock(text); stopWatch.Start(); }, () => { _teamCity.CloseBlock(text); _teamCity.AddStatisticValue( $"NUKE_DURATION_{text.SplitCamelHumpsWithSeparator("_").ToUpper()}", stopWatch.ElapsedMilliseconds.ToString()); stopWatch.Stop(); }); } protected override bool EnableWriteErrors => false; protected override void WriteWarning(string text, string details = null) { _teamCity.WriteWarning(text); if (details != null) _teamCity.WriteWarning(details); } protected override void ReportError(string text, string details = null) { _teamCity.AddBuildProblem(text); if (details != null) base.WriteError(details); } } }
mit
C#
ad1efc37a8b122d40afec98ef46d870508dcc5e5
Hide shuffle menu when shuffling is disabled (bgo#599465)
Carbenium/banshee,dufoli/banshee,GNOME/banshee,ixfalia/banshee,petejohanson/banshee,eeejay/banshee,stsundermann/banshee,GNOME/banshee,Dynalon/banshee-osx,eeejay/banshee,ixfalia/banshee,petejohanson/banshee,dufoli/banshee,stsundermann/banshee,dufoli/banshee,directhex/banshee-hacks,lamalex/Banshee,Carbenium/banshee,arfbtwn/banshee,Dynalon/banshee-osx,Dynalon/banshee-osx,GNOME/banshee,petejohanson/banshee,GNOME/banshee,mono-soc-2011/banshee,eeejay/banshee,directhex/banshee-hacks,allquixotic/banshee-gst-sharp-work,babycaseny/banshee,stsundermann/banshee,stsundermann/banshee,babycaseny/banshee,arfbtwn/banshee,ixfalia/banshee,directhex/banshee-hacks,allquixotic/banshee-gst-sharp-work,allquixotic/banshee-gst-sharp-work,mono-soc-2011/banshee,mono-soc-2011/banshee,GNOME/banshee,GNOME/banshee,petejohanson/banshee,directhex/banshee-hacks,Carbenium/banshee,babycaseny/banshee,mono-soc-2011/banshee,babycaseny/banshee,babycaseny/banshee,stsundermann/banshee,ixfalia/banshee,ixfalia/banshee,mono-soc-2011/banshee,stsundermann/banshee,eeejay/banshee,mono-soc-2011/banshee,dufoli/banshee,lamalex/Banshee,Dynalon/banshee-osx,babycaseny/banshee,lamalex/Banshee,arfbtwn/banshee,babycaseny/banshee,arfbtwn/banshee,GNOME/banshee,mono-soc-2011/banshee,arfbtwn/banshee,arfbtwn/banshee,dufoli/banshee,stsundermann/banshee,dufoli/banshee,dufoli/banshee,ixfalia/banshee,petejohanson/banshee,ixfalia/banshee,dufoli/banshee,ixfalia/banshee,petejohanson/banshee,lamalex/Banshee,GNOME/banshee,Dynalon/banshee-osx,stsundermann/banshee,Dynalon/banshee-osx,lamalex/Banshee,Dynalon/banshee-osx,Carbenium/banshee,lamalex/Banshee,allquixotic/banshee-gst-sharp-work,Carbenium/banshee,Carbenium/banshee,arfbtwn/banshee,allquixotic/banshee-gst-sharp-work,directhex/banshee-hacks,allquixotic/banshee-gst-sharp-work,directhex/banshee-hacks,Dynalon/banshee-osx,arfbtwn/banshee,babycaseny/banshee,eeejay/banshee
src/Core/Banshee.ThickClient/Banshee.Gui.Widgets/NextButton.cs
src/Core/Banshee.ThickClient/Banshee.Gui.Widgets/NextButton.cs
// // NextButton.cs // // Authors: // Aaron Bockover <abockover@novell.com> // // Copyright (C) 2008 Novell, Inc. // // 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 Gtk; using Banshee.Gui; using Hyena.Widgets; namespace Banshee.Gui.Widgets { public class NextButton : MenuButton { PlaybackShuffleActions shuffle_actions; Menu menu; Widget button; public NextButton (InterfaceActionService actionService) { shuffle_actions = actionService.PlaybackActions.ShuffleActions; button = actionService.PlaybackActions["NextAction"].CreateToolItem (); menu = shuffle_actions.CreateMenu (); Construct (button, menu, true); TooltipText = actionService.PlaybackActions["NextAction"].Tooltip; shuffle_actions.Changed += OnActionsChanged; } private void OnActionsChanged (object o, EventArgs args) { if (!shuffle_actions.Sensitive) { menu.Deactivate (); } ToggleButton.Sensitive = shuffle_actions.Sensitive; if (Arrow != null) { Arrow.Sensitive = shuffle_actions.Sensitive; } } } }
// // NextButton.cs // // Authors: // Aaron Bockover <abockover@novell.com> // // Copyright (C) 2008 Novell, Inc. // // 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 Gtk; using Banshee.Gui; using Hyena.Widgets; namespace Banshee.Gui.Widgets { public class NextButton : MenuButton { PlaybackShuffleActions shuffle_actions; Menu menu; Widget button; public NextButton (InterfaceActionService actionService) { shuffle_actions = actionService.PlaybackActions.ShuffleActions; button = actionService.PlaybackActions["NextAction"].CreateToolItem (); menu = shuffle_actions.CreateMenu (); Construct (button, menu, true); TooltipText = actionService.PlaybackActions["NextAction"].Tooltip; shuffle_actions.Changed += OnActionsChanged; } private void OnActionsChanged (object o, EventArgs args) { menu.Sensitive = shuffle_actions.Sensitive; ToggleButton.Sensitive = shuffle_actions.Sensitive; if (Arrow != null) { Arrow.Sensitive = shuffle_actions.Sensitive; } } } }
mit
C#
32e9aed7969b402eb93bad8740c12b848662f8b5
Fix spelling
Kentico/Mvc,Kentico/Mvc,Kentico/Mvc
src/DancingGoat/Infrastructure/CustomPagedListRenderOptions.cs
src/DancingGoat/Infrastructure/CustomPagedListRenderOptions.cs
using PagedList.Mvc; using CMS.Helpers; namespace DancingGoat.Infrastructure { /// <summary> /// Customized render option definitions for X.PagedList. /// </summary> /// <remarks> /// For more customization options see https://github.com/kpi-ua/X.PagedList/blob/master/src/X.PagedList.Mvc/PagedListRenderOptions.cs. /// </remarks> public class CustomPagedListRenderOptions : PagedListRenderOptions { public CustomPagedListRenderOptions() : base() { LinkToPreviousPageFormat = ResHelper.GetString("General.Previous").ToLower(); LinkToNextPageFormat = ResHelper.GetString("General.Next").ToLower(); } } }
using PagedList.Mvc; using CMS.Helpers; namespace DancingGoat.Infrastructure { /// <summary> /// Customized render option definitons for X.PagedList. /// </summary> /// <remarks> /// For more customization options see https://github.com/kpi-ua/X.PagedList/blob/master/src/X.PagedList.Mvc/PagedListRenderOptions.cs. /// </remarks> public class CustomPagedListRenderOptions : PagedListRenderOptions { public CustomPagedListRenderOptions() : base() { LinkToPreviousPageFormat = ResHelper.GetString("General.Previous").ToLower(); LinkToNextPageFormat = ResHelper.GetString("General.Next").ToLower(); } } }
mit
C#
2a5ef5e97039fb142b21b26831ed8ff5879231ec
Remove all but one async void demo test
nunit/nunit3-vs-adapter
demo/NUnitTestDemo/AsyncTests.cs
demo/NUnitTestDemo/AsyncTests.cs
using System; using System.Threading; using System.Threading.Tasks; using NUnit.Framework; namespace NUnitTestDemo { public class AsyncTests { [Test, ExpectError] public async void AsyncVoidTestIsInvalid() { var result = await ReturnOne(); Assert.AreEqual(1, result); } [Test, ExpectPass] public async Task AsyncTaskTestSucceeds() { var result = await ReturnOne(); Assert.AreEqual(1, result); } [Test, ExpectFailure] public async Task AsyncTaskTestFails() { var result = await ReturnOne(); Assert.AreEqual(2, result); } [Test, ExpectError] public async Task AsyncTaskTestThrowsException() { await ThrowException(); Assert.Fail("Should never get here"); } [TestCase(ExpectedResult = 1), ExpectPass] public async Task<int> AsyncTaskWithResultSucceeds() { return await ReturnOne(); } [TestCase(ExpectedResult = 2), ExpectFailure] public async Task<int> AsyncTaskWithResultFails() { return await ReturnOne(); } [TestCase(ExpectedResult = 0), ExpectError] public async Task<int> AsyncTaskWithResultThrowsException() { return await ThrowException(); } private static Task<int> ReturnOne() { return Task.Run(() => 1); } private static Task<int> ThrowException() { return Task.Run(() => { throw new InvalidOperationException(); return 1; }); } } }
using System; using System.Threading; using System.Threading.Tasks; using NUnit.Framework; namespace NUnitTestDemo { public class AsyncTests { [Test, ExpectPass] public async void AsyncVoidTestSucceeds() { var result = await ReturnOne(); Assert.AreEqual(1, result); } [Test, ExpectFailure] public async void AsyncVoidTestFails() { var result = await ReturnOne(); Assert.AreEqual(2, result); } [Test, ExpectError] public async void AsyncVoidTestThrowsException() { await ThrowException(); Assert.Fail("Should never get here"); } [Test, ExpectPass] public async Task AsyncTaskTestSucceeds() { var result = await ReturnOne(); Assert.AreEqual(1, result); } [Test, ExpectFailure] public async Task AsyncTaskTestFails() { var result = await ReturnOne(); Assert.AreEqual(2, result); } [Test, ExpectError] public async Task AsyncTaskTestThrowsException() { await ThrowException(); Assert.Fail("Should never get here"); } [TestCase(ExpectedResult = 1), ExpectPass] public async Task<int> AsyncTaskWithResultSucceeds() { return await ReturnOne(); } [TestCase(ExpectedResult = 2), ExpectFailure] public async Task<int> AsyncTaskWithResultFails() { return await ReturnOne(); } [TestCase(ExpectedResult = 0), ExpectError] public async Task<int> AsyncTaskWithResultThrowsException() { return await ThrowException(); } private static Task<int> ReturnOne() { return Task.Run(() => 1); } private static Task<int> ThrowException() { return Task.Run(() => { throw new InvalidOperationException(); return 1; }); } } }
mit
C#
8b3801d049f5653cebcb1bd22831b8b111dc9dee
Remove enum values
detaybey/MimeBank
MimeBank/FileType.cs
MimeBank/FileType.cs
namespace MimeBank { public enum FileType { Image, Video, Audio, Swf, Other, } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace MimeBank { /// <summary> /// Just an enum to categorize the file types. /// </summary> public enum FileType { Image = 1, Video = 2, Audio = 3, Swf = 4, Other = 255 } }
apache-2.0
C#
e6b6e4a16f2a12e2ef64f1d136c46c805bfb9731
Revert unintended style changes.
FacilityApi/Facility
src/Facility.Definition/Http/HttpAttributeUtility.cs
src/Facility.Definition/Http/HttpAttributeUtility.cs
using System.Collections.Generic; using System.Globalization; using System.Net; namespace Facility.Definition.Http { internal static class HttpAttributeUtility { public static ServiceAttributeInfo TryGetHttpAttribute(this IServiceElementInfo element) { return element.TryGetAttribute("http"); } public static IReadOnlyList<ServiceAttributeParameterInfo> GetHttpParameters(this IServiceElementInfo element) { return element.TryGetAttribute("http")?.Parameters ?? new ServiceAttributeParameterInfo[0]; } public static ServiceDefinitionError CreateInvalidHttpParameterError(this ServiceAttributeParameterInfo parameter) { return new ServiceDefinitionError($"Unexpected 'http' parameter '{parameter.Name}'.", parameter.Position); } public static HttpStatusCode ParseStatusCodeInteger(ServiceAttributeParameterInfo parameter) { int valueAsInteger; int.TryParse(parameter.Value, NumberStyles.Integer, CultureInfo.InvariantCulture, out valueAsInteger); if (valueAsInteger < 200 || valueAsInteger >= 599) throw new ServiceDefinitionException($"'{parameter.Name}' parameter must be an integer between 200 and 599.", parameter.Position); return (HttpStatusCode) valueAsInteger; } } }
using System.Collections.Generic; using System.Globalization; using System.Net; namespace Facility.Definition.Http { internal static class HttpAttributeUtility { public static ServiceAttributeInfo TryGetHttpAttribute(this IServiceElementInfo element) { return element.TryGetAttribute("http"); } public static IReadOnlyList<ServiceAttributeParameterInfo> GetHttpParameters(this IServiceElementInfo element) { return element.TryGetAttribute("http")?.Parameters ?? new ServiceAttributeParameterInfo[0]; } public static ServiceDefinitionError CreateInvalidHttpParameterError(this ServiceAttributeParameterInfo parameter) { return new ServiceDefinitionError($"Unexpected 'http' parameter '{parameter.Name}'.", parameter.Position); } public static HttpStatusCode ParseStatusCodeInteger(ServiceAttributeParameterInfo parameter) { int valueAsInteger; int.TryParse(parameter.Value, NumberStyles.Integer, CultureInfo.InvariantCulture, out valueAsInteger); if (valueAsInteger < 200 || valueAsInteger >= 599) throw new ServiceDefinitionException($"'{parameter.Name}' parameter must be an integer between 200 and 599.", parameter.Position); return (HttpStatusCode)valueAsInteger; } } }
mit
C#
97870c0d8058a28d8d75167e3990b7f7993a192b
Update FileSetOptions.cs
A51UK/File-Repository
File-Repository/FileSetOptions.cs
File-Repository/FileSetOptions.cs
/* * Copyright 2017 Craig Lee Mark Adams 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 File_Repository.Enum; using System; using System.Collections.Generic; using System.IO; using System.Text; namespace File_Repository { public class FileSetOptions { public string Folder { get; set; } = string.Empty; public string Key { get; set; } = string.Empty; public Stream _stream { get; set; } = null; public string ContentType { get; set; } = string.Empty; public string Address { get; set; } = string.Empty; public FileAccessLevel FileAccess { get; set; } = FileAccessLevel._private; public CloudSecureOptions CloudSecure { get; set; } = CloudSecureOptions.defualt; public string SecureFileLocation { get; set; } = string.Empty; public FolderOptions folderOptions { get; set; } = FolderOptions.CreateIfNull; public string ProjectId { get; set; } = string.Empty; public string ConfigurationString { get; set; } = string.Empty; } }
/* * Copyright 2017 Criag Lee Mark Adams 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 File_Repository.Enum; using System; using System.Collections.Generic; using System.IO; using System.Text; namespace File_Repository { public class FileSetOptions { public string Folder { get; set; } = string.Empty; public string Key { get; set; } = string.Empty; public Stream _stream { get; set; } = null; public string ContentType { get; set; } = string.Empty; public string Address { get; set; } = string.Empty; public FileAccessLevel FileAccess { get; set; } = FileAccessLevel._private; public CloudSecureOptions CloudSecure { get; set; } = CloudSecureOptions.defualt; public string SecureFileLocation { get; set; } = string.Empty; public FolderOptions folderOptions { get; set; } = FolderOptions.CreateIfNull; public string ProjectId { get; set; } = string.Empty; public string ConfigurationString { get; set; } = string.Empty; } }
apache-2.0
C#
51faff57eefb1e346d08c088fb773d514938c034
Update ShrinkingToFit.cs
maria-shahid-aspose/Aspose.Cells-for-.NET,asposecells/Aspose_Cells_NET,maria-shahid-aspose/Aspose.Cells-for-.NET,asposecells/Aspose_Cells_NET,aspose-cells/Aspose.Cells-for-.NET,asposecells/Aspose_Cells_NET,aspose-cells/Aspose.Cells-for-.NET,maria-shahid-aspose/Aspose.Cells-for-.NET,maria-shahid-aspose/Aspose.Cells-for-.NET,aspose-cells/Aspose.Cells-for-.NET,aspose-cells/Aspose.Cells-for-.NET,asposecells/Aspose_Cells_NET
Examples/CSharp/Formatting/ConfiguringAlignmentSettings/ShrinkingToFit.cs
Examples/CSharp/Formatting/ConfiguringAlignmentSettings/ShrinkingToFit.cs
using System.IO; using Aspose.Cells; namespace Aspose.Cells.Examples.Formatting.ConfiguringAlignmentSettings { public class ShrinkingToFit { public static void Main(string[] args) { //ExStart:1 // The path to the documents directory. string dataDir = Aspose.Cells.Examples.Utils.GetDataDir(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); // Create directory if it is not already present. bool IsExists = System.IO.Directory.Exists(dataDir); if (!IsExists) System.IO.Directory.CreateDirectory(dataDir); //Instantiating a Workbook object Workbook workbook = new Workbook(); //Obtaining the reference of the worksheet Worksheet worksheet = workbook.Worksheets[0]; //Accessing the "A1" cell from the worksheet Aspose.Cells.Cell cell = worksheet.Cells["A1"]; //Adding some value to the "A1" cell cell.PutValue("Visit Aspose!"); //Setting the horizontal alignment of the text in the "A1" cell Style style = cell.GetStyle(); //Shrinking the text to fit according to the dimensions of the cell style.ShrinkToFit = true; cell.SetStyle(style); //Saving the Excel file workbook.Save(dataDir + "book1.out.xls", SaveFormat.Excel97To2003); //ExEnd:1 } } }
using System.IO; using Aspose.Cells; namespace Aspose.Cells.Examples.Formatting.ConfiguringAlignmentSettings { public class ShrinkingToFit { public static void Main(string[] args) { // The path to the documents directory. string dataDir = Aspose.Cells.Examples.Utils.GetDataDir(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); // Create directory if it is not already present. bool IsExists = System.IO.Directory.Exists(dataDir); if (!IsExists) System.IO.Directory.CreateDirectory(dataDir); //Instantiating a Workbook object Workbook workbook = new Workbook(); //Obtaining the reference of the worksheet Worksheet worksheet = workbook.Worksheets[0]; //Accessing the "A1" cell from the worksheet Aspose.Cells.Cell cell = worksheet.Cells["A1"]; //Adding some value to the "A1" cell cell.PutValue("Visit Aspose!"); //Setting the horizontal alignment of the text in the "A1" cell Style style = cell.GetStyle(); //Shrinking the text to fit according to the dimensions of the cell style.ShrinkToFit = true; cell.SetStyle(style); //Saving the Excel file workbook.Save(dataDir + "book1.out.xls", SaveFormat.Excel97To2003); } } }
mit
C#
5d9e1fee1bafa096f924d37e29cda64a44f1e3aa
add global variables used across projects/solutions
Paymentsense/Dapper.SimpleSave
PS.Mothership.Core/PS.Mothership.Core.Common/Constants/GlobalConstants.cs
PS.Mothership.Core/PS.Mothership.Core.Common/Constants/GlobalConstants.cs
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace PS.Mothership.Core.Common.Constants { public class GlobalConstants { public const char Dot = '.'; public const char Comma = ','; public const char Space = ' '; public const char Star = '*'; public const char At = '@'; public const int IPAddressPadding = 3; public const int InitalMatch = 2; public const int ExactMatchScore = 5; public const int WildCardMatchScore = 1; public const double ExpiryDays = 30; public const int FirstNameScore = 2; public const int LastNameScore = 2; } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace PS.Mothership.Core.Common.Constants { public class GlobalConstants { // Ip Matching constants public const char Dot = '.'; public const char Star = '*'; public const char At = '@'; public const int IPAddressPadding = 3; public const int InitalMatch = 2; public const int ExactMatchScore = 5; public const int WildCardMatchScore = 1; public const double ExpiryDays = 30; public const int FirstNameScore = 2; public const int LastNameScore = 2; } }
mit
C#
dff86ff24fe0c5fb402794a2495c5fb0cb715f1d
Fix coin table name
LykkeCity/EthereumApiDotNetCore,LykkeCity/EthereumApiDotNetCore,LykkeCity/EthereumApiDotNetCore
src/Core/Constants.cs
src/Core/Constants.cs
namespace Core { public class Constants { /// <summary> /// Used to change table and queue names in testing enviroment /// </summary> public static string StoragePrefix { get; set; } = ""; public const string EthereumContractQueue = "ethereum-contract-queue"; public const string EthereumOutQueue = "ethereum-queue-out"; public const string EmailNotifierQueue = "emailsqueue"; /// <summary> /// Used to internal monitoring of refill transactions /// </summary> public const string ContractTransferQueue = "ethereum-contract-transfer-queue"; /// <summary> /// Used to internal monitoring of coin transactions /// </summary> public const string TransactionMonitoringQueue = "ethereum-transaction-monitor-queue"; /// <summary> /// Used to notify external services about coin transactions /// </summary> public const string CoinTransactionQueue = "ethereum-coin-transaction-queue"; /// <summary> /// Used to notify external services about events in coin contracts /// </summary> public const string CoinEventQueue = "ethereum-coin-event-queue"; /// <summary> /// Used to process manual payments /// </summary> public const string UserContractManualQueue = "ethereum-user-payment-manual"; //table names public const string MonitoringTable = "Monitoring"; public const string UserContractsTable = "UserContracts"; public const string AppSettingsTable = "AppSettings"; public const string TransactionsTable = "Transactions"; public const string CoinFiltersTable = "CoinFilters"; public const string CoinTable = "Dictionaries"; public const int GasForUserContractTransafer = 50000; public const int GasForCoinTransaction = 200000; // app settings keys public const string EthereumFilterSettingKey = "ethereum-user-contract-filter"; // user payment event public const string UserPaymentEvent = "PaymentFromUser"; //coin contract event names public const string CashInEvent = "CoinCashIn"; public const string CashOutEvent = "CoinCashOut"; public const string TransferEvent = "CoinTransfer"; public const string EthereumBlockchain = "Ethereum"; } }
namespace Core { public class Constants { /// <summary> /// Used to change table and queue names in testing enviroment /// </summary> public static string StoragePrefix { get; set; } = ""; public const string EthereumContractQueue = "ethereum-contract-queue"; public const string EthereumOutQueue = "ethereum-queue-out"; public const string EmailNotifierQueue = "emailsqueue"; /// <summary> /// Used to internal monitoring of refill transactions /// </summary> public const string ContractTransferQueue = "ethereum-contract-transfer-queue"; /// <summary> /// Used to internal monitoring of coin transactions /// </summary> public const string TransactionMonitoringQueue = "ethereum-transaction-monitor-queue"; /// <summary> /// Used to notify external services about coin transactions /// </summary> public const string CoinTransactionQueue = "ethereum-coin-transaction-queue"; /// <summary> /// Used to notify external services about events in coin contracts /// </summary> public const string CoinEventQueue = "ethereum-coin-event-queue"; /// <summary> /// Used to process manual payments /// </summary> public const string UserContractManualQueue = "ethereum-user-payment-manual"; //table names public const string MonitoringTable = "Monitoring"; public const string UserContractsTable = "UserContracts"; public const string AppSettingsTable = "AppSettings"; public const string TransactionsTable = "Transactions"; public const string CoinFiltersTable = "CoinFilters"; public const string CoinTable = "CoinTable"; public const int GasForUserContractTransafer = 50000; public const int GasForCoinTransaction = 200000; // app settings keys public const string EthereumFilterSettingKey = "ethereum-user-contract-filter"; // user payment event public const string UserPaymentEvent = "PaymentFromUser"; //coin contract event names public const string CashInEvent = "CoinCashIn"; public const string CashOutEvent = "CoinCashOut"; public const string TransferEvent = "CoinTransfer"; public const string EthereumBlockchain = "Ethereum"; } }
mit
C#
88688032e095dfdc2c2110b5328ad7f6a1bc8e79
Update comment
wangkanai/Detection
src/DependencyInjection/IDetectionBuilder.cs
src/DependencyInjection/IDetectionBuilder.cs
// Copyright (c) 2014-2020 Sarin Na Wangkanai, All Rights Reserved. // The Apache v2. See License.txt in the project root for license information. namespace Microsoft.Extensions.DependencyInjection { /// <summary> /// Helper functions for configuring detection services. /// </summary> public interface IDetectionBuilder { /// <summary> /// Gets the <see cref="IServiceCollection" /> services are attached to. /// </summary> /// <value> /// The <see cref="IServiceCollection" /> services are attached to. /// </value> IServiceCollection Services { get; } } }
// Copyright (c) 2014-2020 Sarin Na Wangkanai, All Rights Reserved. // The Apache v2. See License.txt in the project root for license information. namespace Microsoft.Extensions.DependencyInjection { /// <summary> /// Detection builder Interface /// </summary> public interface IDetectionBuilder { /// <summary> /// Gets the services. /// </summary> /// <value> /// The services. /// </value> IServiceCollection Services { get; } } }
apache-2.0
C#
d847a351340a15862755944226f15bb7e30a40fb
Tweak the default help formatter
mrahhal/Konsola
src/Konsola/Parser/IHelpFormatter.Default.cs
src/Konsola/Parser/IHelpFormatter.Default.cs
using System.Linq; using System.Collections.Generic; namespace Konsola.Parser { public class DefaultHelpFormatter : IHelpFormatter { public void Format(HelpContext context, IConsole console) { if (!string.IsNullOrWhiteSpace(context.Options.Description)) { console.WriteLine(context.Options.Description); console.WriteLine(); } if (context.NestedCommands.Any()) { FormatCommands(context.NestedCommands, console); console.WriteLine(); } if (context.Parameters.Any()) { FormatParameters(context.Parameters, console); } } public void FormatForCommand(CommandHelpContext context, IConsole console) { if (!string.IsNullOrWhiteSpace(context.Attribute.Description)) { console.WriteLine(context.Attribute.Description); console.WriteLine(); } if (context.NestedCommands.Any()) { FormatCommands(context.NestedCommands, console); console.WriteLine(); } if (context.Parameters.Any()) { FormatParameters(context.Parameters, console); } } private void FormatParameters(IEnumerable<ParameterContext> parameters, IConsole console) { console.WriteLine(WriteKind.Info, "Parameters:"); foreach (var parameter in parameters) { console.Write("* " + parameter.FullName); if (!string.IsNullOrWhiteSpace(parameter.Attribute.Description)) { console.WriteLine(" - " + parameter.Attribute.Description); } else { console.WriteLine(); } } } private void FormatCommands(IEnumerable<CommandAttribute> commands, IConsole console) { console.WriteLine(WriteKind.Info, "Commands:"); foreach (var command in commands) { console.Write("* " + command.Name); if (!string.IsNullOrWhiteSpace(command.Description)) { console.WriteLine(" - " + command.Description); } else { console.WriteLine(); } } } } }
using System.Linq; using System.Collections.Generic; namespace Konsola.Parser { public class DefaultHelpFormatter : IHelpFormatter { public void Format(HelpContext context, IConsole console) { console.WriteLine(context.Options.Description); console.WriteLine(); FormatCommands(context.NestedCommands, console); console.WriteLine(); FormatParameters(context.Parameters, console); } public void FormatForCommand(CommandHelpContext context, IConsole console) { console.WriteLine(context.Attribute.Description); console.WriteLine(); FormatCommands(context.NestedCommands, console); console.WriteLine(); FormatParameters(context.Parameters, console); } private void FormatParameters(IEnumerable<ParameterContext> parameters, IConsole console) { if (!parameters.Any()) { return; } console.WriteLine(WriteKind.Info, "Parameters:"); foreach (var parameter in parameters) { console.WriteLine("* " + parameter.FullName + " - " + parameter.Attribute.Description); } } private void FormatCommands(IEnumerable<CommandAttribute> commands, IConsole console) { if (!commands.Any()) { return; } console.WriteLine(WriteKind.Info, "Commands:"); foreach (var command in commands) { console.WriteLine("* " + command.Name + " - " + command.Description); } } } }
mit
C#
1f97d021a301fe6a4e51c693a217afd47a5614e5
Make numeric_resolution on date mapping nullable
gayancc/elasticsearch-net,junlapong/elasticsearch-net,gayancc/elasticsearch-net,starckgates/elasticsearch-net,mac2000/elasticsearch-net,ststeiger/elasticsearch-net,starckgates/elasticsearch-net,SeanKilleen/elasticsearch-net,tkirill/elasticsearch-net,joehmchan/elasticsearch-net,LeoYao/elasticsearch-net,robrich/elasticsearch-net,LeoYao/elasticsearch-net,mac2000/elasticsearch-net,starckgates/elasticsearch-net,faisal00813/elasticsearch-net,robertlyson/elasticsearch-net,junlapong/elasticsearch-net,DavidSSL/elasticsearch-net,tkirill/elasticsearch-net,robertlyson/elasticsearch-net,ststeiger/elasticsearch-net,abibell/elasticsearch-net,joehmchan/elasticsearch-net,robrich/elasticsearch-net,ststeiger/elasticsearch-net,faisal00813/elasticsearch-net,abibell/elasticsearch-net,abibell/elasticsearch-net,tkirill/elasticsearch-net,robertlyson/elasticsearch-net,joehmchan/elasticsearch-net,wawrzyn/elasticsearch-net,mac2000/elasticsearch-net,SeanKilleen/elasticsearch-net,gayancc/elasticsearch-net,SeanKilleen/elasticsearch-net,robrich/elasticsearch-net,junlapong/elasticsearch-net,DavidSSL/elasticsearch-net,wawrzyn/elasticsearch-net,LeoYao/elasticsearch-net,wawrzyn/elasticsearch-net,faisal00813/elasticsearch-net,DavidSSL/elasticsearch-net
src/Nest/Domain/Mapping/Types/DateMapping.cs
src/Nest/Domain/Mapping/Types/DateMapping.cs
using System.Collections.Generic; using Newtonsoft.Json; using System; using Newtonsoft.Json.Converters; namespace Nest { [JsonObject(MemberSerialization.OptIn)] public class DateMapping : MultiFieldMapping, IElasticType, IElasticCoreType { public DateMapping():base("date") { } /// <summary> /// The name of the field that will be stored in the index. Defaults to the property/field name. /// </summary> [JsonProperty("index_name")] public string IndexName { get; set; } [JsonProperty("store")] public bool? Store { get; set; } [JsonProperty("index"), JsonConverter(typeof(StringEnumConverter))] public NonStringIndexOption? Index { get; set; } [JsonProperty("format")] public string Format { get; set; } [JsonProperty("precision_step")] public int? PrecisionStep { get; set; } [JsonProperty("boost")] public double? Boost { get; set; } [JsonProperty("null_value")] public DateTime? NullValue { get; set; } [JsonProperty("ignore_malformed")] public bool? IgnoreMalformed { get; set; } [JsonProperty("doc_values")] public bool? DocValues { get; set; } [JsonProperty("numeric_resolution")] public NumericResolutionUnit? NumericResolution { get; set; } } }
using System.Collections.Generic; using Newtonsoft.Json; using System; using Newtonsoft.Json.Converters; namespace Nest { [JsonObject(MemberSerialization.OptIn)] public class DateMapping : MultiFieldMapping, IElasticType, IElasticCoreType { public DateMapping():base("date") { } /// <summary> /// The name of the field that will be stored in the index. Defaults to the property/field name. /// </summary> [JsonProperty("index_name")] public string IndexName { get; set; } [JsonProperty("store")] public bool? Store { get; set; } [JsonProperty("index"), JsonConverter(typeof(StringEnumConverter))] public NonStringIndexOption? Index { get; set; } [JsonProperty("format")] public string Format { get; set; } [JsonProperty("precision_step")] public int? PrecisionStep { get; set; } [JsonProperty("boost")] public double? Boost { get; set; } [JsonProperty("null_value")] public DateTime? NullValue { get; set; } [JsonProperty("ignore_malformed")] public bool? IgnoreMalformed { get; set; } [JsonProperty("doc_values")] public bool? DocValues { get; set; } [JsonProperty("numeric_resolution")] public NumericResolutionUnit NumericResolution { get; set; } } }
apache-2.0
C#
9d701d97fcce6e4f411d96e0b1771e0674c1bfe7
bump version
colored-console/colored-console,colored-console/colored-console
src/CommonAssemblyInfo.cs
src/CommonAssemblyInfo.cs
// <copyright file="CommonAssemblyInfo.cs" company="ColoredConsole contributors"> // Copyright (c) ColoredConsole contributors. (coloredconsole@gmail.com) // </copyright> using System; using System.Reflection; using System.Runtime.InteropServices; [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("ColoredConsole contributors")] [assembly: AssemblyCopyright("Copyright (c) ColoredConsole contributors. (coloredconsole@gmail.com)")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] [assembly: AssemblyProduct("ColoredConsole")] // NOTE (adamralph): the assembly versions are fixed at 0.0.0.0 - only NuGet package versions matter [assembly: AssemblyVersion("0.0.0.0")] [assembly: AssemblyFileVersion("0.0.0.0")] // NOTE (adamralph): this is used for the NuGet package version [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: ComVisible(false)] [assembly: CLSCompliant(true)]
// <copyright file="CommonAssemblyInfo.cs" company="ColoredConsole contributors"> // Copyright (c) ColoredConsole contributors. (coloredconsole@gmail.com) // </copyright> using System; using System.Reflection; using System.Runtime.InteropServices; [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("ColoredConsole contributors")] [assembly: AssemblyCopyright("Copyright (c) ColoredConsole contributors. (coloredconsole@gmail.com)")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] [assembly: AssemblyProduct("ColoredConsole")] // NOTE (adamralph): the assembly versions are fixed at 0.0.0.0 - only NuGet package versions matter [assembly: AssemblyVersion("0.0.0.0")] [assembly: AssemblyFileVersion("0.0.0.0")] // NOTE (adamralph): this is used for the NuGet package version [assembly: AssemblyInformationalVersion("0.6.0")] [assembly: ComVisible(false)] [assembly: CLSCompliant(true)]
mit
C#
9d2f14088ece1313debb0f14b260f7ffb1aca758
Remove nested div to fix style issue
SkillsFundingAgency/das-employerapprenticeshipsservice,SkillsFundingAgency/das-employerapprenticeshipsservice,SkillsFundingAgency/das-employerapprenticeshipsservice
src/SFA.DAS.EmployerAccounts.Web/Views/EmployerTeam/V2/FundingComplete.cshtml
src/SFA.DAS.EmployerAccounts.Web/Views/EmployerTeam/V2/FundingComplete.cshtml
@model SFA.DAS.EmployerAccounts.Web.ViewModels.AccountDashboardViewModel @if (Model.ReservedFundingToShow != null) { <h3 class="das-panel__heading">Apprenticeship funding secured</h3> <dl class="das-definition-list das-definition-list--with-separator"> <dt class="das-definition-list__title">Legal entity:</dt> <dd class="das-definition-list__definition">@Model.ReservedFundingToShowLegalEntityName</dd> <dt class="das-definition-list__title">Training course:</dt> <dd class="das-definition-list__definition">@Model.ReservedFundingToShow.CourseName</dd> <dt class="das-definition-list__title">Start and end date: </dt> <dd class="das-definition-list__definition">@Model.ReservedFundingToShow.StartDate.ToString("MMMM yyyy") to @Model.ReservedFundingToShow.EndDate.ToString("MMMM yyyy")</dd> </dl> } @if (Model.RecentlyAddedReservationId != null && Model.ReservedFundingToShow?.ReservationId != Model.RecentlyAddedReservationId) { <p>We're dealing with your request for funding, please check back later.</p> } <p><a href="@Url.ReservationsAction("reservations")" class="das-panel__link">Check and secure funding now</a> </p>
@model SFA.DAS.EmployerAccounts.Web.ViewModels.AccountDashboardViewModel <div class="das-panel das-panel--featured"> @if (Model.ReservedFundingToShow != null) { <h3 class="das-panel__heading">Apprenticeship funding secured</h3> <dl class="das-definition-list das-definition-list--with-separator"> <dt class="das-definition-list__title">Legal entity:</dt> <dd class="das-definition-list__definition">@Model.ReservedFundingToShowLegalEntityName</dd> <dt class="das-definition-list__title">Training course:</dt> <dd class="das-definition-list__definition">@Model.ReservedFundingToShow.CourseName</dd> <dt class="das-definition-list__title">Start and end date: </dt> <dd class="das-definition-list__definition">@Model.ReservedFundingToShow.StartDate.ToString("MMMM yyyy") to @Model.ReservedFundingToShow.EndDate.ToString("MMMM yyyy")</dd> </dl> } @if (Model.RecentlyAddedReservationId != null && Model.ReservedFundingToShow?.ReservationId != Model.RecentlyAddedReservationId) { <p>We're dealing with your request for funding, please check back later.</p> } <p><a href="@Url.ReservationsAction("reservations")" class="das-panel__link">Check and secure funding now</a> </p> </div>
mit
C#
7dc2eb9041b5d9327690ece4812bde5a369b228b
Fix language syntax issues (#48)
gyrosworkshop/Wukong,gyrosworkshop/Wukong
Wukong/Models/Api.cs
Wukong/Models/Api.cs
using System.Collections.Generic; namespace Wukong.Models { public class TokenResponse { public string UserId; public string Signature; public User User; } public class OAuthMethod { public string Scheme; public string DisplayName; public string Url; } public class WebSocketEvent { public string EventName; public string ChannelId; } public class NextSongUpdated : WebSocketEvent { public new string EventName = "Preload"; public Song Song; } public class UserListUpdated : WebSocketEvent { public new string EventName = "UserListUpdated"; public IList<User> Users; } public class Play : WebSocketEvent { public new string EventName = "Play"; public bool Downvote; public Song Song; public double Elapsed; public string User; } public class Notification { public string Message; public int Timeout; } public class NotificationEvent : WebSocketEvent { public new string EventName = "Notification"; public Notification Notification; } public class ClientSongList { public string Name; public List<ClientSong> Song; } public class SongList { public string Name; public List<Song> Song; } public class SearchSongRequest { public string Key; } public class GetSongRequest : ClientSong { public bool WithFileUrl; } public class CreateOrUpdateSongListResponse { public long Id; } }
using System; using System.Collections.Generic; namespace Wukong.Models { public class TokenResponse { public string UserId; public string Signature; public User User; } public class OAuthMethod { public string Scheme; public string DisplayName; public string Url; } public class WebSocketEvent { public string EventName; public string ChannelId; } public class NextSongUpdated : WebSocketEvent { new public string EventName = "Preload"; public Song Song; } public class UserListUpdated : WebSocketEvent { new public string EventName = "UserListUpdated"; public IList<User> Users; } public class Play : WebSocketEvent { new public string EventName = "Play"; public Boolean Downvote; public Song Song; public double Elapsed; public string User; } public class Notification { public string Message; public int Timeout; } public class NotificationEvent : WebSocketEvent { new public string EventName = "Notification"; public Notification Notification; } public class ClientSongList { public string Name; public List<ClientSong> Song; } public class SongList { public string Name; public List<Song> Song; } public class SearchSongRequest { public string Key; } public class GetSongRequest : ClientSong { public bool WithFileUrl; } public class CreateOrUpdateSongListResponse { public long Id; } }
mit
C#
037a97ab603b86e2e8533f0e15fceb208c8baecc
Introduce a default for enabled flag. (#196)
tg-msft/azure-sdk-tools,tg-msft/azure-sdk-tools,tg-msft/azure-sdk-tools,tg-msft/azure-sdk-tools,tg-msft/azure-sdk-tools,tg-msft/azure-sdk-tools,tg-msft/azure-sdk-tools,tg-msft/azure-sdk-tools
tools/check-enforcer/Azure.Sdk.Tools.CheckEnforcer/RepositoryConfiguration.cs
tools/check-enforcer/Azure.Sdk.Tools.CheckEnforcer/RepositoryConfiguration.cs
using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Text; using YamlDotNet.Serialization; namespace Azure.Sdk.Tools.CheckEnforcer { public class RepositoryConfiguration : IRepositoryConfiguration { public RepositoryConfiguration() { MinimumCheckRuns = 1; IsEnabled = true; } [YamlMember(Alias = "minimumCheckRuns")] public uint MinimumCheckRuns { get; internal set; } [YamlMember(Alias = "enabled")] public bool IsEnabled { get; internal set; } [YamlMember(Alias = "format")] public string Format { get; internal set; } public override string ToString() { var json = JsonConvert.SerializeObject(this); return json; } } }
using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Text; using YamlDotNet.Serialization; namespace Azure.Sdk.Tools.CheckEnforcer { public class RepositoryConfiguration : IRepositoryConfiguration { public RepositoryConfiguration() { MinimumCheckRuns = 1; } [YamlMember(Alias = "minimumCheckRuns")] public uint MinimumCheckRuns { get; internal set; } [YamlMember(Alias = "enabled")] public bool IsEnabled { get; internal set; } [YamlMember(Alias = "format")] public string Format { get; internal set; } public override string ToString() { var json = JsonConvert.SerializeObject(this); return json; } } }
mit
C#
3aa94a173a068fa37618ae1dcd95b886b7f0e57c
Add IAmInitiatedByConcurrencyControlledMessages
MrMDavidson/Rebus.SingleAccessSagas
Rebus.SingleAccessSagas/IHandleConcurrencyControlledMessages.cs
Rebus.SingleAccessSagas/IHandleConcurrencyControlledMessages.cs
using Rebus.Handlers; using Rebus.Sagas; namespace Rebus.SingleAccessSagas { /// <summary> /// Marker interface to indicate that a handler should have concurrency controls applied to it /// </summary> public interface IHandleConcurrencyControlledMessages : IHandleMessages { } /// <summary> /// Indicates that a handler has concurrency controls applied to handling of the messages /// </summary> /// <typeparam name="TMessageType">Type of message being received</typeparam> public interface IHandleConcurrencyControlledMessages<in TMessageType> : IHandleConcurrencyControlledMessages, IHandleMessages<TMessageType> { /// <summary> /// Get concurrency controls to be applied to <paramref name="message"/> /// </summary> /// <param name="message">Message having concurrency controls applied</param> /// <returns><c>null</c> if there's no concurrency controls for <paramref name="message"/> otherwise a <seealso cref="ConcurrencyControlInfo"/> describing the concurrency to be applied</returns> ConcurrencyControlInfo GetConcurrencyControlInfoForMessage(TMessageType message); } /// <summary> /// Market interface to indicate that not only does a saga get initiated by <typeparamref name="TMessageType"/> but that it does so in a concurrency controlled way /// </summary> /// <typeparam name="TMessageType"></typeparam> public interface IAmInitiatedByConcurrencyControlledMessages<in TMessageType> : IAmInitiatedBy<TMessageType>, IHandleConcurrencyControlledMessages<TMessageType> { } }
using Rebus.Handlers; namespace Rebus.SingleAccessSagas { /// <summary> /// Marker interface to indicate that a handler should have concurrency controls applied to it /// </summary> public interface IHandleConcurrencyControlledMessages : IHandleMessages { } /// <summary> /// Indicates that a handler has concurrency controls applied to handling of the messages /// </summary> /// <typeparam name="TMessageType">Type of message being received</typeparam> public interface IHandleConcurrencyControlledMessages<in TMessageType> : IHandleConcurrencyControlledMessages, IHandleMessages<TMessageType> { /// <summary> /// Get concurrency controls to be applied to <paramref name="message"/> /// </summary> /// <param name="message">Message having concurrency controls applied</param> /// <returns><c>null</c> if there's no concurrency controls for <paramref name="message"/> otherwise a <seealso cref="ConcurrencyControlInfo"/> describing the concurrency to be applied</returns> ConcurrencyControlInfo GetConcurrencyControlInfoForMessage(TMessageType message); } }
mit
C#
057b27dda320946f1fff1e5e7929664d2edf4149
Refactor StatementPreparerTests.
mysql-net/MySqlConnector,mysql-net/MySqlConnector
tests/MySqlConnector.Tests/StatementPreparerTests.cs
tests/MySqlConnector.Tests/StatementPreparerTests.cs
using System.Text; using MySql.Data.MySqlClient; using MySqlConnector.Core; using MySqlConnector.Utilities; using Xunit; namespace MySqlConnector.Tests { public class StatementPreparerTests { [Theory] [InlineData("SELECT Id\nFROM mytable\nWHERE column1 = 2\nAND column2 = @param")] [InlineData("SELECT Id\nFROM mytable\nWHERE column1 = 2 -- mycomment\nAND column2 = @param")] [InlineData("SELECT Id\nFROM mytable\nWHERE column1 = 2 -- mycomment\nAND column2 = @param")] [InlineData("SELECT Id\nFROM mytable\nWHERE column1 = 2 -- mycomment\n AND column2 = @param")] public void Bug429(string sql) { var parameters = new MySqlParameterCollection(); parameters.AddWithValue("@param", 123); var parsedSql = GetParsedSql(sql, parameters); Assert.Equal(sql.Replace("@param", "123"), parsedSql); } [Theory] [InlineData(@"SELECT /* * / @param */ 1;")] [InlineData("SELECT # @param \n1;")] [InlineData("SELECT -- @param \n1;")] public void ParametersIgnoredInComments(string sql) { Assert.Equal(sql, GetParsedSql(sql)); } private static string GetParsedSql(string input, MySqlParameterCollection parameters = null) => Encoding.UTF8.GetString(new StatementPreparer(input, parameters ?? new MySqlParameterCollection(), StatementPreparerOptions.None).ParseAndBindParameters().Slice(1)); } }
using System.Text; using MySql.Data.MySqlClient; using MySqlConnector.Core; using MySqlConnector.Utilities; using Xunit; namespace MySqlConnector.Tests { public class StatementPreparerTests { [Theory] [InlineData(GoodSqlText)] [InlineData(AnotherGoodSqlText)] [InlineData(AnotherGoodSqlText2)] [InlineData(BadSqlText)] public void PrepareQuery(string sql) { var parameters = new MySqlParameterCollection(); parameters.AddWithValue("c2", 3); var parsedRequest1 = Encoding.UTF8.GetString(new StatementPreparer(sql, parameters, StatementPreparerOptions.None).ParseAndBindParameters().Slice(1)); Assert.Matches("column2 = 3", parsedRequest1); } [Fact] public void CStyleComment() { var parameters = new MySqlParameterCollection(); var sql = @"SELECT /* * / @param */ 1;"; var parsedSql = Encoding.UTF8.GetString(new StatementPreparer(sql, parameters, StatementPreparerOptions.None).ParseAndBindParameters().Slice(1)); Assert.Equal(sql, parsedSql); } private const string BadSqlText = @"SELECT Id FROM mytable WHERE column1 = 2 -- mycomment AND column2 = @c2"; private const string GoodSqlText = @"SELECT Id FROM mytable WHERE column1 = 2 AND column2 = @c2"; private const string AnotherGoodSqlText = @"SELECT Id FROM mytable WHERE column1 = 2 -- mycomment AND column2 = @c2"; private const string AnotherGoodSqlText2 = @"SELECT Id FROM mytable WHERE column1 = 2 -- mycomment AND column2 = @c2"; } }
mit
C#
bb150357e3175a704202d81890bf0bbdad275490
Update version to 1.1.0.15-rc1
KeyPay/keypay-dotnet,KeyPay/keypay-dotnet,KeyPay/keypay-dotnet,KeyPay/keypay-dotnet
src/keypay-dotnet/Properties/AssemblyInfo.cs
src/keypay-dotnet/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("KeyPay")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyProduct("KeyPay")] [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("93365e33-3b92-4ea6-ab42-ffecbc504138")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyInformationalVersion("1.1.0.15-rc1")] [assembly: AssemblyFileVersion("1.0.0.0")]
using System.Reflection; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("KeyPay")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyProduct("KeyPay")] [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("93365e33-3b92-4ea6-ab42-ffecbc504138")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyInformationalVersion("1.1.0.13")] [assembly: AssemblyFileVersion("1.0.0.0")]
mit
C#
164ab1de9be2c64fc1f8b54423cc20d09ab237ac
Fix Dispose caused shutdown fails to notify.
yonglehou/msgpack-rpc-cli,yfakariya/msgpack-rpc-cli
src/MsgPack.Rpc/Rpc/Protocols/ShutdownCompletedEventArgs.cs
src/MsgPack.Rpc/Rpc/Protocols/ShutdownCompletedEventArgs.cs
#region -- License Terms -- // // MessagePack for CLI // // Copyright (C) 2010 FUJIWARA, Yusuke // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // #endregion -- License Terms -- using System; using System.Diagnostics.Contracts; namespace MsgPack.Rpc.Protocols { /// <summary> /// Contains event data for shutdown completion events both of client and server sides. /// </summary> public class ShutdownCompletedEventArgs : EventArgs { private readonly ShutdownSource _source; /// <summary> /// Gets a <see cref="ShutdownSource"/> value which indicates shutdown source. /// </summary> /// <value> /// A <see cref="ShutdownSource"/> value which indicates shutdown source. /// </value> public ShutdownSource Source { get { return this._source; } } /// <summary> /// Initializes a new instance of the <see cref="ShutdownCompletedEventArgs"/> class. /// </summary> /// <param name="source">A <see cref="ShutdownSource"/> value which indicates shutdown source.</param> /// <exception cref="ArgumentOutOfRangeException"> /// The <paramref name="source"/> is not valid <see cref="ShutdownSource"/> enumeration value. /// </exception> public ShutdownCompletedEventArgs( ShutdownSource source ) { switch ( source ) { case ShutdownSource.Client: case ShutdownSource.Server: case ShutdownSource.Unknown: case ShutdownSource.Disposing: { break; } default: { throw new ArgumentOutOfRangeException( "source" ); } } Contract.EndContractBlock(); this._source = source; } } }
#region -- License Terms -- // // MessagePack for CLI // // Copyright (C) 2010 FUJIWARA, Yusuke // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // #endregion -- License Terms -- using System; using System.Diagnostics.Contracts; namespace MsgPack.Rpc.Protocols { /// <summary> /// Contains event data for shutdown completion events both of client and server sides. /// </summary> public class ShutdownCompletedEventArgs : EventArgs { private readonly ShutdownSource _source; /// <summary> /// Gets a <see cref="ShutdownSource"/> value which indicates shutdown source. /// </summary> /// <value> /// A <see cref="ShutdownSource"/> value which indicates shutdown source. /// </value> public ShutdownSource Source { get { return this._source; } } /// <summary> /// Initializes a new instance of the <see cref="ShutdownCompletedEventArgs"/> class. /// </summary> /// <param name="source">A <see cref="ShutdownSource"/> value which indicates shutdown source.</param> /// <exception cref="ArgumentOutOfRangeException"> /// The <paramref name="source"/> is not valid <see cref="ShutdownSource"/> enumeration value. /// </exception> public ShutdownCompletedEventArgs( ShutdownSource source ) { switch ( source ) { case ShutdownSource.Client: case ShutdownSource.Server: case ShutdownSource.Unknown: { break; } default: { throw new ArgumentOutOfRangeException( "source" ); } } Contract.EndContractBlock(); this._source = source; } } }
apache-2.0
C#
8dbb329b3bde4ee246cec77eb02d7a7185f2973f
update test for CarAdvertController (Get)
mdavid626/artemis
src/Artemis.Web.Tests/CarAdvertControllerTest.cs
src/Artemis.Web.Tests/CarAdvertControllerTest.cs
using System; using Microsoft.VisualStudio.TestTools.UnitTesting; using Artemis.Web.Controllers; using NSubstitute; using Artemis.Common; using System.Web.Http.Results; using Artemis.Web.Models; using AutoMapper; using Artemis.Web.ViewModels; using System.Linq; namespace Artemis.Web.Tests { [TestClass] public class CarAdvertControllerTest { private IMapper CreateMappings() { return AutoMapperConfig.Create(); } [TestMethod] public void TestValidGet() { var carAdvert = new CarAdvert() { Id = 1, Title = "Audi", Price = 1500, Fuel = FuelType.Diesel, IsNew = true }; var vm = Substitute.For<IViewModel<CarAdvert>>(); vm.Get(Arg.Any<QueryContext>()).Returns(c => new CarAdvert[] { carAdvert }); var controller = new CarAdvertController(vm, CreateMappings()); var result = controller.Get() as OkNegotiatedContentResult<CollectionResultDto<CarAdvertDto>>; Assert.IsNotNull(result); var item = result.Content.Entities.Single(); Assert.AreEqual(item.Id, 1); Assert.AreEqual(item.Title, "Audi"); Assert.AreEqual(item.Price, 1500); Assert.AreEqual(item.Fuel, "diesel"); Assert.AreEqual(item.New, true); } [TestMethod] public void TestValidGetId() { var carAdvert = new CarAdvert() { Id = 1, Title = "Audi", Price = 1500, Fuel = FuelType.Diesel, IsNew = true }; var vm = Substitute.For<IViewModel<CarAdvert>>(); vm.Get(Arg.Any<int>()).Returns(c => carAdvert); var controller = new CarAdvertController(vm, CreateMappings()); var result = controller.Get(1) as OkNegotiatedContentResult<CarAdvertDto>; Assert.IsNotNull(result); var item = result.Content; Assert.AreEqual(item.Id, 1); Assert.AreEqual(item.Title, "Audi"); Assert.AreEqual(item.Price, 1500); Assert.AreEqual(item.Fuel, "diesel"); Assert.AreEqual(item.New, true); } } }
using System; using Microsoft.VisualStudio.TestTools.UnitTesting; using Artemis.Web.Controllers; using NSubstitute; using Artemis.Common; using System.Web.Http.Results; using Artemis.Web.Models; using AutoMapper; using Artemis.Web.ViewModels; namespace Artemis.Web.Tests { [TestClass] public class CarAdvertControllerTest { private IMapper CreateMappings() { return AutoMapperConfig.Create(); } [TestMethod] public void TestValidGet() { var vm = Substitute.For<IViewModel<CarAdvert>>(); vm.Get(Arg.Any<QueryContext>()).Returns(c => new CarAdvert[0]); var controller = new CarAdvertController(vm, CreateMappings()); var result = controller.Get(); Assert.IsTrue(result is OkNegotiatedContentResult<CollectionResultDto<CarAdvertDto>>); } [TestMethod] public void TestValidGetId() { var carAdvert = new CarAdvert() { Id = 1, Title = "Audi" }; var vm = Substitute.For<IViewModel<CarAdvert>>(); vm.Get(Arg.Any<int>()).Returns(c => carAdvert); var controller = new CarAdvertController(vm, CreateMappings()); var result = controller.Get(1) as OkNegotiatedContentResult<CarAdvertDto>; Assert.IsNotNull(result); Assert.AreEqual(result.Content.Id, carAdvert.Id); Assert.AreEqual(result.Content.Title, carAdvert.Title); } } }
mit
C#
cc62e9a270aa2832feea4dca1506adbe8cdcd7cc
Add Cronos targeted to .NET 4.5 to artifacts
HangfireIO/Cronos
build.cake
build.cake
#addin nuget:?package=Cake.VersionReader #tool "nuget:?package=xunit.runner.console" var version = "0.1.1"; var configuration = "Release"; Task("Restore-NuGet-Packages") .Does(()=> { DotNetCoreRestore(); }); Task("Clean") .Does(()=> { CleanDirectory("./build"); StartProcess("dotnet", "clean -c:" + configuration); }); Task("Build") .IsDependentOn("Clean") .IsDependentOn("Restore-NuGet-Packages") .Does(()=> { DotNetCoreBuild("src/Cronos/Cronos.csproj", new DotNetCoreBuildSettings { Configuration = configuration, ArgumentCustomization = args => args.Append("/p:Version=" + version) }); }); Task("Test") .IsDependentOn("Build") .Does(() => { DotNetCoreTest("./tests/Cronos.Tests/Cronos.Tests.csproj", new DotNetCoreTestSettings { Configuration = "Release", ArgumentCustomization = args => args.Append("/p:BuildProjectReferences=false") }); }); Task("AppVeyor") .IsDependentOn("Test") .Does(()=> { if (AppVeyor.Environment.Repository.Tag.IsTag) { var tagName = AppVeyor.Environment.Repository.Tag.Name; if(tagName.StartsWith("v")) { version = tagName.Substring(1); } } else { version += "-build-0" + AppVeyor.Environment.Build.Number; } AppVeyor.UpdateBuildVersion(version); }); Task("Local") .Does(()=> { RunTarget("Test"); }); Task("Pack") .Does(()=> { var target = AppVeyor.IsRunningOnAppVeyor ? "AppVeyor" : "Local"; RunTarget(target); CreateDirectory("build"); Zip("./src/Cronos/bin/" + configuration, "build/Cronos-" + version +".zip"); }); RunTarget("Pack");
#addin nuget:?package=Cake.VersionReader #tool "nuget:?package=xunit.runner.console" var version = "0.1.1"; var configuration = "Release"; Task("Restore-NuGet-Packages") .Does(()=> { DotNetCoreRestore(); }); Task("Clean") .Does(()=> { CleanDirectory("./build"); StartProcess("dotnet", "clean -c:" + configuration); }); Task("Build") .IsDependentOn("Clean") .IsDependentOn("Restore-NuGet-Packages") .Does(()=> { DotNetCoreBuild("src/Cronos/Cronos.csproj", new DotNetCoreBuildSettings { Configuration = configuration, ArgumentCustomization = args => args.Append("/p:Version=" + version) }); }); Task("Test") .IsDependentOn("Build") .Does(() => { DotNetCoreTest("./tests/Cronos.Tests/Cronos.Tests.csproj", new DotNetCoreTestSettings { Configuration = "Release", ArgumentCustomization = args => args.Append("/p:BuildProjectReferences=false") }); }); Task("AppVeyor") .IsDependentOn("Test") .Does(()=> { if (AppVeyor.Environment.Repository.Tag.IsTag) { var tagName = AppVeyor.Environment.Repository.Tag.Name; if(tagName.StartsWith("v")) { version = tagName.Substring(1); } } else { version += "-build-0" + AppVeyor.Environment.Build.Number; } AppVeyor.UpdateBuildVersion(version); }); Task("Local") .Does(()=> { RunTarget("Test"); }); Task("Pack") .Does(()=> { var target = AppVeyor.IsRunningOnAppVeyor ? "AppVeyor" : "Local"; RunTarget(target); CreateDirectory("build"); CopyFiles(GetFiles("./src/Cronos/bin/**/*.nupkg"), "build"); Zip("./src/Cronos/bin/" + configuration + "/netstandard1.0", "build/Cronos-" + version +".zip"); }); RunTarget("Pack");
mit
C#
9c6bcec5002d48a82f48e525ab4eef6f71c44bc3
Add model generator testcase for Negative summaries for abstract members.
github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql
csharp/ql/test/utils/model-generator/NoSummaries.cs
csharp/ql/test/utils/model-generator/NoSummaries.cs
using System; namespace NoSummaries; // Single class with a method that produces a flow summary. // Just to prove that, if a method like this is correctly exposed, a flow summary will be captured. public class PublicClassFlow { public object PublicReturn(object input) { return input; } } public sealed class PublicClassNoFlow { private object PrivateReturn(object input) { return input; } internal object InternalReturn(object input) { return input; } private class PrivateClassNoFlow { public object ReturnParam(object input) { return input; } } private class PrivateClassNestedPublicClassNoFlow { public class NestedPublicClassFlow { public object ReturnParam(object input) { return input; } } } } public class EquatableBound : IEquatable<object> { public readonly bool tainted; public bool Equals(object other) { return tainted; } } public class EquatableUnBound<T> : IEquatable<T> { public readonly bool tainted; public bool Equals(T? other) { return tainted; } } // No methods in this class will have generated flow summaries as // simple types are used. public class SimpleTypes { public bool M1(bool b) { return b; } public Boolean M2(Boolean b) { return b; } public int M3(int i) { return i; } public Int32 M4(Int32 i) { return i; } } public class HigherOrderParameters { public string M1(string s, Func<string, string> map) { return s; } public object M2(Func<object, object> map, object o) { return map(o); } } public abstract class BaseClass { // Negative summary. public virtual string M1(string s) { return ""; } // Negative summary. public abstract string M2(string s); }
using System; namespace NoSummaries; // Single class with a method that produces a flow summary. // Just to prove that, if a method like this is correctly exposed, a flow summary will be captured. public class PublicClassFlow { public object PublicReturn(object input) { return input; } } public sealed class PublicClassNoFlow { private object PrivateReturn(object input) { return input; } internal object InternalReturn(object input) { return input; } private class PrivateClassNoFlow { public object ReturnParam(object input) { return input; } } private class PrivateClassNestedPublicClassNoFlow { public class NestedPublicClassFlow { public object ReturnParam(object input) { return input; } } } } public class EquatableBound : IEquatable<object> { public readonly bool tainted; public bool Equals(object other) { return tainted; } } public class EquatableUnBound<T> : IEquatable<T> { public readonly bool tainted; public bool Equals(T? other) { return tainted; } } // No methods in this class will have generated flow summaries as // simple types are used. public class SimpleTypes { public bool M1(bool b) { return b; } public Boolean M2(Boolean b) { return b; } public int M3(int i) { return i; } public Int32 M4(Int32 i) { return i; } } public class HigherOrderParameters { public string M1(string s, Func<string, string> map) { return s; } public object M2(Func<object, object> map, object o) { return map(o); } }
mit
C#
bf9356d158cb8e019475f368feb0698e4d595cae
Add fallback for tests
Tom94/osu-framework,smoogipooo/osu-framework,DrabWeb/osu-framework,DrabWeb/osu-framework,EVAST9919/osu-framework,ZLima12/osu-framework,DrabWeb/osu-framework,ppy/osu-framework,smoogipooo/osu-framework,Tom94/osu-framework,ZLima12/osu-framework,peppy/osu-framework,peppy/osu-framework,EVAST9919/osu-framework,EVAST9919/osu-framework,peppy/osu-framework,EVAST9919/osu-framework,ppy/osu-framework,ppy/osu-framework
osu.Framework/Development/DebugUtils.cs
osu.Framework/Development/DebugUtils.cs
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>. // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu-framework/master/LICENCE using System; using System.Diagnostics; using System.Linq; using System.Reflection; namespace osu.Framework.Development { public static class DebugUtils { public static bool IsDebugBuild => is_debug_build.Value; private static readonly Lazy<bool> is_debug_build = new Lazy<bool>(() => // https://stackoverflow.com/a/2186634 (Assembly.GetEntryAssembly() ?? Assembly.GetExecutingAssembly()).GetCustomAttributes(false).OfType<DebuggableAttribute>().Any(da => da.IsJITTrackingEnabled) ); } }
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>. // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu-framework/master/LICENCE using System; using System.Diagnostics; using System.Linq; using System.Reflection; namespace osu.Framework.Development { public static class DebugUtils { public static bool IsDebugBuild => is_debug_build.Value; private static readonly Lazy<bool> is_debug_build = new Lazy<bool>(() => // https://stackoverflow.com/a/2186634 Assembly.GetEntryAssembly().GetCustomAttributes(false).OfType<DebuggableAttribute>().Any(da => da.IsJITTrackingEnabled) ); } }
mit
C#
5fc01ddc27d62824f1a21aef6dfa741a84126a2c
Update build.cake
AspectCore/Abstractions,AspectCore/AspectCore-Framework,AspectCore/AspectCore-Framework,AspectCore/Lite
build.cake
build.cake
#addin "nuget:https://www.nuget.org/api/v2?package=Newtonsoft.Json&version=9.0.1" #load "./build/index.cake" var target = Argument("target", "Default"); var build = BuildParameters.Create(Context); var util = new Util(Context, build); Task("Clean") .Does(() => { if (DirectoryExists("./artifacts")) { DeleteDirectory("./artifacts", true); } }); Task("Restore") .IsDependentOn("Clean") .Does(() => { var settings = new DotNetCoreRestoreSettings { ArgumentCustomization = args => { args.Append($"/p:VersionSuffix={build.Version.Suffix}"); return args; } }; foreach (var project in build.ProjectFiles) { DotNetCoreRestore(project.FullPath, settings); } }); Task("Build") .IsDependentOn("Restore") .Does(() => { var settings = new DotNetCoreBuildSettings { Configuration = build.Configuration, VersionSuffix = build.Version.Suffix, ArgumentCustomization = args => { args.Append($"/p:InformationalVersion={build.Version.VersionWithSuffix()}"); return args; } }; foreach (var project in build.ProjectFiles) { DotNetCoreBuild(project.FullPath, settings); } }); Task("Test") .IsDependentOn("Build") .Does(() => { foreach (var testProject in build.TestProjectFiles) { DotNetCoreTest(testProject.FullPath); } }); Task("Pack") .Does(() => { var settings = new DotNetCorePackSettings { Configuration = build.Configuration, VersionSuffix = build.Version.Suffix, IncludeSymbols = true, OutputDirectory = "./artifacts/packages" }; foreach (var project in build.ProjectFiles) { DotNetCorePack(project.FullPath, settings); } }); Task("Default") .IsDependentOn("Build") .IsDependentOn("Test") .IsDependentOn("Pack") .Does(() => { util.PrintInfo(); }); Task("Version") .Does(() => { Information($"{build.FullVersion()}"); }); Task("Print") .Does(() => { util.PrintInfo(); }); RunTarget(target);
#addin "nuget:https://www.nuget.org/api/v2?package=Newtonsoft.Json&version=9.0.1" #load "./build/index.cake" var target = Argument("target", "Default"); var build = BuildParameters.Create(Context); var util = new Util(Context, build); Task("Clean") .Does(() => { if (DirectoryExists("./artifacts")) { DeleteDirectory("./artifacts", true); } }); Task("Restore") .IsDependentOn("Clean") .Does(() => { var settings = new DotNetCoreRestoreSettings { ArgumentCustomization = args => { args.Append($"/p:VersionSuffix={build.Version.Suffix}"); return args; } }; DotNetCoreRestore(settings); }); Task("Build") .IsDependentOn("Restore") .Does(() => { var settings = new DotNetCoreBuildSettings { Configuration = build.Configuration, VersionSuffix = build.Version.Suffix, ArgumentCustomization = args => { args.Append($"/p:InformationalVersion={build.Version.VersionWithSuffix()}"); return args; } }; foreach (var project in build.ProjectFiles) { DotNetCoreBuild(project.FullPath, settings); } }); Task("Test") .IsDependentOn("Build") .Does(() => { foreach (var testProject in build.TestProjectFiles) { DotNetCoreTest(testProject.FullPath); } }); Task("Pack") .Does(() => { var settings = new DotNetCorePackSettings { Configuration = build.Configuration, VersionSuffix = build.Version.Suffix, IncludeSymbols = true, OutputDirectory = "./artifacts/packages" }; foreach (var project in build.ProjectFiles) { DotNetCorePack(project.FullPath, settings); } }); Task("Default") .IsDependentOn("Build") .IsDependentOn("Test") .IsDependentOn("Pack") .Does(() => { util.PrintInfo(); }); Task("Version") .Does(() => { Information($"{build.FullVersion()}"); }); Task("Print") .Does(() => { util.PrintInfo(); }); RunTarget(target);
mit
C#
cf3f990ad9759f85c975ff76a7346d1fcf09e9f1
Improve docs.
Lombiq/Helpful-Extensions,Lombiq/Helpful-Extensions
Lombiq.HelpfulExtensions/Extensions/SiteTexts/Services/ISiteTextService.cs
Lombiq.HelpfulExtensions/Extensions/SiteTexts/Services/ISiteTextService.cs
using Microsoft.AspNetCore.Html; using OrchardCore.ContentManagement; using System.Threading.Tasks; namespace Lombiq.HelpfulExtensions.Extensions.SiteTexts.Services; /// <summary> /// A service for getting the value of the site text as HTML. /// </summary> public interface ISiteTextService { /// <summary> /// Looks up the referenced site text and returns it as HTML. Depending on the implementation, it may also perform /// other steps such looking for a localized version. /// </summary> /// <param name="contentItemId"> /// The <see cref="ContentItem.ContentItemId"/> of the Site Text. If the first character is <c>~</c> then the rest /// can be separated with space characters and the trailing <c>0</c> characters omitted. This way /// <c>~help popular topics</c> can be used to look up the ID <c>helppopulartopics000000000</c>. /// </param> Task<HtmlString> RenderHtmlByIdAsync(string contentItemId); }
using Microsoft.AspNetCore.Html; using OrchardCore.ContentManagement; using System.Threading.Tasks; namespace Lombiq.HelpfulExtensions.Extensions.SiteTexts.Services; /// <summary> /// A service for getting the value of the site text as HTML. /// </summary> public interface ISiteTextService { /// <summary> /// Depending on the implementation it may look at the referenced content item, or any localized versions. /// </summary> /// <param name="contentItemId"> /// The <see cref="ContentItem.ContentItemId"/> of the Site Text. If the first character is <c>~</c> then the rest /// can be separated with space characters and the trailing <c>0</c> characters omitted. This way /// <c>~help popular topics</c> can be used to look up the ID <c>helppopulartopics000000000</c>. /// </param> Task<HtmlString> RenderHtmlByIdAsync(string contentItemId); }
bsd-3-clause
C#
158454f38d9261d995e373c2e58f3ee6a119fee8
update GenerateSoil method : faster
pavelkouril/unity-marching-cubes-gpu
Assets/MarchingCubes/Scripts/DensityFieldGenerator.cs
Assets/MarchingCubes/Scripts/DensityFieldGenerator.cs
using System; using System.Collections.Generic; using UnityEngine; namespace PavelKouril.MarchingCubesGPU { public class DensityFieldGenerator : MonoBehaviour { public int Resolution; private MarchingCubes mc; private Texture3D densityTexture; private Color[] colors; private void Awake() { mc = GetComponent<MarchingCubes>(); densityTexture = new Texture3D(Resolution, Resolution, Resolution, TextureFormat.RFloat, false); densityTexture.wrapMode = TextureWrapMode.Clamp; colors = new Color[Resolution * Resolution * Resolution]; for (int i = 0; i < colors.Length; i++) colors[i] = Color.white; } private void Start() { GenerateSoil(); } private void Update() { GenerateSoil(); } private void GenerateSoil() { var idx = 0; float sx, sy, sz; float resol = (Resolution - 2) / 2 * Mathf.Sin(0.25f * Time.time); for (var z = 0; z < Resolution; ++z) { for (var y = 0; y < Resolution; ++y) { for (var x = 0; x < Resolution; ++x, ++idx) { sx = x - Resolution / 2; sy = y - Resolution / 2; sz = z - Resolution / 2; var amount = (sx * sx + sy * sy + sz * sz) <= resol * resol ? 1 : 0; colors[idx].r = amount; } } } densityTexture.SetPixels(colors); densityTexture.Apply(); mc.DensityTexture = densityTexture; } } }
using System; using System.Collections.Generic; using UnityEngine; namespace PavelKouril.MarchingCubesGPU { public class DensityFieldGenerator : MonoBehaviour { public int Resolution; private MarchingCubes mc; private Texture3D densityTexture; private Color[] colors; private void Awake() { mc = GetComponent<MarchingCubes>(); densityTexture = new Texture3D(Resolution, Resolution, Resolution, TextureFormat.RFloat, false); densityTexture.wrapMode = TextureWrapMode.Clamp; colors = new Color[Resolution * Resolution * Resolution]; } private void Start() { GenerateSoil(); } private void Update() { GenerateSoil(); } private void GenerateSoil() { var idx = 0; for (var z = 0; z < Resolution; ++z) { for (var y = 0; y < Resolution; ++y) { for (var x = 0; x < Resolution; ++x, ++idx) { var amount = Mathf.Pow(x - Resolution / 2, 2) + Mathf.Pow(y - Resolution / 2, 2) + Mathf.Pow(z - Resolution / 2, 2) <= Mathf.Pow((Resolution - 2) / 2 * Mathf.Sin(0.25f * Time.time), 2) ? 1 : 0; colors[idx] = new Color(amount, 0, 0); } } } densityTexture.SetPixels(colors); densityTexture.Apply(); mc.DensityTexture = densityTexture; } } }
mit
C#
0b33f89c0861460111f89a5a1a7a6af22a0f930a
update sku
naveedaz/azure-sdk-for-net,herveyw/azure-sdk-for-net,jtlibing/azure-sdk-for-net,jtlibing/azure-sdk-for-net,bgold09/azure-sdk-for-net,naveedaz/azure-sdk-for-net,jtlibing/azure-sdk-for-net,herveyw/azure-sdk-for-net,DeepakRajendranMsft/azure-sdk-for-net,vladca/azure-sdk-for-net,herveyw/azure-sdk-for-net,DeepakRajendranMsft/azure-sdk-for-net,nemanja88/azure-sdk-for-net,AuxMon/azure-sdk-for-net,vladca/azure-sdk-for-net,rohmano/azure-sdk-for-net,ahosnyms/azure-sdk-for-net,bgold09/azure-sdk-for-net,pattipaka/azure-sdk-for-net,pattipaka/azure-sdk-for-net,AuxMon/azure-sdk-for-net,naveedaz/azure-sdk-for-net,nemanja88/azure-sdk-for-net,ahosnyms/azure-sdk-for-net,vladca/azure-sdk-for-net,bgold09/azure-sdk-for-net,DeepakRajendranMsft/azure-sdk-for-net,pattipaka/azure-sdk-for-net,rohmano/azure-sdk-for-net,rohmano/azure-sdk-for-net,ahosnyms/azure-sdk-for-net,nemanja88/azure-sdk-for-net,AuxMon/azure-sdk-for-net
src/ServiceManagement/Network/NetworkManagement/Generated/Models/GatewaySKU.cs
src/ServiceManagement/Network/NetworkManagement/Generated/Models/GatewaySKU.cs
// // Copyright (c) Microsoft and contributors. 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. // // Warning: This code was generated by a tool. // // Changes to this file may cause incorrect behavior and will be lost if the // code is regenerated. using System; using System.Linq; namespace Microsoft.WindowsAzure.Management.Network.Models { /// <summary> /// The different SKUs that a gateway can have. /// </summary> public static partial class GatewaySKU { public const string Default = "Default"; public const string HighPerformance = "HighPerformance"; public const string Standard = "Standard"; public const string UltraPerformance = "UltraPerformance"; } }
// // Copyright (c) Microsoft and contributors. 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. // // Warning: This code was generated by a tool. // // Changes to this file may cause incorrect behavior and will be lost if the // code is regenerated. using System; using System.Linq; namespace Microsoft.WindowsAzure.Management.Network.Models { /// <summary> /// The different SKUs that a gateway can have. /// </summary> public static partial class GatewaySKU { public const string Default = "Default"; public const string HighPerformance = "HighPerformance"; public const string Standard = "Standard"; } }
apache-2.0
C#
99e4193fabbffe08a58a1a9f0b4f415c0e10fca5
Update SearchPageViewModel.cs
nopara73/HiddenWallet,nopara73/HiddenWallet,nopara73/HiddenWallet,nopara73/HiddenWallet
WalletWasabi.Fluent/ViewModels/SearchPageViewModel.cs
WalletWasabi.Fluent/ViewModels/SearchPageViewModel.cs
using System.Collections.ObjectModel; using System.Reactive.Linq; using DynamicData; using DynamicData.Binding; using ReactiveUI; using WalletWasabi.Fluent.ViewModels.NavBar; using WalletWasabi.Fluent.ViewModels.Search; namespace WalletWasabi.Fluent.ViewModels { public class SearchPageViewModel : NavBarItemViewModel { private string? _searchQuery; private readonly ReadOnlyObservableCollection<SearchItemViewModel> _searchItems; public SearchPageViewModel(NavigationStateViewModel navigationState, WalletManagerViewModel walletManager, AddWalletPageViewModel addWalletPage) : base(navigationState, NavigationTarget.HomeScreen) { Title = "Search"; var searchItems = new SourceList<SearchItemViewModel>(); searchItems.Add(new SearchItemViewModel( navigationState, NavigationTarget.HomeScreen, iconName: "home_regular", title: "Home", category: "General", keywords: "Home", () => new HomePageViewModel(navigationState, walletManager, addWalletPage))); searchItems.Add(new SearchItemViewModel( navigationState, NavigationTarget.HomeScreen, iconName: "settings_regular", title: "Settings", category: "General", keywords: "Settings, General, User Interface, Privacy, Advanced", () => new SettingsPageViewModel(navigationState))); searchItems.Add(new SearchItemViewModel( navigationState, NavigationTarget.DialogScreen, iconName: "add_circle_regular", title: "Add Wallet", category: "Wallet", keywords: "Wallet, Add Wallet, Create Wallet, Recover Wallet, Import Wallet, Connect Hardware Wallet", () => addWalletPage)); walletManager.Items.ToObservableChangeSet() .Cast(x => new SearchItemViewModel( navigationState, NavigationTarget.HomeScreen, iconName: "web_asset_regular", title: x.WalletName, category: "Wallet", keywords: $"Wallet, {x.WalletName}", () => x)) .Sort(SortExpressionComparer<SearchItemViewModel>.Ascending(i => i.Title)) .Merge(searchItems.Connect()) .ObserveOn(RxApp.MainThreadScheduler) .Bind(out _searchItems) .AsObservableList(); } public override string IconName => "search_regular"; public string? SearchQuery { get => _searchQuery; set => this.RaiseAndSetIfChanged(ref _searchQuery, value); } public ReadOnlyObservableCollection<SearchItemViewModel> SearchItems => _searchItems; } }
using System.Collections.ObjectModel; using System.Reactive.Linq; using DynamicData; using DynamicData.Binding; using ReactiveUI; using WalletWasabi.Fluent.ViewModels.NavBar; using WalletWasabi.Fluent.ViewModels.Search; namespace WalletWasabi.Fluent.ViewModels { public class SearchPageViewModel : NavBarItemViewModel { private string? _searchQuery; private readonly ReadOnlyObservableCollection<SearchItemViewModel> _searchItems; public SearchPageViewModel(NavigationStateViewModel navigationState, WalletManagerViewModel walletManager, AddWalletPageViewModel addWalletPage) : base(navigationState, NavigationTarget.Home) { Title = "Search"; var searchItems = new SourceList<SearchItemViewModel>(); searchItems.Add(new SearchItemViewModel( navigationState, NavigationTarget.HomeScreen, iconName: "home_regular", title: "Home", category: "General", keywords: "Home", () => new HomePageViewModel(navigationState, walletManager, addWalletPage))); searchItems.Add(new SearchItemViewModel( navigationState, NavigationTarget.HomeScreen, iconName: "settings_regular", title: "Settings", category: "General", keywords: "Settings, General, User Interface, Privacy, Advanced", () => new SettingsPageViewModel(navigationState))); searchItems.Add(new SearchItemViewModel( navigationState, NavigationTarget.DialogScreen, iconName: "add_circle_regular", title: "Add Wallet", category: "Wallet", keywords: "Wallet, Add Wallet, Create Wallet, Recover Wallet, Import Wallet, Connect Hardware Wallet", () => addWalletPage)); walletManager.Items.ToObservableChangeSet() .Cast(x => new SearchItemViewModel( navigationState, NavigationTarget.HomeScreen, iconName: "web_asset_regular", title: x.WalletName, category: "Wallet", keywords: $"Wallet, {x.WalletName}", () => x)) .Sort(SortExpressionComparer<SearchItemViewModel>.Ascending(i => i.Title)) .Merge(searchItems.Connect()) .ObserveOn(RxApp.MainThreadScheduler) .Bind(out _searchItems) .AsObservableList(); } public override string IconName => "search_regular"; public string? SearchQuery { get => _searchQuery; set => this.RaiseAndSetIfChanged(ref _searchQuery, value); } public ReadOnlyObservableCollection<SearchItemViewModel> SearchItems => _searchItems; } }
mit
C#
c6d335ba1cd1688c57f8b501c15ceb5b6427ec37
add DI for skill repo
mzrimsek/resume-site-api
Web/Configuration/DependencyInjectionConfiguration.cs
Web/Configuration/DependencyInjectionConfiguration.cs
using Microsoft.Extensions.DependencyInjection; using Core.Interfaces.RepositoryInterfaces; using Integration.EntityFramework.Repositories; namespace Web.Configuration { public static class DependencyInjectionConfiguration { public static void Configure(IServiceCollection services) { services.AddScoped<IJobRepository, JobRepository>(); services.AddScoped<IJobProjectRepository, JobProjectRepository>(); services.AddScoped<ISchoolRepository, SchoolRepository>(); services.AddScoped<ILanguageRepository, LanguageRepository>(); services.AddScoped<ISkillRepository, SkillRepository>(); } } }
using Microsoft.Extensions.DependencyInjection; using Core.Interfaces.RepositoryInterfaces; using Integration.EntityFramework.Repositories; namespace Web.Configuration { public static class DependencyInjectionConfiguration { public static void Configure(IServiceCollection services) { services.AddScoped<IJobRepository, JobRepository>(); services.AddScoped<IJobProjectRepository, JobProjectRepository>(); services.AddScoped<ISchoolRepository, SchoolRepository>(); services.AddScoped<ILanguageRepository, LanguageRepository>(); } } }
mit
C#
3555dac97f777ff66b97722128e09d30c12b9c54
Bump version to 1.1.0.
FacilityApi/FacilityCSharp
SolutionInfo.cs
SolutionInfo.cs
using System.Reflection; [assembly: AssemblyVersion("1.1.0.0")] [assembly: AssemblyCompany("")] [assembly: AssemblyCopyright("Copyright 2016-2017 Ed Ball")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")]
using System.Reflection; [assembly: AssemblyVersion("1.0.2.0")] [assembly: AssemblyCompany("")] [assembly: AssemblyCopyright("Copyright 2016-2017 Ed Ball")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")]
mit
C#
117e18be43d536d32d617f9e331a5c8c0a5a6559
Fix bug where Smaller wouldn't exit properly
geoffles/Smaller
Smaller/RunJobController.cs
Smaller/RunJobController.cs
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading; using System.Windows; using System.Windows.Documents; using System.Windows.Threading; namespace Smaller { public class RunJobController { private static readonly EventWaitHandle _showSignal = new EventWaitHandle(false, EventResetMode.AutoReset, "Smaller.ShowSignal"); public void TriggerRunJobs() { _showSignal.Set(); } private RunJobController() { StartListenForJobs(); } private static readonly RunJobController _instance = new RunJobController(); public static RunJobController Instance { get { return _instance; } } private void RunJobs() { Action x = () => { //if (Application.Current.MainWindow == null) //{ // Application.Current.MainWindow = new MainWindow(); // Application.Current.MainWindow.Show(); //} new JobRunner().Run(); }; Application.Current.Dispatcher.Invoke(x, DispatcherPriority.Send); } private void StartListenForJobs() { new Thread(() => { // only wait for signals while the app is running while (Application.Current != null) { if (_showSignal.WaitOne(500)) { RunJobs(); } } }).Start(); } } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading; using System.Windows; using System.Windows.Documents; using System.Windows.Threading; namespace Smaller { public class RunJobController { private static readonly EventWaitHandle _showSignal = new EventWaitHandle(false, EventResetMode.AutoReset, "Smaller.ShowSignal"); public void TriggerRunJobs() { _showSignal.Set(); } private RunJobController() { StartListenForJobs(); } private static readonly RunJobController _instance = new RunJobController(); public static RunJobController Instance { get { return _instance; } } private void RunJobs() { Action x = () => { //if (Application.Current.MainWindow == null) //{ // Application.Current.MainWindow = new MainWindow(); // Application.Current.MainWindow.Show(); //} new JobRunner().Run(); }; Application.Current.Dispatcher.Invoke(x, DispatcherPriority.Send); } private void StartListenForJobs() { new Thread(() => { while (true) { _showSignal.WaitOne(); RunJobs(); } }).Start(); } } }
agpl-3.0
C#
48c10bf43609919cd9dcbc7bfd2f75c9edad08ef
Update MiniExample.cs
PlayFab/UnitySDK
PlayFabClientSDK/Examples/Mini/MiniExample.cs
PlayFabClientSDK/Examples/Mini/MiniExample.cs
using UnityEngine; using System.Collections; using PlayFab; using PlayFab.Model; public class MiniExample : MonoBehaviour { void Start () { PlayFabSettings.UseDevelopmentEnvironment = false; PlayFabSettings.TitleId = "AAA"; PlayFabSettings.GlobalErrorHandler = OnPlayFabError; PlayFabClientAPI.LoginWithPlayFab (new LoginWithPlayFabRequest { Username = "Bob", Password = "nose" }, OnLoginResult, null); } void OnLoginResult(LoginResult result) { Debug.Log ("Yay, logged in in session token: " + result.SessionTicket); } void OnPlayFabError(PlayFabError error) { Debug.Log ("Got an error: " + error.ErrorMessage); } }
using UnityEngine; using System.Collections; using PlayFab; using PlayFab.Model; public class MiniExample : MonoBehaviour { void Start () { PlayFabSettings.UseDevelopmentEnvironment = true; PlayFabSettings.TitleId = "AAA"; PlayFabSettings.GlobalErrorHandler = OnPlayFabError; PlayFabClientAPI.LoginWithPlayFab (new LoginWithPlayFabRequest { Username = "Bob", Password = "nose" }, OnLoginResult, null); } void OnLoginResult(LoginResult result) { Debug.Log ("Yay, logged in in session token: " + result.SessionTicket); } void OnPlayFabError(PlayFabError error) { Debug.Log ("Got an error: " + error.ErrorMessage); } }
apache-2.0
C#
0019c0befdbe809bb5e49738ea79ac61ad0cddb0
Remove unused property PortingIssue.NeedsReview
pakdev/roslyn-analyzers,bkoelman/roslyn-analyzers,srivatsn/roslyn-analyzers,natidea/roslyn-analyzers,mavasani/roslyn-analyzers,pakdev/roslyn-analyzers,mattwar/roslyn-analyzers,qinxgit/roslyn-analyzers,Anniepoh/roslyn-analyzers,mavasani/roslyn-analyzers,dotnet/roslyn-analyzers,genlu/roslyn-analyzers,heejaechang/roslyn-analyzers,dotnet/roslyn-analyzers,jasonmalinowski/roslyn-analyzers
PortFxCop/src/Tools/FileIssues/PortingInfo.cs
PortFxCop/src/Tools/FileIssues/PortingInfo.cs
namespace FileIssues { public class PortingInfo { public string Id { get; set; } public string Name { get; set; } public string Title { get; set; } public string Description { get; set; } public string Notes { get; set; } public Disposition Disposition { get; set; } public override string ToString() { return $"{{Id: {Id}, Name: {Name}, ShouldPort: {Disposition}}}"; } } }
namespace FileIssues { public class PortingInfo { public string Id { get; set; } public string Name { get; set; } public string Title { get; set; } public string Description { get; set; } public string Notes { get; set; } public Disposition Disposition { get; set; } public bool NeedsReview { get; set; } public override string ToString() { return $"{{Id: {Id}, Name: {Name}, ShouldPort: {Disposition}}}"; } } }
mit
C#
305e566c94439dc82f544ef98a3c2d0bd578d711
Fix extensions to be easier to use
JudahGabriel/RavenDB.Identity
RavenDB.Identity/IdentityBuilderExtensions.cs
RavenDB.Identity/IdentityBuilderExtensions.cs
using Microsoft.AspNetCore.Identity; using Microsoft.Extensions.DependencyInjection; using Raven.Client; using Raven.Client.Documents; using Raven.Client.Documents.Session; using System; namespace Raven.Identity { /// <summary> /// Extends <see cref="IdentityBuilder"/> so that RavenDB services can be registered through it. /// </summary> public static class IdentityBuilderExtensions { /// <summary> /// Registers a RavenDB as the user store. /// </summary> /// <typeparam name="TUser">The type of the user.</typeparam> /// <param name="builder">The builder.</param> /// <returns></returns> public static IdentityBuilder AddRavenDbIdentityStores<TUser>(this IdentityBuilder builder) where TUser : IdentityUser { return builder.AddRavenDbIdentityStores<TUser, IdentityRole>(c => { }); } /// <summary> /// Registers a RavenDB as the user store. /// </summary> /// <typeparam name="TUser">The type of the user.</typeparam> /// <param name="builder">The builder.</param> /// <param name="configure">Configure options for Raven Identity</param> /// <returns></returns> public static IdentityBuilder AddRavenDbIdentityStores<TUser>(this IdentityBuilder builder, Action<RavenIdentityOptions> configure) where TUser : IdentityUser { return builder.AddRavenDbIdentityStores<TUser, IdentityRole>(configure); } /// <summary> /// Registers a RavenDB as the user store. /// </summary> /// <typeparam name="TUser">The type of the user.</typeparam> /// <typeparam name="TRole">The type of the role.</typeparam> /// <param name="builder">The builder.</param> /// <param name="configure">Configure options for Raven Identity</param> /// <returns>The builder.</returns> public static IdentityBuilder AddRavenDbIdentityStores<TUser, TRole>(this IdentityBuilder builder) where TUser : IdentityUser where TRole : IdentityRole, new() { return builder.AddRavenDbIdentityStores<TUser, TRole>(c => { }); } /// <summary> /// Registers a RavenDB as the user store. /// </summary> /// <typeparam name="TUser">The type of the user.</typeparam> /// <typeparam name="TRole">The type of the role.</typeparam> /// <param name="builder">The builder.</param> /// <param name="configure">Configure options for Raven Identity</param> /// <returns>The builder.</returns> public static IdentityBuilder AddRavenDbIdentityStores<TUser, TRole>(this IdentityBuilder builder, Action<RavenIdentityOptions> configure) where TUser : IdentityUser where TRole : IdentityRole, new() { builder.Services.Configure(configure); builder.Services.AddScoped<IUserStore<TUser>, UserStore<TUser, TRole>>(); builder.Services.AddScoped<IRoleStore<TRole>, RoleStore<TRole>>(); return builder; } } }
using Microsoft.AspNetCore.Identity; using Microsoft.Extensions.DependencyInjection; using Raven.Client; using Raven.Client.Documents; using Raven.Client.Documents.Session; using System; namespace Raven.Identity { /// <summary> /// Extends <see cref="IdentityBuilder"/> so that RavenDB services can be registered through it. /// </summary> public static class IdentityBuilderExtensions { /// <summary> /// Registers a RavenDB as the user store. /// </summary> /// <typeparam name="TUser">The type of the user.</typeparam> /// <param name="builder">The builder.</param> /// <param name="configure">Configure options for Raven Identity</param> /// <returns></returns> public static IdentityBuilder AddRavenDbIdentityStores<TUser>(this IdentityBuilder builder, Action<RavenIdentityOptions>? configure = null) where TUser : IdentityUser { return builder.AddRavenDbIdentityStores<TUser, IdentityRole>(configure); } /// <summary> /// Registers a RavenDB as the user store. /// </summary> /// <typeparam name="TUser">The type of the user.</typeparam> /// <typeparam name="TRole">The type of the role.</typeparam> /// <param name="builder">The builder.</param> /// <param name="configure">Configure options for Raven Identity</param> /// <returns>The builder.</returns> public static IdentityBuilder AddRavenDbIdentityStores<TUser, TRole>(this IdentityBuilder builder, Action<RavenIdentityOptions>? configure = null) where TUser : IdentityUser where TRole : IdentityRole, new() { configure ??= options => {}; builder.Services.Configure(configure); builder.Services.AddScoped<IUserStore<TUser>, UserStore<TUser, TRole>>(); builder.Services.AddScoped<IRoleStore<TRole>, RoleStore<TRole>>(); return builder; } } }
mit
C#
25b489648e8518d574283bd46a782e7049b9308c
Change missing from last commit.
serilog/serilog-sinks-azuretablestorage
src/Serilog.Sinks.AzureTableStorage/Sinks/KeyGenerator/PropertiesKeyGenerator.cs
src/Serilog.Sinks.AzureTableStorage/Sinks/KeyGenerator/PropertiesKeyGenerator.cs
using System; using System.Text; using System.Text.RegularExpressions; using Serilog.Events; using Serilog.Sinks.AzureTableStorage.KeyGenerator; namespace Serilog.Sinks.AzureTableStorage.Sinks.KeyGenerator { public class PropertiesKeyGenerator : DefaultKeyGenerator { // Valid RowKey name characters static readonly Regex _rowKeyNotAllowedMatch = new Regex(@"(\\|/|#|\?|[\x00-\x1f]|[\x7f-\x9f])"); /// <summary> /// Generate a valid string for a table property key by removing invalid characters /// </summary> /// <param name="s"> /// The input string /// </param> /// <returns> /// The string that can be used as a property /// </returns> public static string GetValidStringForTableKey(string s) { return _rowKeyNotAllowedMatch.Replace(s, ""); } /// <summary> /// Automatically generates the RowKey using the following template: {Level|MessageTemplate|IncrementedRowId} /// </summary> /// <param name="logEvent">the log event</param> /// <param name="additionalRowKeyPostfix">suffix for the RowKey</param> /// <returns>The generated RowKey</returns> public override string GenerateRowKey(LogEvent logEvent, string additionalRowKeyPostfix = null) { var prefixBuilder = new StringBuilder(512); // Join level and message template prefixBuilder.Append(logEvent.Level).Append('|').Append(GetValidStringForTableKey(logEvent.MessageTemplate.Text)); var postfixBuilder = new StringBuilder(512); if (additionalRowKeyPostfix != null) postfixBuilder.Append('|').Append(GetValidStringForTableKey(additionalRowKeyPostfix)); // Append GUID to postfix postfixBuilder.Append('|').Append(Guid.NewGuid()); // Truncate prefix if too long var maxPrefixLength = 1024 - postfixBuilder.Length; if (prefixBuilder.Length > maxPrefixLength) { prefixBuilder.Length = maxPrefixLength; } return prefixBuilder.Append(postfixBuilder).ToString(); } } }
using System; using System.Text; using System.Text.RegularExpressions; using Serilog.Events; using Serilog.Sinks.AzureTableStorage.KeyGenerator; namespace Serilog.Sinks.AzureTableStorage.Sinks.KeyGenerator { public class PropertiesKeyGenerator : DefaultKeyGenerator { // Valid RowKey name characters static readonly Regex _rowKeyNotAllowedMatch = new Regex(@"(\\|/|#|\?|\r\n?|\n)"); /// <summary> /// Generate a valid string for a table property key by removing invalid characters /// </summary> /// <param name="s"> /// The input string /// </param> /// <returns> /// The string that can be used as a property /// </returns> public static string GetValidStringForTableKey(string s) { return _rowKeyNotAllowedMatch.Replace(s, ""); } /// <summary> /// Automatically generates the RowKey using the following template: {Level|MessageTemplate|IncrementedRowId} /// </summary> /// <param name="logEvent">the log event</param> /// <param name="additionalRowKeyPostfix">suffix for the RowKey</param> /// <returns>The generated RowKey</returns> public override string GenerateRowKey(LogEvent logEvent, string additionalRowKeyPostfix = null) { var prefixBuilder = new StringBuilder(512); // Join level and message template prefixBuilder.Append(logEvent.Level).Append('|').Append(GetValidStringForTableKey(logEvent.MessageTemplate.Text)); var postfixBuilder = new StringBuilder(512); if (additionalRowKeyPostfix != null) postfixBuilder.Append('|').Append(GetValidStringForTableKey(additionalRowKeyPostfix)); // Append GUID to postfix postfixBuilder.Append('|').Append(Guid.NewGuid()); // Truncate prefix if too long var maxPrefixLength = 1024 - postfixBuilder.Length; if (prefixBuilder.Length > maxPrefixLength) { prefixBuilder.Length = maxPrefixLength; } return prefixBuilder.Append(postfixBuilder).ToString(); } } }
apache-2.0
C#
750e8ac94f6f4345e16cf6d80e9edb433c6a03a6
Add missing summary xml close tag to IRevertibleChangeTracking
yizhang82/corefx,nbarbettini/corefx,dotnet-bot/corefx,mokchhya/corefx,krk/corefx,elijah6/corefx,stone-li/corefx,oceanho/corefx,manu-silicon/corefx,khdang/corefx,billwert/corefx,billwert/corefx,josguil/corefx,vijaykota/corefx,janhenke/corefx,zhenlan/corefx,YoupHulsebos/corefx,Petermarcu/corefx,dtrebbien/corefx,benpye/corefx,lggomez/corefx,SGuyGe/corefx,claudelee/corefx,KrisLee/corefx,alexandrnikitin/corefx,weltkante/corefx,khdang/corefx,lggomez/corefx,stone-li/corefx,bitcrazed/corefx,ravimeda/corefx,cnbin/corefx,parjong/corefx,vs-team/corefx,rubo/corefx,PatrickMcDonald/corefx,matthubin/corefx,rubo/corefx,josguil/corefx,parjong/corefx,destinyclown/corefx,the-dwyer/corefx,vrassouli/corefx,s0ne0me/corefx,akivafr123/corefx,shrutigarg/corefx,scott156/corefx,zhenlan/corefx,billwert/corefx,shrutigarg/corefx,lydonchandra/corefx,Ermiar/corefx,vidhya-bv/corefx-sorting,stormleoxia/corefx,popolan1986/corefx,dkorolev/corefx,Alcaro/corefx,lydonchandra/corefx,alphonsekurian/corefx,dhoehna/corefx,anjumrizwi/corefx,marksmeltzer/corefx,rajansingh10/corefx,gregg-miskelly/corefx,MaggieTsang/corefx,heXelium/corefx,benjamin-bader/corefx,krytarowski/corefx,zhenlan/corefx,zhenlan/corefx,jeremymeng/corefx,wtgodbe/corefx,mafiya69/corefx,manu-silicon/corefx,manu-silicon/corefx,thiagodin/corefx,fgreinacher/corefx,ptoonen/corefx,JosephTremoulet/corefx,nbarbettini/corefx,seanshpark/corefx,zhenlan/corefx,parjong/corefx,bpschoch/corefx,shimingsg/corefx,marksmeltzer/corefx,Chrisboh/corefx,axelheer/corefx,wtgodbe/corefx,richlander/corefx,cartermp/corefx,spoiledsport/corefx,marksmeltzer/corefx,comdiv/corefx,vrassouli/corefx,alexandrnikitin/corefx,scott156/corefx,axelheer/corefx,Petermarcu/corefx,shmao/corefx,shahid-pk/corefx,ellismg/corefx,richlander/corefx,matthubin/corefx,CherryCxldn/corefx,stone-li/corefx,YoupHulsebos/corefx,690486439/corefx,n1ghtmare/corefx,kkurni/corefx,scott156/corefx,ericstj/corefx,bitcrazed/corefx,rajansingh10/corefx,fgreinacher/corefx,chaitrakeshav/corefx,marksmeltzer/corefx,gkhanna79/corefx,rahku/corefx,fgreinacher/corefx,jlin177/corefx,billwert/corefx,shrutigarg/corefx,stormleoxia/corefx,shmao/corefx,mokchhya/corefx,krytarowski/corefx,erpframework/corefx,chenxizhang/corefx,akivafr123/corefx,elijah6/corefx,benpye/corefx,mafiya69/corefx,dtrebbien/corefx,dhoehna/corefx,DnlHarvey/corefx,dotnet-bot/corefx,DnlHarvey/corefx,nbarbettini/corefx,alphonsekurian/corefx,viniciustaveira/corefx,shahid-pk/corefx,Jiayili1/corefx,seanshpark/corefx,janhenke/corefx,nbarbettini/corefx,benjamin-bader/corefx,nelsonsar/corefx,krk/corefx,iamjasonp/corefx,alphonsekurian/corefx,kkurni/corefx,janhenke/corefx,parjong/corefx,mellinoe/corefx,ravimeda/corefx,lggomez/corefx,nbarbettini/corefx,stephenmichaelf/corefx,tstringer/corefx,huanjie/corefx,DnlHarvey/corefx,dotnet-bot/corefx,shahid-pk/corefx,tijoytom/corefx,vidhya-bv/corefx-sorting,twsouthwick/corefx,jeremymeng/corefx,DnlHarvey/corefx,mokchhya/corefx,claudelee/corefx,pgavlin/corefx,pallavit/corefx,ViktorHofer/corefx,gabrielPeart/corefx,shmao/corefx,parjong/corefx,oceanho/corefx,mazong1123/corefx,690486439/corefx,jcme/corefx,nchikanov/corefx,andyhebear/corefx,ravimeda/corefx,shimingsg/corefx,krk/corefx,n1ghtmare/corefx,Petermarcu/corefx,iamjasonp/corefx,fernando-rodriguez/corefx,erpframework/corefx,benpye/corefx,cydhaselton/corefx,xuweixuwei/corefx,rjxby/corefx,seanshpark/corefx,ptoonen/corefx,jcme/corefx,alphonsekurian/corefx,jhendrixMSFT/corefx,richlander/corefx,comdiv/corefx,Jiayili1/corefx,ellismg/corefx,jhendrixMSFT/corefx,shmao/corefx,DnlHarvey/corefx,rahku/corefx,krytarowski/corefx,dhoehna/corefx,weltkante/corefx,ViktorHofer/corefx,PatrickMcDonald/corefx,josguil/corefx,cydhaselton/corefx,chenxizhang/corefx,shrutigarg/corefx,manu-silicon/corefx,rajansingh10/corefx,zhenlan/corefx,lggomez/corefx,brett25/corefx,rajansingh10/corefx,elijah6/corefx,seanshpark/corefx,iamjasonp/corefx,akivafr123/corefx,vidhya-bv/corefx-sorting,dsplaisted/corefx,dotnet-bot/corefx,elijah6/corefx,Priya91/corefx-1,dsplaisted/corefx,krytarowski/corefx,shana/corefx,Frank125/corefx,uhaciogullari/corefx,dhoehna/corefx,kyulee1/corefx,MaggieTsang/corefx,MaggieTsang/corefx,josguil/corefx,shana/corefx,adamralph/corefx,Yanjing123/corefx,cnbin/corefx,alexperovich/corefx,nchikanov/corefx,PatrickMcDonald/corefx,ptoonen/corefx,nchikanov/corefx,Jiayili1/corefx,claudelee/corefx,mokchhya/corefx,shahid-pk/corefx,twsouthwick/corefx,stephenmichaelf/corefx,chenxizhang/corefx,chaitrakeshav/corefx,arronei/corefx,jhendrixMSFT/corefx,pallavit/corefx,mafiya69/corefx,Ermiar/corefx,690486439/corefx,Alcaro/corefx,anjumrizwi/corefx,Chrisboh/corefx,mellinoe/corefx,zmaruo/corefx,mazong1123/corefx,Frank125/corefx,zhenlan/corefx,larsbj1988/corefx,alexperovich/corefx,tijoytom/corefx,cartermp/corefx,akivafr123/corefx,MaggieTsang/corefx,Chrisboh/corefx,adamralph/corefx,khdang/corefx,benjamin-bader/corefx,mafiya69/corefx,fffej/corefx,matthubin/corefx,tijoytom/corefx,fffej/corefx,zhangwenquan/corefx,uhaciogullari/corefx,andyhebear/corefx,tstringer/corefx,shimingsg/corefx,dsplaisted/corefx,YoupHulsebos/corefx,twsouthwick/corefx,the-dwyer/corefx,jmhardison/corefx,axelheer/corefx,seanshpark/corefx,bpschoch/corefx,Winsto/corefx,ViktorHofer/corefx,krytarowski/corefx,Alcaro/corefx,elijah6/corefx,gkhanna79/corefx,rubo/corefx,erpframework/corefx,SGuyGe/corefx,bpschoch/corefx,ViktorHofer/corefx,mmitche/corefx,axelheer/corefx,mafiya69/corefx,shmao/corefx,Chrisboh/corefx,josguil/corefx,Yanjing123/corefx,bpschoch/corefx,nelsonsar/corefx,kkurni/corefx,krytarowski/corefx,Frank125/corefx,josguil/corefx,EverlessDrop41/corefx,jhendrixMSFT/corefx,khdang/corefx,wtgodbe/corefx,gkhanna79/corefx,seanshpark/corefx,thiagodin/corefx,Priya91/corefx-1,Petermarcu/corefx,Priya91/corefx-1,pallavit/corefx,Yanjing123/corefx,Jiayili1/corefx,the-dwyer/corefx,JosephTremoulet/corefx,jmhardison/corefx,cnbin/corefx,gkhanna79/corefx,erpframework/corefx,khdang/corefx,yizhang82/corefx,690486439/corefx,vs-team/corefx,ellismg/corefx,yizhang82/corefx,gabrielPeart/corefx,matthubin/corefx,dkorolev/corefx,Chrisboh/corefx,ravimeda/corefx,vrassouli/corefx,mellinoe/corefx,pgavlin/corefx,SGuyGe/corefx,KrisLee/corefx,wtgodbe/corefx,popolan1986/corefx,zmaruo/corefx,huanjie/corefx,ravimeda/corefx,the-dwyer/corefx,rjxby/corefx,tstringer/corefx,stone-li/corefx,s0ne0me/corefx,rahku/corefx,stone-li/corefx,tstringer/corefx,690486439/corefx,ptoonen/corefx,shimingsg/corefx,lggomez/corefx,stephenmichaelf/corefx,dotnet-bot/corefx,SGuyGe/corefx,JosephTremoulet/corefx,gkhanna79/corefx,ViktorHofer/corefx,ericstj/corefx,heXelium/corefx,kyulee1/corefx,JosephTremoulet/corefx,mmitche/corefx,stone-li/corefx,andyhebear/corefx,uhaciogullari/corefx,bitcrazed/corefx,marksmeltzer/corefx,stone-li/corefx,SGuyGe/corefx,Priya91/corefx-1,ericstj/corefx,CherryCxldn/corefx,weltkante/corefx,janhenke/corefx,ptoonen/corefx,n1ghtmare/corefx,kyulee1/corefx,arronei/corefx,comdiv/corefx,lggomez/corefx,alexperovich/corefx,VPashkov/corefx,marksmeltzer/corefx,FiveTimesTheFun/corefx,shahid-pk/corefx,gkhanna79/corefx,ericstj/corefx,billwert/corefx,shimingsg/corefx,anjumrizwi/corefx,benpye/corefx,larsbj1988/corefx,wtgodbe/corefx,KrisLee/corefx,Priya91/corefx-1,rjxby/corefx,jeremymeng/corefx,rjxby/corefx,kyulee1/corefx,Priya91/corefx-1,mazong1123/corefx,alphonsekurian/corefx,uhaciogullari/corefx,bitcrazed/corefx,oceanho/corefx,wtgodbe/corefx,jlin177/corefx,fffej/corefx,BrennanConroy/corefx,richlander/corefx,jcme/corefx,shimingsg/corefx,viniciustaveira/corefx,larsbj1988/corefx,alexandrnikitin/corefx,pallavit/corefx,fernando-rodriguez/corefx,lydonchandra/corefx,kkurni/corefx,rahku/corefx,KrisLee/corefx,nelsonsar/corefx,FiveTimesTheFun/corefx,VPashkov/corefx,mafiya69/corefx,alexperovich/corefx,iamjasonp/corefx,shana/corefx,kkurni/corefx,nchikanov/corefx,jlin177/corefx,thiagodin/corefx,tstringer/corefx,yizhang82/corefx,pgavlin/corefx,larsbj1988/corefx,popolan1986/corefx,lggomez/corefx,manu-silicon/corefx,CloudLens/corefx,cartermp/corefx,the-dwyer/corefx,BrennanConroy/corefx,shimingsg/corefx,Ermiar/corefx,khdang/corefx,dtrebbien/corefx,mmitche/corefx,ericstj/corefx,cartermp/corefx,stephenmichaelf/corefx,nbarbettini/corefx,VPashkov/corefx,rubo/corefx,thiagodin/corefx,zmaruo/corefx,vidhya-bv/corefx-sorting,JosephTremoulet/corefx,twsouthwick/corefx,brett25/corefx,PatrickMcDonald/corefx,richlander/corefx,andyhebear/corefx,CloudLens/corefx,DnlHarvey/corefx,destinyclown/corefx,gabrielPeart/corefx,cydhaselton/corefx,xuweixuwei/corefx,Jiayili1/corefx,jlin177/corefx,dotnet-bot/corefx,mazong1123/corefx,chenkennt/corefx,chenkennt/corefx,cydhaselton/corefx,bitcrazed/corefx,cydhaselton/corefx,krk/corefx,krytarowski/corefx,mellinoe/corefx,cartermp/corefx,ericstj/corefx,adamralph/corefx,Frank125/corefx,spoiledsport/corefx,shiftkey-tester/corefx,vidhya-bv/corefx-sorting,mmitche/corefx,spoiledsport/corefx,Yanjing123/corefx,PatrickMcDonald/corefx,yizhang82/corefx,Winsto/corefx,iamjasonp/corefx,dhoehna/corefx,vrassouli/corefx,tstringer/corefx,cydhaselton/corefx,n1ghtmare/corefx,comdiv/corefx,mellinoe/corefx,wtgodbe/corefx,vijaykota/corefx,jhendrixMSFT/corefx,benjamin-bader/corefx,YoupHulsebos/corefx,rjxby/corefx,gabrielPeart/corefx,mmitche/corefx,gkhanna79/corefx,nbarbettini/corefx,Ermiar/corefx,BrennanConroy/corefx,marksmeltzer/corefx,CloudLens/corefx,zhangwenquan/corefx,Yanjing123/corefx,ptoonen/corefx,gregg-miskelly/corefx,mazong1123/corefx,FiveTimesTheFun/corefx,rjxby/corefx,mazong1123/corefx,mmitche/corefx,ellismg/corefx,twsouthwick/corefx,mazong1123/corefx,shiftkey-tester/corefx,zhangwenquan/corefx,shiftkey-tester/corefx,dotnet-bot/corefx,rahku/corefx,zhangwenquan/corefx,Alcaro/corefx,rjxby/corefx,oceanho/corefx,stormleoxia/corefx,dtrebbien/corefx,krk/corefx,rahku/corefx,vs-team/corefx,stephenmichaelf/corefx,nchikanov/corefx,Petermarcu/corefx,stephenmichaelf/corefx,ellismg/corefx,janhenke/corefx,janhenke/corefx,yizhang82/corefx,s0ne0me/corefx,alexperovich/corefx,DnlHarvey/corefx,pallavit/corefx,shahid-pk/corefx,anjumrizwi/corefx,alexperovich/corefx,jhendrixMSFT/corefx,jcme/corefx,ViktorHofer/corefx,huanjie/corefx,claudelee/corefx,parjong/corefx,tijoytom/corefx,manu-silicon/corefx,jcme/corefx,akivafr123/corefx,shmao/corefx,weltkante/corefx,tijoytom/corefx,nelsonsar/corefx,richlander/corefx,misterzik/corefx,krk/corefx,vs-team/corefx,Jiayili1/corefx,MaggieTsang/corefx,Ermiar/corefx,heXelium/corefx,VPashkov/corefx,viniciustaveira/corefx,billwert/corefx,tijoytom/corefx,shiftkey-tester/corefx,nchikanov/corefx,krk/corefx,rubo/corefx,lydonchandra/corefx,fernando-rodriguez/corefx,n1ghtmare/corefx,JosephTremoulet/corefx,shana/corefx,elijah6/corefx,MaggieTsang/corefx,benpye/corefx,stephenmichaelf/corefx,brett25/corefx,Winsto/corefx,cnbin/corefx,richlander/corefx,jlin177/corefx,CherryCxldn/corefx,gregg-miskelly/corefx,weltkante/corefx,chenkennt/corefx,Jiayili1/corefx,mokchhya/corefx,iamjasonp/corefx,axelheer/corefx,brett25/corefx,mellinoe/corefx,Ermiar/corefx,benjamin-bader/corefx,fffej/corefx,EverlessDrop41/corefx,cartermp/corefx,weltkante/corefx,pgavlin/corefx,arronei/corefx,mokchhya/corefx,gregg-miskelly/corefx,xuweixuwei/corefx,huanjie/corefx,misterzik/corefx,ViktorHofer/corefx,tijoytom/corefx,shmao/corefx,jmhardison/corefx,misterzik/corefx,jlin177/corefx,stormleoxia/corefx,dhoehna/corefx,destinyclown/corefx,weltkante/corefx,YoupHulsebos/corefx,alphonsekurian/corefx,twsouthwick/corefx,ericstj/corefx,yizhang82/corefx,ravimeda/corefx,rahku/corefx,jeremymeng/corefx,dkorolev/corefx,Petermarcu/corefx,dkorolev/corefx,SGuyGe/corefx,ptoonen/corefx,kkurni/corefx,vijaykota/corefx,billwert/corefx,nchikanov/corefx,pallavit/corefx,YoupHulsebos/corefx,EverlessDrop41/corefx,ellismg/corefx,jmhardison/corefx,Chrisboh/corefx,benjamin-bader/corefx,iamjasonp/corefx,fgreinacher/corefx,alexandrnikitin/corefx,jeremymeng/corefx,dhoehna/corefx,parjong/corefx,chaitrakeshav/corefx,twsouthwick/corefx,CloudLens/corefx,jhendrixMSFT/corefx,alphonsekurian/corefx,viniciustaveira/corefx,alexperovich/corefx,seanshpark/corefx,elijah6/corefx,the-dwyer/corefx,the-dwyer/corefx,axelheer/corefx,jcme/corefx,CherryCxldn/corefx,JosephTremoulet/corefx,MaggieTsang/corefx,mmitche/corefx,YoupHulsebos/corefx,benpye/corefx,alexandrnikitin/corefx,heXelium/corefx,Ermiar/corefx,jlin177/corefx,s0ne0me/corefx,scott156/corefx,zmaruo/corefx,chaitrakeshav/corefx,cydhaselton/corefx,manu-silicon/corefx,Petermarcu/corefx,ravimeda/corefx
src/System.ComponentModel/src/System/ComponentModel/IRevertibleChangeTracking.cs
src/System.ComponentModel/src/System/ComponentModel/IRevertibleChangeTracking.cs
// Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. using System; namespace System.ComponentModel { /// <summary> /// Provides support for rolling back the changes /// </summary> public interface IRevertibleChangeTracking : IChangeTracking { /// <summary> /// Resets the object's state to unchanged by rejecting the modifications. /// </summary> void RejectChanges(); } }
// Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. using System; namespace System.ComponentModel { /// <summary> /// Provides support for rolling back the changes /// </summary> public interface IRevertibleChangeTracking : IChangeTracking { /// <summary> /// Resets the object's state to unchanged by rejecting the modifications. /// void RejectChanges(); } }
mit
C#
b70aaeb0e5b2fe20d2ed64a8b8af885084570012
use current culture when tostringing numbers
kreeben/resin,kreeben/resin
src/ResinCore/Field.cs
src/ResinCore/Field.cs
using System; using System.Diagnostics; using System.Globalization; namespace Resin { [DebuggerDisplay("{Value}")] public struct Field { private readonly string _value; public string Value { get { return _value; } } public string Key { get; private set; } public bool Store { get; private set; } public bool Analyze { get; private set; } public bool Index { get; private set; } public Field(string key, object value, bool store = true, bool analyze = true, bool index = true) { if (string.IsNullOrWhiteSpace(key)) throw new ArgumentException("key"); if (value == null) throw new ArgumentNullException("value"); Key = key; Store = store; Analyze = analyze; Index = index; object obj = value; if (value is DateTime) { obj = ((DateTime)value).ToUniversalTime().Ticks.ToString(CultureInfo.CurrentCulture); } if (obj is string) { _value = obj.ToString(); } else { // Assumes all values that are not DateTime or string must be Int64. // TODO: implement native number indexes var len = long.MaxValue.ToString(CultureInfo.CurrentCulture).Length; _value = obj.ToString().PadLeft(len, '0'); } } } }
using System; using System.Diagnostics; namespace Resin { [DebuggerDisplay("{Value}")] public struct Field { private readonly string _value; public string Value { get { return _value; } } public string Key { get; private set; } public bool Store { get; private set; } public bool Analyze { get; private set; } public bool Index { get; private set; } public Field(string key, object value, bool store = true, bool analyze = true, bool index = true) { if (string.IsNullOrWhiteSpace(key)) throw new ArgumentException("key"); if (value == null) throw new ArgumentNullException("value"); Key = key; Store = store; Analyze = analyze; Index = index; object obj = value; if (value is DateTime) { obj = ((DateTime)value).ToUniversalTime().Ticks.ToString(); } if (obj is string) { _value = obj.ToString(); } else { // Assumes all values that are not DateTime or string must be Int64. // TODO: implement native number indexes var len = long.MaxValue.ToString().Length; _value = obj.ToString().PadLeft(len, '0'); } } } }
mit
C#
2f206d3c48d624e3788a03a77d03c153d41f046b
Update ip to mqtt
larssima/AmiJukeBoxRemote,larssima/AmiJukeBoxRemote,larssima/AmiJukeBoxRemote,larssima/AmiJukeBoxRemote
AmiJukeBoxRemote/Mqtt/Mqtt.cs
AmiJukeBoxRemote/Mqtt/Mqtt.cs
using System; using System.Collections.Generic; using System.Linq; using System.Net; using System.Text; using System.Web; using uPLibrary.Networking.M2Mqtt; using uPLibrary.Networking.M2Mqtt.Messages; namespace AmiJukeBoxRemote.Mqtt { public class Mqtt { public void SendCancelToSubscriber() { var mqttClient = new MqttClient(IPAddress.Parse("192.168.0.134")); string clientId = Guid.NewGuid().ToString(); mqttClient.Connect(clientId); mqttClient.Publish("amiJukebox", Encoding.UTF8.GetBytes("cancel record"), MqttMsgBase.QOS_LEVEL_EXACTLY_ONCE,false); } } }
using System; using System.Collections.Generic; using System.Linq; using System.Net; using System.Text; using System.Web; using uPLibrary.Networking.M2Mqtt; using uPLibrary.Networking.M2Mqtt.Messages; namespace AmiJukeBoxRemote.Mqtt { public class Mqtt { public void SendCancelToSubscriber() { var mqttClient = new MqttClient(IPAddress.Parse("192.168.0.110")); string clientId = Guid.NewGuid().ToString(); mqttClient.Connect(clientId); mqttClient.Publish("amiJukebox", Encoding.UTF8.GetBytes("cancel record"), MqttMsgBase.QOS_LEVEL_EXACTLY_ONCE,false); } } }
mit
C#
c1bf8da9b63bf5ea10fa015f72d6140b21c698c9
Change to expect the string value of ApprenticeshipEmployerType because we are calling the external api controller action with the hashedAccountId
SkillsFundingAgency/das-employerapprenticeshipsservice,SkillsFundingAgency/das-employerapprenticeshipsservice,SkillsFundingAgency/das-employerapprenticeshipsservice
src/SFA.DAS.EmployerFinance.Web/Filters/LevyEmployerTypeOnly.cs
src/SFA.DAS.EmployerFinance.Web/Filters/LevyEmployerTypeOnly.cs
using System; using System.Threading.Tasks; using System.Web.Mvc; using System.Web.Routing; using SFA.DAS.Common.Domain.Types; using SFA.DAS.EAS.Account.Api.Client; using SFA.DAS.EAS.Account.Api.Types; using SFA.DAS.EmployerFinance.Web.Helpers; namespace SFA.DAS.EmployerFinance.Web.Filters { public class LevyEmployerTypeOnly : ActionFilterAttribute { public override void OnActionExecuting(ActionExecutingContext filterContext) { try { if(filterContext.ActionParameters == null || !filterContext.ActionParameters.ContainsKey("HashedAccountId")) { filterContext.Result = new ViewResult { ViewName = ControllerConstants.BadRequestViewName }; return; } var hashedAccountId = filterContext.ActionParameters["HashedAccountId"].ToString(); var accountApi = DependencyResolver.Current.GetService<IAccountApiClient>(); AccountDetailViewModel account = accountApi.GetAccount(hashedAccountId).GetAwaiter().GetResult(); ApprenticeshipEmployerType apprenticeshipEmployerType = (ApprenticeshipEmployerType)Enum.Parse(typeof(ApprenticeshipEmployerType), account.ApprenticeshipEmployerType, true); if (apprenticeshipEmployerType == ApprenticeshipEmployerType.Levy) { base.OnActionExecuting(filterContext); } else { filterContext.Result = new RedirectToRouteResult(new RouteValueDictionary( new { controller = ControllerConstants.AccessDeniedControllerName, action = "Index", })); } } catch (Exception ex) { filterContext.Result = new ViewResult { ViewName = ControllerConstants.BadRequestViewName }; } } } }
using System; using System.Threading.Tasks; using System.Web.Mvc; using System.Web.Routing; using SFA.DAS.Common.Domain.Types; using SFA.DAS.EAS.Account.Api.Client; using SFA.DAS.EAS.Account.Api.Types; using SFA.DAS.EmployerFinance.Web.Helpers; namespace SFA.DAS.EmployerFinance.Web.Filters { public class LevyEmployerTypeOnly : ActionFilterAttribute { public override void OnActionExecuting(ActionExecutingContext filterContext) { try { if(filterContext.ActionParameters == null || !filterContext.ActionParameters.ContainsKey("HashedAccountId")) { filterContext.Result = new ViewResult { ViewName = ControllerConstants.BadRequestViewName }; return; } var hashedAccountId = filterContext.ActionParameters["HashedAccountId"].ToString(); var accountApi = DependencyResolver.Current.GetService<IAccountApiClient>(); AccountDetailViewModel account = accountApi.GetAccount(hashedAccountId).GetAwaiter().GetResult(); if (account.ApprenticeshipEmployerType == ((int)ApprenticeshipEmployerType.Levy).ToString()) { base.OnActionExecuting(filterContext); } else { filterContext.Result = new RedirectToRouteResult(new RouteValueDictionary( new { controller = ControllerConstants.AccessDeniedControllerName, action = "Index", })); } } catch (Exception ex) { filterContext.Result = new ViewResult { ViewName = ControllerConstants.BadRequestViewName }; } } } }
mit
C#
82ef2e53e950dbb84c48c1372cf54b811bbef47b
Update TypeStyle.cs
physhi/roslyn,ErikSchierboom/roslyn,AmadeusW/roslyn,abock/roslyn,brettfo/roslyn,panopticoncentral/roslyn,nguerrera/roslyn,physhi/roslyn,nguerrera/roslyn,sharwell/roslyn,KevinRansom/roslyn,physhi/roslyn,dotnet/roslyn,wvdd007/roslyn,jasonmalinowski/roslyn,wvdd007/roslyn,jmarolf/roslyn,VSadov/roslyn,stephentoub/roslyn,aelij/roslyn,weltkante/roslyn,wvdd007/roslyn,weltkante/roslyn,eriawan/roslyn,VSadov/roslyn,ErikSchierboom/roslyn,AlekseyTs/roslyn,mgoertz-msft/roslyn,genlu/roslyn,diryboy/roslyn,sharwell/roslyn,mavasani/roslyn,mgoertz-msft/roslyn,CyrusNajmabadi/roslyn,tmat/roslyn,sharwell/roslyn,nguerrera/roslyn,brettfo/roslyn,swaroop-sridhar/roslyn,KevinRansom/roslyn,KevinRansom/roslyn,swaroop-sridhar/roslyn,bartdesmet/roslyn,MichalStrehovsky/roslyn,genlu/roslyn,heejaechang/roslyn,reaction1989/roslyn,reaction1989/roslyn,KirillOsenkov/roslyn,shyamnamboodiripad/roslyn,tannergooding/roslyn,heejaechang/roslyn,stephentoub/roslyn,weltkante/roslyn,panopticoncentral/roslyn,bartdesmet/roslyn,agocke/roslyn,KirillOsenkov/roslyn,davkean/roslyn,bartdesmet/roslyn,KirillOsenkov/roslyn,ErikSchierboom/roslyn,tmat/roslyn,abock/roslyn,AlekseyTs/roslyn,CyrusNajmabadi/roslyn,brettfo/roslyn,gafter/roslyn,diryboy/roslyn,stephentoub/roslyn,aelij/roslyn,AmadeusW/roslyn,mavasani/roslyn,jmarolf/roslyn,shyamnamboodiripad/roslyn,genlu/roslyn,panopticoncentral/roslyn,AlekseyTs/roslyn,eriawan/roslyn,tmat/roslyn,agocke/roslyn,gafter/roslyn,eriawan/roslyn,heejaechang/roslyn,MichalStrehovsky/roslyn,jasonmalinowski/roslyn,tannergooding/roslyn,AmadeusW/roslyn,reaction1989/roslyn,shyamnamboodiripad/roslyn,dotnet/roslyn,diryboy/roslyn,davkean/roslyn,mavasani/roslyn,agocke/roslyn,VSadov/roslyn,MichalStrehovsky/roslyn,jasonmalinowski/roslyn,tannergooding/roslyn,aelij/roslyn,jmarolf/roslyn,CyrusNajmabadi/roslyn,mgoertz-msft/roslyn,dotnet/roslyn,davkean/roslyn,swaroop-sridhar/roslyn,gafter/roslyn,abock/roslyn
src/Workspaces/CSharp/Portable/CodeStyle/TypeStyle/TypeStyle.cs
src/Workspaces/CSharp/Portable/CodeStyle/TypeStyle/TypeStyle.cs
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading; using System.Threading.Tasks; using Microsoft.CodeAnalysis.CSharp.Syntax; namespace Microsoft.CodeAnalysis.CSharp.CodeStyle.TypeStyle { [Flags] internal enum UseVarPreference { None = 0, ForBuiltInTypes = 1 << 0, WhenTypeIsApparent = 1 << 1, Elsewhere = 1 << 2, } }
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading; using System.Threading.Tasks; using Microsoft.CodeAnalysis.CSharp.Syntax; namespace Microsoft.CodeAnalysis.CSharp.CodeStyle.TypeStyle { [Flags] internal enum UseVarPreference { None = 0, ForBuiltInTypes = 1 << 0, WhenTypeIsApparent = 1 << 1, Elsewhere = 1 << 2, // ImplicitTypeWhereExplicit = 1 << 3, } }
mit
C#