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
765cc24c6e92840562d093f6d4a358f7ee1cabb0
Fix keymap check
eivindveg/PG3300-Innlevering1
SnakeMess/Player.cs
SnakeMess/Player.cs
namespace SnakeMess { using System; using System.Diagnostics; public class Player { public Player(int id) { Id = id; switch (id) { case 1: Color = ConsoleColor.Green; KeyMap = new KeyMapping(ConsoleKey.UpArrow, ConsoleKey.DownArrow, ConsoleKey.LeftArrow, ConsoleKey.RightArrow); break; case 2: Color = ConsoleColor.Blue; KeyMap = new KeyMapping(ConsoleKey.W, ConsoleKey.S, ConsoleKey.A, ConsoleKey.D); break; } } public ConsoleColor Color { get; set; } public Snake Snake { get; set; } public int Id { get; set; } private int Score { get; set; } private KeyMapping KeyMap { get; set; } public void KeyPushedCheck() { if (!Console.KeyAvailable) { return; } var keyPushed = Console.ReadKey(true); if (keyPushed.Key == KeyMap.Up && Snake.Direction != Direction.Down) { Debug.Write("Up"); } else if (keyPushed.Key == KeyMap.Down && Snake.Direction != Direction.Up) { Debug.Write("Down"); } else if (keyPushed.Key == KeyMap.Left && Snake.Direction != Direction.Right) { Debug.Write("Left"); } else if (keyPushed.Key == KeyMap.Right && Snake.Direction != Direction.Right) { Debug.Write("Right"); } } } }
namespace SnakeMess { using System; using System.Diagnostics; public class Player { private readonly KeyMapping keyMap; public Player(int id) { Id = id; switch (id) { case 1: Color = ConsoleColor.Green; keyMap = new KeyMapping(ConsoleKey.UpArrow, ConsoleKey.DownArrow, ConsoleKey.LeftArrow, ConsoleKey.RightArrow); break; case 2: Color = ConsoleColor.Blue; keyMap = new KeyMapping(ConsoleKey.W, ConsoleKey.S, ConsoleKey.A, ConsoleKey.D); break; } } public ConsoleColor Color { get; set; } public Snake Snake { get; set; } public int Id { get; set; } private int Score { get; set; } private KeyMapping KeyMap { get; set; } public void KeyPushedCheck() { if (!Console.KeyAvailable) { return; } var keyPushed = Console.ReadKey(true); if (keyPushed.Equals(this.keyMap.Up)) { Debug.Write("Up"); } else if (keyPushed.Equals(this.keyMap.Down)) { Debug.Write("Down"); } else if (keyPushed.Equals(this.keyMap.Left)) { Debug.Write("Left"); } else if (keyPushed.Equals(this.keyMap.Left)) { Debug.Write("Right"); } } } }
mit
C#
dcdc6f87682bd577d26ce174796dafd46c717778
Add HostRunner embryo
fredrikholm/wafer
Wafer/HostRunner.cs
Wafer/HostRunner.cs
using System; using System.Net.Http; using System.Web.Http; namespace Wafer { public class HostRunner { private readonly HttpServer _server; private readonly HttpClient _client; private readonly Uri _baseUri; public HostRunner(Uri baseUri, Action<HttpConfiguration> webApiConfigRegistration) : this(baseUri, webApiConfigRegistration, null) { } public HostRunner(Uri baseUri, Action<HttpConfiguration> webApiConfigRegistration, Action<HttpConfiguration> dependencyResolverConfigRegistration) { _baseUri = baseUri; var config = new HttpConfiguration { IncludeErrorDetailPolicy = IncludeErrorDetailPolicy.Always }; webApiConfigRegistration(config); dependencyResolverConfigRegistration?.Invoke(config); _server = new HttpServer(config); _client = new HttpClient(_server); } ~HostRunner() { _client.Dispose(); _server.Dispose(); } } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Wafer { public class HostRunner { } }
mit
C#
605f9d62a16a536f3ddfcdfac0a654983d2b6e7b
Disable TGDB Tests for now
RonnChyran/snowflake,RonnChyran/snowflake,SnowflakePowered/snowflake,RonnChyran/snowflake,SnowflakePowered/snowflake,SnowflakePowered/snowflake
src/Snowflake.Framework.Tests/Scraping/ScraperIntegrationTests.cs
src/Snowflake.Framework.Tests/Scraping/ScraperIntegrationTests.cs
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Snowflake.Plugin.Scraping.TheGamesDb; using Snowflake.Scraping; using Snowflake.Scraping.Extensibility; using Xunit; namespace Snowflake.Scraping.Tests { public class ScraperIntegrationTests { // [Fact] // public async Task TGDBScraping_Test() // { // var tgdb = new TheGamesDbScraper(); // var scrapeJob = new ScrapeJob(new SeedContent[] { // ("platform", "NINTENDO_NES"), // ("search_title", "Super Mario Bros."), // }, new[] { tgdb }, new ICuller[] { }); // while (await scrapeJob.Proceed()); // } } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Snowflake.Plugin.Scraping.TheGamesDb; using Snowflake.Scraping; using Snowflake.Scraping.Extensibility; using Xunit; namespace Snowflake.Scraping.Tests { public class ScraperIntegrationTests { [Fact] public async Task TGDBScraping_Test() { var tgdb = new TheGamesDbScraper(); var scrapeJob = new ScrapeJob(new SeedContent[] { ("platform", "NINTENDO_NES"), ("search_title", "Super Mario Bros."), }, new[] { tgdb }, new ICuller[] { }); while (await scrapeJob.Proceed()); } } }
mpl-2.0
C#
d7b1910885a124dc8c3780d8d89a54abfcb0ac35
fix coordinate centromappa
vvfosprojects/sovvf,vvfosprojects/sovvf,vvfosprojects/sovvf,vvfosprojects/sovvf,vvfosprojects/sovvf
src/backend/SO115App.Persistence.MongoDB/Marker/GetCentroMappa.cs
src/backend/SO115App.Persistence.MongoDB/Marker/GetCentroMappa.cs
using SO115App.API.Models.Classi.Condivise; using SO115App.API.Models.Classi.Geo; using SO115App.Models.Servizi.Infrastruttura.Marker; using SO115App.Models.Servizi.Infrastruttura.SistemiEsterni.Distaccamenti; namespace SO115App.Persistence.MongoDB.Marker { public class GetCentroMappa : IGetCentroMappaMarker { private readonly IGetCoordinateByCodSede _service; public GetCentroMappa(IGetCoordinateByCodSede service) => _service = service; public CentroMappa GetCentroMappaMarker(string codiceSede) { var coordinate = _service.Get(codiceSede); var centroMappa = new CentroMappa() { CoordinateCentro = coordinate, Zoom = 10 }; return centroMappa; } } }
using SO115App.API.Models.Classi.Condivise; using SO115App.API.Models.Classi.Geo; using SO115App.Models.Servizi.Infrastruttura.Marker; namespace SO115App.Persistence.MongoDB.Marker { public class GetCentroMappa : IGetCentroMappaMarker { public CentroMappa GetCentroMappaMarker(string codiceSede) { if (!(codiceSede.Equals("00") || codiceSede.Equals("001"))) { var coordinate = new Coordinate(0.0, 0.0); var centroMappa = new CentroMappa() { CoordinateCentro = coordinate, Zoom = 10 }; return centroMappa; } else { var coordinate = new Coordinate(41.87194, 12.56738); var centroMappa = new CentroMappa() { CoordinateCentro = coordinate, Zoom = 6 }; return centroMappa; } } } }
agpl-3.0
C#
76af40f35c45dd93d535511fe9a96cc9c5866e4e
update assembly
ceee/UptimeSharp
UptimeSharp/Properties/AssemblyInfo.cs
UptimeSharp/Properties/AssemblyInfo.cs
using System.Reflection; // 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("UptimeSharp")] [assembly: AssemblyDescription("UptimeSharp is a .NET portable class library that integrates the UptimeRobot API")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("cee")] [assembly: AssemblyProduct("UptimeSharp")] [assembly: AssemblyCopyright("Copyright © cee 2014")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // 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.0")] [assembly: AssemblyFileVersion("2.0.0")]
using System.Resources; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("UptimeSharp")] [assembly: AssemblyDescription("UptimeSharp is a .NET class library that integrates the UptimeRobot API")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("cee")] [assembly: AssemblyProduct("UptimeSharp")] [assembly: AssemblyCopyright("Copyright © cee 2013")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0")] [assembly: AssemblyFileVersion("1.0.0")]
mit
C#
e43112fd5bb42e13af4f19d08a4c045f4d7e2f50
add menu item for setting
marihachi/CrystalResonanceForDesktop
src/Scenes/Title.cs
src/Scenes/Title.cs
using DxSharp; using DxSharp.Data; using System.Drawing; using DxSharp.Storage; using CrystalResonanceDesktop.Utility; using CrystalResonanceDesktop.Data; using System; namespace CrystalResonanceDesktop.Scenes { class Title : IScene { private bool _IsInitial { get; set; } = true; private Menu _TitleMenu { get; set; } public void Update() { var core = SystemCore.Instance; if (_IsInitial) { _IsInitial = false; ImageStorage.Instance.Add("logo", new DxSharp.Data.Image("Resource/logo.png", 100, DxSharp.Data.Enum.Position.CenterMiddle)); _TitleMenu = new Menu( new Point(0, 100), new Size(400, 50), DxSharp.Data.Enum.Position.CenterMiddle, 20, FontStorage.Instance.Item("メイリオ16"), new ButtonStyle(Color.FromArgb(160, 255, 255, 255), Color.Transparent, Color.FromArgb(160, 255, 255, 255)), new ButtonStyle(Color.FromArgb(200, 255, 255, 255), Color.Transparent, Color.FromArgb(200, 255, 255, 255)), new ButtonStyle(Color.FromArgb(255, 255, 255, 255), Color.Transparent, Color.FromArgb(255, 255, 255, 255))); _TitleMenu.Add("Game Start"); _TitleMenu.Add("Setting"); _TitleMenu.Add("Close"); _TitleMenu.ItemClick += (s, e) => { // game start if (e.ItemIndex == 0) { SceneStorage.Instance.TargetScene = SceneStorage.Instance.FindByName("GameMain"); } // setting if (e.ItemIndex == 1) { SceneStorage.Instance.TargetScene = SceneStorage.Instance.FindByName("Setting"); } // close if (e.ItemIndex == 2) { SystemCore.Instance.Close(); } }; } _TitleMenu.Update(); } public void Draw() { var logo = ImageStorage.Instance.Item("logo"); logo.Draw(new Point(0, -150)); _TitleMenu.Draw(); } } }
using DxSharp; using DxSharp.Data; using System.Drawing; using DxSharp.Storage; using CrystalResonanceDesktop.Utility; using CrystalResonanceDesktop.Data; using System; namespace CrystalResonanceDesktop.Scenes { class Title : IScene { private bool _IsInitial { get; set; } = true; private Menu _TitleMenu { get; set; } public void Update() { var core = SystemCore.Instance; if (_IsInitial) { _IsInitial = false; ImageStorage.Instance.Add("logo", new DxSharp.Data.Image("Resource/logo.png", 100, DxSharp.Data.Enum.Position.CenterMiddle)); _TitleMenu = new Menu( new Point(0, 100), new Size(400, 50), DxSharp.Data.Enum.Position.CenterMiddle, 20, FontStorage.Instance.Item("メイリオ16"), new ButtonStyle(Color.FromArgb(160, 255, 255, 255), Color.Transparent, Color.FromArgb(160, 255, 255, 255)), new ButtonStyle(Color.FromArgb(200, 255, 255, 255), Color.Transparent, Color.FromArgb(200, 255, 255, 255)), new ButtonStyle(Color.FromArgb(255, 255, 255, 255), Color.Transparent, Color.FromArgb(255, 255, 255, 255))); _TitleMenu.Add("Game Start"); _TitleMenu.Add("Close"); _TitleMenu.ItemClick += (s, e) => { if (e.ItemIndex == 0) { SceneStorage.Instance.TargetScene = SceneStorage.Instance.FindByName("GameMain"); } if (e.ItemIndex == 1) { SystemCore.Instance.Close(); } }; } _TitleMenu.Update(); } public void Draw() { var logo = ImageStorage.Instance.Item("logo"); logo.Draw(new Point(0, -150)); _TitleMenu.Draw(); } } }
mit
C#
f1bc6aef7d670533e34336a7b7602b8b38f9d278
Fix typo in xml comment Client: C# Patch: Vladimir Arkhipov
strava/thrift,creker/thrift,eamosov/thrift,yongju-hong/thrift,dcelasun/thrift,dcelasun/thrift,apache/thrift,yongju-hong/thrift,Jens-G/thrift,jeking3/thrift,eamosov/thrift,Jens-G/thrift,apache/thrift,eamosov/thrift,RobberPhex/thrift,nsuke/thrift,bgould/thrift,bgould/thrift,jeking3/thrift,bforbis/thrift,apache/thrift,RobberPhex/thrift,nsuke/thrift,strava/thrift,dcelasun/thrift,nsuke/thrift,Jens-G/thrift,eamosov/thrift,yongju-hong/thrift,creker/thrift,dcelasun/thrift,dcelasun/thrift,bgould/thrift,yongju-hong/thrift,apache/thrift,strava/thrift,apache/thrift,Jens-G/thrift,eamosov/thrift,yongju-hong/thrift,Jens-G/thrift,nsuke/thrift,eamosov/thrift,dcelasun/thrift,jeking3/thrift,bgould/thrift,RobberPhex/thrift,yongju-hong/thrift,RobberPhex/thrift,jeking3/thrift,dcelasun/thrift,apache/thrift,apache/thrift,dcelasun/thrift,Jens-G/thrift,yongju-hong/thrift,creker/thrift,dcelasun/thrift,nsuke/thrift,apache/thrift,Jens-G/thrift,yongju-hong/thrift,Jens-G/thrift,eamosov/thrift,strava/thrift,bgould/thrift,bforbis/thrift,jeking3/thrift,RobberPhex/thrift,nsuke/thrift,yongju-hong/thrift,jeking3/thrift,RobberPhex/thrift,apache/thrift,bgould/thrift,creker/thrift,strava/thrift,yongju-hong/thrift,creker/thrift,yongju-hong/thrift,strava/thrift,bgould/thrift,nsuke/thrift,yongju-hong/thrift,creker/thrift,creker/thrift,RobberPhex/thrift,bgould/thrift,bforbis/thrift,creker/thrift,apache/thrift,creker/thrift,apache/thrift,yongju-hong/thrift,bforbis/thrift,Jens-G/thrift,apache/thrift,strava/thrift,jeking3/thrift,bgould/thrift,Jens-G/thrift,strava/thrift,dcelasun/thrift,jeking3/thrift,bforbis/thrift,RobberPhex/thrift,nsuke/thrift,strava/thrift,bforbis/thrift,jeking3/thrift,jeking3/thrift,bgould/thrift,eamosov/thrift,eamosov/thrift,bforbis/thrift,eamosov/thrift,bgould/thrift,yongju-hong/thrift,yongju-hong/thrift,RobberPhex/thrift,apache/thrift,bforbis/thrift,yongju-hong/thrift,nsuke/thrift,nsuke/thrift,bforbis/thrift,nsuke/thrift,dcelasun/thrift,creker/thrift,Jens-G/thrift,eamosov/thrift,bgould/thrift,RobberPhex/thrift,bforbis/thrift,RobberPhex/thrift,RobberPhex/thrift,nsuke/thrift,strava/thrift,creker/thrift,bforbis/thrift,RobberPhex/thrift,apache/thrift,nsuke/thrift,Jens-G/thrift,Jens-G/thrift,creker/thrift,RobberPhex/thrift,nsuke/thrift,eamosov/thrift,Jens-G/thrift,strava/thrift,bforbis/thrift,nsuke/thrift,bgould/thrift,apache/thrift,RobberPhex/thrift,Jens-G/thrift,apache/thrift,eamosov/thrift,bforbis/thrift,strava/thrift,Jens-G/thrift,eamosov/thrift,eamosov/thrift,strava/thrift,strava/thrift,bforbis/thrift,strava/thrift,strava/thrift,dcelasun/thrift,dcelasun/thrift,jeking3/thrift,bforbis/thrift,dcelasun/thrift,bforbis/thrift,dcelasun/thrift,jeking3/thrift,strava/thrift,yongju-hong/thrift,jeking3/thrift,Jens-G/thrift,jeking3/thrift,bgould/thrift,dcelasun/thrift,RobberPhex/thrift,nsuke/thrift,apache/thrift,dcelasun/thrift,apache/thrift,jeking3/thrift,bgould/thrift,creker/thrift,creker/thrift,eamosov/thrift,bforbis/thrift,nsuke/thrift,Jens-G/thrift,jeking3/thrift,RobberPhex/thrift
lib/csharp/src/Transport/TSocketVersionizer.cs
lib/csharp/src/Transport/TSocketVersionizer.cs
/** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you 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. * * Contains some contributions under the Thrift Software License. * Please see doc/old-thrift-license.txt in the Thrift distribution for * details. */ using System; using System.Collections.Generic; using System.Linq; using System.Net.Sockets; using System.Reflection; using System.Text; #if NET45 using System.Threading.Tasks; #endif namespace Thrift.Transport { /// <summary> /// PropertyInfo for the DualMode property of the System.Net.Sockets.Socket class. Used to determine if the sockets are capable of /// automatic IPv4 and IPv6 handling. If DualMode is present the sockets automatically handle IPv4 and IPv6 connections. /// If the DualMode is not available the system configuration determines whether IPv4 or IPv6 is used. /// </summary> internal static class TSocketVersionizer { /// <summary> /// Creates a TcpClient according to the capabilities of the used framework. /// </summary> internal static TcpClient CreateTcpClient() { TcpClient client = null; #if NET45 client = new TcpClient(AddressFamily.InterNetworkV6); client.Client.DualMode = true; #else client = new TcpClient(AddressFamily.InterNetwork); #endif return client; } /// <summary> /// Creates a TcpListener according to the capabilities of the used framework. /// </summary> internal static TcpListener CreateTcpListener(Int32 port) { TcpListener listener = null; #if NET45 listener = new TcpListener(System.Net.IPAddress.IPv6Any, port); listener.Server.DualMode = true; #else listener = new TcpListener(System.Net.IPAddress.Any, port); #endif return listener; } } }
/** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you 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. * * Contains some contributions under the Thrift Software License. * Please see doc/old-thrift-license.txt in the Thrift distribution for * details. */ using System; using System.Collections.Generic; using System.Linq; using System.Net.Sockets; using System.Reflection; using System.Text; #if NET45 using System.Threading.Tasks; #endif namespace Thrift.Transport { /// <summary> /// PropertyInfo for the DualMode property of the System.Net.Sockets.Socket class. Used to determine if the sockets are capable of /// automatic IPv4 and IPv6 handling. If DualMode is present the sockets automatically handle IPv4 and IPv6 connections. /// If the DualMode is not available the system configuration determines whether IPv4 or IPv6 is used. /// </summary> internal static class TSocketVersionizer { /// <summary> /// Creates a TcpClient according to the capabilitites of the used framework /// </summary> internal static TcpClient CreateTcpClient() { TcpClient client = null; #if NET45 client = new TcpClient(AddressFamily.InterNetworkV6); client.Client.DualMode = true; #else client = new TcpClient(AddressFamily.InterNetwork); #endif return client; } /// <summary> /// Creates a TcpListener according to the capabilitites of the used framework. /// </summary> internal static TcpListener CreateTcpListener(Int32 port) { TcpListener listener = null; #if NET45 listener = new TcpListener(System.Net.IPAddress.IPv6Any, port); listener.Server.DualMode = true; #else listener = new TcpListener(System.Net.IPAddress.Any, port); #endif return listener; } } }
apache-2.0
C#
e50787d8b7a0fbcf65402fbb26ad0d131710b7d3
Update credential store test
claudiospizzi/SecurityFever
Sources/SecurityFever.Tests/CredentialManager/CredentialStoreTest.cs
Sources/SecurityFever.Tests/CredentialManager/CredentialStoreTest.cs
using Microsoft.VisualStudio.TestTools.UnitTesting; using SecurityFever.CredentialManager; using System.Collections.Generic; using System.Linq; using System.Management.Automation; using System.Security; namespace SecurityFever.Tests.CredentialManager { [TestClass] public class CredentialStoreTest { [TestMethod] public void TestCreateCredential() { // Arrange string expectedNamespace = "LegacyGeneric"; string expectedAttribute = "target"; string expectedTargetAlias = string.Empty; string expectedTargetName = "Unit Test Demo"; CredentialType expectedType = CredentialType.Generic; CredentialPersist expectedPersist = CredentialPersist.LocalMachine; string expectedUsername = "DEMO\\user"; string expectedPassword = "MySecurePassword"; PSCredential expectedCredential = new PSCredential(expectedUsername, CredentialHelper.StringToSecureString(expectedPassword)); // Act CredentialEntry actualCredentialEntry = CredentialStore.CreateCredential(expectedTargetName, expectedType, expectedPersist, expectedCredential); // Assert Assert.AreEqual(expectedNamespace, actualCredentialEntry.Namespace); Assert.AreEqual(expectedAttribute, actualCredentialEntry.Attribute); Assert.AreEqual(expectedTargetAlias, actualCredentialEntry.TargetAlias); Assert.AreEqual(expectedTargetName, actualCredentialEntry.TargetName); Assert.AreEqual(expectedType, actualCredentialEntry.Type); Assert.AreEqual(expectedPersist, actualCredentialEntry.Persist); Assert.AreEqual(expectedUsername, actualCredentialEntry.Credential.UserName); Assert.AreEqual(expectedPassword, actualCredentialEntry.Credential.GetNetworkCredential().Password); } //[TestMethod] //public void TestRemoveCredential() //{ // // Arrange // // Act // // Assert //} //[TestMethod] //public void TestCredentialStore() //{ // IEnumerable<CredentialEntry> credentials = CredentialStore.GetCredentials(); // Assert.AreNotEqual(credentials.ToList<CredentialEntry>().Count, 0); //} } }
using Microsoft.VisualStudio.TestTools.UnitTesting; using SecurityFever.CredentialManager; using System.Collections.Generic; using System.Linq; using System.Management.Automation; using System.Security; namespace SecurityFever.Tests.CredentialManager { [TestClass] public class CredentialStoreTest { [TestMethod] public void TestCreateCredential() { // Arrange string expectedNamespace = "LegacyGeneric"; string expectedAttribute = "target"; string expectedTargetAlias = string.Empty; string expectedTargetName = "Unit Test Demo"; CredentialType expectedType = CredentialType.Generic; CredentialPersist expectedPersist = CredentialPersist.LocalMachine; string expectedUsername = "DEMO\\user"; string expectedPassword = "MySecurePassword"; PSCredential expectedCredential = new PSCredential(expectedUsername, CredentialHelper.StringToSecureString(expectedPassword)); // Act CredentialEntry actualCredentialEntry = CredentialStore.CreateCredential(expectedTargetName, expectedType, expectedPersist, expectedCredential); // Assert Assert.AreEqual(expectedNamespace, actualCredentialEntry.Namespace); Assert.AreEqual(expectedAttribute, actualCredentialEntry.Attribute); Assert.AreEqual(expectedTargetAlias, actualCredentialEntry.TargetAlias); Assert.AreEqual(expectedTargetName, actualCredentialEntry.TargetName); Assert.AreEqual(expectedType, actualCredentialEntry.Type); Assert.AreEqual(expectedPersist, actualCredentialEntry.Persist); Assert.AreEqual(expectedUsername, actualCredentialEntry.Credential.UserName); Assert.AreEqual(expectedPassword, actualCredentialEntry.Credential.GetNetworkCredential().Password); } [TestMethod] public void TestRemoveCredential() { // Arrange // Act // Assert } [TestMethod] public void TestCredentialStore() { IEnumerable<CredentialEntry> credentials = CredentialStore.GetCredentials(); Assert.AreNotEqual(credentials.ToList<CredentialEntry>().Count, 0); } } }
mit
C#
8627d1c22c78fdb450489855eee9e8c078634e3c
Return default 'true' and 'false' for comparing converters.
Whathecode/Framework-Class-Library-Extension,Whathecode/Framework-Class-Library-Extension
Whathecode.PresentationFramework/Windows/Data/AbstractComparisonMarkupExtension.cs
Whathecode.PresentationFramework/Windows/Data/AbstractComparisonMarkupExtension.cs
using System; using System.ComponentModel; using Whathecode.System.Reflection.Extensions; using Whathecode.System.Windows.Markup; namespace Whathecode.System.Windows.Data { /// <summary> /// Markup extension which returns a converter which does a comparison resulting in a boolean and associates a value to each of its resulting states. /// </summary> /// <author>Steven Jeuris</author> public abstract class AbstractComparisonMarkupExtension : AbstractMarkupExtension { /// <summary> /// The type of the associated values to the boolean result. /// </summary> public Type Type { get; set; } /// <summary> /// The value to return in case the boolean is true. /// In case <see cref="Type" /> is not specified and this is set to null, true will be returned by default. /// </summary> public object IfTrue { get; set; } /// <summary> /// The value to return in case the boolean is false. /// In case <see cref="Type" /> is not specified and this is set to null, false will be returned by default. /// </summary> public object IfFalse { get; set; } protected override object ProvideValue( object targetObject, object targetProperty ) { object ifTrue = IfTrue; object ifFalse = IfFalse; // Optionally create a generic converter. // TODO: Can this behavior be extracted to a base class? Can the Type parameter be somehow determined automatically? if ( Type != null ) { TypeConverter typeConverter = TypeDescriptor.GetConverter( Type ); ifTrue = typeConverter.ConvertFrom( IfTrue ); ifFalse = typeConverter.ConvertFrom( IfFalse ); } // In case no type is specified and true and false aren't specified, use 'true' and 'false' as default return values. if ( ( Type == null || Type == typeof( bool ) ) && IfTrue == null && IfFalse == null ) { ifTrue = true; ifFalse = false; } object conditionConverter = CreateConditionConverter( Type ?? typeof( object ) ); if ( !conditionConverter.GetType().IsOfGenericType( typeof( IConditionConverter<> ) ) ) { throw new InvalidImplementationException( String.Format( "CreateConditionConverter() should return a IConditionConverter<> but returns a '{0}'.", conditionConverter.GetType() ) ); } conditionConverter.SetPropertyValue( "IfTrue", ifTrue ); conditionConverter.SetPropertyValue( "IfFalse", ifFalse ); return conditionConverter; } protected abstract object CreateConditionConverter( Type type ); } }
using System; using System.ComponentModel; using Whathecode.System.Reflection.Extensions; using Whathecode.System.Windows.Markup; namespace Whathecode.System.Windows.Data { /// <summary> /// Markup extension which returns a converter which does a comparison resulting in a boolean and associates a value to each of its resulting states. /// </summary> /// <author>Steven Jeuris</author> public abstract class AbstractComparisonMarkupExtension : AbstractMarkupExtension { /// <summary> /// The type of the associated values to the boolean result. /// </summary> public Type Type { get; set; } /// <summary> /// The value to return in case the boolean is true. /// </summary> public object IfTrue { get; set; } /// <summary> /// The value to return in case the boolean is false. /// </summary> public object IfFalse { get; set; } protected override object ProvideValue( object targetObject, object targetProperty ) { object ifTrue = IfTrue; object ifFalse = IfFalse; // Optionally create a generic converter. // TODO: Can this behavior be extracted to a base class? Can the Type parameter be somehow determined automatically? if ( Type != null ) { TypeConverter typeConverter = TypeDescriptor.GetConverter( Type ); ifTrue = typeConverter.ConvertFrom( IfTrue ); ifFalse = typeConverter.ConvertFrom( IfFalse ); } object conditionConverter = CreateConditionConverter( Type ?? typeof( object ) ); if ( !conditionConverter.GetType().IsOfGenericType( typeof( IConditionConverter<> ) ) ) { throw new InvalidImplementationException( String.Format( "CreateConditionConverter() should return a IConditionConverter<> but returns a '{0}'.", conditionConverter.GetType() ) ); } conditionConverter.SetPropertyValue( "IfTrue", ifTrue ); conditionConverter.SetPropertyValue( "IfFalse", ifFalse ); return conditionConverter; } protected abstract object CreateConditionConverter( Type type ); } }
mit
C#
9e4456a5d0c647e18552b0757b9a56b0741972ac
remove authentication
NHSChoices/location-service,NHSChoices/location-service
src/GoatTrip.RestApi/Controllers/LocationController.cs
src/GoatTrip.RestApi/Controllers/LocationController.cs
using System.Web.Http; using GoatTrip.RestApi.Services; namespace GoatTrip.RestApi.Controllers { [RoutePrefix("location")] public class LocationController : ApiController { public LocationController(ILocationQueryValidator queryValidator, ILocationService service) { _queryValidator = queryValidator; _service = service; } [Route("search/{query?}")] [HttpGet] public IHttpActionResult Search(string query = "") { if (!_queryValidator.IsValid(query)) return new BadRequestResult(Request, query); var result = _service.GetByAddress(query); return Ok(result); } [Route("{query?}")] public IHttpActionResult Get(string query = "") { if (!_queryValidator.IsValid(query)) return new BadRequestResult(Request, query); var result = _service.Get(query); return Ok(result); } private readonly ILocationQueryValidator _queryValidator; private readonly ILocationService _service; } }
using System.Web.Http; using GoatTrip.RestApi.Services; namespace GoatTrip.RestApi.Controllers { [RoutePrefix("location")] public class LocationController : ApiController { public LocationController(ILocationQueryValidator queryValidator, ILocationService service) { _queryValidator = queryValidator; _service = service; } [Authentication.Authorize] [Route("search/{query?}")] [HttpGet] public IHttpActionResult Search(string query = "") { if (!_queryValidator.IsValid(query)) return new BadRequestResult(Request, query); var result = _service.GetByAddress(query); return Ok(result); } [Authentication.Authorize] [Route("{query?}")] public IHttpActionResult Get(string query = "") { if (!_queryValidator.IsValid(query)) return new BadRequestResult(Request, query); var result = _service.Get(query); return Ok(result); } private readonly ILocationQueryValidator _queryValidator; private readonly ILocationService _service; } }
apache-2.0
C#
330d8e35384ef87665f9c822243ddc7571de53d6
Add new 4.0 PSM modes.
charlesw/tesseract,nguyenq/tesseract
src/Tesseract/PageSegMode.cs
src/Tesseract/PageSegMode.cs
using System; using System.Collections.Generic; using System.Text; namespace Tesseract { /// <summary> /// Represents the possible page layou analysis modes. /// </summary> public enum PageSegMode : int { /// <summary> /// Orientation and script detection (OSD) only. /// </summary> OsdOnly, /// <summary> /// Automatic page sementation with orientantion and script detection (OSD). /// </summary> AutoOsd, /// <summary> /// Automatic page segmentation, but no OSD, or OCR. /// </summary> AutoOnly, /// <summary> /// Fully automatic page segmentation, but no OSD. /// </summary> Auto, /// <summary> /// Assume a single column of text of variable sizes. /// </summary> SingleColumn, /// <summary> /// Assume a single uniform block of vertically aligned text. /// </summary> SingleBlockVertText, /// <summary> /// Assume a single uniform block of text. /// </summary> SingleBlock, /// <summary> /// Treat the image as a single text line. /// </summary> SingleLine, /// <summary> /// Treat the image as a single word. /// </summary> SingleWord, /// <summary> /// Treat the image as a single word in a circle. /// </summary> CircleWord, /// <summary> /// Treat the image as a single character. /// </summary> SingleChar, /// <summary> /// Find as much text as possible in no particular order. /// </summary> SparseText, /// <summary> /// Sparse text with orientation and script det. /// </summary> SparseTextOsd, /// <summary> /// Treat the image as a single text line, bypassing hacks that are Tesseract-specific. /// </summary> RawLine, /// <summary> /// Number of enum entries. /// </summary> Count } }
using System; using System.Collections.Generic; using System.Text; namespace Tesseract { /// <summary> /// Represents the possible page layou analysis modes. /// </summary> public enum PageSegMode : int { /// <summary> /// Orientation and script detection (OSD) only. /// </summary> OsdOnly, /// <summary> /// Automatic page sementation with orientantion and script detection (OSD). /// </summary> AutoOsd, /// <summary> /// Automatic page segmentation, but no OSD, or OCR. /// </summary> AutoOnly, /// <summary> /// Fully automatic page segmentation, but no OSD. /// </summary> Auto, /// <summary> /// Assume a single column of text of variable sizes. /// </summary> SingleColumn, /// <summary> /// Assume a single uniform block of vertically aligned text. /// </summary> SingleBlockVertText, /// <summary> /// Assume a single uniform block of text. /// </summary> SingleBlock, /// <summary> /// Treat the image as a single text line. /// </summary> SingleLine, /// <summary> /// Treat the image as a single word. /// </summary> SingleWord, /// <summary> /// Treat the image as a single word in a circle. /// </summary> CircleWord, /// <summary> /// Treat the image as a single character. /// </summary> SingleChar, /// <summary> /// Number of enum entries. /// </summary> Count } }
apache-2.0
C#
f47718cad95c0abdc6b3869367fd3cdfe1c19e69
Add support for person_token on Person creation
richardlawley/stripe.net,stripe/stripe-dotnet
src/Stripe.net/Services/Persons/PersonSharedOptions.cs
src/Stripe.net/Services/Persons/PersonSharedOptions.cs
namespace Stripe { using System; using System.Collections.Generic; using Newtonsoft.Json; using Stripe.Infrastructure; public abstract class PersonSharedOptions : BaseOptions { [JsonProperty("address")] public AddressOptions Address { get; set; } [JsonProperty("address_kana")] public AddressJapanOptions AddressKana { get; set; } [JsonProperty("address_kanji")] public AddressJapanOptions AddressKanji { get; set; } [JsonProperty("dob")] public DobOptions Dob { get; set; } [JsonProperty("email")] public string Email { get; set; } [JsonProperty("first_name")] public string FirstName { get; set; } [JsonProperty("first_name_kana")] public string FirstNameKana { get; set; } [JsonProperty("first_name_kanji")] public string FirstNameKanji { get; set; } [JsonProperty("gender")] public string Gender { get; set; } [JsonProperty("id_number")] public string IdNumber { get; set; } [JsonProperty("last_name")] public string LastName { get; set; } [JsonProperty("last_name_kana")] public string LastNameKana { get; set; } [JsonProperty("last_name_kanji")] public string LastNameKanji { get; set; } [JsonProperty("maiden_name")] public string MaidenName { get; set; } [JsonProperty("metadata")] public Dictionary<string, string> Metadata { get; set; } [JsonProperty("person_token")] public string PersonToken { get; set; } [JsonProperty("personal_id_number")] public string PersonalIdNumber { get; set; } [JsonProperty("phone")] public string Phone { get; set; } [JsonProperty("relationship")] public PersonRelationshipOptions Relationship { get; set; } [JsonProperty("ssn_last_4")] public string SSNLast4 { get; set; } [JsonProperty("verification")] public PersonVerificationOptions Verification { get; set; } } }
namespace Stripe { using System; using System.Collections.Generic; using Newtonsoft.Json; using Stripe.Infrastructure; public abstract class PersonSharedOptions : BaseOptions { [JsonProperty("address")] public AddressOptions Address { get; set; } [JsonProperty("address_kana")] public AddressJapanOptions AddressKana { get; set; } [JsonProperty("address_kanji")] public AddressJapanOptions AddressKanji { get; set; } [JsonProperty("dob")] public DobOptions Dob { get; set; } [JsonProperty("email")] public string Email { get; set; } [JsonProperty("first_name")] public string FirstName { get; set; } [JsonProperty("first_name_kana")] public string FirstNameKana { get; set; } [JsonProperty("first_name_kanji")] public string FirstNameKanji { get; set; } [JsonProperty("gender")] public string Gender { get; set; } [JsonProperty("id_number")] public string IdNumber { get; set; } [JsonProperty("last_name")] public string LastName { get; set; } [JsonProperty("last_name_kana")] public string LastNameKana { get; set; } [JsonProperty("last_name_kanji")] public string LastNameKanji { get; set; } [JsonProperty("maiden_name")] public string MaidenName { get; set; } [JsonProperty("metadata")] public Dictionary<string, string> Metadata { get; set; } [JsonProperty("personal_id_number")] public string PersonalIdNumber { get; set; } [JsonProperty("phone")] public string Phone { get; set; } [JsonProperty("relationship")] public PersonRelationshipOptions Relationship { get; set; } [JsonProperty("ssn_last_4")] public string SSNLast4 { get; set; } [JsonProperty("verification")] public PersonVerificationOptions Verification { get; set; } } }
apache-2.0
C#
d0e8e77fc54748dc0819114aa833a8ec8b01af68
Fix FileSystemProviderManagerTests
KevinJump/Umbraco-CMS,JimBobSquarePants/Umbraco-CMS,mattbrailsford/Umbraco-CMS,rasmuseeg/Umbraco-CMS,PeteDuncanson/Umbraco-CMS,mattbrailsford/Umbraco-CMS,madsoulswe/Umbraco-CMS,tcmorris/Umbraco-CMS,JimBobSquarePants/Umbraco-CMS,robertjf/Umbraco-CMS,bjarnef/Umbraco-CMS,abjerner/Umbraco-CMS,mattbrailsford/Umbraco-CMS,KevinJump/Umbraco-CMS,aaronpowell/Umbraco-CMS,arknu/Umbraco-CMS,JeffreyPerplex/Umbraco-CMS,tompipe/Umbraco-CMS,hfloyd/Umbraco-CMS,hfloyd/Umbraco-CMS,tcmorris/Umbraco-CMS,kgiszewski/Umbraco-CMS,tcmorris/Umbraco-CMS,KevinJump/Umbraco-CMS,marcemarc/Umbraco-CMS,aadfPT/Umbraco-CMS,lars-erik/Umbraco-CMS,aaronpowell/Umbraco-CMS,rasmuseeg/Umbraco-CMS,jchurchley/Umbraco-CMS,abjerner/Umbraco-CMS,dawoe/Umbraco-CMS,leekelleher/Umbraco-CMS,mattbrailsford/Umbraco-CMS,nul800sebastiaan/Umbraco-CMS,jchurchley/Umbraco-CMS,nul800sebastiaan/Umbraco-CMS,leekelleher/Umbraco-CMS,dawoe/Umbraco-CMS,umbraco/Umbraco-CMS,dawoe/Umbraco-CMS,leekelleher/Umbraco-CMS,WebCentrum/Umbraco-CMS,PeteDuncanson/Umbraco-CMS,umbraco/Umbraco-CMS,hfloyd/Umbraco-CMS,aadfPT/Umbraco-CMS,tcmorris/Umbraco-CMS,robertjf/Umbraco-CMS,lars-erik/Umbraco-CMS,abryukhov/Umbraco-CMS,tompipe/Umbraco-CMS,abryukhov/Umbraco-CMS,JeffreyPerplex/Umbraco-CMS,umbraco/Umbraco-CMS,base33/Umbraco-CMS,rasmuseeg/Umbraco-CMS,kgiszewski/Umbraco-CMS,NikRimington/Umbraco-CMS,NikRimington/Umbraco-CMS,hfloyd/Umbraco-CMS,abryukhov/Umbraco-CMS,abryukhov/Umbraco-CMS,arknu/Umbraco-CMS,NikRimington/Umbraco-CMS,PeteDuncanson/Umbraco-CMS,madsoulswe/Umbraco-CMS,aadfPT/Umbraco-CMS,WebCentrum/Umbraco-CMS,JimBobSquarePants/Umbraco-CMS,KevinJump/Umbraco-CMS,dawoe/Umbraco-CMS,lars-erik/Umbraco-CMS,robertjf/Umbraco-CMS,KevinJump/Umbraco-CMS,WebCentrum/Umbraco-CMS,tcmorris/Umbraco-CMS,abjerner/Umbraco-CMS,lars-erik/Umbraco-CMS,robertjf/Umbraco-CMS,hfloyd/Umbraco-CMS,nul800sebastiaan/Umbraco-CMS,marcemarc/Umbraco-CMS,JimBobSquarePants/Umbraco-CMS,dawoe/Umbraco-CMS,umbraco/Umbraco-CMS,robertjf/Umbraco-CMS,aaronpowell/Umbraco-CMS,bjarnef/Umbraco-CMS,jchurchley/Umbraco-CMS,madsoulswe/Umbraco-CMS,bjarnef/Umbraco-CMS,marcemarc/Umbraco-CMS,tcmorris/Umbraco-CMS,marcemarc/Umbraco-CMS,base33/Umbraco-CMS,leekelleher/Umbraco-CMS,arknu/Umbraco-CMS,lars-erik/Umbraco-CMS,bjarnef/Umbraco-CMS,JeffreyPerplex/Umbraco-CMS,abjerner/Umbraco-CMS,kgiszewski/Umbraco-CMS,arknu/Umbraco-CMS,tompipe/Umbraco-CMS,JimBobSquarePants/Umbraco-CMS,base33/Umbraco-CMS,leekelleher/Umbraco-CMS,marcemarc/Umbraco-CMS
src/Umbraco.Tests/IO/FileSystemProviderManagerTests.cs
src/Umbraco.Tests/IO/FileSystemProviderManagerTests.cs
using System; using Moq; using NUnit.Framework; using Umbraco.Core; using Umbraco.Core.IO; using Umbraco.Core.Logging; using Umbraco.Core.Profiling; using Umbraco.Tests.TestHelpers; namespace Umbraco.Tests.IO { [TestFixture] public class FileSystemProviderManagerTests { [SetUp] public void Setup() { //init the config singleton var config = SettingsForTests.GetDefault(); SettingsForTests.ConfigureSettings(config); // media fs wants this ApplicationContext.Current = new ApplicationContext(CacheHelper.CreateDisabledCacheHelper(), new ProfilingLogger(Mock.Of<ILogger>(), Mock.Of<IProfiler>())); } [Test] public void Can_Get_Base_File_System() { var fs = FileSystemProviderManager.Current.GetUnderlyingFileSystemProvider(FileSystemProviderConstants.Media); Assert.NotNull(fs); } [Test] public void Can_Get_Typed_File_System() { var fs = FileSystemProviderManager.Current.GetFileSystemProvider<MediaFileSystem>(); Assert.NotNull(fs); } [Test] public void Exception_Thrown_On_Invalid_Typed_File_System() { Assert.Throws<InvalidOperationException>(() => FileSystemProviderManager.Current.GetFileSystemProvider<InvalidTypedFileSystem>()); } /// <summary> /// Used in unit tests, for a typed file system we need to inherit from FileSystemWrapper and they MUST have a ctor /// that only accepts a base IFileSystem object /// </summary> internal class InvalidTypedFileSystem : FileSystemWrapper { public InvalidTypedFileSystem(IFileSystem wrapped, string invalidParam) : base(wrapped) { } } } }
using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Text; using NUnit.Framework; using Umbraco.Core.IO; using Umbraco.Tests.TestHelpers; namespace Umbraco.Tests.IO { [TestFixture] public class FileSystemProviderManagerTests { [SetUp] public void Setup() { //init the config singleton var config = SettingsForTests.GetDefault(); SettingsForTests.ConfigureSettings(config); } [Test] public void Can_Get_Base_File_System() { var fs = FileSystemProviderManager.Current.GetUnderlyingFileSystemProvider(FileSystemProviderConstants.Media); Assert.NotNull(fs); } [Test] public void Can_Get_Typed_File_System() { var fs = FileSystemProviderManager.Current.GetFileSystemProvider<MediaFileSystem>(); Assert.NotNull(fs); } [Test] public void Exception_Thrown_On_Invalid_Typed_File_System() { Assert.Throws<InvalidOperationException>(() => FileSystemProviderManager.Current.GetFileSystemProvider<InvalidTypedFileSystem>()); } /// <summary> /// Used in unit tests, for a typed file system we need to inherit from FileSystemWrapper and they MUST have a ctor /// that only accepts a base IFileSystem object /// </summary> internal class InvalidTypedFileSystem : FileSystemWrapper { public InvalidTypedFileSystem(IFileSystem wrapped, string invalidParam) : base(wrapped) { } } } }
mit
C#
d5fe4f0f72e404f9527e2ccfe444dcd6645de0fc
Remove unused skin resolution in `LegacyScoreCounter`
smoogipooo/osu,ppy/osu,peppy/osu-new,ppy/osu,NeoAdonis/osu,peppy/osu,ppy/osu,smoogipoo/osu,UselessToucan/osu,smoogipoo/osu,peppy/osu,peppy/osu,smoogipoo/osu,NeoAdonis/osu,NeoAdonis/osu,UselessToucan/osu,UselessToucan/osu
osu.Game/Skinning/LegacyScoreCounter.cs
osu.Game/Skinning/LegacyScoreCounter.cs
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. using osu.Framework.Graphics; using osu.Game.Graphics.Sprites; using osu.Game.Screens.Play.HUD; using osuTK; namespace osu.Game.Skinning { public class LegacyScoreCounter : GameplayScoreCounter, ISkinnableComponent { protected override double RollingDuration => 1000; protected override Easing RollingEasing => Easing.Out; public LegacyScoreCounter() : base(6) { Anchor = Anchor.TopRight; Origin = Anchor.TopRight; Scale = new Vector2(0.96f); Margin = new MarginPadding(10); } protected sealed override OsuSpriteText CreateSpriteText() => new LegacySpriteText(LegacyFont.Score) { Anchor = Anchor.TopRight, Origin = Anchor.TopRight, }; } }
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Game.Graphics.Sprites; using osu.Game.Screens.Play.HUD; using osuTK; namespace osu.Game.Skinning { public class LegacyScoreCounter : GameplayScoreCounter, ISkinnableComponent { protected override double RollingDuration => 1000; protected override Easing RollingEasing => Easing.Out; [Resolved] private ISkinSource skin { get; set; } public LegacyScoreCounter() : base(6) { Anchor = Anchor.TopRight; Origin = Anchor.TopRight; Scale = new Vector2(0.96f); Margin = new MarginPadding(10); } protected sealed override OsuSpriteText CreateSpriteText() => new LegacySpriteText(LegacyFont.Score) { Anchor = Anchor.TopRight, Origin = Anchor.TopRight, }; } }
mit
C#
4c2e8943a9ee580f6d437a1b812c877500e90190
Add multiple check
masahikomori/timeSignal
timeSignal/Program.cs
timeSignal/Program.cs
 using System; using System.Threading; using System.Windows.Forms; namespace timeSignal { static class Program { /// <summary> /// アプリケーションのメイン エントリ ポイントです。 /// </summary> [STAThread] static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); new Form1(); checkMultiple(); } /// <summary> /// Multiple start check /// </summary> static void checkMultiple() { Mutex objMutex = new System.Threading.Mutex(false, Application.ProductName); if (objMutex.WaitOne(0, false)) { Application.Run(); } GC.KeepAlive(objMutex); objMutex.Close(); } } }
 using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using System.Windows.Forms; namespace timeSignal { static class Program { /// <summary> /// アプリケーションのメイン エントリ ポイントです。 /// </summary> [STAThread] static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); new Form1(); Application.Run(); } } }
mit
C#
b70740615f5a88631de53a345e761c8612bc302b
Fix KVO properties
kangaroo/monomac,PlayScriptRedux/monomac,dlech/monomac
samples/QTRecorder/QTRDocument.cs
samples/QTRecorder/QTRDocument.cs
using System; using System.Collections.Generic; using System.Linq; using MonoMac.Foundation; using MonoMac.AppKit; using MonoMac.QTKit; namespace QTRecorder { public partial class QTRDocument : MonoMac.AppKit.NSDocument { // Called when created from unmanaged code public QTRDocument (IntPtr handle) : base(handle) { } // Called when created directly from a XIB file [Export("initWithCoder:")] public QTRDocument (NSCoder coder) : base(coder) { } public override void WindowControllerDidLoadNib (NSWindowController windowController) { base.WindowControllerDidLoadNib (windowController); // Add code to here after the controller has loaded the document window } // // Save support: // Override one of GetAsData, GetAsFileWrapper, or WriteToUrl. // // This method should store the contents of the document using the given typeName // on the return NSData value. public override NSData GetAsData (string documentType, out NSError outError) { outError = NSError.FromDomain (NSError.OsStatusErrorDomain, -4); return null; } // // Load support: // Override one of ReadFromData, ReadFromFileWrapper or ReadFromUrl // public override bool ReadFromData (NSData data, string typeName, out NSError outError) { outError = NSError.FromDomain (NSError.OsStatusErrorDomain, -4); return false; } QTCaptureDevice [] videoDevices; void RefreshDevices () { Console.WriteLine ("Foo"); WillChangeValue ("VideoDevices"); videoDevices = QTCaptureDevice.GetInputDevices (QTMediaType.Video).Concat (QTCaptureDevice.GetInputDevices (QTMediaType.Muxed)).ToArray (); DidChangeValue ("VideoDevices"); } // // Connections // public QTCaptureDevice [] VideoDevices { [Export ("VideoDevices")] get { Console.WriteLine ("Bar"); if (videoDevices == null) RefreshDevices (); return videoDevices; } [Export ("setVideoDevices:")] set { videoDevices = value; } } [Connect ("SelectedVideoDevice")] public QTCaptureDevice SelectedVideoDevice { get { return null; } set { Console.WriteLine ("Foo"); } } public override string WindowNibName { get { return "QTRDocument"; } } } }
using System; using System.Collections.Generic; using System.Linq; using MonoMac.Foundation; using MonoMac.AppKit; using MonoMac.QTKit; namespace QTRecorder { public partial class QTRDocument : MonoMac.AppKit.NSDocument { // Called when created from unmanaged code public QTRDocument (IntPtr handle) : base(handle) { } // Called when created directly from a XIB file [Export("initWithCoder:")] public QTRDocument (NSCoder coder) : base(coder) { } public override void WindowControllerDidLoadNib (NSWindowController windowController) { base.WindowControllerDidLoadNib (windowController); // Add code to here after the controller has loaded the document window } // // Save support: // Override one of GetAsData, GetAsFileWrapper, or WriteToUrl. // // This method should store the contents of the document using the given typeName // on the return NSData value. public override NSData GetAsData (string documentType, out NSError outError) { outError = NSError.FromDomain (NSError.OsStatusErrorDomain, -4); return null; } // // Load support: // Override one of ReadFromData, ReadFromFileWrapper or ReadFromUrl // public override bool ReadFromData (NSData data, string typeName, out NSError outError) { outError = NSError.FromDomain (NSError.OsStatusErrorDomain, -4); return false; } QTCaptureDevice [] videoDevices; void RefreshDevices () { Console.WriteLine ("Foo"); WillChangeValue ("VideoDevices"); videoDevices = QTCaptureDevice.GetInputDevices (QTMediaType.Video).Concat (QTCaptureDevice.GetInputDevices (QTMediaType.Muxed)).ToArray (); DidChangeValue ("VideoDevices"); } // // Connections // [Connect ("VideoDevices")] public QTCaptureDevice [] VideoDevices { get { Console.WriteLine ("Bar"); if (videoDevices == null) RefreshDevices (); return videoDevices; } } [Connect ("SelectedVideoDevice")] public QTCaptureDevice SelectedVideoDevice { get { return null; } set { Console.WriteLine ("Foo"); } } public override string WindowNibName { get { return "QTRDocument"; } } } }
apache-2.0
C#
848c32ca77fa46aa0efb8d49c413a191777dcdc9
Allow dataloss... shouldn't be necesssary?
mattgwagner/alert-roster
alert-roster.web/Migrations/Configuration.cs
alert-roster.web/Migrations/Configuration.cs
namespace alert_roster.web.Migrations { using alert_roster.web.Models; using System; using System.Data.Entity; using System.Data.Entity.Migrations; using System.Linq; internal sealed class Configuration : DbMigrationsConfiguration<alert_roster.web.Models.AlertRosterDbContext> { public Configuration() { AutomaticMigrationsEnabled = true; AutomaticMigrationDataLossAllowed = true; ContextKey = "alert_roster.web.Models.AlertRosterDbContext"; } protected override void Seed(alert_roster.web.Models.AlertRosterDbContext context) { // This method will be called after migrating to the latest version. //context.Messages.AddOrUpdate( // m => m.Content, // new Message { PostedDate = DateTime.UtcNow, Content = "This is the initial, test message posting" } // ); } } }
namespace alert_roster.web.Migrations { using alert_roster.web.Models; using System; using System.Data.Entity; using System.Data.Entity.Migrations; using System.Linq; internal sealed class Configuration : DbMigrationsConfiguration<alert_roster.web.Models.AlertRosterDbContext> { public Configuration() { AutomaticMigrationsEnabled = true; AutomaticMigrationDataLossAllowed = false; ContextKey = "alert_roster.web.Models.AlertRosterDbContext"; } protected override void Seed(alert_roster.web.Models.AlertRosterDbContext context) { // This method will be called after migrating to the latest version. //context.Messages.AddOrUpdate( // m => m.Content, // new Message { PostedDate = DateTime.UtcNow, Content = "This is the initial, test message posting" } // ); } } }
mit
C#
3ca8ba594ecc06b763a00fe3837d4d258b107827
revert isMainThread
kchen0723/ExcelAsync
ExcelAsync/ExcelOperator/ExcelUIThreadProtecter.cs
ExcelAsync/ExcelOperator/ExcelUIThreadProtecter.cs
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading; namespace ExcelAsync.ExcelOperator { public class ExcelUIThreadProtecter { public static void CheckIsExcelUIMainThread() { //In practice the managed Main thread id is 1. if (Thread.CurrentThread.ManagedThreadId != 1) { throw new Exception("All excel operation must be run at excel UI main thread"); } } } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace ExcelAsync.ExcelOperator { public class ExcelUIThreadProtecter { public static void CheckIsExcelUIMainThread() { if (ExcelDna.Integration.ExcelDnaUtil.IsMainThread == false) { throw new Exception("All excel operation must be run at excel UI main thread"); } } } }
agpl-3.0
C#
be6a66117f012819c8842e5fc9d742813f8f92e7
Fix for #88 - Add support for HTML5 fancy date selection in Edge
csf-dev/CSF.Screenplay,csf-dev/CSF.Screenplay,csf-dev/CSF.Screenplay
Tests/CSF.Screenplay.Web.Tests/ScreenplayConfig.cs
Tests/CSF.Screenplay.Web.Tests/ScreenplayConfig.cs
using System; using System.Collections.Generic; using System.Linq; using CSF.Screenplay.Integration; using CSF.Screenplay.NUnit; using CSF.Screenplay.Reporting; using CSF.Screenplay.Reporting.Models; using CSF.Screenplay.Scenarios; using CSF.Screenplay.Web.Abilities; using CSF.Screenplay.Web.Reporting; using CSF.Screenplay.Web.Tests; using CSF.WebDriverFactory; using CSF.WebDriverFactory.Impl; using OpenQA.Selenium; [assembly:ScreenplayAssembly(typeof(ScreenplayConfig))] namespace CSF.Screenplay.Web.Tests { public class ScreenplayConfig : IIntegrationConfig { public void Configure(IIntegrationConfigBuilder builder) { builder.UseCast(); builder.UseReporting(config => { config .SubscribeToActorsCreatedInCast() .WriteReport(WriteReport) .WithFormatter<StringArrayFormatter>() .WithFormatter<OptionCollectionFormatter>() .WithFormatter<ElementCollectionFormatter>(); }); builder.UseUriTransformer(new RootUriPrependingTransformer("http://localhost:8080/")); builder.UseWebDriver(GetWebDriver); builder.UseWebBrowser(GetWebBrowser); } IWebDriver GetWebDriver(IServiceResolver scenario) { var provider = new ConfigurationWebDriverFactoryProvider(); var factory = provider.GetFactory(); var caps = new Dictionary<string,object>(); if(factory is SauceConnectWebDriverFactory) { caps.Add(SauceConnectWebDriverFactory.TestNameCapability, GetTestName(scenario)); } return factory.GetWebDriver(caps); } BrowseTheWeb GetWebBrowser(IServiceResolver scenario) { var provider = new ConfigurationWebDriverFactoryProvider(); var factory = provider.GetFactory(); var driver = scenario.GetService<IWebDriver>(); var transformer = scenario.GetOptionalService<IUriTransformer>(); var ability = new BrowseTheWeb(driver, transformer?? NoOpUriTransformer.Default); ConfigureBrowserCapabilities(ability, factory); return ability; } void ConfigureBrowserCapabilities(BrowseTheWeb ability, IWebDriverFactory factory) { var browserName = factory.GetBrowserName(); ability.AddCapabilityExceptWhereUnsupported(Capabilities.ClearDomainCookies, browserName, "Edge"); ability.AddCapabilityWhereSupported(Capabilities.EnterDatesInLocaleFormat, browserName, "Chrome", "Edge"); } string GetTestName(IServiceResolver resolver) { var scenarioName = resolver.GetService<IScenarioName>(); return $"{scenarioName.FeatureId.Name} -> {scenarioName.ScenarioId.Name}"; } void WriteReport(IObjectFormattingService formatter, Report report) { var path = "NUnit.report.txt"; TextReportWriter.WriteToFile(report, path, formatter); } } }
using System; using System.Collections.Generic; using System.Linq; using CSF.Screenplay.Integration; using CSF.Screenplay.NUnit; using CSF.Screenplay.Reporting; using CSF.Screenplay.Reporting.Models; using CSF.Screenplay.Scenarios; using CSF.Screenplay.Web.Abilities; using CSF.Screenplay.Web.Reporting; using CSF.Screenplay.Web.Tests; using CSF.WebDriverFactory; using CSF.WebDriverFactory.Impl; using OpenQA.Selenium; [assembly:ScreenplayAssembly(typeof(ScreenplayConfig))] namespace CSF.Screenplay.Web.Tests { public class ScreenplayConfig : IIntegrationConfig { public void Configure(IIntegrationConfigBuilder builder) { builder.UseCast(); builder.UseReporting(config => { config .SubscribeToActorsCreatedInCast() .WriteReport(WriteReport) .WithFormatter<StringArrayFormatter>() .WithFormatter<OptionCollectionFormatter>() .WithFormatter<ElementCollectionFormatter>(); }); builder.UseUriTransformer(new RootUriPrependingTransformer("http://localhost:8080/")); builder.UseWebDriver(GetWebDriver); builder.UseWebBrowser(GetWebBrowser); } IWebDriver GetWebDriver(IServiceResolver scenario) { var provider = new ConfigurationWebDriverFactoryProvider(); var factory = provider.GetFactory(); var caps = new Dictionary<string,object>(); if(factory is SauceConnectWebDriverFactory) { caps.Add(SauceConnectWebDriverFactory.TestNameCapability, GetTestName(scenario)); } return factory.GetWebDriver(caps); } BrowseTheWeb GetWebBrowser(IServiceResolver scenario) { var provider = new ConfigurationWebDriverFactoryProvider(); var factory = provider.GetFactory(); var driver = scenario.GetService<IWebDriver>(); var transformer = scenario.GetOptionalService<IUriTransformer>(); var ability = new BrowseTheWeb(driver, transformer?? NoOpUriTransformer.Default); ConfigureBrowserCapabilities(ability, factory); return ability; } void ConfigureBrowserCapabilities(BrowseTheWeb ability, IWebDriverFactory factory) { var browserName = factory.GetBrowserName(); ability.AddCapabilityExceptWhereUnsupported(Capabilities.ClearDomainCookies, browserName, "Edge"); ability.AddCapabilityWhereSupported(Capabilities.EnterDatesInLocaleFormat, browserName, "Chrome"); } string GetTestName(IServiceResolver resolver) { var scenarioName = resolver.GetService<IScenarioName>(); return $"{scenarioName.FeatureId.Name} -> {scenarioName.ScenarioId.Name}"; } void WriteReport(IObjectFormattingService formatter, Report report) { var path = "NUnit.report.txt"; TextReportWriter.WriteToFile(report, path, formatter); } } }
mit
C#
0140a714de533083de1972e65bbb7f615d30e57e
Remove no longer needed usings
versionone/VersionOne.Integration.Bugzilla,versionone/VersionOne.Integration.Bugzilla,versionone/VersionOne.Integration.Bugzilla
VersionOne.Bugzilla.BugzillaAPI.Testss/BugTests.cs
VersionOne.Bugzilla.BugzillaAPI.Testss/BugTests.cs
using Microsoft.VisualStudio.TestTools.UnitTesting; namespace VersionOne.Bugzilla.BugzillaAPI.Testss { [TestClass()] public class given_a_Bug { private IBug _bug; private string _expectedReassignToPayload; [TestInitialize()] public void SetContext() { _bug = new Bug(); _expectedReassignToPayload = "{\r\n \"assigned_to\": \"denise@denise.com\",\r\n \"status\": \"CONFIRMED\",\r\n \"token\": \"terry.densmore@versionone.com\"\r\n}"; } [TestMethod] public void it_should_give_appropriate_reassigneto_payloads() { var integrationUser = "terry.densmore@versionone.com"; _bug.AssignedTo = "denise@denise.com"; Assert.IsTrue(_expectedReassignToPayload == _bug.GetReassignBugPayload(integrationUser)); } } }
using System.Linq; using Microsoft.VisualStudio.TestTools.UnitTesting; using System; namespace VersionOne.Bugzilla.BugzillaAPI.Testss { [TestClass()] public class given_a_Bug { private IBug _bug; private string _expectedReassignToPayload; [TestInitialize()] public void SetContext() { _bug = new Bug(); _expectedReassignToPayload = "{\r\n \"assigned_to\": \"denise@denise.com\",\r\n \"status\": \"CONFIRMED\",\r\n \"token\": \"terry.densmore@versionone.com\"\r\n}"; } [TestMethod] public void it_should_give_appropriate_reassigneto_payloads() { var integrationUser = "terry.densmore@versionone.com"; _bug.AssignedTo = "denise@denise.com"; Assert.IsTrue(_expectedReassignToPayload == _bug.GetReassignBugPayload(integrationUser)); } } }
bsd-3-clause
C#
853f1b73abf6e4d29e5e97c6a7e0b582385076a1
Update solution properties
sms1991/i18n,VladMukhitdinovLic/i18n
src/i18n/Properties/AssemblyInfo.cs
src/i18n/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("i18n")] [assembly: AssemblyDescription("Smart internationalization for ASP.NET")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("i18n")] [assembly: AssemblyCopyright("Open Source")] [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("1453a162-aca1-4756-84ab-46bd2286444d")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]
using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("i18n")] [assembly: AssemblyDescription("Smart internationalization for ASP.NET")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("i18n")] [assembly: AssemblyCopyright("Open Source")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] [assembly: InternalsVisibleTo("i18n.MVC3")] [assembly: InternalsVisibleTo("i18n.MVC4")] // 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("1453a162-aca1-4756-84ab-46bd2286444d")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]
mit
C#
c5840237e1d1778a02aeca1c3d7bbb4c01af733b
add SetValues to RemoteDeploymentSettingsManager
kali786516/kudu,WeAreMammoth/kudu-obsolete,EricSten-MSFT/kudu,chrisrpatterson/kudu,kenegozi/kudu,bbauya/kudu,EricSten-MSFT/kudu,kali786516/kudu,barnyp/kudu,oliver-feng/kudu,uQr/kudu,badescuga/kudu,dev-enthusiast/kudu,duncansmart/kudu,WeAreMammoth/kudu-obsolete,YOTOV-LIMITED/kudu,shanselman/kudu,juoni/kudu,barnyp/kudu,juoni/kudu,bbauya/kudu,dev-enthusiast/kudu,EricSten-MSFT/kudu,sitereactor/kudu,shrimpy/kudu,mauricionr/kudu,WeAreMammoth/kudu-obsolete,sitereactor/kudu,chrisrpatterson/kudu,shibayan/kudu,chrisrpatterson/kudu,juoni/kudu,YOTOV-LIMITED/kudu,projectkudu/kudu,juvchan/kudu,sitereactor/kudu,badescuga/kudu,puneet-gupta/kudu,kenegozi/kudu,uQr/kudu,puneet-gupta/kudu,oliver-feng/kudu,shrimpy/kudu,duncansmart/kudu,uQr/kudu,juoni/kudu,projectkudu/kudu,barnyp/kudu,shanselman/kudu,projectkudu/kudu,juvchan/kudu,badescuga/kudu,MavenRain/kudu,juvchan/kudu,oliver-feng/kudu,puneet-gupta/kudu,projectkudu/kudu,sitereactor/kudu,shibayan/kudu,dev-enthusiast/kudu,duncansmart/kudu,mauricionr/kudu,bbauya/kudu,projectkudu/kudu,MavenRain/kudu,sitereactor/kudu,shibayan/kudu,shanselman/kudu,kali786516/kudu,dev-enthusiast/kudu,EricSten-MSFT/kudu,puneet-gupta/kudu,kali786516/kudu,puneet-gupta/kudu,mauricionr/kudu,MavenRain/kudu,mauricionr/kudu,juvchan/kudu,shrimpy/kudu,oliver-feng/kudu,kenegozi/kudu,duncansmart/kudu,YOTOV-LIMITED/kudu,MavenRain/kudu,bbauya/kudu,EricSten-MSFT/kudu,shibayan/kudu,chrisrpatterson/kudu,shrimpy/kudu,badescuga/kudu,uQr/kudu,barnyp/kudu,YOTOV-LIMITED/kudu,kenegozi/kudu,juvchan/kudu,badescuga/kudu,shibayan/kudu
Kudu.Client/Settings/RemoteDeploymentSettingsManager.cs
Kudu.Client/Settings/RemoteDeploymentSettingsManager.cs
using System; using System.Collections.Generic; using System.Collections.Specialized; using System.Net.Http; using System.Threading.Tasks; using Kudu.Client.Infrastructure; using Kudu.Contracts.Infrastructure; using Newtonsoft.Json.Linq; namespace Kudu.Client.Deployment { public class RemoteDeploymentSettingsManager : KuduRemoteClientBase { public RemoteDeploymentSettingsManager(string serviceUrl) : base(serviceUrl) { } public RemoteDeploymentSettingsManager(string serviceUrl, HttpClientHandler handler) : base(serviceUrl, handler) { } public Task SetValueLegacy(string key, string value) { var values = HttpClientHelper.CreateJsonContent(new KeyValuePair<string, string>("key", key), new KeyValuePair<string, string>("value", value)); return _client.PostAsync(String.Empty, values).Then(response => response.EnsureSuccessful()); } public Task SetValue(string key, string value) { var values = HttpClientHelper.CreateJsonContent(new KeyValuePair<string, string>(key, value)); return _client.PostAsync(String.Empty, values).Then(response => response.EnsureSuccessful()); } public Task SetValues(params KeyValuePair<string, string>[] values) { var jsonvalues = HttpClientHelper.CreateJsonContent(values); return _client.PostAsync(String.Empty, jsonvalues).Then(response => response.EnsureSuccessful()); } public Task<NameValueCollection> GetValues() { return _client.GetJsonAsync<JObject>(String.Empty).Then(obj => { var nvc = new NameValueCollection(); foreach (var pair in obj) { nvc[pair.Key] = pair.Value.Value<string>(); } return nvc; }); } public Task<string> GetValue(string key) { return _client.GetJsonAsync<string>(key); } public Task Delete(string key) { return _client.DeleteSafeAsync(key); } } }
using System; using System.Collections.Generic; using System.Collections.Specialized; using System.Net.Http; using System.Threading.Tasks; using Kudu.Client.Infrastructure; using Kudu.Contracts.Infrastructure; using Newtonsoft.Json.Linq; namespace Kudu.Client.Deployment { public class RemoteDeploymentSettingsManager : KuduRemoteClientBase { public RemoteDeploymentSettingsManager(string serviceUrl) : base(serviceUrl) { } public RemoteDeploymentSettingsManager(string serviceUrl, HttpClientHandler handler) : base(serviceUrl, handler) { } public Task SetValueLegacy(string key, string value) { var values = HttpClientHelper.CreateJsonContent(new KeyValuePair<string, string>("key", key), new KeyValuePair<string, string>("value", value)); return _client.PostAsync(String.Empty, values).Then(response => response.EnsureSuccessful()); } public Task SetValue(string key, string value) { var values = HttpClientHelper.CreateJsonContent(new KeyValuePair<string, string>(key, value)); return _client.PostAsync(String.Empty, values).Then(response => response.EnsureSuccessful()); } public Task<NameValueCollection> GetValues() { return _client.GetJsonAsync<JObject>(String.Empty).Then(obj => { var nvc = new NameValueCollection(); foreach (var pair in obj) { nvc[pair.Key] = pair.Value.Value<string>(); } return nvc; }); } public Task<string> GetValue(string key) { return _client.GetJsonAsync<string>(key); } public Task Delete(string key) { return _client.DeleteSafeAsync(key); } } }
apache-2.0
C#
957c02a985a39537386778059ccb076a427692ef
Remove typo
erooijak/oogstplanner,erooijak/oogstplanner,erooijak/oogstplanner,erooijak/oogstplanner
Oogstplanner.Web/Views/Calendar/NoCropsOtherUser.cshtml
Oogstplanner.Web/Views/Calendar/NoCropsOtherUser.cshtml
@model YearCalendarViewModel @{ ViewBag.Title = "Zaaikalender"; } @Scripts.Render("~/Scripts/oogstplanner.likes") <div id="top"></div> <div id="yearCalendar"> <h1>Zaaikalender</h1> <div class="row"> <div class="col-lg-4 col-md-3 col-sm-2 col-xs-2"></div> <div class="col-lg-4 col-md-6 col-sm-8 col-xs-8"> <div class="panel panel-default dark"> <p> <span class="glyphicon glyphicon-heart-empty"></span>&nbsp; @Model.UserName heeft geen gewassen in zijn of haar zaaikalender.<br/><br/> <!--@Html.ActionLink("Doe inspiratie op bij een andere gebruiker", "TODO", "TODO", null, null)<br/> @Html.ActionLink("Zie de veelgestelde vragen lijst (FAQ)", "TODO", "TODO", null, null)<br/>--> @Html.ActionLink("Terug naar profiel van " + Model.UserName, "UserInfo", "Account", new { userName = Model.UserName }, null)<br/> ...of ga terug naar de <strong>@Html.ActionLink("OogstPlanner.nl Welkomstpagina", "Index", "Home", null, null)</strong> </p> </div> </div> </div> </div> @* End yearcalendar *@
@model YearCalendarViewModel @{ ViewBag.Title = "Zaaikalender"; } @Scripts.Render("~/Scripts/oogstplanner.likes") <div id="top"></div> <div id="yearCalendar"> <h1>Zaaikalender</h1> <div class="row"> <div class="col-lg-4 col-md-3 col-sm-2 col-xs-2"></div> <div class="col-lg-4 col-md-6 col-sm-8 col-xs-8"> <div class="panel panel-default dark"> <p> <span class="glyphicon glyphicon-heart-empty"></span>&nbsp;@Model.UserName heeft geen gewassen in zijn of haar zaaikalender.<br/><br/> <!--@Html.ActionLink("Doe inspiratie op bij een andere gebruiker", "TODO", "TODO", null, null)<br/> @Html.ActionLink("Zie de veelgestelde vragen lijst (FAQ)", "TODO", "TODO", null, null)<br/>--> @Html.ActionLink("Terug naar profiel van " + Model.UserName, "UserInfo", "Account", new { userName = Model.UserName }, null)<br/> ...of ga terug naar de <strong>@Html.ActionLink("OogstPlanner.nl Welkomstpagina", "Index", "Home", null, null)</strong> </p> </div> </div> </div> </div> @* End yearcalendar *@
mit
C#
0bc6f4f86d80664c86c856ac13441491cef37bd7
Update HandleControl Designer properties
HavenDV/ImprovedControls,HavenDV/ImprovedControls,HavenDV/ImprovedControls,HavenDV/ImprovedControls
SliderControlLibrary/Controls/HandleControl.Designer.cs
SliderControlLibrary/Controls/HandleControl.Designer.cs
using System.Windows.Forms; namespace T3000Controls { partial class HandleControl { /// <summary> /// Required designer variable. /// </summary> private System.ComponentModel.IContainer components = null; /// <summary> /// Clean up any resources being used. /// </summary> /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> protected override void Dispose(bool disposing) { if (disposing && (components != null)) { components.Dispose(); } base.Dispose(disposing); } #region Component Designer generated code /// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { this.valueLabel = new T3000Controls.TransparentLabel(); this.SuspendLayout(); // // valueLabel // this.valueLabel.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.valueLabel.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.valueLabel.Location = new System.Drawing.Point(54, 0); this.valueLabel.Name = "valueLabel"; this.valueLabel.Size = new System.Drawing.Size(39, 16); this.valueLabel.TabIndex = 1; this.valueLabel.Text = "Text"; this.valueLabel.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; // // HandleControl // this.BackColor = System.Drawing.Color.Transparent; this.Controls.Add(this.valueLabel); this.DoubleBuffered = true; this.Name = "HandleControl"; this.Size = new System.Drawing.Size(94, 16); this.ResumeLayout(false); } #endregion private TransparentLabel valueLabel; } }
using System.Windows.Forms; namespace T3000Controls { partial class HandleControl { /// <summary> /// Required designer variable. /// </summary> private System.ComponentModel.IContainer components = null; /// <summary> /// Clean up any resources being used. /// </summary> /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> protected override void Dispose(bool disposing) { if (disposing && (components != null)) { components.Dispose(); } base.Dispose(disposing); } #region Component Designer generated code /// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { this.valueLabel = new T3000Controls.TransparentLabel(); this.SuspendLayout(); // // valueLabel // this.valueLabel.AutoSize = true; this.valueLabel.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.valueLabel.Location = new System.Drawing.Point(54, 0); this.valueLabel.Name = "valueLabel"; this.valueLabel.Size = new System.Drawing.Size(39, 13); this.valueLabel.TabIndex = 1; this.valueLabel.Text = "Value"; // // HandleControl // this.BackColor = System.Drawing.Color.Transparent; this.Controls.Add(this.valueLabel); this.DoubleBuffered = true; this.Name = "HandleControl"; this.Size = new System.Drawing.Size(94, 16); this.ResumeLayout(false); this.PerformLayout(); } #endregion private System.Windows.Forms.Label valueLabel; } }
lgpl-2.1
C#
4894d068148b2b65dd32efcf3caf0af0a797198c
Edit it
2Toad/websocket-sharp,sta/websocket-sharp,sta/websocket-sharp,2Toad/websocket-sharp,jogibear9988/websocket-sharp,2Toad/websocket-sharp,jogibear9988/websocket-sharp,jogibear9988/websocket-sharp,sta/websocket-sharp,2Toad/websocket-sharp,jogibear9988/websocket-sharp,sta/websocket-sharp
websocket-sharp/WebSocketException.cs
websocket-sharp/WebSocketException.cs
#region License /* * WebSocketException.cs * * The MIT License * * Copyright (c) 2012-2014 sta.blockhead * * 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 WebSocketSharp { /// <summary> /// The exception that is thrown when a fatal error occurs in /// the WebSocket communication. /// </summary> public class WebSocketException : Exception { #region Private Fields private CloseStatusCode _code; #endregion #region Internal Constructors internal WebSocketException () : this (CloseStatusCode.Abnormal, null, null) { } internal WebSocketException (Exception innerException) : this (CloseStatusCode.Abnormal, null, innerException) { } internal WebSocketException (string message) : this (CloseStatusCode.Abnormal, message, null) { } internal WebSocketException (CloseStatusCode code) : this (code, null, null) { } internal WebSocketException (string message, Exception innerException) : this (CloseStatusCode.Abnormal, message, innerException) { } internal WebSocketException (CloseStatusCode code, Exception innerException) : this (code, null, innerException) { } internal WebSocketException (CloseStatusCode code, string message) : this (code, message, null) { } internal WebSocketException ( CloseStatusCode code, string message, Exception innerException ) : base (message ?? code.GetMessage (), innerException) { _code = code; } #endregion #region Public Properties /// <summary> /// Gets the status code indicating the cause of the exception. /// </summary> /// <value> /// One of the <see cref="CloseStatusCode"/> enum values that represents /// the status code indicating the cause of the exception. /// </value> public CloseStatusCode Code { get { return _code; } } #endregion } }
#region License /* * WebSocketException.cs * * The MIT License * * Copyright (c) 2012-2014 sta.blockhead * * 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 WebSocketSharp { /// <summary> /// The exception that is thrown when a <see cref="WebSocket"/> gets a fatal error. /// </summary> public class WebSocketException : Exception { #region Private Fields private CloseStatusCode _code; #endregion #region Internal Constructors internal WebSocketException () : this (CloseStatusCode.Abnormal, null, null) { } internal WebSocketException (Exception innerException) : this (CloseStatusCode.Abnormal, null, innerException) { } internal WebSocketException (string message) : this (CloseStatusCode.Abnormal, message, null) { } internal WebSocketException (CloseStatusCode code) : this (code, null, null) { } internal WebSocketException (string message, Exception innerException) : this (CloseStatusCode.Abnormal, message, innerException) { } internal WebSocketException (CloseStatusCode code, Exception innerException) : this (code, null, innerException) { } internal WebSocketException (CloseStatusCode code, string message) : this (code, message, null) { } internal WebSocketException ( CloseStatusCode code, string message, Exception innerException ) : base (message ?? code.GetMessage (), innerException) { _code = code; } #endregion #region Public Properties /// <summary> /// Gets the status code indicating the cause of the exception. /// </summary> /// <value> /// One of the <see cref="CloseStatusCode"/> enum values that represents /// the status code indicating the cause of the exception. /// </value> public CloseStatusCode Code { get { return _code; } } #endregion } }
mit
C#
ab338f05443060207779c756ae9f92123dfe4870
Add missing MessagesBatchSize parameter in AppSettingsBusConfiguration
Abc-Arbitrage/Zebus.Directory,Abc-Arbitrage/Zebus
src/Abc.Zebus.Directory/Configuration/AppSettingsBusConfiguration.cs
src/Abc.Zebus.Directory/Configuration/AppSettingsBusConfiguration.cs
using System; using Abc.Zebus.Util; namespace Abc.Zebus.Directory.Configuration { public class AppSettingsBusConfiguration : IBusConfiguration { public AppSettingsBusConfiguration() { RegistrationTimeout = AppSettings.Get("Bus.Directory.RegistrationTimeout", 30.Seconds()); StartReplayTimeout = AppSettings.Get("Bus.Persistence.StartReplayTimeout", 30.Seconds()); IsDirectoryPickedRandomly = AppSettings.Get("Bus.Directory.PickRandom", true); IsErrorPublicationEnabled = AppSettings.Get("Bus.IsErrorPublicationEnabled", true); MessagesBatchSize = AppSettings.Get("Bus.MessagesBatchSize", 100); } public string[] DirectoryServiceEndPoints { get { return new string[0]; } } public bool IsPersistent { get { return false; } } public TimeSpan RegistrationTimeout { get; private set; } public TimeSpan StartReplayTimeout { get; private set; } public bool IsDirectoryPickedRandomly { get; private set; } public bool IsErrorPublicationEnabled { get; private set; } public int MessagesBatchSize { get; private set; } } }
using System; using Abc.Zebus.Util; namespace Abc.Zebus.Directory.Configuration { public class AppSettingsBusConfiguration : IBusConfiguration { public AppSettingsBusConfiguration() { RegistrationTimeout = AppSettings.Get("Bus.Directory.RegistrationTimeout", 30.Seconds()); StartReplayTimeout = AppSettings.Get("Bus.Persistence.StartReplayTimeout", 30.Seconds()); IsDirectoryPickedRandomly = AppSettings.Get("Bus.Directory.PickRandom", true); IsErrorPublicationEnabled = AppSettings.Get("Bus.IsErrorPublicationEnabled", true); } public string[] DirectoryServiceEndPoints { get { return new string[0]; } } public bool IsPersistent { get { return false; } } public TimeSpan RegistrationTimeout { get; private set; } public TimeSpan StartReplayTimeout { get; private set; } public bool IsDirectoryPickedRandomly { get; private set; } public bool IsErrorPublicationEnabled { get; private set; } } }
mit
C#
cfc31fdcec61207af14c3b46130dcf6a7dfc22d0
Drop "-message" from all message names
mike-kaufman/Glimpse.Prototype,mike-kaufman/Glimpse.Prototype,zanetdev/Glimpse.Prototype,mike-kaufman/Glimpse.Prototype,peterblazejewicz/Glimpse.Prototype,mike-kaufman/Glimpse.Prototype,peterblazejewicz/Glimpse.Prototype,mike-kaufman/Glimpse.Prototype,zanetdev/Glimpse.Prototype,peterblazejewicz/Glimpse.Prototype,zanetdev/Glimpse.Prototype,zanetdev/Glimpse.Prototype,peterblazejewicz/Glimpse.Prototype,Glimpse/Glimpse.Prototype,Glimpse/Glimpse.Prototype,peterblazejewicz/Glimpse.Prototype,Glimpse/Glimpse.Prototype,Glimpse/Glimpse.Prototype
src/Glimpse.Common/Internal/Messaging/DefaultMessageTypeProcessor.cs
src/Glimpse.Common/Internal/Messaging/DefaultMessageTypeProcessor.cs
using System; using System.Collections.Generic; using System.Linq; using System.Reflection; using Glimpse.Extensions; namespace Glimpse.Internal { public class DefaultMessageTypeProcessor : IMessageTypeProcessor { private readonly static Type[] _exclusions = { typeof(object) }; public virtual IEnumerable<string> Derive(object payload) { var typeInfo = payload.GetType().GetTypeInfo(); return typeInfo.BaseTypes(true) .Concat(typeInfo.ImplementedInterfaces) .Except(_exclusions) .Select(t => { var result = t.KebabCase(); if (result.EndsWith("-message")) return result.Substring(0, result.Length - 8); return result; }); } } }
using System; using System.Collections.Generic; using System.Linq; using System.Reflection; using Glimpse.Extensions; namespace Glimpse.Internal { public class DefaultMessageTypeProcessor : IMessageTypeProcessor { private readonly static Type[] _exclusions = { typeof(object) }; public virtual IEnumerable<string> Derive(object payload) { var typeInfo = payload.GetType().GetTypeInfo(); return typeInfo.BaseTypes(true) .Concat(typeInfo.ImplementedInterfaces) .Except(_exclusions) .Select(t => t.KebabCase()); } } }
mit
C#
3ce2baaddc645b39ced243c257658dfb64c02961
add missing $
SkillsFundingAgency/das-commitments,SkillsFundingAgency/das-commitments,SkillsFundingAgency/das-commitments
src/SFA.DAS.Commitments.Infrastructure/Data/JobProgressRepository.cs
src/SFA.DAS.Commitments.Infrastructure/Data/JobProgressRepository.cs
using System; using System.Collections.Generic; using System.Data; using System.Linq; using System.Text; using System.Threading.Tasks; using Dapper; using SFA.DAS.Commitments.Domain.Data; using SFA.DAS.Commitments.Domain.Interfaces; using SFA.DAS.Sql.Client; namespace SFA.DAS.Commitments.Infrastructure.Data { public class JobProgressRepository : BaseRepository, IJobProgressRepository { private readonly ICommitmentsLogger _logger; public JobProgressRepository(string connectionString, ICommitmentsLogger logger) : base(connectionString, logger.BaseLogger) { _logger = logger; } // column per progress tag, or row per tag? // column +ve : tags can be different data type // row +ve : unlimited tags, no schema change for extra tags unless require different data type // -ve : tags all same data type, or muliple columns // https://stackoverflow.com/questions/3967372/sql-server-how-to-constrain-a-table-to-contain-a-single-row public async Task<long?> Get_AddEpaToApprenticeships_LastSubmissionEventId() { _logger.Debug("Getting last (processed by AddEpaToApprenticeships) SubmissionEvents Id"); return await WithConnection(async connection => await connection.ExecuteScalarAsync<long?>( "SELECT [AddEpa_LastSubmissionEventId] FROM [dbo].[JobProgress]", commandType: CommandType.Text)); } public async Task Set_AddEpaToApprenticeships_LastSubmissionEventId(long lastSubmissionEventId) { _logger.Debug($"Setting last (processed by AddEpaToApprenticeships) SubmissionEvent Id to {lastSubmissionEventId}"); await WithConnection(async connection => { var parameters = new DynamicParameters(); parameters.Add("@lastSubmissionEventId", lastSubmissionEventId, DbType.Int64); return await connection.ExecuteAsync( @"MERGE [dbo].[JobProgress] WITH(HOLDLOCK) as target using (values(@lastSubmissionEventId)) as source (AddEpa_LastSubmissionEventId) on target.Lock = 'X' when matched then update set AddEpa_LastSubmissionEventId = source.AddEpa_LastSubmissionEventId when not matched then insert (AddEpa_LastSubmissionEventId) values (source.AddEpa_LastSubmissionEventId);", param: parameters, commandType: CommandType.Text); }); } } }
using System; using System.Collections.Generic; using System.Data; using System.Linq; using System.Text; using System.Threading.Tasks; using Dapper; using SFA.DAS.Commitments.Domain.Data; using SFA.DAS.Commitments.Domain.Interfaces; using SFA.DAS.Sql.Client; namespace SFA.DAS.Commitments.Infrastructure.Data { public class JobProgressRepository : BaseRepository, IJobProgressRepository { private readonly ICommitmentsLogger _logger; public JobProgressRepository(string connectionString, ICommitmentsLogger logger) : base(connectionString, logger.BaseLogger) { _logger = logger; } // column per progress tag, or row per tag? // column +ve : tags can be different data type // row +ve : unlimited tags, no schema change for extra tags unless require different data type // -ve : tags all same data type, or muliple columns // https://stackoverflow.com/questions/3967372/sql-server-how-to-constrain-a-table-to-contain-a-single-row public async Task<long?> Get_AddEpaToApprenticeships_LastSubmissionEventId() { _logger.Debug("Getting last (processed by AddEpaToApprenticeships) SubmissionEvents Id"); return await WithConnection(async connection => await connection.ExecuteScalarAsync<long?>( "SELECT [AddEpa_LastSubmissionEventId] FROM [dbo].[JobProgress]", commandType: CommandType.Text)); } public async Task Set_AddEpaToApprenticeships_LastSubmissionEventId(long lastSubmissionEventId) { _logger.Debug("Setting last (processed by AddEpaToApprenticeships) SubmissionEvent Id to {lastSubmissionEventId}"); await WithConnection(async connection => { var parameters = new DynamicParameters(); parameters.Add("@lastSubmissionEventId", lastSubmissionEventId, DbType.Int64); return await connection.ExecuteAsync( @"MERGE [dbo].[JobProgress] WITH(HOLDLOCK) as target using (values(@lastSubmissionEventId)) as source (AddEpa_LastSubmissionEventId) on target.Lock = 'X' when matched then update set AddEpa_LastSubmissionEventId = source.AddEpa_LastSubmissionEventId when not matched then insert (AddEpa_LastSubmissionEventId) values (source.AddEpa_LastSubmissionEventId);", param: parameters, commandType: CommandType.Text); }); } } }
mit
C#
05c12c1846b86aaf2409f84b80208d74fe27bd23
remove active issue so test is run
linq2db/linq2db,LinqToDB4iSeries/linq2db,MaceWindu/linq2db,MaceWindu/linq2db,LinqToDB4iSeries/linq2db,ronnyek/linq2db,linq2db/linq2db
Tests/Linq/UserTests/Issue1057Tests.cs
Tests/Linq/UserTests/Issue1057Tests.cs
using System; using System.Linq; using System.Linq.Expressions; using NUnit.Framework; namespace Tests.UserTests { using LinqToDB; using LinqToDB.Mapping; public class Issue1057Tests : TestBase { [Table, InheritanceMapping(Code = "bda.Requests", Type = typeof(BdaTask))] class Task { [Column(IsPrimaryKey = true)] public int Id { get; set; } [Column(IsDiscriminator = true)] public string TargetName { get; set; } [Association(ExpressionPredicate =nameof(ActualStageExp))] public TaskStage ActualStage { get; set; } private static Expression<Func<Task, TaskStage, bool>> ActualStageExp() => (t, ts) => t.Id == ts.TaskId && ts.Actual == true; } class BdaTask : Task { public const string Code = "bda.Requests"; } [Table] class TaskStage { [Column(IsPrimaryKey = true)] public int Id { get; set; } [Column] public int TaskId { get; set; } [Column] public bool Actual { get; set; } } [Test, DataContextSource] public void Test(string configuration) { using (var db = GetDataContext(configuration)) { try { db.CreateTable<Task>(); db.CreateTable<TaskStage>(); } catch { db.DropTable<Task>(throwExceptionIfNotExists: false); db.DropTable<TaskStage>(throwExceptionIfNotExists: false); db.CreateTable<Task>(); db.CreateTable<TaskStage>(); } try { db.Insert(new Task { Id = 1, TargetName = "bda.Requests" }); db.Insert(new TaskStage { Id = 1, TaskId = 1, Actual = true}); var query = db.GetTable<Task>() .OfType<BdaTask>() .Select(p => new { Instance = p, ActualStageId = p.ActualStage.Id }); var res = query.ToArray(); } finally { db.DropTable<Task>(); db.DropTable<TaskStage>(); } } } } }
using System; using System.Linq; using System.Linq.Expressions; using NUnit.Framework; namespace Tests.UserTests { using LinqToDB; using LinqToDB.Mapping; [ActiveIssue(1057)] public class Issue1057Tests : TestBase { [Table, InheritanceMapping(Code = "bda.Requests", Type = typeof(BdaTask))] class Task { [Column(IsPrimaryKey = true)] public int Id { get; set; } [Column(IsDiscriminator = true)] public string TargetName { get; set; } [Association(ExpressionPredicate =nameof(ActualStageExp))] public TaskStage ActualStage { get; set; } private static Expression<Func<Task, TaskStage, bool>> ActualStageExp() => (t, ts) => t.Id == ts.TaskId && ts.Actual == true; } class BdaTask : Task { public const string Code = "bda.Requests"; } [Table] class TaskStage { [Column(IsPrimaryKey = true)] public int Id { get; set; } [Column] public int TaskId { get; set; } [Column] public bool Actual { get; set; } } [Test, DataContextSource] public void Test(string configuration) { using (var db = GetDataContext(configuration)) { try { db.CreateTable<Task>(); db.CreateTable<TaskStage>(); } catch { db.DropTable<Task>(throwExceptionIfNotExists: false); db.DropTable<TaskStage>(throwExceptionIfNotExists: false); db.CreateTable<Task>(); db.CreateTable<TaskStage>(); } try { db.Insert(new Task { Id = 1, TargetName = "bda.Requests" }); db.Insert(new TaskStage { Id = 1, TaskId = 1, Actual = true}); var query = db.GetTable<Task>() .OfType<BdaTask>() .Select(p => new { Instance = p, ActualStageId = p.ActualStage.Id }); var res = query.ToArray(); } finally { db.DropTable<Task>(); db.DropTable<TaskStage>(); } } } } }
mit
C#
dc4e73b92a0fc916a7a92f8e3e7a0b1e356385cf
bump version to 1.1 for pushing new nuget package
jamesmanning/EntityFramework.LazyLoadLoggingInterceptor
EntityFramework.LazyLoadLoggingInterceptor/Properties/AssemblyInfo.cs
EntityFramework.LazyLoadLoggingInterceptor/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("EntityFramework.LazyLoadLoggingInterceptor")] [assembly: AssemblyDescription("see https://github.com/jamesmanning/EntityFramework.LazyLoadLoggingInterceptor")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("James Manning")] [assembly: AssemblyProduct("EntityFramework.LazyLoadLoggingInterceptor")] [assembly: AssemblyCopyright("Copyright © 2017")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("39a9b613-9ffb-46d6-8e70-148e1e266b2b")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.1.0.0")] [assembly: AssemblyFileVersion("1.1.0.0")]
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("EntityFramework.LazyLoadLoggingInterceptor")] [assembly: AssemblyDescription("see https://github.com/jamesmanning/EntityFramework.LazyLoadLoggingInterceptor")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("James Manning")] [assembly: AssemblyProduct("EntityFramework.LazyLoadLoggingInterceptor")] [assembly: AssemblyCopyright("Copyright © 2017")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("39a9b613-9ffb-46d6-8e70-148e1e266b2b")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]
mit
C#
8f7d161461c8072fd5a2e0ce9b1a48f1eb15bccd
add signup query - check user
ravjotsingh9/DBLike
DBLike/Server/DatabaseAccess/Query.SignUp.cs
DBLike/Server/DatabaseAccess/Query.SignUp.cs
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Data.SqlClient; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; namespace Server.DatabaseAccess { public partial class Query { // return true if user exists public bool checkIfUserExists(string userName, SqlConnection sqlConnection) { try { SqlDataReader myReader = null; SqlCommand myCommand = new SqlCommand("select * from dbo.Users where UserName = @UserName", sqlConnection); myCommand.Parameters.AddWithValue("@UserName", userName); myReader = myCommand.ExecuteReader(); // if user exists if (myReader.Read()) { return true; } return false; } catch (Exception e) { Console.WriteLine(e.ToString()); return true; } finally { sqlConnection.Close(); } } } }
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Data.SqlClient; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; namespace Server.DatabaseAccess { public partial class Query { public bool checkIfUserExists(string userName, SqlConnection sqlConnection) { try { SqlDataReader myReader = null; SqlCommand myCommand = new SqlCommand("select * from dbo.Users where UserName = @UserName", sqlConnection); myCommand.Parameters.AddWithValue("@UserName", userName); myReader = myCommand.ExecuteReader(); // if user exists if (myReader.Read()) { return true; } return false; } catch (Exception e) { Console.WriteLine(e.ToString()); return true; } finally { sqlConnection.Close(); } } } }
apache-2.0
C#
e2f1de00b1796c0d7dd145203d5c338f96862781
Remove maintenance burden
nopara73/HiddenWallet,nopara73/HiddenWallet,nopara73/HiddenWallet,nopara73/HiddenWallet
WalletWasabi.Tests/UnitTests/BitcoinCore/BitcoindBinaryHashesTests.cs
WalletWasabi.Tests/UnitTests/BitcoinCore/BitcoindBinaryHashesTests.cs
using System; using System.Collections.Generic; using System.IO; using System.Runtime.InteropServices; using System.Security.Cryptography; using System.Threading; using WalletWasabi.Microservices; using Xunit; namespace WalletWasabi.Tests.UnitTests.BitcoinCore { public class BitcoindBinaryHashesTests { /// <summary> /// Bitcoin Knots distributes only SHA256 checksums for installers and for zip archives and not their content, so the validity of the hashes below depends on peer review consensus. /// </summary> /// <remarks>To verify a file hash, you can use, for example, <c>certUtil -hashfile bitcoind.exe SHA256</c> command.</remarks> [Fact] public void VerifyBitcoindBinaryChecksumHashes() { using var cts = new CancellationTokenSource(5_000); Dictionary<OSPlatform, string> expectedHashes = new() { { OSPlatform.Windows, "2406e8d63e8ee5dc71089049a52f5b3f3f7a39a9b054a323d7e3e0c8cbadec1b" }, { OSPlatform.Linux, "09aff9831d5ea24e69bbc27d16cf57c3763ba42dacd69f425710828e7f9101c8" }, { OSPlatform.OSX, "2353e36d938eb314ade94df2d18b85e23fd7232ac096feaed46f0306c6b55b59" }, }; foreach (var item in expectedHashes) { string binaryFolder = MicroserviceHelpers.GetBinaryFolder(item.Key); string filePath = Path.Combine(binaryFolder, item.Key == OSPlatform.Windows ? "bitcoind.exe" : "bitcoind"); using SHA256 sha256 = SHA256.Create(); using FileStream fileStream = File.OpenRead(filePath); Assert.Equal(item.Value, ByteHelpers.ToHex(sha256.ComputeHash(fileStream)).ToLowerInvariant()); } } } }
using System; using System.Collections.Generic; using System.IO; using System.Runtime.InteropServices; using System.Security.Cryptography; using System.Threading; using WalletWasabi.Microservices; using Xunit; namespace WalletWasabi.Tests.UnitTests.BitcoinCore { public class BitcoindBinaryHashesTests { /// <summary> /// Bitcoin Knots distributes only SHA256 checksums for installers and for zip archives and not their content, so the validity of the hashes below depends on peer review consensus. /// </summary> /// <remarks>To verify a file hash, you can use, for example, <c>certUtil -hashfile bitcoind.exe SHA256</c> command.</remarks> /// <seealso href="https://bitcoinknots.org/files/0.20.x/0.20.1.knots20200815/SHA256SUMS.asc">Our current Bitcoin Knots version is 0.20.1.</seealso> [Fact] public void VerifyBitcoindBinaryChecksumHashes() { using var cts = new CancellationTokenSource(5_000); Dictionary<OSPlatform, string> expectedHashes = new() { { OSPlatform.Windows, "2406e8d63e8ee5dc71089049a52f5b3f3f7a39a9b054a323d7e3e0c8cbadec1b" }, { OSPlatform.Linux, "09aff9831d5ea24e69bbc27d16cf57c3763ba42dacd69f425710828e7f9101c8" }, { OSPlatform.OSX, "2353e36d938eb314ade94df2d18b85e23fd7232ac096feaed46f0306c6b55b59" }, }; foreach (var item in expectedHashes) { string binaryFolder = MicroserviceHelpers.GetBinaryFolder(item.Key); string filePath = Path.Combine(binaryFolder, item.Key == OSPlatform.Windows ? "bitcoind.exe" : "bitcoind"); using SHA256 sha256 = SHA256.Create(); using FileStream fileStream = File.OpenRead(filePath); Assert.Equal(item.Value, ByteHelpers.ToHex(sha256.ComputeHash(fileStream)).ToLowerInvariant()); } } } }
mit
C#
4a0af86524086afc5b1ed2765bb4ef8bcf9613a7
Make line endings consistant
It423/enigma-simulator,wrightg42/enigma-simulator
Enigma/EnigmaUtilities/Data/ComponentData.cs
Enigma/EnigmaUtilities/Data/ComponentData.cs
// ComponentData.cs // <copyright file="ComponentData.cs"> This code is protected under the MIT License. </copyright> namespace EnigmaUtilities.Data { /// <summary> /// A class that holds data about components to be used. /// </summary> public abstract class ComponentData { /// <summary> /// Gets or sets the name of the component. /// </summary> public string Name { get; set; } /// <summary> /// Gets or sets the wiring to be used for this component. /// </summary> public string Wiring { get; set; } } }
// ComponentData.cs // <copyright file="ComponentData.cs"> This code is protected under the MIT License. </copyright> namespace EnigmaUtilities.Data { /// <summary> /// A class that holds data about components to be used. /// </summary> public abstract class ComponentData { /// <summary> /// Gets or sets the name of the component. /// </summary> public string Name { get; set; } /// <summary> /// Gets or sets the wiring to be used for this component. /// </summary> public string Wiring { get; set; } } }
mit
C#
cd532ff4f674bb992145dcd861da6ddc52ed4fed
Handle 0^0.
Peter-Juhasz/Science.Mathematics.Algebra
Science.Mathematics.Algebra/Simplification/ExponentiationWithExponentZeroSimplifier.cs
Science.Mathematics.Algebra/Simplification/ExponentiationWithExponentZeroSimplifier.cs
using System.Threading; namespace Science.Mathematics.Algebra.Simplification { /// <summary> /// Simplifies expressions like x ^ 0 to x. /// </summary> public sealed class ExponentiationWithExponentZeroSimplifier : ISimplifier<PowerExpression> { public AlgebraExpression Simplify(PowerExpression expression, CancellationToken cancellationToken) { if (expression.Exponent.GetConstantValue() == 0) { if (expression.Base.GetConstantValue() == 0) return ConstantExpression.One; return ConstantExpression.Zero; } return expression; } } }
using System.Threading; namespace Science.Mathematics.Algebra.Simplification { /// <summary> /// Simplifies expressions like x ^ 0 to x. /// </summary> public sealed class ExponentiationWithExponentZeroSimplifier : ISimplifier<PowerExpression> { public AlgebraExpression Simplify(PowerExpression expression, CancellationToken cancellationToken) { if (expression.Exponent.GetConstantValue() == 0) return ConstantExpression.One; return expression; } } }
mit
C#
876c9cedb3f17f6818090f34e13176b4cc8d9cc9
Add comments to IResultSetTracker
mavasani/roslyn,CyrusNajmabadi/roslyn,shyamnamboodiripad/roslyn,CyrusNajmabadi/roslyn,mavasani/roslyn,dotnet/roslyn,shyamnamboodiripad/roslyn,shyamnamboodiripad/roslyn,CyrusNajmabadi/roslyn,mavasani/roslyn,dotnet/roslyn,dotnet/roslyn
src/Features/Lsif/Generator/ResultSetTracking/IResultSetTracker.cs
src/Features/Lsif/Generator/ResultSetTracking/IResultSetTracker.cs
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. using System; using Microsoft.CodeAnalysis.LanguageServerIndexFormat.Generator.Graph; namespace Microsoft.CodeAnalysis.LanguageServerIndexFormat.Generator.ResultSetTracking { /// <summary> /// An object that tracks a mapping from symbols to the result sets that have information about those symbols. /// </summary> internal interface IResultSetTracker { /// <summary> /// Returns the ID of the <see cref="ResultSet"/> that represents a symbol. /// </summary> Id<ResultSet> GetResultSetIdForSymbol(ISymbol symbol); /// <summary> /// Returns an ID of a vertex that is linked from a result set. For example, a <see cref="ResultSet"/> has an edge that points to a <see cref="ReferenceResult"/>, and /// item edges from that <see cref="ReferenceResult"/> are the references for the range. This gives you the ID of the <see cref="ReferenceResult"/> in this case. /// </summary> Id<T> GetResultIdForSymbol<T>(ISymbol symbol, string edgeKind, Func<T> vertexCreator) where T : Vertex; /// <summary> /// Similar to <see cref="GetResultIdForSymbol{T}(ISymbol, string, Func{T})"/>, but instead of creating the vertex (if needed) and adding an edge, this /// simply tracks that this method has been called, and it's up to the caller that got a true return value to create and add the vertex themselves. This is handy /// when the actual identity of the node isn't needed by any other consumers, or the vertex creation is expensive and we don't want it running under the lock that /// <see cref="GetResultIdForSymbol{T}(ISymbol, string, Func{T})"/> would have to take. /// </summary> bool ResultSetNeedsInformationalEdgeAdded(ISymbol symbol, string edgeKind); } }
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. using System; using Microsoft.CodeAnalysis.LanguageServerIndexFormat.Generator.Graph; namespace Microsoft.CodeAnalysis.LanguageServerIndexFormat.Generator.ResultSetTracking { /// <summary> /// An object that tracks a mapping from symbols to the result sets that have information about those symbols. /// </summary> internal interface IResultSetTracker { Id<ResultSet> GetResultSetIdForSymbol(ISymbol symbol); Id<T> GetResultIdForSymbol<T>(ISymbol symbol, string edgeKind, Func<T> vertexCreator) where T : Vertex; bool ResultSetNeedsInformationalEdgeAdded(ISymbol symbol, string edgeKind); } }
mit
C#
aff981020ece51a678a8589891cfa2916543d538
Use the viewBag Title rather than the hard coded one.
SkillsFundingAgency/das-employerusers,SkillsFundingAgency/das-employerusers,SkillsFundingAgency/das-employerusers
src/SFA.DAS.EmployerUsers.Web/Views/Login/AuthorizeResponse.cshtml
src/SFA.DAS.EmployerUsers.Web/Views/Login/AuthorizeResponse.cshtml
@model IdentityServer3.Core.ViewModels.AuthorizeResponseViewModel @{ ViewBag.PageID = "authorize-response"; ViewBag.Title = "Please wait"; ViewBag.HideSigninLink = "true"; Layout = "~/Views/Shared/_Layout-NoBanner.cshtml"; } <h1 class="heading-xlarge">@ViewBag.Title</h1> <form id="mainForm" method="post" action="@Model.ResponseFormUri"> <div id="autoRedirect" style="display: none;">Please wait...</div> @Html.Raw(Model.ResponseFormFields) <div id="manualLoginContainer"> <button type="submit" class="button" autofocus="autofocus">Continue</button> </div> </form> @section scripts { <script src="@Url.Content("~/Scripts/AuthorizeResponse.js")"></script> }
@model IdentityServer3.Core.ViewModels.AuthorizeResponseViewModel @{ ViewBag.PageID = "authorize-response"; ViewBag.Title = "Please wait"; ViewBag.HideSigninLink = "true"; Layout = "~/Views/Shared/_Layout-NoBanner.cshtml"; } <h1 class="heading-xlarge">You've logged in</h1> <form id="mainForm" method="post" action="@Model.ResponseFormUri"> <div id="autoRedirect" style="display: none;">Please wait...</div> @Html.Raw(Model.ResponseFormFields) <div id="manualLoginContainer"> <button type="submit" class="button" autofocus="autofocus">Continue</button> </div> </form> @section scripts { <script src="@Url.Content("~/Scripts/AuthorizeResponse.js")"></script> }
mit
C#
3835633fd00da75fc8434a23ab4b7c8cf9662705
fix unity plugin compilation
JetBrains/resharper-unity,JetBrains/resharper-unity,JetBrains/resharper-unity
debugger/debugger-worker/src/UnityDebuggerWorkerHost.cs
debugger/debugger-worker/src/UnityDebuggerWorkerHost.cs
using Autofac; using JetBrains.Debugger.Model.Plugins.Unity; using Mono.Debugging.Autofac; namespace JetBrains.Debugger.Worker.Plugins.Unity { [DebuggerGlobalComponent] public class UnityDebuggerWorkerHost : IStartable { public UnityDebuggerWorkerHost(RiderDebuggerWorker debuggerWorker) { // Get/create the model. This registers serialisers for all types in the model, including the start info // derived types used in the root protocol, not in our extension Model = debuggerWorker.FrontendModel.GetUnityDebuggerWorkerModel(); } public UnityDebuggerWorkerModel Model { get; } void IStartable.Start() { // Do nothing. IStartable means Autofac will eagerly create the component but we do all our work in the ctor } } }
using Autofac; using JetBrains.Debugger.Model.Plugins.Unity; using Mono.Debugging.Autofac; namespace JetBrains.Debugger.Worker.Plugins.Unity { [DebuggerGlobalComponent] public class UnityDebuggerWorkerHost : IStartable { public UnityDebuggerWorkerHost(DebuggerWorker debuggerWorker) { // Get/create the model. This registers serialisers for all types in the model, including the start info // derived types used in the root protocol, not in our extension Model = debuggerWorker.FrontendModel.GetUnityDebuggerWorkerModel(); } public UnityDebuggerWorkerModel Model { get; } void IStartable.Start() { // Do nothing. IStartable means Autofac will eagerly create the component but we do all our work in the ctor } } }
apache-2.0
C#
a2f325c4e60212afb4714c6eed45257b59a8f08a
Fix build
Elders/Cronus,Elders/Cronus
src/Elders.Cronus/Projections/Rebuilding/RebuildProjection_JobData.cs
src/Elders.Cronus/Projections/Rebuilding/RebuildProjection_JobData.cs
using System; using System.Collections.Generic; using System.Linq; using Elders.Cronus.EventStore.Index; namespace Elders.Cronus.Projections.Rebuilding { public class RebuildProjection_JobData : IJobData { public RebuildProjection_JobData() { IsCompleted = false; EventTypePaging = new List<EventPaging>(); Timestamp = DateTimeOffset.UtcNow; DueDate = DateTimeOffset.MaxValue; } public bool IsCompleted { get; set; } public List<EventPaging> EventTypePaging { get; set; } public ProjectionVersion Version { get; set; } public DateTimeOffset Timestamp { get; set; } public DateTimeOffset DueDate { get; set; } public void MarkEventTypeProgress(EventPaging progress) { EventPaging existing = EventTypePaging.Where(et => et.Type.Equals(progress.Type, StringComparison.OrdinalIgnoreCase)).FirstOrDefault(); if (existing is null) { EventTypePaging.Add(progress); } else { existing.PaginationToken = progress.PaginationToken; existing.ProcessedCount = progress.ProcessedCount; existing.TotalCount = progress.TotalCount; } } public void Init(EventPaging progress) { EventPaging existing = EventTypePaging.Where(et => et.Type.Equals(progress.Type, StringComparison.OrdinalIgnoreCase)).FirstOrDefault(); if (existing is null) { EventTypePaging.Add(progress); } } public partial class EventPaging { public EventPaging(string eventTypeId, string paginationToken, long processedCount, long totalCount) { Type = eventTypeId; PaginationToken = paginationToken; ProcessedCount = processedCount; TotalCount = totalCount; } public string Type { get; set; } public string PaginationToken { get; set; } public long ProcessedCount { get; set; } public long TotalCount { get; set; } } } }
using Elders.Cronus.EventStore.Index; using System; using System.Collections.Generic; using System.Linq; namespace Elders.Cronus.Projections.Rebuilding { public class RebuildProjection_JobData : IJobData { public RebuildProjection_JobData() { IsCompleted = false; EventTypePaging = new List<EventPaging>(); Timestamp = DateTimeOffset.UtcNow; DueDate = DateTimeOffset.MaxValue; } public bool IsCompleted { get; set; } public List<EventPaging> EventTypePaging { get; set; } public ProjectionVersion Version { get; set; } public DateTimeOffset Timestamp { get; set; } public DateTimeOffset DueDate { get; set; } public void MarkEventTypeProgress(EventPaging progress) { EventPaging existing = EventTypePaging.Where(et => et.Type.Equals(progress.Type, StringComparison.OrdinalIgnoreCase)).FirstOrDefault(); if (existing is null) { EventTypePaging.Add(progress); } else { existing.PaginationToken = progress.PaginationToken; existing.ProcessedCount = progress.ProcessedCount; existing.TotalCount = progress.TotalCount; } } public void Init(EventPaging progress) { EventPaging existing = EventTypePaging.Where(et => et.Type.Equals(progress.Type, StringComparison.OrdinalIgnoreCase)).FirstOrDefault(); if (existing is null) { EventTypePaging.Add(progress); } } public partial class EventPaging { public EventPaging(string eventTypeId, string paginationToken, long processedCount, long totalCount) { Type = eventTypeId; PaginationToken = paginationToken; ProcessedCount = processedCount; TotalCount = totalCount; } public string Type { get; set; } public string PaginationToken { get; set; } public long ProcessedCount { get; set; } public long TotalCount { get; set; } } } }
apache-2.0
C#
363259c7872dd8b009553f46da912bd50050bfcc
fix for IE
smbc-digital/iag-webapp,smbc-digital/iag-webapp,smbc-digital/iag-webapp
src/StockportWebapp/Views/healthystockport/Shared/SubItem-List.cshtml
src/StockportWebapp/Views/healthystockport/Shared/SubItem-List.cshtml
@model StockportWebapp.Models.SubItem @{ var item = Model; var imageUrl = item.Image; } <li class="article-list-item article-list-item-mobile grid-33 tablet-grid-50 mobile-grid-50 matchbox-item"> <a href="@item.NavigationLink" class="article-list-item-block grid-45 tablet-grid-45"> @if (!string.IsNullOrEmpty(imageUrl)) { <div style="margin: 0 -10px 0 -10px;"> <img style="width: 100%;" src="@imageUrl?w=450&q=50" srcset="@imageUrl?w=260&q=40 260w, @imageUrl?w=360&q=60 360w, @imageUrl?w=450&q=50 450w, @imageUrl?w=350&q=50 350w" sizes="(max-width: 560px) 260px, (max-width: 767px) 750px, (min-width: 768px) and (max-width: 1024px) 450px, 350px" alt="" /> </div> } <div class="article-list-container"> <div class="matchbox-child"> <h2>@item.Title</h2> <p class="hide-on-mobile">@item.Teaser</p> </div> </div> </a> </li>
@model StockportWebapp.Models.SubItem @{ var item = Model; var imageUrl = item.Image; } <li class="article-list-item article-list-item-mobile grid-33 tablet-grid-50 mobile-grid-50 matchbox-item"> <a href="@item.NavigationLink" class="article-list-item-block grid-45 tablet-grid-45"> @if (!string.IsNullOrEmpty(imageUrl)) { <div style="margin: 0 -10px 0 -10px;"> <img srcset="@imageUrl?w=260&q=40 260w, @imageUrl?w=360&q=60 360w, @imageUrl?w=450&q=50 450w, @imageUrl?w=350&q=50 350w" sizes="(max-width: 560px) 260px, (max-width: 767px) 750px, (min-width: 768px) and (max-width: 1024px) 450px, 350px" alt="" /> </div> } <div class="article-list-container"> <div class="matchbox-child"> <h2>@item.Title</h2> <p class="hide-on-mobile">@item.Teaser</p> </div> </div> </a> </li>
mit
C#
ab0f3a6b86e4e6215f345515869c70c0ef0fcbf0
fix jump
dead-line-games/one-of-us
one-of-us/Assets/Scripts/playerJump.cs
one-of-us/Assets/Scripts/playerJump.cs
using UnityEngine; using System.Collections; public class playerJump : MonoBehaviour { public int jumpHeight; public int maxJump; private int jumpNum; // Use this for initialization void Start () { jumpNum = 0; } // Update is called once per frame void Update () { if (Input.GetKeyDown (KeyCode.Space) && (jumpNum<maxJump)) { GetComponent<Rigidbody2D> ().velocity = new Vector2 (0, jumpHeight); jumpNum++; } } void OnCollisionEnter2D (Collision2D call){ if (call.gameObject.CompareTag("Ground")){ jumpNum = 0; } } }
using UnityEngine; using System.Collections; public class playerJump : MonoBehaviour { // Use this for initialization void Start () { } // Update is called once per frame void Update () { } }
mit
C#
98ece26201e4197269e2ecb51e18596d09632cd2
Update remaining references
ZLima12/osu-framework,peppy/osu-framework,ppy/osu-framework,peppy/osu-framework,smoogipooo/osu-framework,EVAST9919/osu-framework,ZLima12/osu-framework,ppy/osu-framework,EVAST9919/osu-framework,smoogipooo/osu-framework,EVAST9919/osu-framework,peppy/osu-framework,EVAST9919/osu-framework,ppy/osu-framework
osu.Framework.Tests/Visual/Testing/TestCaseTest.cs
osu.Framework.Tests/Visual/Testing/TestCaseTest.cs
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. using NUnit.Framework; using osu.Framework.Development; using osu.Framework.Testing; namespace osu.Framework.Tests.Visual.Testing { public class TestCaseTest : TestCase { private int setupRun; private int setupStepsRun; private int testRunCount; [SetUp] public void SetUp() { setupRun++; } [SetUpSteps] public void SetUpSteps() { setupStepsRun++; } public TestCaseTest() { Schedule(() => { // [SetUp] gets run via TestConstructor() when we are running under nUnit. // note that in TestBrowser's case, this does not invoke SetUp methods, so we skip this increment. // schedule is required to ensure that IsNUnitRunning is initialised. if (DebugUtils.IsNUnitRunning) testRunCount++; }); AddStep("dummy step", () => { }); } [Test] public void Test1() { AddStep("increment run count", () => testRunCount++); AddAssert("correct setup run count", () => testRunCount == setupRun); AddAssert("correct setup steps run count", () => (DebugUtils.IsNUnitRunning ? testRunCount : 2) == setupStepsRun); } [Test] public void Test2() { AddStep("increment run count", () => testRunCount++); AddAssert("correct setup run count", () => testRunCount == setupRun); AddAssert("correct setup steps run count", () => (DebugUtils.IsNUnitRunning ? testRunCount : 2) == setupStepsRun); } protected override ITestCaseTestRunner CreateRunner() => new TestRunner(); private class TestRunner : TestCaseTestRunner { public override void RunTestBlocking(TestCase test) { base.RunTestBlocking(test); // This will only ever trigger via NUnit Assert.That(test.StepsContainer, Has.Count.GreaterThan(0)); } } } }
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. using NUnit.Framework; using osu.Framework.Testing; namespace osu.Framework.Tests.Visual.Testing { public class TestCaseTest : TestCase { private int setupRun; private int setupStepsRun; private int testRunCount; [SetUp] public void SetUp() { setupRun++; } [SetUpSteps] public void SetUpSteps() { setupStepsRun++; } public TestCaseTest() { Schedule(() => { // [SetUp] gets run via TestConstructor() when we are running under nUnit. // note that in TestBrowser's case, this does not invoke SetUp methods, so we skip this increment. // schedule is required to ensure that IsNUnitRunning is initialised. if (IsNUnitRunning) testRunCount++; }); AddStep("dummy step", () => { }); } [Test] public void Test1() { AddStep("increment run count", () => testRunCount++); AddAssert("correct setup run count", () => testRunCount == setupRun); AddAssert("correct setup steps run count", () => (IsNUnitRunning ? testRunCount : 2) == setupStepsRun); } [Test] public void Test2() { AddStep("increment run count", () => testRunCount++); AddAssert("correct setup run count", () => testRunCount == setupRun); AddAssert("correct setup steps run count", () => (IsNUnitRunning ? testRunCount : 2) == setupStepsRun); } protected override ITestCaseTestRunner CreateRunner() => new TestRunner(); private class TestRunner : TestCaseTestRunner { public override void RunTestBlocking(TestCase test) { base.RunTestBlocking(test); // This will only ever trigger via NUnit Assert.That(test.StepsContainer, Has.Count.GreaterThan(0)); } } } }
mit
C#
bb4193d985cb47e450adafe03059b03fcff38705
Fix taiko infinity health drain on some beatmaps
smoogipooo/osu,2yangk23/osu,smoogipoo/osu,UselessToucan/osu,smoogipoo/osu,smoogipoo/osu,ppy/osu,ppy/osu,peppy/osu,NeoAdonis/osu,peppy/osu,2yangk23/osu,ppy/osu,NeoAdonis/osu,peppy/osu-new,UselessToucan/osu,UselessToucan/osu,EVAST9919/osu,NeoAdonis/osu,peppy/osu,EVAST9919/osu
osu.Game.Rulesets.Taiko/Scoring/TaikoHealthProcessor.cs
osu.Game.Rulesets.Taiko/Scoring/TaikoHealthProcessor.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.Linq; using osu.Game.Beatmaps; using osu.Game.Rulesets.Judgements; using osu.Game.Rulesets.Scoring; using osu.Game.Rulesets.Taiko.Objects; namespace osu.Game.Rulesets.Taiko.Scoring { /// <summary> /// A <see cref="HealthProcessor"/> for the taiko ruleset. /// Taiko fails if the player has not half-filled their health by the end of the map. /// </summary> public class TaikoHealthProcessor : AccumulatingHealthProcessor { /// <summary> /// A value used for calculating <see cref="hpMultiplier"/>. /// </summary> private const double object_count_factor = 3; /// <summary> /// HP multiplier for a successful <see cref="HitResult"/>. /// </summary> private double hpMultiplier; /// <summary> /// HP multiplier for a <see cref="HitResult.Miss"/>. /// </summary> private double hpMissMultiplier; public TaikoHealthProcessor() : base(0.5) { } public override void ApplyBeatmap(IBeatmap beatmap) { base.ApplyBeatmap(beatmap); hpMultiplier = 1 / (object_count_factor * Math.Max(1, beatmap.HitObjects.OfType<Hit>().Count()) * BeatmapDifficulty.DifficultyRange(beatmap.BeatmapInfo.BaseDifficulty.DrainRate, 0.5, 0.75, 0.98)); hpMissMultiplier = BeatmapDifficulty.DifficultyRange(beatmap.BeatmapInfo.BaseDifficulty.DrainRate, 0.0018, 0.0075, 0.0120); } protected override double GetHealthIncreaseFor(JudgementResult result) => base.GetHealthIncreaseFor(result) * (result.Type == HitResult.Miss ? hpMissMultiplier : hpMultiplier); } }
// 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.Linq; using osu.Game.Beatmaps; using osu.Game.Rulesets.Judgements; using osu.Game.Rulesets.Scoring; using osu.Game.Rulesets.Taiko.Objects; namespace osu.Game.Rulesets.Taiko.Scoring { /// <summary> /// A <see cref="HealthProcessor"/> for the taiko ruleset. /// Taiko fails if the player has not half-filled their health by the end of the map. /// </summary> public class TaikoHealthProcessor : AccumulatingHealthProcessor { /// <summary> /// A value used for calculating <see cref="hpMultiplier"/>. /// </summary> private const double object_count_factor = 3; /// <summary> /// HP multiplier for a successful <see cref="HitResult"/>. /// </summary> private double hpMultiplier; /// <summary> /// HP multiplier for a <see cref="HitResult.Miss"/>. /// </summary> private double hpMissMultiplier; public TaikoHealthProcessor() : base(0.5) { } public override void ApplyBeatmap(IBeatmap beatmap) { base.ApplyBeatmap(beatmap); hpMultiplier = 1 / (object_count_factor * beatmap.HitObjects.OfType<Hit>().Count() * BeatmapDifficulty.DifficultyRange(beatmap.BeatmapInfo.BaseDifficulty.DrainRate, 0.5, 0.75, 0.98)); hpMissMultiplier = BeatmapDifficulty.DifficultyRange(beatmap.BeatmapInfo.BaseDifficulty.DrainRate, 0.0018, 0.0075, 0.0120); } protected override double GetHealthIncreaseFor(JudgementResult result) => base.GetHealthIncreaseFor(result) * (result.Type == HitResult.Miss ? hpMissMultiplier : hpMultiplier); } }
mit
C#
9154e2a1a454345e6d9418d8ae901350c60a8273
Add controller to validate and register entrance/exit.
marcuson/A2BBServer,marcuson/A2BBServer,marcuson/A2BBServer
A2BBAPI/Controllers/InOutController.cs
A2BBAPI/Controllers/InOutController.cs
using Microsoft.AspNetCore.Mvc; using A2BBCommon.Models; using A2BBCommon; using A2BBAPI.Data; using Microsoft.Extensions.Logging; using Microsoft.AspNetCore.Authorization; using A2BBAPI.Utils; using System.Linq; using A2BBAPI.Models; using static A2BBAPI.Models.InOut; using System; namespace A2BBAPI.Controllers { [Produces("application/json")] [Route("api")] [AllowAnonymous] public class InOutController : Controller { private readonly A2BBApiDbContext _dbContext; private readonly ILogger _logger; private Device CheckDeviceId(int deviceId) { var device = _dbContext.Device.FirstOrDefault(d => d.Id == deviceId); if (device == null) { throw new RestReturnException(Constants.RestReturn.ERR_DEVICE_NOT_FOUND); } if (!device.Enabled) { throw new RestReturnException(Constants.RestReturn.ERR_DEVICE_DISABLED); } var response = ClientUtils.GetRTClient(Constants.A2BB_API_RESOURCE_NAME, Constants.A2BB_API_RO_CLIENT_ID, device.RefreshToken); if (response.IsError) { throw new RestReturnException(Constants.RestReturn.ERR_DEVICE_DISABLED); } return device; } public InOutController(A2BBApiDbContext dbContext, ILoggerFactory loggerFactory) { _dbContext = dbContext; _logger = loggerFactory.CreateLogger<MeController>(); } [HttpPost] [Route("in/{deviceId}")] public ResponseWrapper<string> In([FromRoute] int deviceId) { Device device; try { device = CheckDeviceId(deviceId); } catch (RestReturnException e) { return new ResponseWrapper<string>(e.Value); } var inObj = new InOut { Type = InOutType.In, Device = device, OnDate = DateTime.Now }; _dbContext.InOut.Add(inObj); _dbContext.SaveChanges(); return new ResponseWrapper<string>("In " + deviceId, Constants.RestReturn.OK); } [HttpPost] [Route("out/{deviceId}")] public ResponseWrapper<string> Out([FromRoute] int deviceId) { Device device; try { device = CheckDeviceId(deviceId); } catch (RestReturnException e) { return new ResponseWrapper<string>(e.Value); } var inObj = new InOut { Type = InOutType.In, Device = device, OnDate = DateTime.Now }; _dbContext.InOut.Add(inObj); _dbContext.SaveChanges(); return new ResponseWrapper<string>("Out " + deviceId, Constants.RestReturn.OK); } } }
using System; using System.Linq; using System.Threading.Tasks; using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Authorization; using A2BBCommon.Models; using A2BBCommon; using A2BBAPI.Data; using IdentityModel.Client; using A2BBAPI.DTO; using Microsoft.Extensions.Logging; namespace A2BBAPI.Controllers { [Produces("application/json")] [Route("api")] public class InOutController : Controller { private readonly A2BBApiDbContext _dbContext; private readonly ILogger _logger; public InOutController(A2BBApiDbContext dbContext, ILoggerFactory loggerFactory) { _dbContext = dbContext; _logger = loggerFactory.CreateLogger<MeController>(); } [HttpPost] [Route("in/{deviceId}")] public ResponseWrapper<string> In([FromRoute] int deviceId) { return new ResponseWrapper<string>("In " + deviceId, Constants.RestReturn.OK); } } }
apache-2.0
C#
25fa7f7ec399c15c9a13ae717224608a20742354
Update BoundsPoint.cs
wieslawsoltes/Core2D,Core2D/Core2D,wieslawsoltes/Core2D,wieslawsoltes/Core2D,Core2D/Core2D,wieslawsoltes/Core2D
src/Core2D/Editor/Bounds/Shapes/BoundsPoint.cs
src/Core2D/Editor/Bounds/Shapes/BoundsPoint.cs
// Copyright (c) Wiesław Šoltés. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. using System; using System.Collections.Generic; using Core2D.Shapes; using Spatial; namespace Core2D.Editor.Bounds.Shapes { public class BoundsPoint : IBounds { public Type TargetType => typeof(IPointShape); public IPointShape TryToGetPoint(IBaseShape shape, Point2 target, double radius, IDictionary<Type, IBounds> registered) { if (!(shape is IPointShape point)) { throw new ArgumentNullException(nameof(shape)); } if (Point2.FromXY(point.X, point.Y).ExpandToRect(radius).Contains(target.X, target.Y)) { return point; } return null; } public bool Contains(IBaseShape shape, Point2 target, double radius, IDictionary<Type, IBounds> registered) { if (!(shape is IPointShape point)) { throw new ArgumentNullException(nameof(shape)); } return Point2.FromXY(point.X, point.Y).ExpandToRect(radius).Contains(target.X, target.Y); } public bool Overlaps(IBaseShape shape, Rect2 target, double radius, IDictionary<Type, IBounds> registered) { if (!(shape is IPointShape point)) { throw new ArgumentNullException(nameof(shape)); } return Point2.FromXY(point.X, point.Y).ExpandToRect(radius).IntersectsWith(target); } } }
// Copyright (c) Wiesław Šoltés. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. using System; using System.Collections.Generic; using Core2D.Shapes; using Spatial; namespace Core2D.Editor.Bounds.Shapes { public class BoundsPoint : IBounds { public Type TargetType => typeof(IPointShape); public IPointShape TryToGetPoint(IBaseShape shape, Point2 target, double radius, IDictionary<Type, IBounds> registered) { if (!(shape is IPointShape point)) throw new ArgumentNullException(nameof(shape)); if (Point2.FromXY(point.X, point.Y).ExpandToRect(radius).Contains(target.X, target.Y)) { return point; } return null; } public bool Contains(IBaseShape shape, Point2 target, double radius, IDictionary<Type, IBounds> registered) { if (!(shape is IPointShape point)) throw new ArgumentNullException(nameof(shape)); return Point2.FromXY(point.X, point.Y).ExpandToRect(radius).Contains(target.X, target.Y); } public bool Overlaps(IBaseShape shape, Rect2 target, double radius, IDictionary<Type, IBounds> registered) { if (!(shape is IPointShape point)) throw new ArgumentNullException(nameof(shape)); return Point2.FromXY(point.X, point.Y).ExpandToRect(radius).IntersectsWith(target); } } }
mit
C#
b28b7db51dbd5b9878a625623f5517109f74e0d9
fix dashboard not config discovery throw exceptions bug.
dotnetcore/CAP,dotnetcore/CAP,ouraspnet/cap,dotnetcore/CAP
src/DotNetCore.CAP/Dashboard/Pages/NodePage.cs
src/DotNetCore.CAP/Dashboard/Pages/NodePage.cs
using System.Collections.Generic; using DotNetCore.CAP.NodeDiscovery; using Microsoft.Extensions.DependencyInjection; namespace DotNetCore.CAP.Dashboard.Pages { internal partial class NodePage { private INodeDiscoveryProvider _discoveryProvider; private IList<Node> _nodes; public NodePage() { } public NodePage(string id) { CurrentNodeId = id; } public string CurrentNodeId { get; set; } public IList<Node> Nodes { get { if (_nodes == null) { _discoveryProvider = RequestServices.GetService<INodeDiscoveryProvider>(); if (_discoveryProvider == null) { return new List<Node>(); } _nodes = _discoveryProvider.GetNodes().GetAwaiter().GetResult(); } return _nodes; } } } }
using System.Collections.Generic; using DotNetCore.CAP.NodeDiscovery; using Microsoft.Extensions.DependencyInjection; namespace DotNetCore.CAP.Dashboard.Pages { internal partial class NodePage { private INodeDiscoveryProvider _discoveryProvider; private IList<Node> _nodes; public NodePage() { } public NodePage(string id) { CurrentNodeId = id; } public string CurrentNodeId { get; set; } public IList<Node> Nodes { get { if (_nodes == null) { _discoveryProvider = RequestServices.GetService<INodeDiscoveryProvider>(); _nodes = _discoveryProvider.GetNodes().GetAwaiter().GetResult(); } return _nodes; } } } }
mit
C#
644ce97b76e60d58d453ef8304913a4138235ae5
Improve menu item coloring
sillsdev/hearthis,sillsdev/hearthis,sillsdev/hearthis
src/HearThis/UI/ToolStripColorArrowRenderer.cs
src/HearThis/UI/ToolStripColorArrowRenderer.cs
using System; using System.Collections.Generic; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; namespace HearThis.UI { /// <summary> /// This is apparently the only way we can make ToolStripDropDownButtons have non-black arrows. /// It makes such arrows use the forecolor as the arrow color. /// An instance should be created and set as the Renderer of the containing toolstrip. /// </summary> internal class ToolStripColorArrowRenderer : ToolStripRenderer { protected override void OnRenderArrow(ToolStripArrowRenderEventArgs e) { e.ArrowColor = e.Item.ForeColor; // why on earth isn't this the default?? base.OnRenderArrow(e); } /// <summary> /// Without this, for some reason the menu item hovered over goes white and thus almost /// disappears against the very light grey background of the menu. (But, we need to exclude /// the top-level button from the fix, since it doesn't need to go black.) /// </summary> /// <param name="e"></param> protected override void OnRenderItemText(ToolStripItemTextRenderEventArgs e) { if (e.Item.Selected && !(e.Item is ToolStripDropDownButton)) e.TextColor = Color.Black; base.OnRenderItemText(e); } /// <summary> /// Since all the menu items are black, making the hovered one black doesn't give any feedback. /// Giving a little color to the background provides some. The hightlight color may be too bright, /// but it seemed the most appropriate of the colors already in our palette. /// </summary> /// <param name="e"></param> protected override void OnRenderMenuItemBackground(ToolStripItemRenderEventArgs e) { if (e.Item.Selected) { e.Graphics.FillRectangle(AppPallette.HighlightBrush, new Rectangle(Point.Empty, e.Item.Size)); return; } base.OnRenderMenuItemBackground(e); } } }
using System; using System.Collections.Generic; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; namespace HearThis.UI { /// <summary> /// This is apparently the only way we can make ToolStripDropDownButtons have non-black arrows. /// It makes such arrows use the forecolor as the arrow color. /// An instance should be created and set as the Renderer of the containing toolstrip. /// </summary> internal class ToolStripColorArrowRenderer : ToolStripRenderer { protected override void OnRenderArrow(ToolStripArrowRenderEventArgs e) { e.ArrowColor = e.Item.ForeColor; // why on earth isn't this the default?? base.OnRenderArrow(e); } } }
mit
C#
6dc41da72ea477fa4d1cbea965d80277a61b69af
Update BehaviorOfT.cs
wieslawsoltes/AvaloniaBehaviors,wieslawsoltes/AvaloniaBehaviors
src/Avalonia.Xaml.Interactivity/BehaviorOfT.cs
src/Avalonia.Xaml.Interactivity/BehaviorOfT.cs
// Copyright (c) Wiesław Šoltés. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. using System; using System.ComponentModel; namespace Avalonia.Xaml.Interactivity { /// <summary> /// A base class for behaviors making them code compatible with older frameworks, /// and allow for typed associated objects. /// </summary> /// <typeparam name="T">The object type to attach to</typeparam> public abstract class Behavior<T> : Behavior where T : AvaloniaObject { /// <summary> /// Gets the object to which this behavior is attached. /// </summary> public new T? AssociatedObject => base.AssociatedObject as T; /// <summary> /// Called after the behavior is attached to the <see cref="Behavior.AssociatedObject"/>. /// </summary> /// <remarks> /// Override this to hook up functionality to the <see cref="Behavior.AssociatedObject"/> /// </remarks> protected override void OnAttached() { base.OnAttached(); if (AssociatedObject == null && base.AssociatedObject != null) { string actualType = base.AssociatedObject.GetType().FullName; string expectedType = typeof(T).FullName; string message = string.Format("AssociatedObject is of type {0} but should be of type {1}.", actualType, expectedType); throw new InvalidOperationException(message); } } } }
// Copyright (c) Wiesław Šoltés. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. using System; using System.ComponentModel; namespace Avalonia.Xaml.Interactivity { /// <summary> /// A base class for behaviors making them code compatible with older frameworks, /// and allow for typed associated objects. /// </summary> /// <typeparam name="T">The object type to attach to</typeparam> public abstract class Behavior<T> : Behavior where T : notnull, AvaloniaObject { /// <summary> /// Gets the object to which this behavior is attached. /// </summary> public new T? AssociatedObject => base.AssociatedObject as T; /// <summary> /// Called after the behavior is attached to the <see cref="Behavior.AssociatedObject"/>. /// </summary> /// <remarks> /// Override this to hook up functionality to the <see cref="Behavior.AssociatedObject"/> /// </remarks> protected override void OnAttached() { base.OnAttached(); if (AssociatedObject == null && base.AssociatedObject != null) { string actualType = base.AssociatedObject.GetType().FullName; string expectedType = typeof(T).FullName; string message = string.Format("AssociatedObject is of type {0} but should be of type {1}.", actualType, expectedType); throw new InvalidOperationException(message); } } } }
mit
C#
e234f5ff8521e3cbf2658784dfff0600405492c1
修复MPQ Session错误的问题
Newbe36524/Newbe.Mahua.Framework
src/Newbe.Mahua.MPQ/QqProvider.cs
src/Newbe.Mahua.MPQ/QqProvider.cs
using Newbe.Mahua.MPQ.NativeApi; using System; namespace Newbe.Mahua.MPQ { public class QqProvider : IQqProvider { private readonly IMpqApi _mpqApi; public QqProvider( IMpqApi mpqApi) { _mpqApi = mpqApi; } public Func<string> DefaultQqProvider => () => { var apiGetOnlineQQlist = _mpqApi.Api_GetOnlineQQlist(); return apiGetOnlineQQlist; }; public bool CheckQq(string qq) { return DefaultQqProvider() == qq; } } }
using Newbe.Mahua.Logging; using Newbe.Mahua.MPQ.NativeApi; using System; namespace Newbe.Mahua.MPQ { public class QqProvider : IQqProvider { private readonly IMpqApi _mpqApi; public QqProvider( IMpqApi mpqApi) { _mpqApi = mpqApi; } // TODO 需要测试 public Func<string> DefaultQqProvider => () => { var apiGetOnlineQQlist = _mpqApi.Api_GetOnlineQQlist(); LogProvider.For<QqProvider>().Info($" get qq list {apiGetOnlineQQlist}"); return string.Empty; }; public bool CheckQq(string qq) { // TODO 需要实现 return false; } } }
mit
C#
a8c4dc83fe6d4195ca47b4d3370e9cd1a06120b5
Add license header
bonimy/MushROMs
Helper/ISelection.cs
Helper/ISelection.cs
// <copyright file="ISelection.cs" company="Public Domain"> // Copyright (c) 2017 Nelson Garcia. // </copyright> using System.Collections.Generic; namespace Helper { public interface ISelection<T> : IReadOnlyList<T> { bool Contains(T value); ISelection<T> Copy(); } }
using System; using System.Collections.Generic; using System.Text; namespace Helper { public interface ISelection<T> : IReadOnlyList<T> { bool Contains(T value); ISelection<T> Copy(); } }
agpl-3.0
C#
600d100cd9c144e3dc00617e0bf6a29d5661e30c
Fix for deserializing string-like values. This removes the surrounding double-quotes around strings that aren't part of the original value.
mcintyre321/RestSharp-.NET-2.0-Fork,paulcbetts/RestSharp,jmartin84/RestSharp,PKRoma/RestSharp,Haacked/RestSharp,felipegtx/RestSharp,fmmendo/RestSharp,kouweizhong/RestSharp,paulcbetts/RestSharp,eamonwoortman/RestSharp.Unity,restsharp/RestSharp,mattleibow/RestSharp,jmartin84/RestSharp,mattwalden/RestSharp,chengxiaole/RestSharp,devinrader/RestSharpRTExperimental,who/RestSharp,lydonchandra/RestSharp,Haacked/RestSharp,mwereda/RestSharp,KraigM/RestSharp,dgreenbean/RestSharp,benfo/RestSharp,wparad/RestSharp,jiangzm/RestSharp,devinrader/RestSharpRTExperimental,IsCoolEntertainment/unity-restsharp,rucila/RestSharp,amccarter/RestSharp,periface/RestSharp,IsCoolEntertainment/unity-restsharp,dyh333/RestSharp,rivy/RestSharp,mcintyre321/RestSharp-.NET-2.0-Fork,uQr/RestSharp,wparad/RestSharp,RestSharp-resurrected/RestSharp,cnascimento/RestSharp,SaltyDH/RestSharp,haithemaraissia/RestSharp,dmgandini/RestSharp,huoxudong125/RestSharp
RestSharp/Extensions/MiscExtensions.cs
RestSharp/Extensions/MiscExtensions.cs
#region License // Copyright 2010 John Sheehan // // 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 using System.IO; using Newtonsoft.Json.Linq; namespace RestSharp.Extensions { /// <summary> /// Extension method overload! /// </summary> public static class MiscExtensions { #if !WINDOWS_PHONE /// <summary> /// Save a byte array to a file /// </summary> /// <param name="input">Bytes to save</param> /// <param name="path">Full path to save file to</param> public static void SaveAs(this byte[] input, string path) { File.WriteAllBytes(path, input); } #endif /// <summary> /// Read a stream into a byte array /// </summary> /// <param name="input">Stream to read</param> /// <returns>byte[]</returns> public static byte[] ReadAsBytes(this Stream input) { byte[] buffer = new byte[16 * 1024]; using (MemoryStream ms = new MemoryStream()) { int read; while ((read = input.Read(buffer, 0, buffer.Length)) > 0) { ms.Write(buffer, 0, read); } return ms.ToArray(); } } /// <summary> /// Copies bytes from one stream to another /// </summary> /// <param name="input">The input stream.</param> /// <param name="output">The output stream.</param> public static void CopyTo(this Stream input, Stream output) { var buffer = new byte[32768]; while(true) { var read = input.Read(buffer, 0, buffer.Length); if(read <= 0) return; output.Write(buffer, 0, read); } } /// <summary> /// Gets string value from JToken /// </summary> /// <param name="token"></param> /// <returns></returns> public static string AsString(this JToken token) { return token.Value<string>(); } } }
#region License // Copyright 2010 John Sheehan // // 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 using System.IO; using Newtonsoft.Json.Linq; namespace RestSharp.Extensions { /// <summary> /// Extension method overload! /// </summary> public static class MiscExtensions { #if !WINDOWS_PHONE /// <summary> /// Save a byte array to a file /// </summary> /// <param name="input">Bytes to save</param> /// <param name="path">Full path to save file to</param> public static void SaveAs(this byte[] input, string path) { File.WriteAllBytes(path, input); } #endif /// <summary> /// Read a stream into a byte array /// </summary> /// <param name="input">Stream to read</param> /// <returns>byte[]</returns> public static byte[] ReadAsBytes(this Stream input) { byte[] buffer = new byte[16 * 1024]; using (MemoryStream ms = new MemoryStream()) { int read; while ((read = input.Read(buffer, 0, buffer.Length)) > 0) { ms.Write(buffer, 0, read); } return ms.ToArray(); } } /// <summary> /// Copies bytes from one stream to another /// </summary> /// <param name="input">The input stream.</param> /// <param name="output">The output stream.</param> public static void CopyTo(this Stream input, Stream output) { var buffer = new byte[32768]; while(true) { var read = input.Read(buffer, 0, buffer.Length); if(read <= 0) return; output.Write(buffer, 0, read); } } /// <summary> /// Gets string value from JToken /// </summary> /// <param name="token"></param> /// <returns></returns> public static string AsString(this JToken token) { return token.ToString(); } } }
apache-2.0
C#
17bab1e8772968abac4be5f461076e92b62f1137
remove remaining reference to BCad.UI
IxMilia/BCad,IxMilia/BCad
BCad/App.xaml.cs
BCad/App.xaml.cs
using System.Windows; using System.Reflection; using System.Composition.Hosting; using System; using System.IO; namespace BCad { /// <summary> /// Interaction logic for App.xaml /// </summary> public partial class App : Application, IDisposable { public static CompositionHost Container { get; private set; } public App() { //base.OnStartup(e); this.ShutdownMode = ShutdownMode.OnMainWindowClose; var currentAssembly = typeof(App).GetTypeInfo().Assembly; var assemblyDir = Path.GetDirectoryName(currentAssembly.Location); var configuration = new ContainerConfiguration() .WithAssemblies(new[] { currentAssembly, Assembly.LoadFile(Path.Combine(assemblyDir, "BCad.Core.dll")), Assembly.LoadFile(Path.Combine(assemblyDir, "BCad.Core.UI.dll")), Assembly.LoadFile(Path.Combine(assemblyDir, "BCad.FileHandlers.dll")) }); Container = configuration.CreateContainer(); } public void Dispose() { if (Container != null) { Container.Dispose(); Container = null; } } } }
using System.Windows; using System.Reflection; using System.Composition.Hosting; using System; using System.IO; namespace BCad { /// <summary> /// Interaction logic for App.xaml /// </summary> public partial class App : Application, IDisposable { public static CompositionHost Container { get; private set; } public App() { //base.OnStartup(e); this.ShutdownMode = ShutdownMode.OnMainWindowClose; var currentAssembly = typeof(App).GetTypeInfo().Assembly; var assemblyDir = Path.GetDirectoryName(currentAssembly.Location); var configuration = new ContainerConfiguration() .WithAssemblies(new[] { currentAssembly, Assembly.LoadFile(Path.Combine(assemblyDir, "BCad.Core.dll")), Assembly.LoadFile(Path.Combine(assemblyDir, "BCad.Core.UI.dll")), Assembly.LoadFile(Path.Combine(assemblyDir, "BCad.FileHandlers.dll")), Assembly.LoadFile(Path.Combine(assemblyDir, "BCad.UI.dll")), }); Container = configuration.CreateContainer(); } public void Dispose() { if (Container != null) { Container.Dispose(); Container = null; } } } }
apache-2.0
C#
a8704d78f49810d7c2addf886cb2d49ae07cca6c
Fix the sample app following previous changes.
SolalPirelli/ThinMvvm
ThinMvvm.WindowsPhone.SampleApp/App.cs
ThinMvvm.WindowsPhone.SampleApp/App.cs
// Copyright (c) Solal Pirelli 2014 // See License.txt file for more details using ThinMvvm.WindowsPhone.SampleApp.Resources; using ThinMvvm.WindowsPhone.SampleApp.ViewModels; namespace ThinMvvm.WindowsPhone.SampleApp { public sealed class App : AppBase { private readonly IWindowsPhoneNavigationService _navigationService; protected override string Language { get { return AppResources.ResourceLanguage; } } protected override string FlowDirection { get { return AppResources.ResourceFlowDirection; } } public App() { _navigationService = Container.Bind<IWindowsPhoneNavigationService, WindowsPhoneNavigationService>(); Container.Bind<ISettingsStorage, WindowsPhoneSettingsStorage>(); Container.Bind<ISettings, Settings>(); } protected override void Start( AppArguments arguments ) { // simple app, no additional dependencies or arguments _navigationService.Bind<MainViewModel>( "/Views/MainView.xaml" ); _navigationService.Bind<AboutViewModel>( "/Views/AboutView.xaml" ); _navigationService.NavigateTo<MainViewModel, int>( 42 ); } } }
// Copyright (c) Solal Pirelli 2014 // See License.txt file for more details using ThinMvvm.WindowsPhone.SampleApp.Resources; using ThinMvvm.WindowsPhone.SampleApp.ViewModels; namespace ThinMvvm.WindowsPhone.SampleApp { public sealed class App : AppBase { protected override string Language { get { return AppResources.ResourceLanguage; } } protected override string FlowDirection { get { return AppResources.ResourceFlowDirection; } } public App() { Container.Bind<IWindowsPhoneNavigationService, WindowsPhoneNavigationService>(); Container.Bind<ISettingsStorage, WindowsPhoneSettingsStorage>(); Container.Bind<ISettings, Settings>(); } protected override void Start( AppDependencies dependencies, AppArguments arguments ) { // simple app, no additional dependencies or arguments dependencies.NavigationService.Bind<MainViewModel>( "/Views/MainView.xaml" ); dependencies.NavigationService.Bind<AboutViewModel>( "/Views/AboutView.xaml" ); dependencies.NavigationService.NavigateTo<MainViewModel, int>( 42 ); } } }
mit
C#
787c2e09298c7b47d17219aedc376e23d9972a26
Update version to 8.0.0-beta-007
Weingartner/XUnitRemote
XUnitRemote/Properties/AssemblyInfo.cs
XUnitRemote/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("XUnitRemote")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Weingartner")] [assembly: AssemblyProduct("XUnitRemote")] [assembly: AssemblyCopyright("Copyright © Weingartner Machinenbau Gmbh 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("21248cf4-3629-4cfa-8632-9e4468a0526e")] // 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("7.99.0.0")] [assembly: AssemblyFileVersion("7.99.0.0")] [assembly: AssemblyInformationalVersion("8.0.0-beta-007")]
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("XUnitRemote")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Weingartner")] [assembly: AssemblyProduct("XUnitRemote")] [assembly: AssemblyCopyright("Copyright © Weingartner Machinenbau Gmbh 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("21248cf4-3629-4cfa-8632-9e4468a0526e")] // 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("7.99.0.0")] [assembly: AssemblyFileVersion("7.99.0.0")] [assembly: AssemblyInformationalVersion("8.0.0-beta-006")]
mit
C#
59bfb4148adf810ccb61acdceac42d10e104d2fb
Add extension method for IRandom to get an unsigned 64-bit integer.
brendanjbaker/Bakery
src/Bakery/Security/RandomExtensions.cs
src/Bakery/Security/RandomExtensions.cs
namespace Bakery.Security { using System; public static class RandomExtensions { public static Byte[] GetBytes(this IRandom random, Int32 count) { if (count <= 0) throw new ArgumentOutOfRangeException(nameof(count)); var buffer = new Byte[count]; for (var i = 0; i < count; i++) buffer[i] = random.GetByte(); return buffer; } public static Int64 GetInt64(this IRandom random) { return BitConverter.ToInt64(random.GetBytes(8), 0); } public static UInt64 GetUInt64(this IRandom random) { return BitConverter.ToUInt64(random.GetBytes(8), 0); } } }
namespace Bakery.Security { using System; public static class RandomExtensions { public static Byte[] GetBytes(this IRandom random, Int32 count) { if (count <= 0) throw new ArgumentOutOfRangeException(nameof(count)); var buffer = new Byte[count]; for (var i = 0; i < count; i++) buffer[i] = random.GetByte(); return buffer; } public static Int64 GetInt64(this IRandom random) { return BitConverter.ToInt64(random.GetBytes(8), 0); } } }
mit
C#
f22f45acd718ca607a5ba2058cc5782269b1ce4d
Add sector for PublicSectorOrganisation
SkillsFundingAgency/das-referencedata,SkillsFundingAgency/das-referencedata
src/SFA.DAS.ReferenceData.Domain/Models/PublicSectorOrganisation.cs
src/SFA.DAS.ReferenceData.Domain/Models/PublicSectorOrganisation.cs
namespace SFA.DAS.ReferenceData.Domain.Models { public class PublicSectorOrganisation { public string Name { get; set; } public DataSource Source { get; set; } public string Sector { get; set; } } public enum DataSource { Ons = 1, Nhs = 2, Police = 3 } }
namespace SFA.DAS.ReferenceData.Domain.Models { public class PublicSectorOrganisation { public string Name { get; set; } public DataSource Source { get; set; } } public enum DataSource { Ons = 1, Nhs = 2, Police = 3 } }
mit
C#
47c61e58279caf34536addb62b90b7d73ef883b2
Update MiNetService.cs
yungtechboy1/MiNET,MiPE-JP/RaNET,InPvP/MiNET
src/MiNET/MiNET.Service/MiNetService.cs
src/MiNET/MiNET.Service/MiNetService.cs
using System; using log4net; using log4net.Config; using Topshelf; // Configure log4net using the .config file [assembly: XmlConfigurator(Watch = true)] // This will cause log4net to look for a configuration file // called TestApp.exe.config in the application base // directory (i.e. the directory containing TestApp.exe) // The config file will be watched for changes. namespace MiNET.Service { public class MiNetService { private static readonly ILog Log = LogManager.GetLogger(typeof (MiNetServer)); private MiNetServer _server; /// <summary> /// Starts this instance. /// </summary> private void Start() { Log.Info("Starting MiNET"); _server = new MiNetServer(); _server.StartServer(); } /// <summary> /// Stops this instance. /// </summary> private void Stop() { Log.Info("Stopping MiNET"); _server.StopServer(); } /// <summary> /// The programs entry point. /// </summary> /// <param name="args">The arguments.</param> private static void Main(string[] args) { if (IsRunningOnMono()) { var service = new MiNetService(); service.Start(); Console.WriteLine("MiNET running. Press <enter> to stop service."); Console.ReadLine(); service.Stop(); } else { HostFactory.Run(host => { host.Service<MiNetService>(s => { s.ConstructUsing(construct => new MiNetService()); s.WhenStarted(service => service.Start()); s.WhenStopped(service => service.Stop()); }); host.RunAsLocalService(); host.SetDisplayName("MiNET Service"); host.SetDescription("MiNET Minecraft Pocket Edition server."); host.SetServiceName("MiNET"); }); } } /// <summary> /// Determines whether is running on mono. /// </summary> /// <returns></returns> public static bool IsRunningOnMono() { return Type.GetType("Mono.Runtime") != null; } } }
using System; using log4net; using log4net.Config; using Topshelf; // Configure log4net using the .config file [assembly: XmlConfigurator(Watch = true)] // This will cause log4net to look for a configuration file // called TestApp.exe.config in the application base // directory (i.e. the directory containing TestApp.exe) // The config file will be watched for changes. namespace MiNET.Service { public class MiNetService { private static readonly ILog Log = LogManager.GetLogger(typeof (MiNetServer)); private MiNetServer _server; /// <summary> /// Starts this instance. /// </summary> private void Start() { Log.Info("Starting MiNET"); _server = new MiNetServer(); _server.StartServer(); } /// <summary> /// Stops this instance. /// </summary> private void Stop() { Log.Info("Stopping MiNET"); _server.StopServer(); } /// <summary> /// The programs entry point. /// </summary> /// <param name="args">The arguments.</param> private static void Main(string[] args) { if (IsRunningOnMono()) { var service = new MiNetService(); service.Start(); Console.WriteLine("MiNET runing. Press <enter> to stop service.."); Console.ReadLine(); service.Stop(); } else { HostFactory.Run(host => { host.Service<MiNetService>(s => { s.ConstructUsing(construct => new MiNetService()); s.WhenStarted(service => service.Start()); s.WhenStopped(service => service.Stop()); }); host.RunAsLocalService(); host.SetDisplayName("MiNET Service"); host.SetDescription("MiNET MineCraft Pocket Edition server."); host.SetServiceName("MiNET"); }); } } /// <summary> /// Determines whether is running on mono. /// </summary> /// <returns></returns> public static bool IsRunningOnMono() { return Type.GetType("Mono.Runtime") != null; } } }
mpl-2.0
C#
79323d50470c03fd94ff53def74f6fcf0d01d1ad
Fix Android AdvancedFrame border layout issue
XAM-Consulting/FreshEssentials,XAM-Consulting/FreshEssentials
src/FreshEssentials/Controls/AdvancedFrame.cs
src/FreshEssentials/Controls/AdvancedFrame.cs
using System; using Xamarin.Forms; namespace FreshEssentials { public enum RoundedCorners { left, right, all, none } public class AdvancedFrame: Frame { public static readonly BindableProperty InnerBackgroundProperty = BindableProperty.Create("InnerBackground", typeof(Color), typeof(AdvancedFrame), default(Color)); public Color InnerBackground { get { return (Color)GetValue(InnerBackgroundProperty); } set { SetValue(InnerBackgroundProperty, value); } } public RoundedCorners Corners { get; set; } public int CornerRadius { get; set; } public AdvancedFrame() { BackgroundColor = Color.Transparent; HasShadow = false; Corners = RoundedCorners.none; this.Padding = new Thickness(0, 0, 0, 0); } } }
using System; using Xamarin.Forms; namespace FreshEssentials { public enum RoundedCorners { left, right, all, none } public class AdvancedFrame: Frame { public static readonly BindableProperty InnerBackgroundProperty = BindableProperty.Create("InnerBackground", typeof(Color), typeof(AdvancedFrame), default(Color)); public Color InnerBackground { get { return (Color)GetValue(InnerBackgroundProperty); } set { SetValue(InnerBackgroundProperty, value); } } public RoundedCorners Corners { get; set; } public int CornerRadius { get; set; } public AdvancedFrame() { HasShadow = false; Corners = RoundedCorners.none; this.Padding = new Thickness(0, 0, 0, 0); } } }
apache-2.0
C#
9b97d0c91ad1918644d8981237b188630a4759e0
update the blogs controller to use the updated blogs manager
smeehan82/Hermes,smeehan82/Hermes,smeehan82/Hermes
src/Hermes.Web/Controllers/BlogsController.cs
src/Hermes.Web/Controllers/BlogsController.cs
using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using Microsoft.AspNet.Mvc; using Microsoft.Extensions.Logging; using Hermes.Content.Blogs; // For more information on enabling Web API for empty projects, visit http://go.microsoft.com/fwlink/?LinkID=397860 namespace Hermes.Web.Controllers { [Route("api/blogs")] public class BlogsController : Controller { #region Contructors private BlogsManager _blogsManager; private ILogger _logger; public BlogsController(BlogsManager blogsManager, ILoggerFactory loggerFactory) { _blogsManager = blogsManager; _logger = loggerFactory.CreateLogger<BlogsController>(); } #endregion // GET: api/values [HttpGet] [Route("list")] public async Task<IActionResult> Get() { var blogs = _blogsManager.Blogs; return new ObjectResult(blogs); } //GET [HttpGet] [Route("single")] public async Task<IActionResult> Get(Guid id) { var blog = await _blogsManager.FindByIdAsync(id); return new ObjectResult(blog); } [HttpGet] [Route("single")] public async Task<IActionResult> Get(string slug) { var blog = await _blogsManager.FindBySlugAsync(slug); return new ObjectResult(blog); } [HttpPost] [Route("add")] public async Task<IActionResult> Put(string title, string slug) { var blog = new Blog(); blog.Id = new Guid(); blog.Title = title; blog.Slug = slug; blog.DateCreated = DateTimeOffset.Now; blog.DateModified = DateTimeOffset.Now; blog.DatePublished = DateTimeOffset.Now; await _blogsManager.AddAsync(blog); return new ObjectResult(true); } } }
using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using Microsoft.AspNet.Mvc; using Microsoft.Extensions.Logging; using Hermes.Content.Blogs; // For more information on enabling Web API for empty projects, visit http://go.microsoft.com/fwlink/?LinkID=397860 namespace Hermes.Web.Controllers { [Route("api/blogs")] public class BlogsController : Controller { #region Contructors private BlogsManager _blogsManager; private ILogger _logger; public BlogsController(BlogsManager blogsManager, ILoggerFactory loggerFactory) { _blogsManager = blogsManager; _logger = loggerFactory.CreateLogger<BlogsController>(); } #endregion // GET: api/values [HttpGet] [Route("list")] public async Task<IActionResult> Get() { var blogs = await _blogsManager.GetBlogsAsync(); return new ObjectResult(blogs); } //GET [HttpGet] [Route("single")] public async Task<IActionResult> Get(Guid id) { var blog = await _blogsManager.FindBlogAsync(id); return new ObjectResult(blog); } [HttpGet] [Route("single")] public async Task<IActionResult> Get(string slug) { var blog = await _blogsManager.FindBlogAsync(slug); return new ObjectResult(blog); } [HttpPost] [Route("add")] public async Task<IActionResult> Put(string title, string slug) { var blog = new Blog(); blog.Id = new Guid(); blog.Title = title; blog.Slug = slug; blog.DateCreated = DateTimeOffset.Now; blog.DateModified = DateTimeOffset.Now; blog.DatePublished = DateTimeOffset.Now; await _blogsManager.AddBlogAsync(blog); return new ObjectResult(true); } } }
mit
C#
d7b015d8c9fd3dfd7b92c0fd62f12e5d0bab47fe
Fix possible null error
abjerner/Umbraco-CMS,umbraco/Umbraco-CMS,abryukhov/Umbraco-CMS,marcemarc/Umbraco-CMS,marcemarc/Umbraco-CMS,abjerner/Umbraco-CMS,abryukhov/Umbraco-CMS,arknu/Umbraco-CMS,umbraco/Umbraco-CMS,abjerner/Umbraco-CMS,marcemarc/Umbraco-CMS,abryukhov/Umbraco-CMS,umbraco/Umbraco-CMS,arknu/Umbraco-CMS,arknu/Umbraco-CMS,umbraco/Umbraco-CMS,abjerner/Umbraco-CMS,abryukhov/Umbraco-CMS,arknu/Umbraco-CMS,marcemarc/Umbraco-CMS,marcemarc/Umbraco-CMS
src/Umbraco.Core/Models/RelationItem.cs
src/Umbraco.Core/Models/RelationItem.cs
using System; using System.Runtime.Serialization; using Umbraco.Cms.Core.Models.Entities; namespace Umbraco.Cms.Core.Models { [DataContract(Name = "relationItem", Namespace = "")] public class RelationItem { [DataMember(Name = "id")] public int NodeId { get; set; } [DataMember(Name = "key")] public Guid NodeKey { get; set; } [DataMember(Name = "name")] public string? NodeName { get; set; } [DataMember(Name = "type")] public string? NodeType { get; set; } [DataMember(Name = "udi")] public Udi? NodeUdi => NodeType == Constants.UdiEntityType.Unknown ? null : Udi.Create(NodeType, NodeKey); [DataMember(Name = "icon")] public string? ContentTypeIcon { get; set; } [DataMember(Name = "alias")] public string? ContentTypeAlias { get; set; } [DataMember(Name = "contentTypeName")] public string? ContentTypeName { get; set; } [DataMember(Name = "relationTypeName")] public string? RelationTypeName { get; set; } [DataMember(Name = "relationTypeIsBidirectional")] public bool RelationTypeIsBidirectional { get; set; } [DataMember(Name = "relationTypeIsDependency")] public bool RelationTypeIsDependency { get; set; } } }
using System; using System.Runtime.Serialization; using Umbraco.Cms.Core.Models.Entities; namespace Umbraco.Cms.Core.Models { [DataContract(Name = "relationItem", Namespace = "")] public class RelationItem { [DataMember(Name = "id")] public int NodeId { get; set; } [DataMember(Name = "key")] public Guid NodeKey { get; set; } [DataMember(Name = "name")] public string? NodeName { get; set; } [DataMember(Name = "type")] public string? NodeType { get; set; } [DataMember(Name = "udi")] public Udi NodeUdi => NodeType == Constants.UdiEntityType.Unknown ? null : Udi.Create(NodeType, NodeKey); [DataMember(Name = "icon")] public string? ContentTypeIcon { get; set; } [DataMember(Name = "alias")] public string? ContentTypeAlias { get; set; } [DataMember(Name = "contentTypeName")] public string? ContentTypeName { get; set; } [DataMember(Name = "relationTypeName")] public string? RelationTypeName { get; set; } [DataMember(Name = "relationTypeIsBidirectional")] public bool RelationTypeIsBidirectional { get; set; } [DataMember(Name = "relationTypeIsDependency")] public bool RelationTypeIsDependency { get; set; } } }
mit
C#
911256603bf0ba6d83c05694c6d20ecdbafa041b
Rewrite comment to hopefully be more informative
UselessToucan/osu,ppy/osu,smoogipoo/osu,UselessToucan/osu,peppy/osu,smoogipoo/osu,peppy/osu-new,ppy/osu,smoogipoo/osu,NeoAdonis/osu,ppy/osu,NeoAdonis/osu,UselessToucan/osu,smoogipooo/osu,peppy/osu,peppy/osu,NeoAdonis/osu
osu.Game/Tests/Visual/TestPlayer.cs
osu.Game/Tests/Visual/TestPlayer.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.Collections.Generic; using System.Linq; using osu.Framework.Allocation; using osu.Framework.Bindables; using osu.Game.Rulesets.Judgements; using osu.Game.Rulesets.Mods; using osu.Game.Rulesets.Scoring; using osu.Game.Rulesets.UI; using osu.Game.Screens.Play; namespace osu.Game.Tests.Visual { /// <summary> /// A player that exposes many components that would otherwise not be available, for testing purposes. /// </summary> public class TestPlayer : Player { protected override bool PauseOnFocusLost { get; } public new DrawableRuleset DrawableRuleset => base.DrawableRuleset; /// <summary> /// Mods from *player* (not OsuScreen). /// </summary> public new Bindable<IReadOnlyList<Mod>> Mods => base.Mods; public new HUDOverlay HUDOverlay => base.HUDOverlay; public new GameplayClockContainer GameplayClockContainer => base.GameplayClockContainer; public new ScoreProcessor ScoreProcessor => base.ScoreProcessor; public new HealthProcessor HealthProcessor => base.HealthProcessor; public new bool PauseCooldownActive => base.PauseCooldownActive; public readonly List<JudgementResult> Results = new List<JudgementResult>(); public TestPlayer(bool allowPause = true, bool showResults = true, bool pauseOnFocusLost = false) : base(new PlayerConfiguration { AllowPause = allowPause, ShowResults = showResults }) { PauseOnFocusLost = pauseOnFocusLost; } protected override void PrepareReplay() { // Generally, replay generation is handled by whatever is constructing the player. // This is implemented locally here to ease migration of test scenes that have some executions // running with autoplay and some not, but are not written in a way that lends to instantiating // different `Player` types. // // Eventually we will want to remove this and update all test usages which rely on autoplay to use // a `TestReplayPlayer`. var autoplayMod = Mods.Value.OfType<ModAutoplay>().FirstOrDefault(); if (autoplayMod != null) { DrawableRuleset?.SetReplayScore(autoplayMod.CreateReplayScore(GameplayBeatmap.PlayableBeatmap, Mods.Value)); return; } base.PrepareReplay(); } [BackgroundDependencyLoader] private void load() { ScoreProcessor.NewJudgement += r => Results.Add(r); } } }
// 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.Collections.Generic; using System.Linq; using osu.Framework.Allocation; using osu.Framework.Bindables; using osu.Game.Rulesets.Judgements; using osu.Game.Rulesets.Mods; using osu.Game.Rulesets.Scoring; using osu.Game.Rulesets.UI; using osu.Game.Screens.Play; namespace osu.Game.Tests.Visual { /// <summary> /// A player that exposes many components that would otherwise not be available, for testing purposes. /// </summary> public class TestPlayer : Player { protected override bool PauseOnFocusLost { get; } public new DrawableRuleset DrawableRuleset => base.DrawableRuleset; /// <summary> /// Mods from *player* (not OsuScreen). /// </summary> public new Bindable<IReadOnlyList<Mod>> Mods => base.Mods; public new HUDOverlay HUDOverlay => base.HUDOverlay; public new GameplayClockContainer GameplayClockContainer => base.GameplayClockContainer; public new ScoreProcessor ScoreProcessor => base.ScoreProcessor; public new HealthProcessor HealthProcessor => base.HealthProcessor; public new bool PauseCooldownActive => base.PauseCooldownActive; public readonly List<JudgementResult> Results = new List<JudgementResult>(); public TestPlayer(bool allowPause = true, bool showResults = true, bool pauseOnFocusLost = false) : base(new PlayerConfiguration { AllowPause = allowPause, ShowResults = showResults }) { PauseOnFocusLost = pauseOnFocusLost; } protected override void PrepareReplay() { var autoplayMod = Mods.Value.OfType<ModAutoplay>().FirstOrDefault(); // This logic should really not exist (and tests should be instantiating a ReplayPlayer), but a lot of base work is required to make that happen. if (autoplayMod != null) { DrawableRuleset?.SetReplayScore(autoplayMod.CreateReplayScore(GameplayBeatmap.PlayableBeatmap, Mods.Value)); return; } base.PrepareReplay(); } [BackgroundDependencyLoader] private void load() { ScoreProcessor.NewJudgement += r => Results.Add(r); } } }
mit
C#
f6221cf4780cb69e0c5ee2f6839b0bd070602383
Add UnionWith to Maps.
garbervetsky/analysis-net
Backend/Utils/Map.cs
Backend/Utils/Map.cs
// Copyright (c) Edgardo Zoppi. All Rights Reserved. Licensed under the MIT License. See License.txt in the project root for license information. using System; using System.Collections.Generic; using System.Linq; using System.Text; using Backend.Model; using Model; namespace Backend.Utils { public class Map<TKey, TValue, TCollection> : Dictionary<TKey, TCollection> where TCollection : ICollection<TValue>, new() { public void Add(TKey key) { this.AddKeyAndGetValues(key); } public void Add(TKey key, TValue value) { var collection = this.AddKeyAndGetValues(key); collection.Add(value); } public void AddRange(TKey key, IEnumerable<TValue> values) { var collection = this.AddKeyAndGetValues(key); collection.AddRange(values); } public void UnionWith(Map<TKey, TValue, TCollection> oth) { foreach (var entry in oth) { this.AddRange(entry.Key, entry.Value); } } private TCollection AddKeyAndGetValues(TKey key) { TCollection result; if (this.ContainsKey(key)) { result = this[key]; } else { result = new TCollection(); this.Add(key, result); } return result; } } public class MapSet<TKey, TValue> : Map<TKey, TValue, HashSet<TValue>> { public MapSet(): base() { } public MapSet(MapSet<TKey, TValue> map) { this.AddRange(map); } public bool MapEquals(MapSet<TKey, TValue> other) { Func<ISet<TValue>, ISet<TValue>, bool> setEquals = (a, b) => a.SetEquals(b); return this.DictionaryEquals(other, setEquals); } } public class MapList<TKey, TValue> : Map<TKey, TValue, List<TValue>> { public bool MapEquals(MapList<TKey, TValue> other) { Func<IList<TValue>, IList<TValue>, bool> listEquals = (a, b) => a.SequenceEqual(b); return this.DictionaryEquals(other, listEquals); } } }
// Copyright (c) Edgardo Zoppi. All Rights Reserved. Licensed under the MIT License. See License.txt in the project root for license information. using System; using System.Collections.Generic; using System.Linq; using System.Text; using Backend.Model; using Model; namespace Backend.Utils { public class Map<TKey, TValue, TCollection> : Dictionary<TKey, TCollection> where TCollection : ICollection<TValue>, new() { public void Add(TKey key) { this.AddKeyAndGetValues(key); } public void Add(TKey key, TValue value) { var collection = this.AddKeyAndGetValues(key); collection.Add(value); } public void AddRange(TKey key, IEnumerable<TValue> values) { var collection = this.AddKeyAndGetValues(key); collection.AddRange(values); } private TCollection AddKeyAndGetValues(TKey key) { TCollection result; if (this.ContainsKey(key)) { result = this[key]; } else { result = new TCollection(); this.Add(key, result); } return result; } } public class MapSet<TKey, TValue> : Map<TKey, TValue, HashSet<TValue>> { public MapSet(): base() { } public MapSet(MapSet<TKey, TValue> map) { this.AddRange(map); } public bool MapEquals(MapSet<TKey, TValue> other) { Func<ISet<TValue>, ISet<TValue>, bool> setEquals = (a, b) => a.SetEquals(b); return this.DictionaryEquals(other, setEquals); } } public class MapList<TKey, TValue> : Map<TKey, TValue, List<TValue>> { public bool MapEquals(MapList<TKey, TValue> other) { Func<IList<TValue>, IList<TValue>, bool> listEquals = (a, b) => a.SequenceEqual(b); return this.DictionaryEquals(other, listEquals); } } }
mit
C#
c4e3edee858c058eb7145875960a327d84e22cb8
Fix RSS Feed for Allan Ritchie (#578)
planetxamarin/planetxamarin,planetxamarin/planetxamarin,planetxamarin/planetxamarin,planetxamarin/planetxamarin
src/Firehose.Web/Authors/AllanRitchie.cs
src/Firehose.Web/Authors/AllanRitchie.cs
using System; using System.Collections.Generic; using System.ServiceModel.Syndication; using Firehose.Web.Infrastructure; namespace Firehose.Web.Authors { public class AllanRitchie : IAmAXamarinMVP, IAmAMicrosoftMVP, IFilterMyBlogPosts { public string FirstName => "Allan"; public string LastName => "Ritchie"; public string StateOrRegion => "Toronto, Canada"; public string EmailAddress => "allan.ritchie@gmail.com"; public string ShortBioOrTagLine => ""; public Uri WebSite => new Uri("https://allancritchie.net"); public string TwitterHandle => "allanritchie911"; public string GitHubHandle => "aritchie"; public string GravatarHash => "5f22bd04ca38ed4d0a5225d0825e0726"; public GeoPosition Position => new GeoPosition(43.6425701,-79.3892455); public string FeedLanguageCode => "en"; // my feed is prebuilt by wyam and has a dedicated rss feed for xamarin content - thus all items are "good" public IEnumerable<Uri> FeedUris { get { yield return new Uri("https://allancritchie.net/xamarin.rss"); } } public bool Filter(SyndicationItem item) => true; } }
using System; using System.Collections.Generic; using Firehose.Web.Infrastructure; namespace Firehose.Web.Authors { public class AllanRitchie : IAmAXamarinMVP, IAmAMicrosoftMVP { public string FirstName => "Allan"; public string LastName => "Ritchie"; public string StateOrRegion => "Toronto, Canada"; public string EmailAddress => "allan.ritchie@gmail.com"; public string ShortBioOrTagLine => ""; public Uri WebSite => new Uri("https://allancritchie.net"); public string TwitterHandle => "allanritchie911"; public string GitHubHandle => "aritchie"; public string GravatarHash => "5f22bd04ca38ed4d0a5225d0825e0726"; public IEnumerable<Uri> FeedUris { get { yield return new Uri("https://allancritchie.net/xamarin.rss"); } } public GeoPosition Position => new GeoPosition(43.6425701,-79.3892455); public string FeedLanguageCode => "en"; } }
mit
C#
7c0ebf31ce8b8e9101bd46e6c14b5e7e19859471
Use nameof()
TheEadie/LazyLibrary,TheEadie/LazyStorage,TheEadie/LazyStorage
src/LazyStorage.Tests/RepositoryTests.cs
src/LazyStorage.Tests/RepositoryTests.cs
using System.Collections.Generic; using System.Linq; using LazyStorage.InMemory; using LazyStorage.Interfaces; using LazyStorage.Json; using LazyStorage.Xml; using Xunit; namespace LazyStorage.Tests { public class RepositoryTests { public static IEnumerable<object[]> Repos => new[] { new object[] {new InMemoryRepository<TestObject>()}, new object[] {new XmlRepository<TestObject>("RepositoryTests") }, new object[] {new JsonRepository<TestObject>("RepositoryTests") } }; [Theory, MemberData(nameof(Repos))] public void CanAddToRepo(IRepository<TestObject> repo) { var obj = new TestObject(); repo.Set(obj); var repoObj = repo.Get().Single(); Assert.True(repoObj.ContentEquals(obj), "The object returned does not match the one added"); } [Theory, MemberData(nameof(Repos))] public void CanUpdateRepo(IRepository<TestObject> repo) { var obj = new TestObject(); repo.Set(obj); obj.Name = "Test"; repo.Set(obj); var repoObj = repo.Get().Single(); Assert.True(repoObj.ContentEquals(obj), "The object returned does not match the one added"); } [Theory, MemberData(nameof(Repos))] public void CanDelete(IRepository<TestObject> repo) { var obj = new TestObject(); repo.Set(obj); repo.Delete(obj); Assert.False(repo.Get().Any(), "The object could not be deleted from the repository"); } [Theory, MemberData(nameof(Repos))] public void CanGetByLinq(IRepository<TestObject> repo) { var objOne = new TestObject {Name = "one"}; var objTwo = new TestObject {Name = "two"}; repo.Set(objOne); repo.Set(objTwo); var result = repo.Get(x => x.Name == "one").SingleOrDefault(); Assert.NotNull(result); Assert.True(result.Equals(objOne), "The object could not be retrieved from the repository"); } } }
using System.Collections.Generic; using System.Linq; using LazyStorage.InMemory; using LazyStorage.Interfaces; using LazyStorage.Json; using LazyStorage.Xml; using Xunit; namespace LazyStorage.Tests { public class RepositoryTests { public static IEnumerable<object[]> Repos => new[] { new object[] {new InMemoryRepository<TestObject>()}, new object[] {new XmlRepository<TestObject>("RepositoryTests") }, new object[] {new JsonRepository<TestObject>("RepositoryTests") } }; [Theory, MemberData("Repos")] public void CanAddToRepo(IRepository<TestObject> repo) { var obj = new TestObject(); repo.Set(obj); var repoObj = repo.Get().Single(); Assert.True(repoObj.ContentEquals(obj), "The object returned does not match the one added"); } [Theory, MemberData("Repos")] public void CanUpdateRepo(IRepository<TestObject> repo) { var obj = new TestObject(); repo.Set(obj); obj.Name = "Test"; repo.Set(obj); var repoObj = repo.Get().Single(); Assert.True(repoObj.ContentEquals(obj), "The object returned does not match the one added"); } [Theory, MemberData("Repos")] public void CanDelete(IRepository<TestObject> repo) { var obj = new TestObject(); repo.Set(obj); repo.Delete(obj); Assert.False(repo.Get().Any(), "The object could not be deleted from the repository"); } [Theory, MemberData("Repos")] public void CanGetByLinq(IRepository<TestObject> repo) { var objOne = new TestObject {Name = "one"}; var objTwo = new TestObject {Name = "two"}; repo.Set(objOne); repo.Set(objTwo); var result = repo.Get(x => x.Name == "one").SingleOrDefault(); Assert.NotNull(result); Assert.True(result.Equals(objOne), "The object could not be retrieved from the repository"); } } }
mit
C#
d33ee612e59400706d3cd623ae35a508bf13c810
Revert changes to the test.
dlemstra/Magick.NET,dlemstra/Magick.NET
tests/Magick.NET.Tests/Shared/MagickImageTests/TheAddNoiseMethod.cs
tests/Magick.NET.Tests/Shared/MagickImageTests/TheAddNoiseMethod.cs
// Copyright 2013-2020 Dirk Lemstra <https://github.com/dlemstra/Magick.NET/> // // Licensed under the ImageMagick License (the "License"); you may not use this file except in // compliance with the License. You may obtain a copy of the License at // // https://www.imagemagick.org/script/license.php // // Unless required by applicable law or agreed to in writing, software distributed under the // License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, // either express or implied. See the License for the specific language governing permissions // and limitations under the License. using ImageMagick; using Xunit; namespace Magick.NET.Tests { public partial class MagickImageTests { public class TheAddNoiseMethod { [Fact] public void ShouldCreateDifferentImagesEachRun() { using (var imageA = new MagickImage(MagickColors.Black, 10, 10)) { using (var imageB = new MagickImage(MagickColors.Black, 10, 10)) { imageA.AddNoise(NoiseType.Random); imageB.AddNoise(NoiseType.Random); Assert.NotEqual(0.0, imageA.Compare(imageB, ErrorMetric.RootMeanSquared)); } } } } } }
// Copyright 2013-2020 Dirk Lemstra <https://github.com/dlemstra/Magick.NET/> // // Licensed under the ImageMagick License (the "License"); you may not use this file except in // compliance with the License. You may obtain a copy of the License at // // https://www.imagemagick.org/script/license.php // // Unless required by applicable law or agreed to in writing, software distributed under the // License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, // either express or implied. See the License for the specific language governing permissions // and limitations under the License. using ImageMagick; using Xunit; namespace Magick.NET.Tests { public partial class MagickImageTests { public class TheAddNoiseMethod { [Fact] public void ShouldCreateDifferentImagesEachRun() { using (var imageA = new MagickImage(MagickColors.Black, 100, 100)) { imageA.AddNoise(NoiseType.Random); using (var imageB = new MagickImage(MagickColors.Black, 100, 100)) { imageB.AddNoise(NoiseType.Random); Assert.NotEqual(0.0, imageA.Compare(imageB, ErrorMetric.RootMeanSquared)); } } } } } }
apache-2.0
C#
ba90f52ed1d5fcc6aeb496909ba82bc0bc95711a
Clean up SslInformation, use modern features
arthot/xsp,arthot/xsp,arthot/xsp,murador/xsp,stormleoxia/xsp,arthot/xsp,stormleoxia/xsp,murador/xsp,stormleoxia/xsp,murador/xsp,stormleoxia/xsp,murador/xsp
src/Mono.WebServer.XSP/SslInformation.cs
src/Mono.WebServer.XSP/SslInformation.cs
// // Mono.WebServer.SslInfomation // // Authors: // Gonzalo Paniagua Javier (gonzalo@ximian.com) // Lluis Sanchez Gual (lluis@ximian.com) // // (C) Copyright 2004-2010 Novell, Inc. (http://www.novell.com) // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // using System; using X509Certificate = System.Security.Cryptography.X509Certificates.X509Certificate; namespace Mono.WebServer { [Serializable] [Obsolete ("This class should not be used. It will be removed from Mono.WebServer.dll")] public class SslInformation { public bool AllowClientCertificate { get; set; } public bool RequireClientCertificate { get; set; } public bool ClientCertificateValid { get; set; } public int KeySize { get; set; } public byte[] RawClientCertificate { get; set; } public byte[] RawServerCertificate { get; set; } public int SecretKeySize { get; set; } public X509Certificate GetServerCertificate () { return RawServerCertificate == null ? null : new X509Certificate (RawServerCertificate); } } }
// // Mono.WebServer.SslInfomation // // Authors: // Gonzalo Paniagua Javier (gonzalo@ximian.com) // Lluis Sanchez Gual (lluis@ximian.com) // // (C) Copyright 2004-2010 Novell, Inc. (http://www.novell.com) // // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // using System; using System.Security.Cryptography; using System.Security.Cryptography.X509Certificates; using Mono.Security.Protocol.Tls; using SecurityProtocolType = Mono.Security.Protocol.Tls.SecurityProtocolType; using X509Certificate = System.Security.Cryptography.X509Certificates.X509Certificate; namespace Mono.WebServer { [Serializable] [Obsolete ("This class should not be used. It will be removed from Mono.WebServer.dll")] public class SslInformation { bool client_cert_allowed; bool client_cert_required; bool client_cert_valid; byte[] raw_client_cert; byte[] raw_server_cert; int key_size; int secret_key_size; public bool AllowClientCertificate { get { return client_cert_allowed; } set { client_cert_allowed = value; } } public bool RequireClientCertificate { get { return client_cert_required; } set { client_cert_required = value; } } public bool ClientCertificateValid { get { return client_cert_valid; } set { client_cert_valid = value; } } public int KeySize { get { return key_size; } set { key_size = value; } } public byte[] RawClientCertificate { get { return raw_client_cert; } set { raw_client_cert = value; } } public byte[] RawServerCertificate { get { return raw_server_cert; } set { raw_server_cert = value; } } public int SecretKeySize { get { return secret_key_size; } set { secret_key_size = value; } } public X509Certificate GetServerCertificate () { if (raw_server_cert == null) return null; return new X509Certificate (raw_server_cert); } } }
mit
C#
9faa4b095d1784dbe1901b4b3d98b2d1024e792c
Update Program.cs
Sadikk/BlueSheep
BlueSheep/Program.cs
BlueSheep/Program.cs
using System; using System.Windows.Forms; using BlueSheep.Interface; using Microsoft.Win32; using System.IO; namespace BlueSheep { static class Program { /// <summary> /// Point d'entrée principal de l'application. /// </summary> [STAThread] static void Main(string[] args) { if (args[0] == "ok") { try { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); RegistryKey reg; Registry.CurrentUser.DeleteSubKeyTree("Software\\BlueSheep", false); reg = Registry.CurrentUser.CreateSubKey("Software\\BlueSheep"); reg = Registry.CurrentUser.OpenSubKey("Software\\BlueSheep", true); if (reg.ValueCount > 1) { reg.DeleteValue("Version"); reg.DeleteValue("Minor"); System.Threading.Thread.Sleep(1000); } reg.SetValue("Version", 0.8); reg.SetValue("Minor", 7); Application.Run(new MainForm("0.8.7")); } catch (Exception ex) { MessageBox.Show(ex.Message + ex.StackTrace); } } else { System.Windows.Forms.MessageBox.Show("Veuillez lancer BlueSheep via l'updater !"); Application.Exit(); } } } }
using System; using System.Windows.Forms; using BlueSheep.Interface; using Microsoft.Win32; using System.IO; namespace BlueSheep { static class Program { /// <summary> /// Point d'entrée principal de l'application. /// </summary> [STAThread] static void Main(string[] args) { args = new string[] {"ok"}; if (args[0] == "ok") { try { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); RegistryKey reg; Registry.CurrentUser.DeleteSubKeyTree("Software\\BlueSheep", false); reg = Registry.CurrentUser.CreateSubKey("Software\\BlueSheep"); reg = Registry.CurrentUser.OpenSubKey("Software\\BlueSheep", true); if (reg.ValueCount > 1) { reg.DeleteValue("Version"); reg.DeleteValue("Minor"); System.Threading.Thread.Sleep(1000); } reg.SetValue("Version", 0.8); reg.SetValue("Minor", 7); Application.Run(new MainForm("0.8.7")); } catch (Exception ex) { MessageBox.Show(ex.Message + ex.StackTrace); } } else { System.Windows.Forms.MessageBox.Show("Veuillez lancer BlueSheep via l'updater !"); Application.Exit(); } } } }
mit
C#
35fc0a2e8a16e1efe51b80fc509da8d7eeb2b797
Fix SolutionAreaEffectSystem exception when the collection is modified.
space-wizards/space-station-14,space-wizards/space-station-14,space-wizards/space-station-14,space-wizards/space-station-14,space-wizards/space-station-14,space-wizards/space-station-14
Content.Server/GameObjects/EntitySystems/SolutionAreaEffectSystem.cs
Content.Server/GameObjects/EntitySystems/SolutionAreaEffectSystem.cs
#nullable enable using System.Linq; using Content.Server.GameObjects.Components.Chemistry; using JetBrains.Annotations; using Robust.Shared.GameObjects; namespace Content.Server.GameObjects.EntitySystems { [UsedImplicitly] public class SolutionAreaEffectSystem : EntitySystem { public override void Update(float frameTime) { foreach (var inception in ComponentManager.EntityQuery<SolutionAreaEffectInceptionComponent>().ToArray()) { inception.InceptionUpdate(frameTime); } } } }
#nullable enable using Content.Server.GameObjects.Components.Chemistry; using JetBrains.Annotations; using Robust.Shared.GameObjects; namespace Content.Server.GameObjects.EntitySystems { [UsedImplicitly] public class SolutionAreaEffectSystem : EntitySystem { public override void Update(float frameTime) { foreach (var inception in ComponentManager.EntityQuery<SolutionAreaEffectInceptionComponent>()) { inception.InceptionUpdate(frameTime); } } } }
mit
C#
584b31d5c8874d96bf8c538b859b254a6d37e21b
Add valid cron expression to test
InEngine-NET/InEngine.NET,InEngine-NET/InEngine.NET,InEngine-NET/InEngine.NET
IntegrationEngine.Tests/Api/Controllers/CronTriggerControllerTest.cs
IntegrationEngine.Tests/Api/Controllers/CronTriggerControllerTest.cs
using IntegrationEngine.Api.Controllers; using IntegrationEngine.Core.Storage; using IntegrationEngine.Model; using IntegrationEngine.Scheduler; using Moq; using NUnit.Framework; namespace IntegrationEngine.Tests.Api.Controllers { public class CronTriggerControllerTest { [Test] public void ShouldScheduleJobWhenCronTriggerIsCreatedWithValidCronExpression() { var subject = new CronTriggerController(); var cronExpression = "0 6 * * 1-5 ?"; var jobType = "MyProject.MyIntegrationJob"; var expected = new CronTrigger() { JobType = jobType, CronExpressionString = cronExpression }; var engineScheduler = new Mock<IEngineScheduler>(); engineScheduler.Setup(x => x.ScheduleJobWithCronTrigger(expected)); subject.EngineScheduler = engineScheduler.Object; var esRepository = new Mock<ESRepository<CronTrigger>>(); esRepository.Setup(x => x.Insert(expected)).Returns(expected); subject.Repository = esRepository.Object; subject.PostCronTrigger(expected); engineScheduler.Verify(x => x .ScheduleJobWithCronTrigger(It.Is<CronTrigger>(y => y.JobType == jobType && y.CronExpressionString == cronExpression)), Times.Once); } } }
using IntegrationEngine.Api.Controllers; using IntegrationEngine.Core.Storage; using IntegrationEngine.Model; using IntegrationEngine.Scheduler; using Moq; using NUnit.Framework; namespace IntegrationEngine.Tests.Api.Controllers { public class CronTriggerControllerTest { [Test] public void ShouldScheduleJobWhenCronTriggerIsCreated() { var subject = new CronTriggerController(); var cronExpression = "0 6 * * 1-5"; var jobType = "MyProject.MyIntegrationJob"; var expected = new CronTrigger() { JobType = jobType, CronExpressionString = cronExpression }; var engineScheduler = new Mock<IEngineScheduler>(); engineScheduler.Setup(x => x.ScheduleJobWithCronTrigger(expected)); subject.EngineScheduler = engineScheduler.Object; var esRepository = new Mock<ESRepository<CronTrigger>>(); esRepository.Setup(x => x.Insert(expected)).Returns(expected); subject.Repository = esRepository.Object; subject.PostCronTrigger(expected); engineScheduler.Verify(x => x .ScheduleJobWithCronTrigger(It.Is<CronTrigger>(y => y.JobType == jobType && y.CronExpressionString == cronExpression)), Times.Once); } } }
mit
C#
a7a8f79a255bc18f8906d510e7476fb5324375a3
fix for when paths contains globs witch then can sometimes
aL3891/ServiceFabricSdkContrib,aL3891/ServiceFabricSdkContrib
ServiceFabricSdkContrib.MsBuild/CleanServiceFabricApplicationTask.cs
ServiceFabricSdkContrib.MsBuild/CleanServiceFabricApplicationTask.cs
using System; using Microsoft.Build.Evaluation; using Microsoft.Build.Framework; using ServiceFabricSdkContrib.Common; using System.Collections.Generic; using System.IO; using System.Linq; using System.Runtime.InteropServices; using System.Threading; namespace ServiceFabricSdkContrib.MsBuild { public class CleanServiceFabricApplicationTask : Microsoft.Build.Utilities.Task { public string PackageLocation { get; set; } public string ProjectPath { get; set; } public ITaskItem[] CleanItems { get; set; } [Output] public ITaskItem[] SymlinkItems { get; set; } private HashSet<string> symPaths = new HashSet<string>(); public override bool Execute() { BasePath = Path.GetDirectoryName(ProjectPath); SymlinkItems = CleanItems.Where(c => IsUnderSymbolicLink(c.ItemSpec)).ToArray(); return true; } public string BasePath { get; set; } public bool IsUnderSymbolicLink(string path) { if (path.Contains("*")) return false; var fullPath = Path.Combine(BasePath, path); if (symPaths.Any(s => path.StartsWith(fullPath))) return true; var symPath = Symlink.IsUnderSymbolicLink(path, BasePath); if (symPath != null) { symPaths.Add(symPath); return true; } else return false; } } }
using System; using Microsoft.Build.Evaluation; using Microsoft.Build.Framework; using ServiceFabricSdkContrib.Common; using System.Collections.Generic; using System.IO; using System.Linq; using System.Runtime.InteropServices; using System.Threading; namespace ServiceFabricSdkContrib.MsBuild { public class CleanServiceFabricApplicationTask : Microsoft.Build.Utilities.Task { public string PackageLocation { get; set; } public string ProjectPath { get; set; } public ITaskItem[] CleanItems { get; set; } [Output] public ITaskItem[] SymlinkItems { get; set; } private HashSet<string> symPaths = new HashSet<string>(); public override bool Execute() { BasePath = Path.GetDirectoryName(ProjectPath); SymlinkItems = CleanItems.Where(c => IsUnderSymbolicLink(c.ItemSpec)).ToArray(); return true; } public string BasePath { get; set; } public bool IsUnderSymbolicLink(string path) { var fullPath = Path.Combine(BasePath, path); if (symPaths.Any(s => path.StartsWith(fullPath))) return true; var symPath = Symlink.IsUnderSymbolicLink(path, BasePath); if (symPath != null) { symPaths.Add(symPath); return true; } else return false; } } }
mit
C#
476542032fe13e31db36a0a15a75972069b45992
Add error logging for ErrorDescriptorToBorderColorConverter.
nopara73/HiddenWallet,nopara73/HiddenWallet,nopara73/HiddenWallet,nopara73/HiddenWallet
WalletWasabi.Gui/Converters/ErrorDescriptorToBorderColorConverter.cs
WalletWasabi.Gui/Converters/ErrorDescriptorToBorderColorConverter.cs
using Avalonia.Data.Converters; using Avalonia.Media; using System; using System.Collections.Generic; using System.Globalization; using System.Linq; using WalletWasabi.Models; using WalletWasabi.Logging; namespace WalletWasabi.Gui.Converters { public class ErrorDescriptorToBorderColorConverter : IValueConverter { public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { if (value is IEnumerable<object> rawObj) { var descriptors = new ErrorDescriptors(); foreach (var obj in rawObj) { switch (obj) { case ErrorDescriptor ed: descriptors.Add(ed); break; case Exception ex: Logger.LogError(ex); break; } } return GetColorFromDescriptors(descriptors); } return null; } private SolidColorBrush GetColorFromDescriptors(ErrorDescriptors descriptors) { if (!descriptors.HasErrors) { return null; } var highPrioError = descriptors.OrderByDescending(p => p.Severity).FirstOrDefault(); if (ErrorSeverityColorConverter.ErrorSeverityColors.TryGetValue(highPrioError.Severity, out var brush)) { return brush; } else { return null; } } public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) { return null; } } }
using Avalonia.Data.Converters; using Avalonia.Media; using System; using System.Collections.Generic; using System.Globalization; using System.Linq; using WalletWasabi.Models; namespace WalletWasabi.Gui.Converters { public class ErrorDescriptorToBorderColorConverter : IValueConverter { public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { if (value is IEnumerable<object> rawObj) { var descriptors = new ErrorDescriptors(); foreach (var obj in rawObj) { switch (obj) { case ErrorDescriptor ed: descriptors.Add(ed); break; case Exception ex: break; } } return GetColorFromDescriptors(descriptors); } return null; } private SolidColorBrush GetColorFromDescriptors(ErrorDescriptors descriptors) { if (!descriptors.HasErrors) { return null; } var highPrioError = descriptors.OrderByDescending(p => p.Severity).FirstOrDefault(); if (ErrorSeverityColorConverter.ErrorSeverityColors.TryGetValue(highPrioError.Severity, out var brush)) { return brush; } else { return null; } } public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) { return null; } } }
mit
C#
928c070bda38e4a8b9c02d60fc2383a454bce4e4
Mark itemID for traitor uplink as an entityprototype (#5898)
space-wizards/space-station-14,space-wizards/space-station-14,space-wizards/space-station-14,space-wizards/space-station-14,space-wizards/space-station-14,space-wizards/space-station-14
Content.Shared/PDA/UplinkStoreListingPrototype.cs
Content.Shared/PDA/UplinkStoreListingPrototype.cs
using Robust.Shared.Prototypes; using Robust.Shared.Serialization.Manager.Attributes; using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype; using Robust.Shared.Utility; using Robust.Shared.ViewVariables; namespace Content.Shared.PDA { [Prototype("uplinkListing")] public class UplinkStoreListingPrototype : IPrototype { [ViewVariables] [DataField("id", required: true)] public string ID { get; } = default!; [DataField("itemId", customTypeSerializer:typeof(PrototypeIdSerializer<EntityPrototype>))] public string ItemId { get; } = string.Empty; [DataField("price")] public int Price { get; } = 5; [DataField("category")] public UplinkCategory Category { get; } = UplinkCategory.Utility; [DataField("description")] public string Description { get; } = string.Empty; [DataField("listingName")] public string ListingName { get; } = string.Empty; [DataField("icon")] public SpriteSpecifier? Icon { get; } = null; } }
using Robust.Shared.Prototypes; using Robust.Shared.Serialization.Manager.Attributes; using Robust.Shared.Utility; using Robust.Shared.ViewVariables; namespace Content.Shared.PDA { [Prototype("uplinkListing")] public class UplinkStoreListingPrototype : IPrototype { [ViewVariables] [DataField("id", required: true)] public string ID { get; } = default!; [DataField("itemId")] public string ItemId { get; } = string.Empty; [DataField("price")] public int Price { get; } = 5; [DataField("category")] public UplinkCategory Category { get; } = UplinkCategory.Utility; [DataField("description")] public string Description { get; } = string.Empty; [DataField("listingName")] public string ListingName { get; } = string.Empty; [DataField("icon")] public SpriteSpecifier? Icon { get; } = null; } }
mit
C#
fa2bf9f9d9baa4d77e32d109226dec75e8f7ec63
Implement ValuesGremlinStep.Resolve for mixed propertyKey and id-steps.
ExRam/ExRam.Gremlinq
ExRam.Gremlinq/Gremlin/Steps/ValuesGremlinStep.cs
ExRam.Gremlinq/Gremlin/Steps/ValuesGremlinStep.cs
using System; using System.Collections.Generic; using System.Collections.Immutable; using System.Linq; using System.Linq.Expressions; namespace ExRam.Gremlinq { public sealed class ValuesGremlinStep<TSource, TTarget> : NonTerminalGremlinStep { private readonly Expression<Func<TSource, TTarget>>[] _projections; public ValuesGremlinStep(Expression<Func<TSource, TTarget>>[] projections) { this._projections = projections; } public override IEnumerable<TerminalGremlinStep> Resolve(IGraphModel model) { var keys = this._projections .Select(projection => { if (projection.Body is MemberExpression memberExpression) return model.GetIdentifier(memberExpression.Member.Name); throw new NotSupportedException(); }) .ToArray(); var numberOfIdSteps = keys .OfType<T>() .Count(x => x == T.Id); var propertyKeys = keys .OfType<string>() .Cast<object>() .ToArray(); if (numberOfIdSteps > 1 || numberOfIdSteps > 0 && propertyKeys.Length > 0) { yield return new MethodGremlinStep("union", GremlinQuery.Anonymous.AddStep(new MethodGremlinStep( "values", propertyKeys .ToImmutableList())), GremlinQuery.Anonymous.Id()); } else if (numberOfIdSteps > 0) yield return new MethodGremlinStep("id"); else { yield return new MethodGremlinStep( "values", propertyKeys .ToImmutableList()); } } } }
using System; using System.Collections.Generic; using System.Collections.Immutable; using System.Linq; using System.Linq.Expressions; namespace ExRam.Gremlinq { public sealed class ValuesGremlinStep<TSource, TTarget> : NonTerminalGremlinStep { private readonly Expression<Func<TSource, TTarget>>[] _projections; public ValuesGremlinStep(Expression<Func<TSource, TTarget>>[] projections) { this._projections = projections; } public override IEnumerable<TerminalGremlinStep> Resolve(IGraphModel model) { var keys = this._projections .Select(projection => { if (projection.Body is MemberExpression memberExpression) return model.GetIdentifier(memberExpression.Member.Name); throw new NotSupportedException(); }) .ToArray(); var numberOfIdSteps = keys .OfType<T>() .Count(x => x == T.Id); var propertyKeys = keys .OfType<string>() .Cast<object>() .ToArray(); if (numberOfIdSteps > 1 || numberOfIdSteps > 0 && propertyKeys.Length > 0) throw new NotSupportedException(); if (numberOfIdSteps > 0) yield return new MethodGremlinStep("id"); else { yield return new MethodGremlinStep( "values", propertyKeys .ToImmutableList()); } } } }
mit
C#
a6d664d629f516737ddc1024a61ff9cdfaed035b
Add some comments for the host process
phaetto/serviceable-objects
Examples/TestHttpCompositionConsoleApp/Program.cs
Examples/TestHttpCompositionConsoleApp/Program.cs
 namespace TestHttpCompositionConsoleApp { using Serviceable.Objects.Remote.Composition.Host; using Serviceable.Objects.Remote.Composition.Host.Commands; class Program { static void Main(string[] args) { /* * Principles: * * Testable * Composable * Configurable * Instrumentable * Scalable * Updatable TODO * */ // Sample host should minimal like that. // Override templates or data from args before reaching the host execution new ApplicationHost(args).Execute(new RunAndBlock()); } } }
 namespace TestHttpCompositionConsoleApp { using Serviceable.Objects.Remote.Composition.Host; using Serviceable.Objects.Remote.Composition.Host.Commands; class Program { static void Main(string[] args) { /* * Principles: * * Testable * Composable * Configurable * Instrumentable * Scalable * Updatable TODO * */ new ApplicationHost(args).Execute(new RunAndBlock()); } } }
mit
C#
4568d8da4f0aa91044dc4eafc3a67f863afea2d5
Add group by test
SimpleStack/simplestack.orm,SimpleStack/simplestack.orm
test/SimpleStack.Orm.Tests/SelectCountTests.cs
test/SimpleStack.Orm.Tests/SelectCountTests.cs
using System; using System.Data; using System.Linq; using Dapper; using SimpleStack.Orm.Attributes; using NUnit.Framework; using SimpleStack.Orm.Expressions; using SimpleStack.Orm.Expressions.Statements.Typed; namespace SimpleStack.Orm.Tests { [TestFixture] public partial class ExpressionTests { [Test] public void Can_select_count_without_parameters() { CreateModelWithFieldsOfDifferentTypes(10); using (var conn = OpenDbConnection()) { Assert.AreEqual(10, conn.Count<ModelWithFieldsOfDifferentTypes>()); } } [Test] public void Can_select_count_with_where_Statement() { CreateModelWithFieldsOfDifferentTypes(10); using (var conn = OpenDbConnection()) { var v = new TypedSelectStatement<ModelWithFieldsOfDifferentTypes>(_dialectProvider); v.Where(x => x.Bool); var select = _dialectProvider.ToSelectStatement(v.Statement,CommandFlags.None); Assert.AreEqual(5, conn.Count<ModelWithFieldsOfDifferentTypes>(x => { x.Where(q => q.Bool); })); } } [Test] public void Can_select_count_with_distinct() { OpenDbConnection().Insert(new Person { Id = 1, Age = 5 }); OpenDbConnection().Insert(new Person { Id = 2, Age = 10 }); OpenDbConnection().Insert(new Person { Id = 3, Age = 10 }); OpenDbConnection().Insert(new Person { Id = 4, Age = 20 }); OpenDbConnection().Insert(new Person { Id = 5, Age = 20 }); OpenDbConnection().Insert(new Person { Id = 6, Age = 25 }); using (var conn = OpenDbConnection()) { Assert.AreEqual(4, conn.Count<Person>(x => { x.Distinct(); x.Select(y => y.Age); })); // SELECT COUNT (DISTINCT Age) FROM Person } } [Test] public void Can_select_count_with_group_by() { OpenDbConnection().Insert(new Person { Id = 1, Age = 5 }); OpenDbConnection().Insert(new Person { Id = 2, Age = 10 }); OpenDbConnection().Insert(new Person { Id = 3, Age = 10 }); OpenDbConnection().Insert(new Person { Id = 4, Age = 20 }); OpenDbConnection().Insert(new Person { Id = 5, Age = 20 }); OpenDbConnection().Insert(new Person { Id = 6, Age = 25 }); using (var conn = OpenDbConnection()) { var rr = conn.Select<Person>(x => { //x.Select(y => new {Age = y.Age, Id = Sql.Max(y.Id)}); x.Select(y => new Person{Age = y.Age, Id = Sql.Max(y.Id)}); //x.SelectAlso(y => Sql.Max(y.Id)); x.GroupBy(y => y.Age); }); Assert.AreEqual(4, conn.Count<Person>(x => { x.Distinct(); x.Select(y => y.Age); })); // SELECT COUNT (DISTINCT Age) FROM Person } } } }
using System; using System.Data; using System.Linq; using Dapper; using SimpleStack.Orm.Attributes; using NUnit.Framework; using SimpleStack.Orm.Expressions; using SimpleStack.Orm.Expressions.Statements.Typed; namespace SimpleStack.Orm.Tests { [TestFixture] public partial class ExpressionTests { [Test] public void Can_select_count_without_parameters() { CreateModelWithFieldsOfDifferentTypes(10); using (var conn = OpenDbConnection()) { Assert.AreEqual(10, conn.Count<ModelWithFieldsOfDifferentTypes>()); } } [Test] public void Can_select_count_with_where_Statement() { CreateModelWithFieldsOfDifferentTypes(10); using (var conn = OpenDbConnection()) { var v = new TypedSelectStatement<ModelWithFieldsOfDifferentTypes>(_dialectProvider); v.Where(x => x.Bool); var select = _dialectProvider.ToSelectStatement(v.Statement,CommandFlags.None); Assert.AreEqual(5, conn.Count<ModelWithFieldsOfDifferentTypes>(x => { x.Where(q => q.Bool); })); } } [Test] public void Can_select_count_with_distinct() { OpenDbConnection().Insert(new Person { Id = 1, Age = 5 }); OpenDbConnection().Insert(new Person { Id = 2, Age = 10 }); OpenDbConnection().Insert(new Person { Id = 3, Age = 10 }); OpenDbConnection().Insert(new Person { Id = 4, Age = 20 }); OpenDbConnection().Insert(new Person { Id = 5, Age = 20 }); OpenDbConnection().Insert(new Person { Id = 6, Age = 25 }); using (var conn = OpenDbConnection()) { Assert.AreEqual(4, conn.Count<Person>(x => { x.Distinct(); x.Select(y => y.Age); })); // SELECT COUNT (DISTINCT Age) FROM Person } } } }
bsd-3-clause
C#
ca3584a7ddf4a20b08240123492bad4049ec327e
revert to join() again for now
collinbarrett/FilterLists,collinbarrett/FilterLists,collinbarrett/FilterLists,collinbarrett/FilterLists,collinbarrett/FilterLists
src/FilterLists.Services/Snapshot/SnapshotBatch.cs
src/FilterLists.Services/Snapshot/SnapshotBatch.cs
using System.Collections.Generic; using System.Linq; using FilterLists.Data; using FilterLists.Data.Entities; using FilterLists.Data.Entities.Junctions; using FilterLists.Services.Extensions; namespace FilterLists.Services.Snapshot { public class SnapshotBatch { private readonly FilterListsDbContext dbContext; private readonly IEnumerable<string> lines; private readonly Data.Entities.Snapshot snapEntity; public SnapshotBatch(FilterListsDbContext dbContext, IEnumerable<string> lines, Data.Entities.Snapshot snapEntity) { this.dbContext = dbContext; this.lines = lines; this.snapEntity = snapEntity; } public void Save() { var existingRules = GetExistingRules(); var newRules = CreateNewRules(existingRules); dbContext.Rules.AddRange(newRules); var rules = existingRules.Concat(newRules); AddSnapshotRules(rules); dbContext.SaveChanges(); } private IQueryable<Rule> GetExistingRules() => dbContext.Rules.Join(lines, rule => rule.Raw, line => line, (rule, line) => rule); private List<Rule> CreateNewRules(IQueryable<Rule> existingRules) => lines.Except(existingRules.Select(r => r.Raw)).Select(r => new Rule {Raw = r}).ToList(); private void AddSnapshotRules(IQueryable<Rule> rules) => snapEntity.AddedSnapshotRules.AddRange(rules.Select(r => new SnapshotRule {Rule = r})); } }
using System.Collections.Generic; using System.Linq; using FilterLists.Data; using FilterLists.Data.Entities; using FilterLists.Data.Entities.Junctions; using FilterLists.Services.Extensions; namespace FilterLists.Services.Snapshot { public class SnapshotBatch { private readonly FilterListsDbContext dbContext; private readonly IEnumerable<string> lines; private readonly Data.Entities.Snapshot snapEntity; public SnapshotBatch(FilterListsDbContext dbContext, IEnumerable<string> lines, Data.Entities.Snapshot snapEntity) { this.dbContext = dbContext; this.lines = lines; this.snapEntity = snapEntity; } public void Save() { var existingRules = GetExistingRules(); var newRules = CreateNewRules(existingRules); dbContext.Rules.AddRange(newRules); var rules = existingRules.Concat(newRules); AddSnapshotRules(rules); dbContext.SaveChanges(); } private IQueryable<Rule> GetExistingRules() => dbContext.Rules.Where(r => lines.Contains(r.Raw)); private List<Rule> CreateNewRules(IQueryable<Rule> existingRules) => lines.Except(existingRules.Select(r => r.Raw)).Select(r => new Rule {Raw = r}).ToList(); private void AddSnapshotRules(IQueryable<Rule> rules) => snapEntity.AddedSnapshotRules.AddRange(rules.Select(r => new SnapshotRule {Rule = r})); } }
mit
C#
cd57985ba43f7d2185c2150ce49393747aefb148
Fix caching based on ISignals
jagraz/Orchard,fassetar/Orchard,xiaobudian/Orchard,rtpHarry/Orchard,austinsc/Orchard,huoxudong125/Orchard,jersiovic/Orchard,johnnyqian/Orchard,dburriss/Orchard,Inner89/Orchard,andyshao/Orchard,enspiral-dev-academy/Orchard,gcsuk/Orchard,vairam-svs/Orchard,sfmskywalker/Orchard-Off-The-Grid-Sample-Code,angelapper/Orchard,mgrowan/Orchard,OrchardCMS/Orchard,salarvand/Portal,jersiovic/Orchard,tobydodds/folklife,openbizgit/Orchard,abhishekluv/Orchard,armanforghani/Orchard,ehe888/Orchard,m2cms/Orchard,jagraz/Orchard,ehe888/Orchard,armanforghani/Orchard,vard0/orchard.tan,Ermesx/Orchard,xiaobudian/Orchard,johnnyqian/Orchard,Inner89/Orchard,Cphusion/Orchard,cryogen/orchard,sfmskywalker/Orchard,phillipsj/Orchard,IDeliverable/Orchard,bigfont/orchard-continuous-integration-demo,brownjordaninternational/OrchardCMS,sfmskywalker/Orchard,TalaveraTechnologySolutions/Orchard,dmitry-urenev/extended-orchard-cms-v10.1,caoxk/orchard,Sylapse/Orchard.HttpAuthSample,sfmskywalker/Orchard-Off-The-Grid-Sample-Code,TalaveraTechnologySolutions/Orchard,jagraz/Orchard,kgacova/Orchard,IDeliverable/Orchard,ericschultz/outercurve-orchard,abhishekluv/Orchard,Sylapse/Orchard.HttpAuthSample,princeppy/JPYSites-Orchard-Azure-Live-SourceCode,TalaveraTechnologySolutions/Orchard,AndreVolksdorf/Orchard,luchaoshuai/Orchard,MpDzik/Orchard,RoyalVeterinaryCollege/Orchard,Morgma/valleyviewknolls,spraiin/Orchard,vairam-svs/Orchard,salarvand/orchard,MpDzik/Orchard,armanforghani/Orchard,TalaveraTechnologySolutions/Orchard,arminkarimi/Orchard,spraiin/Orchard,MetSystem/Orchard,qt1/orchard4ibn,angelapper/Orchard,emretiryaki/Orchard,Anton-Am/Orchard,kgacova/Orchard,huoxudong125/Orchard,Serlead/Orchard,arminkarimi/Orchard,m2cms/Orchard,asabbott/chicagodevnet-website,yonglehou/Orchard,AndreVolksdorf/Orchard,AEdmunds/beautiful-springtime,bigfont/orchard-continuous-integration-demo,dcinzona/Orchard-Harvest-Website,openbizgit/Orchard,neTp9c/Orchard,sebastienros/msc,sebastienros/msc,johnnyqian/Orchard,jerryshi2007/Orchard,TaiAivaras/Orchard,omidnasri/Orchard,IDeliverable/Orchard,sfmskywalker/Orchard,Sylapse/Orchard.HttpAuthSample,andyshao/Orchard,LaserSrl/Orchard,omidnasri/Orchard,NIKASoftwareDevs/Orchard,luchaoshuai/Orchard,neTp9c/Orchard,sfmskywalker/Orchard,SouleDesigns/SouleDesigns.Orchard,escofieldnaxos/Orchard,dcinzona/Orchard,m2cms/Orchard,phillipsj/Orchard,MpDzik/Orchard,planetClaire/Orchard-LETS,qt1/orchard4ibn,RoyalVeterinaryCollege/Orchard,jtkech/Orchard,hhland/Orchard,smartnet-developers/Orchard,Lombiq/Orchard,Serlead/Orchard,hhland/Orchard,aaronamm/Orchard,yersans/Orchard,vard0/orchard.tan,RoyalVeterinaryCollege/Orchard,bigfont/orchard-cms-modules-and-themes,sebastienros/msc,Fogolan/OrchardForWork,LaserSrl/Orchard,aaronamm/Orchard,arminkarimi/Orchard,Sylapse/Orchard.HttpAuthSample,sfmskywalker/Orchard-Off-The-Grid-Sample-Code,grapto/Orchard.CloudBust,qt1/orchard4ibn,jerryshi2007/Orchard,TalaveraTechnologySolutions/Orchard,stormleoxia/Orchard,OrchardCMS/Orchard-Harvest-Website,qt1/Orchard,oxwanawxo/Orchard,armanforghani/Orchard,rtpHarry/Orchard,spraiin/Orchard,stormleoxia/Orchard,Dolphinsimon/Orchard,salarvand/Portal,fortunearterial/Orchard,fassetar/Orchard,kouweizhong/Orchard,Cphusion/Orchard,OrchardCMS/Orchard-Harvest-Website,smartnet-developers/Orchard,sebastienros/msc,marcoaoteixeira/Orchard,tobydodds/folklife,jchenga/Orchard,vard0/orchard.tan,patricmutwiri/Orchard,escofieldnaxos/Orchard,Cphusion/Orchard,ericschultz/outercurve-orchard,OrchardCMS/Orchard-Harvest-Website,KeithRaven/Orchard,geertdoornbos/Orchard,qt1/orchard4ibn,patricmutwiri/Orchard,mvarblow/Orchard,fortunearterial/Orchard,SouleDesigns/SouleDesigns.Orchard,qt1/Orchard,austinsc/Orchard,Cphusion/Orchard,NIKASoftwareDevs/Orchard,vard0/orchard.tan,OrchardCMS/Orchard-Harvest-Website,ehe888/Orchard,marcoaoteixeira/Orchard,alejandroaldana/Orchard,AndreVolksdorf/Orchard,dmitry-urenev/extended-orchard-cms-v10.1,hbulzy/Orchard,Lombiq/Orchard,omidnasri/Orchard,sebastienros/msc,andyshao/Orchard,sfmskywalker/Orchard-Off-The-Grid-Sample-Code,planetClaire/Orchard-LETS,hbulzy/Orchard,jagraz/Orchard,IDeliverable/Orchard,jersiovic/Orchard,bedegaming-aleksej/Orchard,marcoaoteixeira/Orchard,geertdoornbos/Orchard,bedegaming-aleksej/Orchard,KeithRaven/Orchard,bedegaming-aleksej/Orchard,cooclsee/Orchard,hannan-azam/Orchard,DonnotRain/Orchard,alejandroaldana/Orchard,harmony7/Orchard,salarvand/orchard,KeithRaven/Orchard,AdvantageCS/Orchard,SzymonSel/Orchard,brownjordaninternational/OrchardCMS,DonnotRain/Orchard,bigfont/orchard-cms-modules-and-themes,alejandroaldana/Orchard,princeppy/JPYSites-Orchard-Azure-Live-SourceCode,bigfont/orchard-cms-modules-and-themes,dcinzona/Orchard,sfmskywalker/Orchard-Off-The-Grid-Sample-Code,AdvantageCS/Orchard,aaronamm/Orchard,mgrowan/Orchard,TaiAivaras/Orchard,gcsuk/Orchard,harmony7/Orchard,Fogolan/OrchardForWork,jerryshi2007/Orchard,mvarblow/Orchard,jaraco/orchard,m2cms/Orchard,planetClaire/Orchard-LETS,xkproject/Orchard,enspiral-dev-academy/Orchard,MpDzik/Orchard,fortunearterial/Orchard,qt1/orchard4ibn,sfmskywalker/Orchard,xiaobudian/Orchard,kouweizhong/Orchard,jimasp/Orchard,dcinzona/Orchard-Harvest-Website,tobydodds/folklife,gcsuk/Orchard,NIKASoftwareDevs/Orchard,salarvand/orchard,kouweizhong/Orchard,RoyalVeterinaryCollege/Orchard,hhland/Orchard,Dolphinsimon/Orchard,jtkech/Orchard,li0803/Orchard,johnnyqian/Orchard,Fogolan/OrchardForWork,enspiral-dev-academy/Orchard,yonglehou/Orchard,OrchardCMS/Orchard,mgrowan/Orchard,SzymonSel/Orchard,dcinzona/Orchard-Harvest-Website,salarvand/Portal,smartnet-developers/Orchard,stormleoxia/Orchard,emretiryaki/Orchard,openbizgit/Orchard,LaserSrl/Orchard,princeppy/JPYSites-Orchard-Azure-Live-SourceCode,dcinzona/Orchard,Morgma/valleyviewknolls,omidnasri/Orchard,SzymonSel/Orchard,SeyDutch/Airbrush,dcinzona/Orchard-Harvest-Website,hannan-azam/Orchard,xkproject/Orchard,fortunearterial/Orchard,jimasp/Orchard,AndreVolksdorf/Orchard,tobydodds/folklife,hbulzy/Orchard,LaserSrl/Orchard,spraiin/Orchard,openbizgit/Orchard,dcinzona/Orchard,DonnotRain/Orchard,vard0/orchard.tan,yonglehou/Orchard,enspiral-dev-academy/Orchard,planetClaire/Orchard-LETS,omidnasri/Orchard,emretiryaki/Orchard,caoxk/orchard,tobydodds/folklife,Fogolan/OrchardForWork,SouleDesigns/SouleDesigns.Orchard,jagraz/Orchard,AdvantageCS/Orchard,dburriss/Orchard,infofromca/Orchard,Lombiq/Orchard,hhland/Orchard,mvarblow/Orchard,geertdoornbos/Orchard,mvarblow/Orchard,dozoft/Orchard,geertdoornbos/Orchard,vairam-svs/Orchard,salarvand/Portal,ehe888/Orchard,cryogen/orchard,JRKelso/Orchard,Praggie/Orchard,aaronamm/Orchard,yersans/Orchard,emretiryaki/Orchard,jaraco/orchard,Inner89/Orchard,IDeliverable/Orchard,luchaoshuai/Orchard,KeithRaven/Orchard,Codinlab/Orchard,infofromca/Orchard,MetSystem/Orchard,Praggie/Orchard,ehe888/Orchard,angelapper/Orchard,dmitry-urenev/extended-orchard-cms-v10.1,sfmskywalker/Orchard,qt1/Orchard,abhishekluv/Orchard,hbulzy/Orchard,kouweizhong/Orchard,MetSystem/Orchard,hannan-azam/Orchard,TaiAivaras/Orchard,hannan-azam/Orchard,JRKelso/Orchard,dozoft/Orchard,caoxk/orchard,marcoaoteixeira/Orchard,xiaobudian/Orchard,arminkarimi/Orchard,huoxudong125/Orchard,brownjordaninternational/OrchardCMS,jchenga/Orchard,Ermesx/Orchard,dmitry-urenev/extended-orchard-cms-v10.1,jimasp/Orchard,qt1/orchard4ibn,Serlead/Orchard,bigfont/orchard-continuous-integration-demo,luchaoshuai/Orchard,dcinzona/Orchard-Harvest-Website,omidnasri/Orchard,AdvantageCS/Orchard,oxwanawxo/Orchard,enspiral-dev-academy/Orchard,xkproject/Orchard,xiaobudian/Orchard,TalaveraTechnologySolutions/Orchard,TalaveraTechnologySolutions/Orchard,Fogolan/OrchardForWork,phillipsj/Orchard,grapto/Orchard.CloudBust,Anton-Am/Orchard,gcsuk/Orchard,Ermesx/Orchard,AEdmunds/beautiful-springtime,bigfont/orchard-cms-modules-and-themes,JRKelso/Orchard,grapto/Orchard.CloudBust,RoyalVeterinaryCollege/Orchard,li0803/Orchard,m2cms/Orchard,omidnasri/Orchard,abhishekluv/Orchard,brownjordaninternational/OrchardCMS,Cphusion/Orchard,yonglehou/Orchard,jtkech/Orchard,MetSystem/Orchard,gcsuk/Orchard,bedegaming-aleksej/Orchard,kgacova/Orchard,emretiryaki/Orchard,SzymonSel/Orchard,harmony7/Orchard,grapto/Orchard.CloudBust,TaiAivaras/Orchard,jchenga/Orchard,Lombiq/Orchard,cooclsee/Orchard,SeyDutch/Airbrush,Codinlab/Orchard,austinsc/Orchard,hhland/Orchard,caoxk/orchard,ericschultz/outercurve-orchard,TalaveraTechnologySolutions/Orchard,oxwanawxo/Orchard,johnnyqian/Orchard,cooclsee/Orchard,dozoft/Orchard,omidnasri/Orchard,LaserSrl/Orchard,princeppy/JPYSites-Orchard-Azure-Live-SourceCode,Ermesx/Orchard,OrchardCMS/Orchard-Harvest-Website,bigfont/orchard-cms-modules-and-themes,rtpHarry/Orchard,neTp9c/Orchard,Codinlab/Orchard,alejandroaldana/Orchard,vairam-svs/Orchard,jerryshi2007/Orchard,dozoft/Orchard,spraiin/Orchard,armanforghani/Orchard,luchaoshuai/Orchard,neTp9c/Orchard,jimasp/Orchard,angelapper/Orchard,neTp9c/Orchard,jaraco/orchard,jchenga/Orchard,MetSystem/Orchard,asabbott/chicagodevnet-website,jaraco/orchard,dburriss/Orchard,bedegaming-aleksej/Orchard,Dolphinsimon/Orchard,salarvand/orchard,patricmutwiri/Orchard,kouweizhong/Orchard,yonglehou/Orchard,Anton-Am/Orchard,xkproject/Orchard,SeyDutch/Airbrush,dcinzona/Orchard-Harvest-Website,sfmskywalker/Orchard,NIKASoftwareDevs/Orchard,kgacova/Orchard,Dolphinsimon/Orchard,andyshao/Orchard,vairam-svs/Orchard,AEdmunds/beautiful-springtime,DonnotRain/Orchard,MpDzik/Orchard,yersans/Orchard,rtpHarry/Orchard,smartnet-developers/Orchard,asabbott/chicagodevnet-website,escofieldnaxos/Orchard,arminkarimi/Orchard,Anton-Am/Orchard,AdvantageCS/Orchard,oxwanawxo/Orchard,li0803/Orchard,dcinzona/Orchard,geertdoornbos/Orchard,salarvand/Portal,Codinlab/Orchard,rtpHarry/Orchard,jchenga/Orchard,aaronamm/Orchard,huoxudong125/Orchard,phillipsj/Orchard,Inner89/Orchard,vard0/orchard.tan,fassetar/Orchard,AEdmunds/beautiful-springtime,NIKASoftwareDevs/Orchard,harmony7/Orchard,yersans/Orchard,escofieldnaxos/Orchard,SeyDutch/Airbrush,alejandroaldana/Orchard,grapto/Orchard.CloudBust,Ermesx/Orchard,austinsc/Orchard,Lombiq/Orchard,jimasp/Orchard,xkproject/Orchard,austinsc/Orchard,MpDzik/Orchard,fortunearterial/Orchard,dburriss/Orchard,marcoaoteixeira/Orchard,patricmutwiri/Orchard,huoxudong125/Orchard,li0803/Orchard,hbulzy/Orchard,grapto/Orchard.CloudBust,OrchardCMS/Orchard,qt1/Orchard,jtkech/Orchard,yersans/Orchard,Praggie/Orchard,SeyDutch/Airbrush,cryogen/orchard,Morgma/valleyviewknolls,Inner89/Orchard,infofromca/Orchard,sfmskywalker/Orchard,AndreVolksdorf/Orchard,tobydodds/folklife,andyshao/Orchard,OrchardCMS/Orchard,oxwanawxo/Orchard,li0803/Orchard,jersiovic/Orchard,Morgma/valleyviewknolls,Praggie/Orchard,phillipsj/Orchard,stormleoxia/Orchard,SouleDesigns/SouleDesigns.Orchard,cooclsee/Orchard,SzymonSel/Orchard,bigfont/orchard-continuous-integration-demo,dmitry-urenev/extended-orchard-cms-v10.1,asabbott/chicagodevnet-website,infofromca/Orchard,Serlead/Orchard,kgacova/Orchard,dozoft/Orchard,smartnet-developers/Orchard,harmony7/Orchard,mgrowan/Orchard,KeithRaven/Orchard,abhishekluv/Orchard,angelapper/Orchard,openbizgit/Orchard,SouleDesigns/SouleDesigns.Orchard,ericschultz/outercurve-orchard,abhishekluv/Orchard,Serlead/Orchard,cooclsee/Orchard,OrchardCMS/Orchard-Harvest-Website,omidnasri/Orchard,Anton-Am/Orchard,infofromca/Orchard,Praggie/Orchard,stormleoxia/Orchard,Morgma/valleyviewknolls,hannan-azam/Orchard,patricmutwiri/Orchard,escofieldnaxos/Orchard,fassetar/Orchard,princeppy/JPYSites-Orchard-Azure-Live-SourceCode,Sylapse/Orchard.HttpAuthSample,OrchardCMS/Orchard,JRKelso/Orchard,JRKelso/Orchard,jerryshi2007/Orchard,fassetar/Orchard,cryogen/orchard,mvarblow/Orchard,dburriss/Orchard,qt1/Orchard,brownjordaninternational/OrchardCMS,Dolphinsimon/Orchard,mgrowan/Orchard,TaiAivaras/Orchard,planetClaire/Orchard-LETS,jtkech/Orchard,DonnotRain/Orchard,Codinlab/Orchard,salarvand/orchard,jersiovic/Orchard
src/Orchard/Caching/Signals.cs
src/Orchard/Caching/Signals.cs
using System.Collections.Generic; namespace Orchard.Caching { public interface ISignals : IVolatileProvider { void Trigger<T>(T signal); IVolatileToken When<T>(T signal); } public class Signals : ISignals { readonly IDictionary<object, Token> _tokens = new Dictionary<object, Token>(); public void Trigger<T>(T signal) { lock (_tokens) { Token token; if (_tokens.TryGetValue(signal, out token)) { _tokens.Remove(signal); token.Trigger(); } } } public IVolatileToken When<T>(T signal) { lock (_tokens) { Token token; if (!_tokens.TryGetValue(signal, out token)) { token = new Token(); _tokens[signal] = token; } return token; } } class Token : IVolatileToken { public Token() { IsCurrent = true; } public bool IsCurrent { get; private set; } public void Trigger() { IsCurrent = false; } } } }
using System.Collections.Generic; namespace Orchard.Caching { public interface ISignals : IVolatileProvider { void Trigger<T>(T signal); IVolatileToken When<T>(T signal); } public class Signals : ISignals { readonly IDictionary<object, Token> _tokens = new Dictionary<object, Token>(); public void Trigger<T>(T signal) { lock (_tokens) { Token token; if (_tokens.TryGetValue(signal, out token)) { _tokens.Remove(signal); token.Trigger(); } } } public IVolatileToken When<T>(T signal) { lock (_tokens) { Token token; if (!_tokens.TryGetValue(signal, out token)) { token = new Token(); _tokens[signal] = token; } return token; } } class Token : IVolatileToken { public bool IsCurrent { get; private set; } public void Trigger() { IsCurrent = false; } } } }
bsd-3-clause
C#
7e67969903e7b9492b9dab5d4ecbf4e5eba5cc76
Fix DotNetCliServiceFacts tests
OmniSharp/omnisharp-roslyn,OmniSharp/omnisharp-roslyn
tests/OmniSharp.Tests/DotNetCliServiceFacts.cs
tests/OmniSharp.Tests/DotNetCliServiceFacts.cs
using OmniSharp.Services; using TestUtility; using Xunit; using Xunit.Abstractions; namespace OmniSharp.Tests { public class DotNetCliServiceFacts : AbstractTestFixture { private const string DotNetVersion = "7.0.100-preview.2.22153.17"; private int Major { get; } private int Minor { get; } private int Patch { get; } private string Release { get; } public DotNetCliServiceFacts(ITestOutputHelper output) : base(output) { var version = SemanticVersion.Parse(DotNetVersion); Major = version.Major; Minor = version.Minor; Patch = version.Patch; Release = version.PreReleaseLabel; } [Fact] public void GetVersion() { using (var host = CreateOmniSharpHost(dotNetCliVersion: DotNetCliVersion.Current)) { var dotNetCli = host.GetExport<IDotNetCliService>(); var version = dotNetCli.GetVersion(); Assert.Equal(Major, version.Major); Assert.Equal(Minor, version.Minor); Assert.Equal(Patch, version.Patch); Assert.Equal(Release, version.PreReleaseLabel); } } [Fact] public void GetInfo() { using (var host = CreateOmniSharpHost(dotNetCliVersion: DotNetCliVersion.Current)) { var dotNetCli = host.GetExport<IDotNetCliService>(); var info = dotNetCli.GetInfo(); Assert.Equal(Major, info.Version.Major); Assert.Equal(Minor, info.Version.Minor); Assert.Equal(Patch, info.Version.Patch); Assert.Equal(Release, info.Version.PreReleaseLabel); } } } }
using OmniSharp.Services; using TestUtility; using Xunit; using Xunit.Abstractions; namespace OmniSharp.Tests { public class DotNetCliServiceFacts : AbstractTestFixture { private const string DotNetVersion = "6.0.201"; private int Major { get; } private int Minor { get; } private int Patch { get; } private string Release { get; } public DotNetCliServiceFacts(ITestOutputHelper output) : base(output) { var version = SemanticVersion.Parse(DotNetVersion); Major = version.Major; Minor = version.Minor; Patch = version.Patch; Release = version.PreReleaseLabel; } [Fact] public void GetVersion() { using (var host = CreateOmniSharpHost(dotNetCliVersion: DotNetCliVersion.Current)) { var dotNetCli = host.GetExport<IDotNetCliService>(); var version = dotNetCli.GetVersion(); Assert.Equal(Major, version.Major); Assert.Equal(Minor, version.Minor); Assert.Equal(Patch, version.Patch); Assert.Equal(Release, version.PreReleaseLabel); } } [Fact] public void GetInfo() { using (var host = CreateOmniSharpHost(dotNetCliVersion: DotNetCliVersion.Current)) { var dotNetCli = host.GetExport<IDotNetCliService>(); var info = dotNetCli.GetInfo(); Assert.Equal(Major, info.Version.Major); Assert.Equal(Minor, info.Version.Minor); Assert.Equal(Patch, info.Version.Patch); Assert.Equal(Release, info.Version.PreReleaseLabel); } } } }
mit
C#
e2a9e396279d233a3ecbc6aee857da6aad55817a
remove old header
csyntax/BlogSystem
Source/BlogSystem.Web/Views/Shared/_Header.cshtml
Source/BlogSystem.Web/Views/Shared/_Header.cshtml
<header id="site-header"> <nav class="navbar navbar-default navbar-fixed-top"> <div class="container"> <div class="navbar-header"> <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target=".navbar-collapse" aria-expanded="false"> <span class="sr-only">Toggle navigation</span> <i class="fa fa-bars" aria-hidden="true"></i> </button> <a href="@Url.Action("Index", "Home")" class="navbar-brand" title="@ViewBag.Settings["Title"]"> <img src="~/images/logo.png" class="img-responsive" alt="@ViewBag.Settings["Title"]" width="125" height="90" /> </a> </div> <div class="collapse navbar-collapse"> <ul class="nav navbar-nav"> <li> @Html.ActionLink("Home", "Index", "Home") </li> @{ Html.RenderAction("Menu", "Nav"); } </ul> @Html.Partial("_LoginPartial") <ul class="nav navbar-nav navbar-right"> @{ Html.RenderAction("AdminMenu", "Nav"); } </ul> </div> </div> </nav> </header>
<header id="site-header"> <nav class="navbar navbar-default navbar-fixed-top"> <div class="container"> <div class="navbar-header"> <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target=".navbar-collapse" aria-expanded="false"> <span class="sr-only">Toggle navigation</span> <i class="fa fa-bars" aria-hidden="true"></i> </button> <a href="@Url.Action("Index", "Home")" class="navbar-brand" title="Home"> @ViewBag.Settings["Title"] </a> </div> <div class="collapse navbar-collapse"> <ul class="nav navbar-nav"> <li> @Html.ActionLink("Home", "Index", "Home") </li> @{ Html.RenderAction("Menu", "Nav"); } </ul> @Html.Partial("_LoginPartial") <ul class="nav navbar-nav navbar-right"> @{ Html.RenderAction("AdminMenu", "Nav"); } </ul> </div> </div> </nav> </header>
mit
C#
4d0b3ecdee0c9a74a9ca085b23953baaed62cf55
Disable 19545 (#19547)
the-dwyer/corefx,rjxby/corefx,krytarowski/corefx,shimingsg/corefx,YoupHulsebos/corefx,ViktorHofer/corefx,Jiayili1/corefx,mmitche/corefx,rubo/corefx,elijah6/corefx,nbarbettini/corefx,shimingsg/corefx,fgreinacher/corefx,seanshpark/corefx,krytarowski/corefx,parjong/corefx,MaggieTsang/corefx,stone-li/corefx,tijoytom/corefx,ptoonen/corefx,nbarbettini/corefx,axelheer/corefx,alexperovich/corefx,the-dwyer/corefx,wtgodbe/corefx,cydhaselton/corefx,ravimeda/corefx,dotnet-bot/corefx,rjxby/corefx,nchikanov/corefx,ravimeda/corefx,shimingsg/corefx,JosephTremoulet/corefx,ravimeda/corefx,nchikanov/corefx,zhenlan/corefx,elijah6/corefx,YoupHulsebos/corefx,gkhanna79/corefx,BrennanConroy/corefx,elijah6/corefx,axelheer/corefx,the-dwyer/corefx,wtgodbe/corefx,jlin177/corefx,wtgodbe/corefx,shimingsg/corefx,ViktorHofer/corefx,DnlHarvey/corefx,seanshpark/corefx,rubo/corefx,stephenmichaelf/corefx,zhenlan/corefx,yizhang82/corefx,nbarbettini/corefx,MaggieTsang/corefx,axelheer/corefx,ptoonen/corefx,mazong1123/corefx,wtgodbe/corefx,YoupHulsebos/corefx,yizhang82/corefx,YoupHulsebos/corefx,rubo/corefx,krk/corefx,mazong1123/corefx,MaggieTsang/corefx,rubo/corefx,parjong/corefx,axelheer/corefx,cydhaselton/corefx,axelheer/corefx,parjong/corefx,wtgodbe/corefx,axelheer/corefx,ptoonen/corefx,stephenmichaelf/corefx,parjong/corefx,Jiayili1/corefx,richlander/corefx,gkhanna79/corefx,the-dwyer/corefx,billwert/corefx,zhenlan/corefx,alexperovich/corefx,billwert/corefx,MaggieTsang/corefx,seanshpark/corefx,DnlHarvey/corefx,Jiayili1/corefx,Jiayili1/corefx,JosephTremoulet/corefx,yizhang82/corefx,seanshpark/corefx,fgreinacher/corefx,krytarowski/corefx,wtgodbe/corefx,elijah6/corefx,rjxby/corefx,richlander/corefx,krk/corefx,rjxby/corefx,nbarbettini/corefx,ravimeda/corefx,gkhanna79/corefx,dhoehna/corefx,the-dwyer/corefx,nchikanov/corefx,YoupHulsebos/corefx,stephenmichaelf/corefx,richlander/corefx,billwert/corefx,ptoonen/corefx,twsouthwick/corefx,Ermiar/corefx,yizhang82/corefx,stephenmichaelf/corefx,gkhanna79/corefx,elijah6/corefx,krytarowski/corefx,ptoonen/corefx,jlin177/corefx,dotnet-bot/corefx,gkhanna79/corefx,stone-li/corefx,ravimeda/corefx,dhoehna/corefx,wtgodbe/corefx,seanshpark/corefx,gkhanna79/corefx,alexperovich/corefx,JosephTremoulet/corefx,gkhanna79/corefx,stephenmichaelf/corefx,ptoonen/corefx,fgreinacher/corefx,tijoytom/corefx,twsouthwick/corefx,twsouthwick/corefx,krytarowski/corefx,dhoehna/corefx,yizhang82/corefx,cydhaselton/corefx,jlin177/corefx,mmitche/corefx,Jiayili1/corefx,stone-li/corefx,dotnet-bot/corefx,twsouthwick/corefx,ViktorHofer/corefx,tijoytom/corefx,cydhaselton/corefx,zhenlan/corefx,ericstj/corefx,dotnet-bot/corefx,dotnet-bot/corefx,ericstj/corefx,ViktorHofer/corefx,dhoehna/corefx,dhoehna/corefx,krytarowski/corefx,zhenlan/corefx,mmitche/corefx,DnlHarvey/corefx,ericstj/corefx,rjxby/corefx,Ermiar/corefx,dotnet-bot/corefx,JosephTremoulet/corefx,alexperovich/corefx,BrennanConroy/corefx,JosephTremoulet/corefx,MaggieTsang/corefx,YoupHulsebos/corefx,alexperovich/corefx,alexperovich/corefx,ericstj/corefx,yizhang82/corefx,ericstj/corefx,alexperovich/corefx,parjong/corefx,ViktorHofer/corefx,krk/corefx,mazong1123/corefx,rubo/corefx,parjong/corefx,shimingsg/corefx,jlin177/corefx,krk/corefx,stephenmichaelf/corefx,jlin177/corefx,zhenlan/corefx,billwert/corefx,mmitche/corefx,the-dwyer/corefx,krk/corefx,tijoytom/corefx,billwert/corefx,jlin177/corefx,rjxby/corefx,Ermiar/corefx,billwert/corefx,Ermiar/corefx,seanshpark/corefx,mazong1123/corefx,zhenlan/corefx,Ermiar/corefx,nchikanov/corefx,DnlHarvey/corefx,JosephTremoulet/corefx,twsouthwick/corefx,mazong1123/corefx,stone-li/corefx,ravimeda/corefx,BrennanConroy/corefx,stone-li/corefx,krytarowski/corefx,mmitche/corefx,krk/corefx,dotnet-bot/corefx,DnlHarvey/corefx,billwert/corefx,rjxby/corefx,mmitche/corefx,cydhaselton/corefx,MaggieTsang/corefx,dhoehna/corefx,nbarbettini/corefx,tijoytom/corefx,mazong1123/corefx,elijah6/corefx,nchikanov/corefx,the-dwyer/corefx,twsouthwick/corefx,JosephTremoulet/corefx,nchikanov/corefx,shimingsg/corefx,krk/corefx,parjong/corefx,twsouthwick/corefx,Ermiar/corefx,stephenmichaelf/corefx,ViktorHofer/corefx,tijoytom/corefx,cydhaselton/corefx,seanshpark/corefx,ericstj/corefx,mmitche/corefx,shimingsg/corefx,elijah6/corefx,DnlHarvey/corefx,nbarbettini/corefx,tijoytom/corefx,MaggieTsang/corefx,richlander/corefx,fgreinacher/corefx,stone-li/corefx,ericstj/corefx,mazong1123/corefx,ravimeda/corefx,dhoehna/corefx,YoupHulsebos/corefx,nbarbettini/corefx,richlander/corefx,richlander/corefx,nchikanov/corefx,Jiayili1/corefx,cydhaselton/corefx,yizhang82/corefx,stone-li/corefx,DnlHarvey/corefx,Jiayili1/corefx,Ermiar/corefx,ViktorHofer/corefx,jlin177/corefx,ptoonen/corefx,richlander/corefx
src/System.Diagnostics.DiagnosticSource/tests/ActivityDateTimeTests.cs
src/System.Diagnostics.DiagnosticSource/tests/ActivityDateTimeTests.cs
using System.Threading; using Xunit; namespace System.Diagnostics.Tests { public class ActivityDateTimeTests { [Fact] [SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework, "dotnet/corefx #19545")] public void StartStopReturnsPreciseDuration() { var activity = new Activity("test"); var sw = Stopwatch.StartNew(); activity.Start(); SpinWait.SpinUntil(() => sw.ElapsedMilliseconds > 1, 2); activity.Stop(); sw.Stop(); Assert.True(activity.Duration.TotalMilliseconds > 1 && activity.Duration <= sw.Elapsed); } } }
using System.Threading; using Xunit; namespace System.Diagnostics.Tests { public class ActivityDateTimeTests { [Fact] public void StartStopReturnsPreciseDuration() { var activity = new Activity("test"); var sw = Stopwatch.StartNew(); activity.Start(); SpinWait.SpinUntil(() => sw.ElapsedMilliseconds > 1, 2); activity.Stop(); sw.Stop(); Assert.True(activity.Duration.TotalMilliseconds > 1 && activity.Duration <= sw.Elapsed); } } }
mit
C#
6ba1fc068f29a4c4024ea1295c4bacfbb4469332
Fix CS0067.
KN4CK3R/ReClass.NET,jesterret/ReClass.NET,KN4CK3R/ReClass.NET,jesterret/ReClass.NET,jesterret/ReClass.NET,KN4CK3R/ReClass.NET
Logger/NullLogger.cs
Logger/NullLogger.cs
using System; namespace ReClassNET.Logger { class NullLogger : ILogger { public event NewLogEntryEventHandler NewLogEntry { add { throw new NotSupportedException(); } remove { } } public void Log(Exception ex) { } public void Log(LogLevel level, string message) { } } }
using System; namespace ReClassNET.Logger { class NullLogger : ILogger { public event NewLogEntryEventHandler NewLogEntry; public void Log(Exception ex) { } public void Log(LogLevel level, string message) { } } }
mit
C#
7033b6bac27536b3ba5f9bc34e887326ffaf2d4a
Revert "son example upd"
pmpu/serverhouse,pmpu/serverhouse,pmpu/serverhouse,pmpu/serverhouse
test_tasks/code/JSONExample/JSONExample/Program.cs
test_tasks/code/JSONExample/JSONExample/Program.cs
using System; using SimpleJson; using System.Collections.Generic; using System.Net; namespace JSONExample { class MainClass { public static void Main (string[] args) { JsonObject jsonObject = new JsonObject(); JsonArray pointsArray = new JsonArray (); for (int i = 0; i < 5; i++) { for (int j = 0; j < 5; j++) { JsonObject point = new JsonObject (); point ["x"] = i; point ["y"] = j; pointsArray.Add (point); } } jsonObject ["objectsArray"] = pointsArray; jsonObject["name"] = "foo"; jsonObject["num"] = 10; jsonObject["is_vip"] = true; jsonObject["nickname"] = null; string jsonString = jsonObject.ToString(); JsonObject obj = (JsonObject)SimpleJson.SimpleJson.DeserializeObject (jsonString); jsonString = "foo=45&data=" + jsonString; jsonString = parsePost (jsonString)["data"]; Console.WriteLine (jsonString); Console.WriteLine (obj["name"]); } private static Dictionary<string, string> parsePost (string postString) { Dictionary<string, string> postParams = new Dictionary<string, string>(); string[] rawParams = postString.Split('&'); foreach (string param in rawParams) { string[] kvPair = param.Split('='); string key = kvPair[0]; string value = WebUtility.UrlDecode(kvPair[1]); postParams.Add(key, value); } return postParams; } } }
using System; using SimpleJson; using System.Collections.Generic; using System.Net; struct XY { public int x; public int y; } namespace JSONExample { class MainClass { public static void Main (string[] args) { JsonObject jsonObject = new JsonObject(); JsonArray pointsArray = new JsonArray (); for (int i = 0; i < 5; i++) { for (int j = 0; j < 5; j++) { JsonObject point = new JsonObject (); point ["x"] = i; point ["y"] = j; pointsArray.Add (point); } } jsonObject ["objectsArray"] = pointsArray; jsonObject["name"] = "foo"; jsonObject["num"] = 10; jsonObject["is_vip"] = true; jsonObject["nickname"] = null; string jsonString = jsonObject.ToString(); JsonObject obj = (JsonObject)SimpleJson.SimpleJson.DeserializeObject (jsonString); jsonString = "foo=45&data=" + jsonString; jsonString = parsePost (jsonString)["data"]; Console.WriteLine (jsonString); Console.WriteLine (obj["name"]); XY first = new XY(); first.y = 21; Console.WriteLine (first.y); } private static Dictionary<string, string> parsePost (string postString) { Dictionary<string, string> postParams = new Dictionary<string, string>(); string[] rawParams = postString.Split('&'); foreach (string param in rawParams) { string[] kvPair = param.Split('='); string key = kvPair[0]; string value = WebUtility.UrlDecode(kvPair[1]); postParams.Add(key, value); } return postParams; } } }
mit
C#
3800b54ef52c5af9f68de341007a44e22048e180
Change namespace to TestCases
antony-liu/npoi,tonyqus/npoi
testcases/main/SS/UserModel/TestHSSFBorderStyle.cs
testcases/main/SS/UserModel/TestHSSFBorderStyle.cs
/* ==================================================================== Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for Additional information regarding copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ==================================================================== */ namespace TestCases.SS.UserModel { using NUnit.Framework; using TestCases.HSSF; /** * @author Yegor Kozlov */ [TestFixture] public class TestHSSFBorderStyle : BaseTestBorderStyle { public TestHSSFBorderStyle() : base(HSSFITestDataProvider.Instance) { } } }
/* ==================================================================== Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for Additional information regarding copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ==================================================================== */ namespace NPOI.SS.UserModel { using NUnit.Framework; using TestCases.HSSF; using TestCases.SS.UserModel; /** * @author Yegor Kozlov */ [TestFixture] public class TestHSSFBorderStyle : BaseTestBorderStyle { public TestHSSFBorderStyle() : base(HSSFITestDataProvider.Instance) { } } }
apache-2.0
C#
37be1708d3e09b91786f7d6de6ed0018e80a0c75
remove obsolete OldConfiguration and NewConfiguration
304NotModified/NLog,NLog/NLog,snakefoot/NLog
src/NLog/Config/LoggingConfigurationChangedEventArgs.cs
src/NLog/Config/LoggingConfigurationChangedEventArgs.cs
// // Copyright (c) 2004-2019 Jaroslaw Kowalski <jaak@jkowalski.net>, Kim Christensen, Julian Verdurmen // // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // // * Redistributions of source code must retain the above copyright notice, // this list of conditions and the following disclaimer. // // * 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. // // * Neither the name of Jaroslaw Kowalski nor the names of its // contributors may be used to endorse or promote products derived from this // software without specific prior written permission. // // 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. // namespace NLog.Config { using System; /// <summary> /// Arguments for <see cref="LogFactory.ConfigurationChanged"/> events. /// </summary> public class LoggingConfigurationChangedEventArgs : EventArgs { /// <summary> /// Initializes a new instance of the <see cref="LoggingConfigurationChangedEventArgs" /> class. /// </summary> /// <param name="activatedConfiguration">The new configuration.</param> /// <param name="deactivatedConfiguration">The old configuration.</param> public LoggingConfigurationChangedEventArgs(LoggingConfiguration activatedConfiguration, LoggingConfiguration deactivatedConfiguration) { ActivatedConfiguration = activatedConfiguration; DeactivatedConfiguration = deactivatedConfiguration; } /// <summary> /// Gets the old configuration. /// </summary> /// <value>The old configuration.</value> public LoggingConfiguration DeactivatedConfiguration { get; } /// <summary> /// Gets the new configuration. /// </summary> /// <value>The new configuration.</value> public LoggingConfiguration ActivatedConfiguration { get; } } }
// // Copyright (c) 2004-2019 Jaroslaw Kowalski <jaak@jkowalski.net>, Kim Christensen, Julian Verdurmen // // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // // * Redistributions of source code must retain the above copyright notice, // this list of conditions and the following disclaimer. // // * 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. // // * Neither the name of Jaroslaw Kowalski nor the names of its // contributors may be used to endorse or promote products derived from this // software without specific prior written permission. // // 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. // namespace NLog.Config { using System; /// <summary> /// Arguments for <see cref="LogFactory.ConfigurationChanged"/> events. /// </summary> public class LoggingConfigurationChangedEventArgs : EventArgs { /// <summary> /// Initializes a new instance of the <see cref="LoggingConfigurationChangedEventArgs" /> class. /// </summary> /// <param name="activatedConfiguration">The new configuration.</param> /// <param name="deactivatedConfiguration">The old configuration.</param> public LoggingConfigurationChangedEventArgs(LoggingConfiguration activatedConfiguration, LoggingConfiguration deactivatedConfiguration) { ActivatedConfiguration = activatedConfiguration; DeactivatedConfiguration = deactivatedConfiguration; } /// <summary> /// Gets the old configuration. /// </summary> /// <value>The old configuration.</value> public LoggingConfiguration DeactivatedConfiguration { get; private set; } /// <summary> /// Gets the new configuration. /// </summary> /// <value>The new configuration.</value> public LoggingConfiguration ActivatedConfiguration { get; private set; } /// <summary> /// Gets the new configuration /// </summary> /// <value>The new configuration.</value> [Obsolete("This option will be removed in NLog 5. Marked obsolete on NLog 4.5")] public LoggingConfiguration OldConfiguration => ActivatedConfiguration; /// <summary> /// Gets the old configuration /// </summary> /// <value>The old configuration.</value> [Obsolete("This option will be removed in NLog 5. Marked obsolete on NLog 4.5")] public LoggingConfiguration NewConfiguration => DeactivatedConfiguration; } }
bsd-3-clause
C#
c5728c0906412a02b02c70ce194ecbebd8b2d797
Remove interface lookup per instance
TurnerSoftware/MongoFramework
src/MongoFramework/Infrastructure/ShallowPropertyEqualityComparer.cs
src/MongoFramework/Infrastructure/ShallowPropertyEqualityComparer.cs
using System; using System.Collections.Generic; using System.Linq; using System.Reflection; namespace MongoFramework.Infrastructure { public class ShallowPropertyEqualityComparer<TObject> : IEqualityComparer<TObject> { private PropertyInfo[] Properties { get; } private static bool ImplementsIEquatable { get; } = typeof(TObject).GetInterfaces().Any(i => i == typeof(IEquatable<TObject>)); public ShallowPropertyEqualityComparer() { if (!ImplementsIEquatable) { Properties = typeof(TObject).GetProperties(BindingFlags.Public | BindingFlags.Instance); } } public bool Equals(TObject x, TObject y) { if (object.Equals(x, default(TObject)) && object.Equals(y, default(TObject))) { return true; } else if (object.Equals(x, default(TObject)) || object.Equals(y, default(TObject))) { return false; } if (ImplementsIEquatable) { return (x as IEquatable<TObject>).Equals(y); } foreach (var property in Properties) { var xValue = property.GetValue(x); var yValue = property.GetValue(y); if (!object.Equals(xValue, yValue)) { return false; } } return true; } public int GetHashCode(TObject obj) { if (obj == null) { throw new ArgumentNullException(nameof(obj)); } if (ImplementsIEquatable) { return obj.GetHashCode(); } var combinedHashCode = 1; foreach (var property in Properties) { var xValue = property.GetValue(obj); if (xValue != null) { var localHashCode = xValue.GetHashCode(); combinedHashCode = (((localHashCode << 5) + localHashCode) ^ combinedHashCode); } } return combinedHashCode; } } }
using System; using System.Collections.Generic; using System.Linq; using System.Reflection; namespace MongoFramework.Infrastructure { public class ShallowPropertyEqualityComparer<TObject> : IEqualityComparer<TObject> { private PropertyInfo[] Properties { get; } private bool ImplementsIEquatable { get; } public ShallowPropertyEqualityComparer() { if (typeof(TObject).GetInterfaces().Any(i => i == typeof(IEquatable<TObject>))) { ImplementsIEquatable = true; } else { Properties = typeof(TObject).GetProperties(BindingFlags.Public | BindingFlags.Instance); } } public bool Equals(TObject x, TObject y) { if (object.Equals(x, default(TObject)) && object.Equals(y, default(TObject))) { return true; } else if (object.Equals(x, default(TObject)) || object.Equals(y, default(TObject))) { return false; } if (ImplementsIEquatable) { return (x as IEquatable<TObject>).Equals(y); } foreach (var property in Properties) { var xValue = property.GetValue(x); var yValue = property.GetValue(y); if (!object.Equals(xValue, yValue)) { return false; } } return true; } public int GetHashCode(TObject obj) { if (obj == null) { throw new ArgumentNullException(nameof(obj)); } if (ImplementsIEquatable) { return obj.GetHashCode(); } var combinedHashCode = 1; foreach (var property in Properties) { var xValue = property.GetValue(obj); if (xValue != null) { var localHashCode = xValue.GetHashCode(); combinedHashCode = (((localHashCode << 5) + localHashCode) ^ combinedHashCode); } } return combinedHashCode; } } }
mit
C#
357f1aa1661ee6e8acbe0232687b4ee20107e063
Fix incorrect title on edit page
Serlead/Orchard,Lombiq/Orchard,Serlead/Orchard,li0803/Orchard,rtpHarry/Orchard,aaronamm/Orchard,jersiovic/Orchard,aaronamm/Orchard,abhishekluv/Orchard,OrchardCMS/Orchard,Dolphinsimon/Orchard,tobydodds/folklife,Codinlab/Orchard,bedegaming-aleksej/Orchard,aaronamm/Orchard,jimasp/Orchard,jimasp/Orchard,abhishekluv/Orchard,AdvantageCS/Orchard,Fogolan/OrchardForWork,li0803/Orchard,IDeliverable/Orchard,ehe888/Orchard,yersans/Orchard,li0803/Orchard,LaserSrl/Orchard,fassetar/Orchard,gcsuk/Orchard,jersiovic/Orchard,grapto/Orchard.CloudBust,gcsuk/Orchard,tobydodds/folklife,yersans/Orchard,gcsuk/Orchard,jersiovic/Orchard,fassetar/Orchard,hbulzy/Orchard,OrchardCMS/Orchard,jimasp/Orchard,Dolphinsimon/Orchard,tobydodds/folklife,grapto/Orchard.CloudBust,gcsuk/Orchard,Codinlab/Orchard,omidnasri/Orchard,li0803/Orchard,IDeliverable/Orchard,AdvantageCS/Orchard,IDeliverable/Orchard,OrchardCMS/Orchard,ehe888/Orchard,rtpHarry/Orchard,abhishekluv/Orchard,yersans/Orchard,tobydodds/folklife,OrchardCMS/Orchard,omidnasri/Orchard,omidnasri/Orchard,jersiovic/Orchard,Codinlab/Orchard,yersans/Orchard,hbulzy/Orchard,fassetar/Orchard,omidnasri/Orchard,grapto/Orchard.CloudBust,Fogolan/OrchardForWork,grapto/Orchard.CloudBust,bedegaming-aleksej/Orchard,OrchardCMS/Orchard,hbulzy/Orchard,jimasp/Orchard,Fogolan/OrchardForWork,Serlead/Orchard,abhishekluv/Orchard,Codinlab/Orchard,Serlead/Orchard,Codinlab/Orchard,omidnasri/Orchard,AdvantageCS/Orchard,Dolphinsimon/Orchard,li0803/Orchard,Fogolan/OrchardForWork,LaserSrl/Orchard,Dolphinsimon/Orchard,abhishekluv/Orchard,omidnasri/Orchard,rtpHarry/Orchard,IDeliverable/Orchard,hbulzy/Orchard,grapto/Orchard.CloudBust,rtpHarry/Orchard,jersiovic/Orchard,Lombiq/Orchard,aaronamm/Orchard,bedegaming-aleksej/Orchard,omidnasri/Orchard,Dolphinsimon/Orchard,tobydodds/folklife,Lombiq/Orchard,grapto/Orchard.CloudBust,Fogolan/OrchardForWork,yersans/Orchard,AdvantageCS/Orchard,ehe888/Orchard,rtpHarry/Orchard,tobydodds/folklife,jimasp/Orchard,aaronamm/Orchard,bedegaming-aleksej/Orchard,fassetar/Orchard,hbulzy/Orchard,omidnasri/Orchard,LaserSrl/Orchard,bedegaming-aleksej/Orchard,gcsuk/Orchard,ehe888/Orchard,AdvantageCS/Orchard,omidnasri/Orchard,IDeliverable/Orchard,LaserSrl/Orchard,abhishekluv/Orchard,fassetar/Orchard,LaserSrl/Orchard,ehe888/Orchard,Lombiq/Orchard,Lombiq/Orchard,Serlead/Orchard
src/Orchard.Web/Modules/Orchard.Blogs/Views/Content-Blog.Edit.cshtml
src/Orchard.Web/Modules/Orchard.Blogs/Views/Content-Blog.Edit.cshtml
@using Orchard.Mvc.Html; <div class="edit-item"> <div class="edit-item-primary"> @if (Model.Content != null) { <div class="edit-item-content"> @Display(Model.Content) </div> } </div> <div class="edit-item-secondary group"> @if (Model.Actions != null) { <div class="edit-item-actions"> @Display(Model.Actions) </div> } @if (Model.Sidebar != null) { <div class="edit-item-sidebar group"> @Display(Model.Sidebar) </div> } </div> </div>
@using Orchard.Mvc.Html; @{ Layout.Title = T("New Blog"); } <div class="edit-item"> <div class="edit-item-primary"> @if (Model.Content != null) { <div class="edit-item-content"> @Display(Model.Content) </div> } </div> <div class="edit-item-secondary group"> @if (Model.Actions != null) { <div class="edit-item-actions"> @Display(Model.Actions) </div> } @if (Model.Sidebar != null) { <div class="edit-item-sidebar group"> @Display(Model.Sidebar) </div> } </div> </div>
bsd-3-clause
C#
1e6d29eac62406acbea55e4a222222a09c3d9f9c
Format dates properly for the api
bcemmett/SurveyMonkeyApi-v3,davek17/SurveyMonkeyApi-v3
SurveyMonkey/Helpers/RequestSettingsHelper.cs
SurveyMonkey/Helpers/RequestSettingsHelper.cs
using System; using System.Reflection; using SurveyMonkey.RequestSettings; namespace SurveyMonkey.Helpers { internal class RequestSettingsHelper { internal static RequestData GetPopulatedProperties(object obj) { var output = new RequestData(); foreach (PropertyInfo property in obj.GetType().GetProperties(BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public)) { if (property.GetValue(obj, null) != null) { Type underlyingType = property.PropertyType.IsGenericType && property.PropertyType.GetGenericTypeDefinition() == typeof(Nullable<>) ? Nullable.GetUnderlyingType(property.PropertyType) : property.PropertyType; if (underlyingType.IsEnum) { output.Add(PropertyCasingHelper.CamelToSnake(property.Name), PropertyCasingHelper.CamelToSnake(property.GetValue(obj, null).ToString())); } else if (underlyingType == typeof(DateTime)) { output.Add(PropertyCasingHelper.CamelToSnake(property.Name), ((DateTime)property.GetValue(obj, null)).ToString("s") + "+00:00"); } else { output.Add(PropertyCasingHelper.CamelToSnake(property.Name), property.GetValue(obj, null)); } } } return output; } } }
using System; using System.Reflection; using SurveyMonkey.RequestSettings; namespace SurveyMonkey.Helpers { internal class RequestSettingsHelper { internal static RequestData GetPopulatedProperties(object obj) { var output = new RequestData(); foreach (PropertyInfo property in obj.GetType().GetProperties(BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public)) { if (property.GetValue(obj, null) != null) { Type underlyingType = property.PropertyType.IsGenericType && property.PropertyType.GetGenericTypeDefinition() == typeof(Nullable<>) ? Nullable.GetUnderlyingType(property.PropertyType) : property.PropertyType; if (underlyingType.IsEnum) { output.Add(PropertyCasingHelper.CamelToSnake(property.Name), PropertyCasingHelper.CamelToSnake(property.GetValue(obj, null).ToString())); } else if (underlyingType == typeof(DateTime)) { output.Add(PropertyCasingHelper.CamelToSnake(property.Name), ((DateTime)property.GetValue(obj, null)).ToString("s")); } else { output.Add(PropertyCasingHelper.CamelToSnake(property.Name), property.GetValue(obj, null)); } } } return output; } } }
mit
C#
3c5f0c77da7a341f89ef96780f3babfd85f45c40
Correct some file paths in build script.
Flamtap/Flamtap
build.cake
build.cake
#tool nuget:?package=NUnit.ConsoleRunner&version=3.7.0 ////////////////////////////////////////////////////////////////////// // ARGUMENTS ////////////////////////////////////////////////////////////////////// var target = Argument("target", "Default"); var configuration = Argument("configuration", "Release"); ////////////////////////////////////////////////////////////////////// // PREPARATION ////////////////////////////////////////////////////////////////////// // Define directories. var buildDir = Directory("./build") + Directory(configuration); ////////////////////////////////////////////////////////////////////// // TASKS ////////////////////////////////////////////////////////////////////// Task("Clean") .Does(() => { CleanDirectory(buildDir); }); Task("Restore-NuGet-Packages") .IsDependentOn("Clean") .Does(() => { NuGetRestore("./src/Flamtap.sln"); }); Task("Build") .IsDependentOn("Restore-NuGet-Packages") .Does(() => { MSBuild("./src/Flamtap.sln", settings => settings.SetConfiguration(configuration)); }); Task("Run-Unit-Tests") .IsDependentOn("Build") .Does(() => { NUnit3(buildDir.ToString() + "/*.Tests.dll"); }); ////////////////////////////////////////////////////////////////////// // TASK TARGETS ////////////////////////////////////////////////////////////////////// Task("Default") .IsDependentOn("Run-Unit-Tests"); ////////////////////////////////////////////////////////////////////// // EXECUTION ////////////////////////////////////////////////////////////////////// RunTarget(target);
#tool nuget:?package=NUnit.ConsoleRunner&version=3.7.0 ////////////////////////////////////////////////////////////////////// // ARGUMENTS ////////////////////////////////////////////////////////////////////// var target = Argument("target", "Default"); var configuration = Argument("configuration", "Release"); ////////////////////////////////////////////////////////////////////// // PREPARATION ////////////////////////////////////////////////////////////////////// // Define directories. var buildDir = Directory("./src/build") + Directory(configuration); ////////////////////////////////////////////////////////////////////// // TASKS ////////////////////////////////////////////////////////////////////// Task("Clean") .Does(() => { CleanDirectory(buildDir); }); Task("Restore-NuGet-Packages") .IsDependentOn("Clean") .Does(() => { NuGetRestore("./src/Flamtap.sln"); }); Task("Build") .IsDependentOn("Restore-NuGet-Packages") .Does(() => { MSBuild("./src/Flamtap.sln", settings => settings.SetConfiguration(configuration)); }); Task("Run-Unit-Tests") .IsDependentOn("Build") .Does(() => { NUnit3("./src/**/bin/" + configuration + "/*.Tests.dll"); }); ////////////////////////////////////////////////////////////////////// // TASK TARGETS ////////////////////////////////////////////////////////////////////// Task("Default") .IsDependentOn("Run-Unit-Tests"); ////////////////////////////////////////////////////////////////////// // EXECUTION ////////////////////////////////////////////////////////////////////// RunTarget(target);
mit
C#
ab66ed384b8c95475755dff1c558e392e0cc7e8c
Make decimal serialization in Gremlin.Net culture independent CTR
krlohnes/tinkerpop,robertdale/tinkerpop,apache/incubator-tinkerpop,robertdale/tinkerpop,pluradj/incubator-tinkerpop,robertdale/tinkerpop,apache/incubator-tinkerpop,krlohnes/tinkerpop,artem-aliev/tinkerpop,apache/incubator-tinkerpop,robertdale/tinkerpop,artem-aliev/tinkerpop,robertdale/tinkerpop,krlohnes/tinkerpop,apache/tinkerpop,artem-aliev/tinkerpop,apache/tinkerpop,pluradj/incubator-tinkerpop,artem-aliev/tinkerpop,apache/tinkerpop,artem-aliev/tinkerpop,apache/tinkerpop,apache/tinkerpop,apache/tinkerpop,krlohnes/tinkerpop,apache/tinkerpop,pluradj/incubator-tinkerpop,krlohnes/tinkerpop
gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/NumberConverter.cs
gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/NumberConverter.cs
#region License /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you 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 using System; using System.Collections.Generic; using System.Globalization; using Newtonsoft.Json.Linq; namespace Gremlin.Net.Structure.IO.GraphSON { internal abstract class NumberConverter : IGraphSONDeserializer, IGraphSONSerializer { protected abstract string GraphSONTypeName { get; } protected abstract Type HandledType { get; } protected virtual string Prefix => "g"; protected virtual bool StringifyValue => false; public dynamic Objectify(JToken graphsonObject, GraphSONReader reader) { return graphsonObject.ToObject(HandledType); } public Dictionary<string, dynamic> Dictify(dynamic objectData, GraphSONWriter writer) { object value = objectData; if (StringifyValue) { value = string.Format(CultureInfo.InvariantCulture, "{0}", value); } return GraphSONUtil.ToTypedValue(GraphSONTypeName, value, Prefix); } } }
#region License /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you 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 using System; using System.Collections.Generic; using Newtonsoft.Json.Linq; namespace Gremlin.Net.Structure.IO.GraphSON { internal abstract class NumberConverter : IGraphSONDeserializer, IGraphSONSerializer { protected abstract string GraphSONTypeName { get; } protected abstract Type HandledType { get; } protected virtual string Prefix => "g"; protected virtual bool StringifyValue => false; public dynamic Objectify(JToken graphsonObject, GraphSONReader reader) { return graphsonObject.ToObject(HandledType); } public Dictionary<string, dynamic> Dictify(dynamic objectData, GraphSONWriter writer) { object value = objectData; if (StringifyValue) { value = value?.ToString(); } return GraphSONUtil.ToTypedValue(GraphSONTypeName, value, Prefix); } } }
apache-2.0
C#
c4445ce8838604dde091df1db5d3ecae89151259
Adjust wordings
mnaiman/duplicati,duplicati/duplicati,mnaiman/duplicati,mnaiman/duplicati,duplicati/duplicati,mnaiman/duplicati,mnaiman/duplicati,duplicati/duplicati,duplicati/duplicati,duplicati/duplicati
Duplicati.Library.Backend.Tardigrade/Strings.cs
Duplicati.Library.Backend.Tardigrade/Strings.cs
using Duplicati.Library.Localization.Short; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Duplicati.Library.Backend.Strings { internal static class Tardigrade { public static string DisplayName { get { return LC.L(@"Tardigrade Decentralized Cloud Storage"); } } public static string Description { get { return LC.L(@"This backend can read and write data to the Tardigrade Decentralized Cloud Storage."); } } public static string TardigradeSatelliteDescriptionShort { get { return LC.L(@"The satellite"); } } public static string TardigradeSatelliteDescriptionLong { get { return LC.L(@"The satellite that keeps track of all metadata. Use a Tardigrade-grade server for high-performance SLA-backed connectivity or use a community server. Or even host your own."); } } public static string TardigradeAPIKeyDescriptionShort { get { return LC.L(@"The API key"); } } public static string TardigradeAPIKeyDescriptionLong { get { return LC.L(@"The API key grants access to a specific project on your chosen satellite. Head over to the dashboard of your satellite to create one if you do not already have an API key."); } } public static string TardigradeSecretDescriptionShort { get { return LC.L(@"The encryption passphrase"); } } public static string TardigradeSecretDescriptionLong { get { return LC.L(@"The encryption passphrase is used to encrypt your data before sending it to the tardigrade network. This passphrase can be the only secret to provide - for Tardigrade you do not necessary need any additional encryption (from Duplicati) in place."); } } public static string TardigradeSharedAccessDescriptionShort { get { return LC.L(@"The access grant"); } } public static string TardigradeSharedAccessDescriptionLong { get { return LC.L(@"An access grant contains all information in one encrypted string. You may use it instead of a satellite, API key and secret."); } } } }
using Duplicati.Library.Localization.Short; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Duplicati.Library.Backend.Strings { internal static class Tardigrade { public static string DisplayName { get { return LC.L(@"Tardigrade Decentralized Cloud Storage"); } } public static string Description { get { return LC.L(@"This backend can read and write data to the Tardigrade Decentralized Cloud Storage."); } } public static string TardigradeSatelliteDescriptionShort { get { return LC.L(@"The satellite"); } } public static string TardigradeSatelliteDescriptionLong { get { return LC.L(@"The satellite that keeps track of all metadata. Use a Tardigrade-grade server for high-performance SLA-backed connectivity or use a community server. Or even host your own."); } } public static string TardigradeAPIKeyDescriptionShort { get { return LC.L(@"The API-key"); } } public static string TardigradeAPIKeyDescriptionLong { get { return LC.L(@"The API-key grants access to a specific project on your chosen satellite. Head over to the dashboard of your satellite to create one if you do not already have an API-key."); } } public static string TardigradeSecretDescriptionShort { get { return LC.L(@"The secret"); } } public static string TardigradeSecretDescriptionLong { get { return LC.L(@"The secret is used to encrypt your data before sending it to the tardigrade network. This secret can be the only secret to provide - for Tardigrade you do not necessary need any additional encryption (from Duplicati) in place."); } } public static string TardigradeSharedAccessDescriptionShort { get { return LC.L(@"The shared access"); } } public static string TardigradeSharedAccessDescriptionLong { get { return LC.L(@"A shared access contains all information in one encrypted string. You may use it instead of a satellite, API-key and secret."); } } } }
lgpl-2.1
C#
ffa2c432b098936e9dd7407506c85dc36b86442f
support isMatching for ShippingRate
commercetools/commercetools-dotnet-sdk
commercetools.NET/ShippingMethods/ShippingRate.cs
commercetools.NET/ShippingMethods/ShippingRate.cs
using System; using System.Collections.Generic; using commercetools.Common; using commercetools.ShippingMethods.Tiers; using Newtonsoft.Json; namespace commercetools.ShippingMethods { /// <summary> /// ShippingRate /// </summary> /// <see href="https://dev.commercetools.com/http-api-projects-shippingMethods.html#shippingrate"/> public class ShippingRate { #region Properties [JsonProperty(PropertyName = "price")] public Money Price { get; set; } [JsonProperty(PropertyName = "freeAbove")] public Money FreeAbove { get; set; } [JsonProperty(PropertyName = "tiers")] public List<Tier> Tiers { get; set; } [JsonProperty(PropertyName = "isMatching")] public Boolean IsMatching { get; set; } #endregion #region Constructors /// <summary> /// Constructor. /// </summary> public ShippingRate() { } /// <summary> /// Initializes this instance with JSON data from an API response. /// </summary> /// <param name="data">JSON object</param> public ShippingRate(dynamic data) { if (data == null) { return; } this.Price = Helper.GetMoneyBasedOnType(data.price); this.FreeAbove = Helper.GetMoneyBasedOnType(data.freeAbove); // We do not use Helper.GetListFromJsonArray here, due to the JsonConverter property on Tier class. // Using GetListFromJsonArray ignores the JsonConverter property and fails to deserialize properly. this.Tiers = JsonConvert.DeserializeObject<List<Tier>>(data.tiers.ToString()); this.IsMatching = data.isMatching; } #endregion } }
using System.Collections.Generic; using commercetools.Common; using commercetools.ShippingMethods.Tiers; using Newtonsoft.Json; namespace commercetools.ShippingMethods { /// <summary> /// ShippingRate /// </summary> /// <see href="https://dev.commercetools.com/http-api-projects-shippingMethods.html#shippingrate"/> public class ShippingRate { #region Properties [JsonProperty(PropertyName = "price")] public Money Price { get; set; } [JsonProperty(PropertyName = "freeAbove")] public Money FreeAbove { get; set; } [JsonProperty(PropertyName = "tiers")] public List<Tier> Tiers { get; set; } #endregion #region Constructors /// <summary> /// Constructor. /// </summary> public ShippingRate() { } /// <summary> /// Initializes this instance with JSON data from an API response. /// </summary> /// <param name="data">JSON object</param> public ShippingRate(dynamic data) { if (data == null) { return; } this.Price = Helper.GetMoneyBasedOnType(data.price); this.FreeAbove = Helper.GetMoneyBasedOnType(data.freeAbove); // We do not use Helper.GetListFromJsonArray here, due to the JsonConverter property on Tier class. // Using GetListFromJsonArray ignores the JsonConverter property and fails to deserialize properly. this.Tiers = JsonConvert.DeserializeObject<List<Tier>>(data.tiers.ToString()); } #endregion } }
mit
C#
91a681a7d0dd7eb731264ba2c009d47a86fd3de1
Rename a little more.
sburnicki/Pash,ForNeVeR/Pash,sillvan/Pash,sillvan/Pash,sillvan/Pash,ForNeVeR/Pash,JayBazuzi/Pash,mrward/Pash,sillvan/Pash,WimObiwan/Pash,mrward/Pash,WimObiwan/Pash,Jaykul/Pash,Jaykul/Pash,sburnicki/Pash,JayBazuzi/Pash,Jaykul/Pash,JayBazuzi/Pash,ForNeVeR/Pash,JayBazuzi/Pash,mrward/Pash,WimObiwan/Pash,WimObiwan/Pash,sburnicki/Pash,ForNeVeR/Pash,Jaykul/Pash,sburnicki/Pash,mrward/Pash
Source/Pash.System.Management.Tests/AssemblyInfo.cs
Source/Pash.System.Management.Tests/AssemblyInfo.cs
// Copyright (C) Pash Contributors. License: GPL/BSD. See https://github.com/Pash-Project/Pash/ using System.Reflection; using System.Runtime.CompilerServices; // Information about this assembly is defined by the following attributes. // Change them to the values specific to your project. [assembly: AssemblyTitle("Pash.System.Management.Tests")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Pash Contributors")] [assembly: AssemblyProduct("Pash - https://github.com/Pash-Project/Pash/")] [assembly: AssemblyCopyright("Copyright © 2012-2013 - License: GPL/BSD")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}". // The form "{Major}.{Minor}.*" will automatically update the build and revision, // and "{Major}.{Minor}.{Build}.*" will update just the revision. [assembly: AssemblyVersion("1.0.*")] // The following attributes are used to specify the signing key for the assembly, // if desired. See the Mono documentation for more information about signing. //[assembly: AssemblyDelaySign(false)] //[assembly: AssemblyKeyFile("")]
// Copyright (C) Pash Contributors. License: GPL/BSD. See https://github.com/Pash-Project/Pash/ using System.Reflection; using System.Runtime.CompilerServices; // Information about this assembly is defined by the following attributes. // Change them to the values specific to your project. [assembly: AssemblyTitle("ParserTest")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Pash Contributors")] [assembly: AssemblyProduct("Pash - https://github.com/Pash-Project/Pash/")] [assembly: AssemblyCopyright("Copyright © 2012-2013 - License: GPL/BSD")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}". // The form "{Major}.{Minor}.*" will automatically update the build and revision, // and "{Major}.{Minor}.{Build}.*" will update just the revision. [assembly: AssemblyVersion("1.0.*")] // The following attributes are used to specify the signing key for the assembly, // if desired. See the Mono documentation for more information about signing. //[assembly: AssemblyDelaySign(false)] //[assembly: AssemblyKeyFile("")]
bsd-3-clause
C#
9aa07a056442e3dd71817d892c28140ac8f05e25
upgrade price text add "$"
solfen/Rogue_Cadet
Assets/Scripts/UI/ShipUpgrade/ShopDetailsUI.cs
Assets/Scripts/UI/ShipUpgrade/ShopDetailsUI.cs
using UnityEngine; using UnityEngine.UI; using System.Collections; public class ShopDetailsUI : MonoBehaviour { [SerializeField] private Animator anim; [SerializeField] private Text header; [SerializeField] private Text description; [SerializeField] private Text activeNb; [SerializeField] private Text price; [SerializeField] private Text wheight; [SerializeField] private Text totalWeight; public void Open() { anim.SetTrigger("Open"); } public void Close() { anim.SetTrigger("Close"); } public void UpdateDetails(BaseUpgrade upgrade) { header.text = upgrade.title; description.text = upgrade.description; activeNb.text = "Active: " + upgrade.currentEquipedNb + "/" + upgrade.numberOfUpgrade; price.text = "Price: " + (int)upgrade.currentPrice + "$"; wheight.text = "Wheight: " + upgrade.wheight; totalWeight.text = "Tot Wheight: " + (int)(upgrade.wheight * upgrade.currentEquipedNb); } }
using UnityEngine; using UnityEngine.UI; using System.Collections; public class ShopDetailsUI : MonoBehaviour { [SerializeField] private Animator anim; [SerializeField] private Text header; [SerializeField] private Text description; [SerializeField] private Text activeNb; [SerializeField] private Text price; [SerializeField] private Text wheight; [SerializeField] private Text totalWeight; public void Open() { anim.SetTrigger("Open"); } public void Close() { anim.SetTrigger("Close"); } public void UpdateDetails(BaseUpgrade upgrade) { header.text = upgrade.title; description.text = upgrade.description; activeNb.text = "Active: " + upgrade.currentEquipedNb + "/" + upgrade.numberOfUpgrade; price.text = "Price: " + (int)upgrade.currentPrice; wheight.text = "Wheight: " + upgrade.wheight; totalWeight.text = "Tot Wheight: " + (int)(upgrade.wheight * upgrade.currentEquipedNb); } }
mit
C#
b1c7e996c936c1a22ebcfd95ed2cfffb0f359c46
Rename parameter
mstrother/BmpListener
BmpListener/Bgp/OptionalParameterCapability.cs
BmpListener/Bgp/OptionalParameterCapability.cs
using System; using System.Collections.Generic; using System.Linq; namespace BmpListener.Bgp { public class OptionalParameterCapability : OptionalParameter { public OptionalParameterCapability(ArraySegment<byte> data) : base(ref data) { Decode(data); } public Capability[] Capabilities { get; private set; } public void Decode(ArraySegment<byte> data) { var capabilities = new List<Capability>(); //var offset = data.Offset + 10; //var length = (int)data.ElementAt(9); //data = new ArraySegment<byte>(data.Array, offset, length); //while (data.Count > 0) //{ // //TODO if OptParamLength <2 return an error // var optParam = OptionalParameter.GetOptionalParameter(data); // OptionalParameters.Add(optParam); // offset = data.Offset + optParam.ParameterLength + 2; // length = data.Count - optParam.ParameterLength - 2; // data = new ArraySegment<byte>(data.Array, offset, length); //} for (var i = 0; i < ParameterLength;) { var type = (Capability.CapabilityCode) data.First(); i++; var length = data.ElementAt(i); i++; data = new ArraySegment<byte>(bytes, i, length); var capability = Capability.GetCapability(type, data); if (capability != null) capabilities.Add(capability); i += length; } Capabilities = capabilities.ToArray(); } } }
using System; using System.Collections.Generic; namespace BmpListener.Bgp { public class OptionalParameterCapability : OptionalParameter { public OptionalParameterCapability(ArraySegment<byte> data) : base(data) { Decode(data); } public Capability[] ParameterValue { get; private set; } public void Decode(ArraySegment<byte> data) { var capabilities = new List<Capability>(); var bytes = new byte[ParameterLength]; Array.Copy(data.Array, data.Offset + 2, bytes, 0, ParameterLength); for (var i = 0; i < ParameterLength;) { var type = (Capability.CapabilityCode) bytes[i]; i++; var length = bytes[i]; i++; data = new ArraySegment<byte>(bytes, i, length); var capability = Capability.GetCapability(type, data); if (capability != null) capabilities.Add(capability); i += length; } ParameterValue = capabilities.ToArray(); } } }
mit
C#
11bf039572b4e4eb074c65cf9359917b375825eb
Update App.xaml.cs
blstream/AugmentedSzczecin_WP,blstream/AugmentedSzczecin_WP,blstream/AugmentedSzczecin_WP
AugmentedSzczecin/AugmentedSzczecin/App.xaml.cs
AugmentedSzczecin/AugmentedSzczecin/App.xaml.cs
using AugmentedSzczecin.ViewModels; using AugmentedSzczecin.Views; using Caliburn.Micro; using System; using System.Collections.Generic; using Windows.ApplicationModel.Activation; using Windows.UI.Xaml.Controls; namespace AugmentedSzczecin { public sealed partial class App { private WinRTContainer container; public App() { InitializeComponent(); } protected override void Configure() { container = new WinRTContainer(); container.RegisterWinRTServices(); container.PerRequest<MainViewModel>(); container.PerRequest<AboutViewModel>(); } protected override void PrepareViewFirst(Frame rootFrame) { container.RegisterNavigationService(rootFrame); } protected override void OnLaunched(LaunchActivatedEventArgs args) { DisplayRootView<MainView>(); } protected override object GetInstance(Type service, string key) { return container.GetInstance(service, key); } protected override IEnumerable<object> GetAllInstances(Type service) { return container.GetAllInstances(service); } protected override void BuildUp(object instance) { container.BuildUp(instance); } } }
using AugmentedSzczecin.ViewModels; using AugmentedSzczecin.Views; using Caliburn.Micro; using System; using System.Collections.Generic; using Windows.ApplicationModel.Activation; using Windows.UI.Xaml.Controls; namespace AugmentedSzczecin { public sealed partial class App { private WinRTContainer container; public App() { InitializeComponent(); } protected override void Configure() { container = new WinRTContainer(); container.RegisterWinRTServices(); container.PerRequest<MainViewModel>(); } protected override void PrepareViewFirst(Frame rootFrame) { container.RegisterNavigationService(rootFrame); } protected override void OnLaunched(LaunchActivatedEventArgs args) { DisplayRootView<MainView>(); } protected override object GetInstance(Type service, string key) { return container.GetInstance(service, key); } protected override IEnumerable<object> GetAllInstances(Type service) { return container.GetAllInstances(service); } protected override void BuildUp(object instance) { container.BuildUp(instance); } } }
apache-2.0
C#
adc84f0e5053acd4811f6024556ebd3ba330553b
Solve build related issue
Promact/trappist,Promact/trappist,Promact/trappist,Promact/trappist,Promact/trappist
Trappist/src/Promact.Trappist.Core/Controllers/QuestionsController.cs
Trappist/src/Promact.Trappist.Core/Controllers/QuestionsController.cs
using Microsoft.AspNetCore.Mvc; using Promact.Trappist.DomainModel.Models.Question; using Promact.Trappist.Repository.Questions; using System; namespace Promact.Trappist.Core.Controllers { [Route("api")] public class QuestionsController : Controller { private readonly IQuestionRepository _questionsRepository; public QuestionsController(IQuestionRepository questionsRepository) { _questionsRepository = questionsRepository; } /// <summary> /// Add single multiple answer question into model /// </summary> /// <param name="singleMultipleAnswerQuestion"></param> /// <param name="singleMultipleAnswerQuestionOption"></param> /// <returns></returns> [Route("single-multiple-question")] [HttpPost] public IActionResult AddSingleMultipleAnswerQuestion(SingleMultipleAnswerQuestion singleMultipleAnswerQuestion, SingleMultipleAnswerQuestionOption singleMultipleAnswerQuestionOption) { _questionsRepository.AddSingleMultipleAnswerQuestion(singleMultipleAnswerQuestion, singleMultipleAnswerQuestionOption); return Ok(); } } }
using Microsoft.AspNetCore.Mvc; using Promact.Trappist.DomainModel.Models.Question; using Promact.Trappist.Repository.Questions; using System; namespace Promact.Trappist.Core.Controllers { [Route("api")] public class QuestionsController : Controller { private readonly IQuestionRepository _questionsRepository; public QuestionsController(IQuestionRepository questionsRepository) { _questionsRepository = questionsRepository; } [Route("single-multiple-question")] [HttpPost] /// <summary> /// Add single multiple answer question into model /// </summary> /// <param name="singleMultipleAnswerQuestion"></param> public IActionResult AddSingleMultipleAnswerQuestion(SingleMultipleAnswerQuestion singleMultipleAnswerQuestion, SingleMultipleAnswerQuestionOption singleMultipleAnswerQuestionOption) { _questionsRepository.AddSingleMultipleAnswerQuestion(singleMultipleAnswerQuestion, singleMultipleAnswerQuestionOption); return Ok(); } } }
mit
C#
ae1de1dd927cb00db27988b2d34fdbb0c783d88d
Check all object for ispassable
krille90/unitystation,fomalsd/unitystation,krille90/unitystation,fomalsd/unitystation,Necromunger/unitystation,fomalsd/unitystation,Necromunger/unitystation,fomalsd/unitystation,krille90/unitystation,Necromunger/unitystation,Necromunger/unitystation,Necromunger/unitystation,fomalsd/unitystation,fomalsd/unitystation,Necromunger/unitystation,fomalsd/unitystation
UnityProject/Assets/Scripts/Tilemaps/Behaviours/Layers/ObjectLayer.cs
UnityProject/Assets/Scripts/Tilemaps/Behaviours/Layers/ObjectLayer.cs
using System.Collections.Generic; using System.Linq; using UnityEngine; [ExecuteInEditMode] public class ObjectLayer : Layer { private TileList _objects; public TileList Objects => _objects ?? (_objects = new TileList()); public override void SetTile(Vector3Int position, GenericTile tile, Matrix4x4 transformMatrix) { ObjectTile objectTile = tile as ObjectTile; if (objectTile) { if (!objectTile.IsItem) { tilemap.SetTile(position, null); } objectTile.SpawnObject(position, tilemap, transformMatrix); } else { base.SetTile(position, tile, transformMatrix); } } public override bool HasTile(Vector3Int position) { return Objects.Get(position).Count > 0 || base.HasTile(position); } public override void RemoveTile(Vector3Int position) { foreach (RegisterTile obj in Objects.Get(position).ToArray()) { DestroyImmediate(obj.gameObject); } base.RemoveTile(position); } public override bool IsPassableAt(Vector3Int origin, Vector3Int to) { List<RegisterTile> objectsTo = Objects.Get<RegisterTile>(to); if (!objectsTo.All(o => o.IsPassable(origin))) { return false; } List<RegisterTile> objectsOrigin = Objects.Get<RegisterTile>(origin); return objectsOrigin.All(o => o.IsPassable(origin)) && base.IsPassableAt(origin, to); } public override bool IsPassableAt(Vector3Int position) { List<RegisterTile> objects = Objects.Get<RegisterTile>(position); return objects.All(x => x.IsPassable()) && base.IsPassableAt(position); } public override bool IsAtmosPassableAt(Vector3Int position) { RegisterTile obj = Objects.GetFirst<RegisterTile>(position); return obj ? obj.IsAtmosPassable() : base.IsAtmosPassableAt(position); } public override bool IsSpaceAt(Vector3Int position) { return IsAtmosPassableAt(position) && base.IsSpaceAt(position); } public override void ClearAllTiles() { foreach (RegisterTile obj in Objects.AllObjects) { if (obj != null) { DestroyImmediate(obj.gameObject); } } base.ClearAllTiles(); } }
using System.Collections.Generic; using System.Linq; using UnityEngine; [ExecuteInEditMode] public class ObjectLayer : Layer { private TileList _objects; public TileList Objects => _objects ?? (_objects = new TileList()); public override void SetTile(Vector3Int position, GenericTile tile, Matrix4x4 transformMatrix) { ObjectTile objectTile = tile as ObjectTile; if (objectTile) { if (!objectTile.IsItem) { tilemap.SetTile(position, null); } objectTile.SpawnObject(position, tilemap, transformMatrix); } else { base.SetTile(position, tile, transformMatrix); } } public override bool HasTile(Vector3Int position) { return Objects.Get(position).Count > 0 || base.HasTile(position); } public override void RemoveTile(Vector3Int position) { foreach (RegisterTile obj in Objects.Get(position).ToArray()) { DestroyImmediate(obj.gameObject); } base.RemoveTile(position); } public override bool IsPassableAt(Vector3Int origin, Vector3Int to) { RegisterTile objTo = Objects.GetFirst<RegisterTile>(to); if (objTo && !objTo.IsPassable(origin)) { return false; } RegisterTile objOrigin = Objects.GetFirst<RegisterTile>(origin); if (objOrigin && !objOrigin.IsPassable(to)) { return false; } return base.IsPassableAt(origin, to); } public override bool IsPassableAt(Vector3Int position) { List<RegisterTile> objects = Objects.Get<RegisterTile>(position); return objects.All(x => x.IsPassable()) && base.IsPassableAt(position); } public override bool IsAtmosPassableAt(Vector3Int position) { RegisterTile obj = Objects.GetFirst<RegisterTile>(position); return obj ? obj.IsAtmosPassable() : base.IsAtmosPassableAt(position); } public override bool IsSpaceAt(Vector3Int position) { return IsAtmosPassableAt(position) && base.IsSpaceAt(position); } public override void ClearAllTiles() { foreach (RegisterTile obj in Objects.AllObjects) { if (obj != null) { DestroyImmediate(obj.gameObject); } } base.ClearAllTiles(); } }
agpl-3.0
C#
29e10eb7014612da52d1603e27622084e8a02d1d
Add comment.
mrtska/SRNicoNico,mrtska/SRNicoNico,mrtska/SRNicoNico,mrtska/SRNicoNico
SRNicoNico/Models/NicoNicoViewer/UpdateCheck.cs
SRNicoNico/Models/NicoNicoViewer/UpdateCheck.cs
using System; using System.Collections.Generic; using System.Linq; using System.Text; using Livet; using Codeplex.Data; using SRNicoNico.Models.NicoNicoWrapper; using System.Xml; namespace SRNicoNico.Models.NicoNicoViewer { public class UpdateCheck : NotificationObject { //アップデート確認するURL #if DEBUG private static string CheckUrl = "https://mrtska.net/niconicowrapper/update"; #else private static string CheckUrl = "http://download.mrtska.net/DownloadCounter/Download?file=NicoNicoViewer/update"; #endif //アップデート確認 trueならアップデートあり //urlはダウンロードできるURL public static bool IsUpdateAvailable(double cur, ref string url) { try { var a = NicoNicoWrapperMain.Session.GetAsync(CheckUrl).Result; if(a.Length == 0) { return false; } var json = DynamicJson.Parse(a); //現在のバージョンとダウンロードしてきたjsonのバージョンを比較してjsonのほうが高かったらアップデートがあるってこと if(cur < json.version) { url = json.url; return true; } return false; //例外処理でたとえ私のサーバーが落ちてもViewerには何も影響が出ないように } catch(Exception ex) when (ex is XmlException || ex is RequestTimeout) { return false; } } } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using Livet; using Codeplex.Data; using SRNicoNico.Models.NicoNicoWrapper; using System.Xml; namespace SRNicoNico.Models.NicoNicoViewer { public class UpdateCheck : NotificationObject { #if DEBUG private static string CheckUrl = "https://mrtska.net/niconicowrapper/update"; #else private static string CheckUrl = "http://download.mrtska.net/DownloadCounter/Download?file=NicoNicoViewer/update"; #endif public static bool IsUpdateAvailable(double cur, ref string url) { try { var a = NicoNicoWrapperMain.Session.GetAsync(CheckUrl).Result; if(a.Length == 0) { return false; } var json = DynamicJson.Parse(a); if(cur < json.version) { url = json.url; return true; } return false; } catch(Exception ex) when (ex is XmlException || ex is RequestTimeout) { return false; } } } }
mit
C#
7d709204310548db34330e2ac23690ed25769419
reduce password req
prozum/solitude
Solitude.Server/Identity/SolitudeUserManager.cs
Solitude.Server/Identity/SolitudeUserManager.cs
using System; using System.Threading.Tasks; using Microsoft.AspNet.Identity; using Microsoft.AspNet.Identity.Owin; using Microsoft.Owin; using Neo4j.AspNet.Identity; using Dal; namespace Solitude.Server { // Configure the application user manager used in this application. UserManager is defined in ASP.NET Identity and is used by the application. public class SolitudeUserManager : UserManager<SolitudeUser> { private SolitudeUserStore _store; public SolitudeUserManager(SolitudeUserStore store) : base(store) { _store = store; } public static SolitudeUserManager Create(IdentityFactoryOptions<SolitudeUserManager> options, IOwinContext context) { var manager = new SolitudeUserManager(new SolitudeUserStore(context.Get<GraphClientWrapper>().GraphClient, context.Get<DatabaseAbstrationLayer>())); // Configure validation logic for usernames manager.UserValidator = new UserValidator<SolitudeUser>(manager) { AllowOnlyAlphanumericUserNames = false }; // Configure validation logic for passwords manager.PasswordValidator = new PasswordValidator { RequiredLength = 6, RequireDigit = true, }; // Configure user lockout defaults manager.UserLockoutEnabledByDefault = true; manager.DefaultAccountLockoutTimeSpan = TimeSpan.FromMinutes(5); manager.MaxFailedAccessAttemptsBeforeLockout = 5; var dataProtectionProvider = options.DataProtectionProvider; if (dataProtectionProvider != null) { manager.UserTokenProvider = new DataProtectorTokenProvider<SolitudeUser>(dataProtectionProvider.Create("ASP.NET Identity")); } return manager; } public override async Task<IdentityResult> DeleteAsync(SolitudeUser user) { if (user == null) return IdentityResult.Failed("User does not exist!"); await _store.DeleteAsyncFixed(user); return IdentityResult.Success; } } }
using System; using System.Threading.Tasks; using Microsoft.AspNet.Identity; using Microsoft.AspNet.Identity.Owin; using Microsoft.Owin; using Neo4j.AspNet.Identity; using Dal; namespace Solitude.Server { // Configure the application user manager used in this application. UserManager is defined in ASP.NET Identity and is used by the application. public class SolitudeUserManager : UserManager<SolitudeUser> { private SolitudeUserStore _store; public SolitudeUserManager(SolitudeUserStore store) : base(store) { _store = store; } public static SolitudeUserManager Create(IdentityFactoryOptions<SolitudeUserManager> options, IOwinContext context) { var manager = new SolitudeUserManager(new SolitudeUserStore(context.Get<GraphClientWrapper>().GraphClient, context.Get<DatabaseAbstrationLayer>())); // Configure validation logic for usernames manager.UserValidator = new UserValidator<SolitudeUser>(manager) { AllowOnlyAlphanumericUserNames = false }; // Configure validation logic for passwords manager.PasswordValidator = new PasswordValidator { RequiredLength = 6, RequireNonLetterOrDigit = true, RequireDigit = true, RequireLowercase = true, RequireUppercase = true, }; // Configure user lockout defaults manager.UserLockoutEnabledByDefault = true; manager.DefaultAccountLockoutTimeSpan = TimeSpan.FromMinutes(5); manager.MaxFailedAccessAttemptsBeforeLockout = 5; var dataProtectionProvider = options.DataProtectionProvider; if (dataProtectionProvider != null) { manager.UserTokenProvider = new DataProtectorTokenProvider<SolitudeUser>(dataProtectionProvider.Create("ASP.NET Identity")); } return manager; } public override async Task<IdentityResult> DeleteAsync(SolitudeUser user) { if (user == null) return IdentityResult.Failed("User does not exist!"); await _store.DeleteAsyncFixed(user); return IdentityResult.Success; } } }
mit
C#
d46f8165a9eb6c7fe6f9f292ef04cd65be24e6e6
Set IndexedAttachments to version 2.0.3.0
ravendb/ravendb.contrib
src/Raven.Bundles.Contrib.IndexedAttachments/Properties/AssemblyInfo.cs
src/Raven.Bundles.Contrib.IndexedAttachments/Properties/AssemblyInfo.cs
using System.Reflection; [assembly: AssemblyTitle("Raven.Bundles.Contrib.IndexedAttachments")] [assembly: AssemblyDescription("Plugin for RavenDB that extracts text from attachments so they can be indexed.")] [assembly: AssemblyVersion("2.0.3.0")] [assembly: AssemblyFileVersion("2.0.3.0")]
using System.Reflection; [assembly: AssemblyTitle("Raven.Bundles.Contrib.IndexedAttachments")] [assembly: AssemblyDescription("Plugin for RavenDB that extracts text from attachments so they can be indexed.")] [assembly: AssemblyVersion("2.0.2.0")] [assembly: AssemblyFileVersion("2.0.2.0")]
mit
C#
5a99c21b6b30e2999914129509a310366beaf227
update version.
Aaron-Liu/ecommon,tangxuehua/ecommon
src/ECommon/Properties/AssemblyInfo.cs
src/ECommon/Properties/AssemblyInfo.cs
using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // 有关程序集的常规信息通过以下 // 特性集控制。更改这些特性值可修改 // 与程序集关联的信息。 [assembly: AssemblyTitle("ECommon")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("ECommon")] [assembly: AssemblyCopyright("Copyright © 2014")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // 将 ComVisible 设置为 false 使此程序集中的类型 // 对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型, // 则将该类型上的 ComVisible 特性设置为 true。 [assembly: ComVisible(false)] // 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID [assembly: Guid("b3edf459-8725-465e-a484-410b9a68df1f")] // 程序集的版本信息由下面四个值组成: // // 主版本 // 次版本 // 生成号 // 修订号 // // 可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值, // 方法是按如下所示使用“*”: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.3.0")] [assembly: AssemblyFileVersion("1.3.0")]
using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // 有关程序集的常规信息通过以下 // 特性集控制。更改这些特性值可修改 // 与程序集关联的信息。 [assembly: AssemblyTitle("ECommon")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("ECommon")] [assembly: AssemblyCopyright("Copyright © 2014")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // 将 ComVisible 设置为 false 使此程序集中的类型 // 对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型, // 则将该类型上的 ComVisible 特性设置为 true。 [assembly: ComVisible(false)] // 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID [assembly: Guid("b3edf459-8725-465e-a484-410b9a68df1f")] // 程序集的版本信息由下面四个值组成: // // 主版本 // 次版本 // 生成号 // 修订号 // // 可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值, // 方法是按如下所示使用“*”: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.2.9")] [assembly: AssemblyFileVersion("1.2.9")]
mit
C#