commit
stringlengths
40
40
old_file
stringlengths
4
237
new_file
stringlengths
4
237
old_contents
stringlengths
1
4.24k
new_contents
stringlengths
1
4.87k
subject
stringlengths
15
778
message
stringlengths
15
8.75k
lang
stringclasses
266 values
license
stringclasses
13 values
repos
stringlengths
5
127k
f334fd6b7eab616b3a188124a77ff1f791a14509
TypeCoercion.cs
TypeCoercion.cs
namespace ScriptNET { using System; using System.Collections.Generic; using System.Linq; using System.Text; internal class TypeCoercion { // Handle type coercion to bool for Javascript-style if(foo) statements. static public object CoerceToBool(object obj) { if (obj is bool) { // Do nothing, we're fine. } else if (obj is string) { // A non-empty string is true. obj = !string.IsNullOrEmpty(obj as string); } else { // Give the binder a chance to splice in a bool coercion. var equalityMethod = Runtime.RuntimeHost.Binder.BindToMethod(obj, "IsTrue", null, new object[0]); if (equalityMethod != null) { var result = equalityMethod.Invoke(null, new object[0]); if (result is bool) obj = (bool)result; else obj = obj != null; } else { // A non-null object is true. obj = obj != null; } } return obj; } } }
namespace ScriptNET { using System; using System.Collections.Generic; using System.Linq; using System.Text; internal class TypeCoercion { // Handle type coercion to bool for Javascript-style if(foo) statements. static public object CoerceToBool(object obj) { if (obj is bool) { // Do nothing, we're fine. } else if (obj is string) { // A non-empty string is true. obj = !string.IsNullOrEmpty(obj as string); } else if (obj is Array) { obj = ((Array)obj).Length > 0; } else if (obj == null) { obj = false; } else { // Give the binder a chance to splice in a bool coercion. var equalityMethod = Runtime.RuntimeHost.Binder.BindToMethod(obj, "IsTrue", null, new object[0]); if (equalityMethod != null) { var result = equalityMethod.Invoke(null, new object[0]); if (result is bool) obj = (bool)result; else obj = obj != null; } } // If all else fails... if (!(obj is bool)) { // A non-null object is true. obj = obj != null; } return obj; } } }
Make bool type coercion work with arrays, and improve handling of non-null objects as expression arguments to unary ! and such
Make bool type coercion work with arrays, and improve handling of non-null objects as expression arguments to unary ! and such
C#
mit
kayateia/scriptdotnet,kayateia/scriptdotnet
5ad122bfec900566a9d3ec1ad5f910d5e77c3528
osu.Game/Beatmaps/BeatmapSetInfo.cs
osu.Game/Beatmaps/BeatmapSetInfo.cs
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>. // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.Collections.Generic; using System.ComponentModel.DataAnnotations.Schema; using System.Linq; using osu.Game.Database; namespace osu.Game.Beatmaps { public class BeatmapSetInfo : IHasPrimaryKey, IHasFiles<BeatmapSetFileInfo>, ISoftDelete { [DatabaseGenerated(DatabaseGeneratedOption.Identity)] public int ID { get; set; } public int? OnlineBeatmapSetID { get; set; } public BeatmapMetadata Metadata { get; set; } public List<BeatmapInfo> Beatmaps { get; set; } [NotMapped] public BeatmapSetOnlineInfo OnlineInfo { get; set; } public double MaxStarDifficulty => Beatmaps?.Max(b => b.StarDifficulty) ?? 0; [NotMapped] public bool DeletePending { get; set; } public string Hash { get; set; } public string StoryboardFile => Files?.FirstOrDefault(f => f.Filename.EndsWith(".osb"))?.Filename; public List<BeatmapSetFileInfo> Files { get; set; } public override string ToString() => Metadata?.ToString() ?? base.ToString(); public bool Protected { get; set; } } }
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>. // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.Collections.Generic; using System.ComponentModel.DataAnnotations.Schema; using System.Linq; using osu.Game.Database; namespace osu.Game.Beatmaps { public class BeatmapSetInfo : IHasPrimaryKey, IHasFiles<BeatmapSetFileInfo>, ISoftDelete { [DatabaseGenerated(DatabaseGeneratedOption.Identity)] public int ID { get; set; } private int? onlineBeatmapSetID; public int? OnlineBeatmapSetID { get { return onlineBeatmapSetID; } set { onlineBeatmapSetID = value > 0 ? value : null; } } public BeatmapMetadata Metadata { get; set; } public List<BeatmapInfo> Beatmaps { get; set; } [NotMapped] public BeatmapSetOnlineInfo OnlineInfo { get; set; } public double MaxStarDifficulty => Beatmaps?.Max(b => b.StarDifficulty) ?? 0; [NotMapped] public bool DeletePending { get; set; } public string Hash { get; set; } public string StoryboardFile => Files?.FirstOrDefault(f => f.Filename.EndsWith(".osb"))?.Filename; public List<BeatmapSetFileInfo> Files { get; set; } public override string ToString() => Metadata?.ToString() ?? base.ToString(); public bool Protected { get; set; } } }
Fix beatmaps importing with -1 as online set ID
Fix beatmaps importing with -1 as online set ID
C#
mit
ppy/osu,smoogipoo/osu,DrabWeb/osu,UselessToucan/osu,smoogipoo/osu,EVAST9919/osu,DrabWeb/osu,NeoAdonis/osu,ppy/osu,smoogipooo/osu,UselessToucan/osu,NeoAdonis/osu,johnneijzen/osu,ZLima12/osu,ZLima12/osu,ppy/osu,NeoAdonis/osu,DrabWeb/osu,peppy/osu,2yangk23/osu,EVAST9919/osu,naoey/osu,2yangk23/osu,peppy/osu,UselessToucan/osu,johnneijzen/osu,peppy/osu-new,naoey/osu,peppy/osu,naoey/osu,smoogipoo/osu
ac9bbab618055e15d1ce98af7e998e019ad90595
Sdl.Community.GroupShareKit.Tests.Integration/Helper.cs
Sdl.Community.GroupShareKit.Tests.Integration/Helper.cs
using System; using System.Threading.Tasks; using Sdl.Community.GroupShareKit.Clients; using Sdl.Community.GroupShareKit.Http; namespace Sdl.Community.GroupShareKit.Tests.Integration { public static class Helper { public static async Task<GroupShareClient> GetGroupShareClient() { var groupShareUser = Environment.GetEnvironmentVariable("GROUPSHAREKIT_USERNAME"); var groupSharePassword = Environment.GetEnvironmentVariable("GROUPSHAREKIT_PASSWORD"); var token = await GroupShareClient.GetRequestToken(groupShareUser, groupSharePassword, BaseUri, GroupShareClient.AllScopes); var gsClient = await GroupShareClient.AuthenticateClient(token, groupShareUser, groupSharePassword,BaseUri, GroupShareClient.AllScopes); return gsClient; } public static Uri BaseUri => new Uri(Environment.GetEnvironmentVariable("GROUPSHAREKIT_BASEURI")); public static string TestOrganization => Environment.GetEnvironmentVariable("GROUPSHAREKIT_TESTORGANIZATION"); } }
using System; using System.Threading.Tasks; using Sdl.Community.GroupShareKit.Clients; using Sdl.Community.GroupShareKit.Http; namespace Sdl.Community.GroupShareKit.Tests.Integration { public static class Helper { public static string GetVariable(string key) { // by default it gets a process variable. Allow getting user as well return Environment.GetEnvironmentVariable(key) ?? Environment.GetEnvironmentVariable(key, EnvironmentVariableTarget.User); } public static async Task<GroupShareClient> GetGroupShareClient() { var groupShareUser = Helper.GetVariable("GROUPSHAREKIT_USERNAME"); var groupSharePassword = Helper.GetVariable("GROUPSHAREKIT_PASSWORD"); var token = await GroupShareClient.GetRequestToken(groupShareUser, groupSharePassword, BaseUri, GroupShareClient.AllScopes); var gsClient = await GroupShareClient.AuthenticateClient(token, groupShareUser, groupSharePassword,BaseUri, GroupShareClient.AllScopes); return gsClient; } public static Uri BaseUri => new Uri(Helper.GetVariable("GROUPSHAREKIT_BASEURI")); public static string TestOrganization => Helper.GetVariable("GROUPSHAREKIT_TESTORGANIZATION"); } }
Allow getting a user env variable
Allow getting a user env variable
C#
mit
sdl/groupsharekit.net
b329becda54800fbdbb7de002cf3f96d2386e033
Anlab.Mvc/Extensions/StringExtensions.cs
Anlab.Mvc/Extensions/StringExtensions.cs
using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; namespace AnlabMvc.Extensions { public static class StringExtensions { public static string PaymentMethodDescription(this string value) { if (string.Equals(value, "uc", StringComparison.OrdinalIgnoreCase)) { return "UC Account"; } if (string.Equals(value, "creditcard", StringComparison.OrdinalIgnoreCase)) { return "Credit Card"; } return "Other"; } public static string MaxLength(this string value, int maxLength, bool ellipsis = true) { if (string.IsNullOrWhiteSpace(value)) { return value; } if (value.Length > maxLength) { if (ellipsis) { return $"{value.Substring(0, maxLength - 3)}..."; } return value.Substring(0, maxLength); } return value; } } }
using System; using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; using System.Threading.Tasks; namespace AnlabMvc.Extensions { public static class StringExtensions { const string emailRegex = @"^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$"; public static string PaymentMethodDescription(this string value) { if (string.Equals(value, "uc", StringComparison.OrdinalIgnoreCase)) { return "UC Account"; } if (string.Equals(value, "creditcard", StringComparison.OrdinalIgnoreCase)) { return "Credit Card"; } return "Other"; } public static string MaxLength(this string value, int maxLength, bool ellipsis = true) { if (string.IsNullOrWhiteSpace(value)) { return value; } if (value.Length > maxLength) { if (ellipsis) { return $"{value.Substring(0, maxLength - 3)}..."; } return value.Substring(0, maxLength); } return value; } public static bool IsEmailValid(this string value) { if (string.IsNullOrWhiteSpace(value)) { return false; } return Regex.IsMatch(value.ToLower(), emailRegex); } } }
Add a string extension to validate Email
Add a string extension to validate Email Regex was from the labworks service which was from the order form
C#
mit
ucdavis/Anlab,ucdavis/Anlab,ucdavis/Anlab,ucdavis/Anlab
cb3512f84af32d1809c1e233e170a21499c0071c
src/VisualStudio/Core/Def/Implementation/Serialization/AssemblySerializationInfoService.cs
src/VisualStudio/Core/Def/Implementation/Serialization/AssemblySerializationInfoService.cs
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System.Composition; using System.IO; using Microsoft.CodeAnalysis.Host.Mef; using Roslyn.Utilities; namespace Microsoft.CodeAnalysis.Serialization { [ExportWorkspaceService(typeof(IAssemblySerializationInfoService), ServiceLayer.Host)] [Shared] internal class AssemblySerializationInfoService : IAssemblySerializationInfoService { public bool Serializable(Solution solution, string assemblyFilePath) { if (assemblyFilePath == null || !File.Exists(assemblyFilePath) || !ReferencePathUtilities.PartOfFrameworkOrReferencePaths(assemblyFilePath)) { return false; } // if solution is not from a disk, just create one. if (solution.FilePath == null || !File.Exists(solution.FilePath)) { return false; } return true; } public bool TryGetSerializationPrefixAndVersion(Solution solution, string assemblyFilePath, out string prefix, out VersionStamp version) { prefix = FilePathUtilities.GetRelativePath(solution.FilePath, assemblyFilePath); version = VersionStamp.Create(File.GetLastWriteTimeUtc(assemblyFilePath)); return true; } } }
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System.Composition; using System.IO; using Microsoft.CodeAnalysis.Host.Mef; using Roslyn.Utilities; namespace Microsoft.CodeAnalysis.Serialization { [ExportWorkspaceService(typeof(IAssemblySerializationInfoService), ServiceLayer.Host)] [Shared] internal class AssemblySerializationInfoService : IAssemblySerializationInfoService { public bool Serializable(Solution solution, string assemblyFilePath) { if (assemblyFilePath == null || !File.Exists(assemblyFilePath)) { return false; } // if solution is not from a disk, just create one. if (solution.FilePath == null || !File.Exists(solution.FilePath)) { return false; } return true; } public bool TryGetSerializationPrefixAndVersion(Solution solution, string assemblyFilePath, out string prefix, out VersionStamp version) { prefix = FilePathUtilities.GetRelativePath(solution.FilePath, assemblyFilePath); version = VersionStamp.Create(File.GetLastWriteTimeUtc(assemblyFilePath)); return true; } } }
Allow indices to be stored for .net assemblies.
Allow indices to be stored for .net assemblies.
C#
mit
sharwell/roslyn,VSadov/roslyn,zooba/roslyn,balajikris/roslyn,Maxwe11/roslyn,mattwar/roslyn,AlekseyTs/roslyn,robinsedlaczek/roslyn,sharadagrawal/Roslyn,jasonmalinowski/roslyn,khyperia/roslyn,lorcanmooney/roslyn,leppie/roslyn,mavasani/roslyn,leppie/roslyn,mmitche/roslyn,xoofx/roslyn,budcribar/roslyn,Pvlerick/roslyn,rgani/roslyn,xasx/roslyn,paulvanbrenk/roslyn,ljw1004/roslyn,ValentinRueda/roslyn,SeriaWei/roslyn,VSadov/roslyn,tmeschter/roslyn,nguerrera/roslyn,Maxwe11/roslyn,yeaicc/roslyn,TyOverby/roslyn,KevinRansom/roslyn,abock/roslyn,wvdd007/roslyn,jhendrixMSFT/roslyn,mattwar/roslyn,CaptainHayashi/roslyn,physhi/roslyn,thomaslevesque/roslyn,akrisiun/roslyn,AlekseyTs/roslyn,eriawan/roslyn,AArnott/roslyn,amcasey/roslyn,jaredpar/roslyn,panopticoncentral/roslyn,jasonmalinowski/roslyn,bkoelman/roslyn,natgla/roslyn,dpoeschl/roslyn,MattWindsor91/roslyn,mavasani/roslyn,davkean/roslyn,drognanar/roslyn,DustinCampbell/roslyn,ericfe-ms/roslyn,MatthieuMEZIL/roslyn,Giftednewt/roslyn,drognanar/roslyn,tvand7093/roslyn,kelltrick/roslyn,lorcanmooney/roslyn,bbarry/roslyn,KiloBravoLima/roslyn,MattWindsor91/roslyn,basoundr/roslyn,stephentoub/roslyn,orthoxerox/roslyn,mavasani/roslyn,AArnott/roslyn,CyrusNajmabadi/roslyn,xasx/roslyn,cston/roslyn,ErikSchierboom/roslyn,jamesqo/roslyn,jmarolf/roslyn,basoundr/roslyn,KiloBravoLima/roslyn,shyamnamboodiripad/roslyn,bbarry/roslyn,KevinRansom/roslyn,orthoxerox/roslyn,balajikris/roslyn,reaction1989/roslyn,bartdesmet/roslyn,heejaechang/roslyn,ericfe-ms/roslyn,rgani/roslyn,michalhosala/roslyn,jmarolf/roslyn,stephentoub/roslyn,gafter/roslyn,akrisiun/roslyn,TyOverby/roslyn,pdelvo/roslyn,ericfe-ms/roslyn,jhendrixMSFT/roslyn,kelltrick/roslyn,KevinH-MS/roslyn,tmat/roslyn,khyperia/roslyn,ljw1004/roslyn,Shiney/roslyn,weltkante/roslyn,jamesqo/roslyn,jeffanders/roslyn,Shiney/roslyn,KirillOsenkov/roslyn,vcsjones/roslyn,CaptainHayashi/roslyn,srivatsn/roslyn,natgla/roslyn,xoofx/roslyn,weltkante/roslyn,tmeschter/roslyn,antonssonj/roslyn,jkotas/roslyn,bbarry/roslyn,aelij/roslyn,swaroop-sridhar/roslyn,ValentinRueda/roslyn,AmadeusW/roslyn,natidea/roslyn,AdamSpeight2008/roslyn-AdamSpeight2008,mmitche/roslyn,cston/roslyn,sharadagrawal/Roslyn,agocke/roslyn,xasx/roslyn,pdelvo/roslyn,Shiney/roslyn,swaroop-sridhar/roslyn,balajikris/roslyn,Pvlerick/roslyn,budcribar/roslyn,DustinCampbell/roslyn,aelij/roslyn,AArnott/roslyn,khellang/roslyn,MattWindsor91/roslyn,dotnet/roslyn,MichalStrehovsky/roslyn,leppie/roslyn,davkean/roslyn,gafter/roslyn,tannergooding/roslyn,brettfo/roslyn,paulvanbrenk/roslyn,wvdd007/roslyn,mgoertz-msft/roslyn,MatthieuMEZIL/roslyn,davkean/roslyn,jmarolf/roslyn,tmat/roslyn,rgani/roslyn,TyOverby/roslyn,khyperia/roslyn,jaredpar/roslyn,dotnet/roslyn,OmarTawfik/roslyn,sharwell/roslyn,abock/roslyn,shyamnamboodiripad/roslyn,VSadov/roslyn,mattscheffer/roslyn,dpoeschl/roslyn,AdamSpeight2008/roslyn-AdamSpeight2008,aelij/roslyn,tmeschter/roslyn,mmitche/roslyn,eriawan/roslyn,zooba/roslyn,pdelvo/roslyn,bkoelman/roslyn,wvdd007/roslyn,SeriaWei/roslyn,drognanar/roslyn,brettfo/roslyn,vslsnap/roslyn,jcouv/roslyn,CaptainHayashi/roslyn,jcouv/roslyn,sharadagrawal/Roslyn,kelltrick/roslyn,robinsedlaczek/roslyn,vslsnap/roslyn,a-ctor/roslyn,jasonmalinowski/roslyn,panopticoncentral/roslyn,OmarTawfik/roslyn,jhendrixMSFT/roslyn,KiloBravoLima/roslyn,genlu/roslyn,reaction1989/roslyn,tvand7093/roslyn,AmadeusW/roslyn,budcribar/roslyn,physhi/roslyn,bkoelman/roslyn,amcasey/roslyn,ljw1004/roslyn,MatthieuMEZIL/roslyn,jkotas/roslyn,vcsjones/roslyn,nguerrera/roslyn,natidea/roslyn,agocke/roslyn,AnthonyDGreen/roslyn,tmat/roslyn,KevinH-MS/roslyn,xoofx/roslyn,DustinCampbell/roslyn,vcsjones/roslyn,abock/roslyn,a-ctor/roslyn,diryboy/roslyn,Hosch250/roslyn,akrisiun/roslyn,Giftednewt/roslyn,khellang/roslyn,zooba/roslyn,KevinRansom/roslyn,bartdesmet/roslyn,sharwell/roslyn,a-ctor/roslyn,ErikSchierboom/roslyn,thomaslevesque/roslyn,mgoertz-msft/roslyn,agocke/roslyn,jcouv/roslyn,Hosch250/roslyn,michalhosala/roslyn,nguerrera/roslyn,srivatsn/roslyn,stephentoub/roslyn,physhi/roslyn,khellang/roslyn,yeaicc/roslyn,CyrusNajmabadi/roslyn,bartdesmet/roslyn,heejaechang/roslyn,dotnet/roslyn,MichalStrehovsky/roslyn,OmarTawfik/roslyn,mattscheffer/roslyn,CyrusNajmabadi/roslyn,Hosch250/roslyn,diryboy/roslyn,antonssonj/roslyn,AdamSpeight2008/roslyn-AdamSpeight2008,yeaicc/roslyn,jkotas/roslyn,brettfo/roslyn,ErikSchierboom/roslyn,tvand7093/roslyn,AnthonyDGreen/roslyn,paulvanbrenk/roslyn,AnthonyDGreen/roslyn,KirillOsenkov/roslyn,AmadeusW/roslyn,orthoxerox/roslyn,genlu/roslyn,tannergooding/roslyn,cston/roslyn,genlu/roslyn,antonssonj/roslyn,weltkante/roslyn,jeffanders/roslyn,MattWindsor91/roslyn,heejaechang/roslyn,Pvlerick/roslyn,Maxwe11/roslyn,robinsedlaczek/roslyn,eriawan/roslyn,shyamnamboodiripad/roslyn,gafter/roslyn,tannergooding/roslyn,panopticoncentral/roslyn,ValentinRueda/roslyn,jaredpar/roslyn,mattwar/roslyn,mattscheffer/roslyn,jamesqo/roslyn,jeffanders/roslyn,KevinH-MS/roslyn,michalhosala/roslyn,AlekseyTs/roslyn,mgoertz-msft/roslyn,thomaslevesque/roslyn,KirillOsenkov/roslyn,basoundr/roslyn,lorcanmooney/roslyn,dpoeschl/roslyn,diryboy/roslyn,natgla/roslyn,Giftednewt/roslyn,SeriaWei/roslyn,natidea/roslyn,amcasey/roslyn,reaction1989/roslyn,swaroop-sridhar/roslyn,srivatsn/roslyn,MichalStrehovsky/roslyn,vslsnap/roslyn
d8f4b56f0046192dc8c861c278ef7bf5fa44e41f
Kliva/ViewModels/SidePaneViewModel.cs
Kliva/ViewModels/SidePaneViewModel.cs
using Cimbalino.Toolkit.Services; using GalaSoft.MvvmLight; using GalaSoft.MvvmLight.Command; using Kliva.Models; using Kliva.Views; using Windows.UI.Xaml.Controls; namespace Kliva.ViewModels { public class SidePaneViewModel : KlivaBaseViewModel { private bool _isPaneOpen = true; public bool IsPaneOpen { get { return _isPaneOpen; } set { Set(() => IsPaneOpen, ref _isPaneOpen, value); } } private bool _isPaneVisible = true; public bool IsPaneVisible { get { return _isPaneVisible; } set { Set(() => IsPaneVisible, ref _isPaneVisible, value); } } private SplitViewDisplayMode _displayMode = SplitViewDisplayMode.CompactOverlay; public SplitViewDisplayMode DisplayMode { get { return _displayMode; } set { Set(() => DisplayMode, ref _displayMode, value); } } private RelayCommand _hamburgerCommand; public RelayCommand HamburgerCommand => _hamburgerCommand ?? (_hamburgerCommand = new RelayCommand(() => this.IsPaneOpen = !this.IsPaneOpen)); private RelayCommand _settingsCommand; public RelayCommand SettingsCommand => _settingsCommand ?? (_settingsCommand = new RelayCommand(() => _navigationService.Navigate<SettingsPage>())); public SidePaneViewModel(INavigationService navigationService) : base(navigationService) { } internal void ShowHide(bool show) { if (show) this.DisplayMode = SplitViewDisplayMode.CompactOverlay; else this.DisplayMode = SplitViewDisplayMode.Inline; this.IsPaneVisible = show; } } }
using Cimbalino.Toolkit.Services; using GalaSoft.MvvmLight; using GalaSoft.MvvmLight.Command; using Kliva.Models; using Kliva.Views; using Windows.UI.Xaml.Controls; namespace Kliva.ViewModels { public class SidePaneViewModel : KlivaBaseViewModel { private bool _isPaneOpen = false; public bool IsPaneOpen { get { return _isPaneOpen; } set { Set(() => IsPaneOpen, ref _isPaneOpen, value); } } private SplitViewDisplayMode _displayMode = SplitViewDisplayMode.CompactOverlay; public SplitViewDisplayMode DisplayMode { get { return _displayMode; } set { Set(() => DisplayMode, ref _displayMode, value); } } private RelayCommand _hamburgerCommand; public RelayCommand HamburgerCommand => _hamburgerCommand ?? (_hamburgerCommand = new RelayCommand(() => this.IsPaneOpen = !this.IsPaneOpen)); private RelayCommand _settingsCommand; public RelayCommand SettingsCommand => _settingsCommand ?? (_settingsCommand = new RelayCommand(() => _navigationService.Navigate<SettingsPage>())); public SidePaneViewModel(INavigationService navigationService) : base(navigationService) { } internal void ShowHide(bool show) { if (show) this.DisplayMode = SplitViewDisplayMode.CompactOverlay; else { this.DisplayMode = SplitViewDisplayMode.Inline; this.IsPaneOpen = false; } } } }
Adjust pane when going to inline mode to close it
Adjust pane when going to inline mode to close it
C#
mit
clarkezone/Kliva,AppCreativity/Kliva,timheuer/Kliva-1,JasterAtMicrosoft/Kliva
3a5155066012e818f964236a36c927ca7aa3e450
src/Dnn.PersonaBar.Library/Helper/PortalHelper.cs
src/Dnn.PersonaBar.Library/Helper/PortalHelper.cs
using DotNetNuke.Entities.Portals; using System; using System.Linq; namespace Dnn.PersonaBar.Library.Helper { public class PortalHelper { private static readonly IContentVerifier _contentVerifier = new ContentVerifier(PortalController.Instance, PortalGroupController.Instance); [Obsolete("Deprecated in 9.2.1. Use IContentVerifier.IsContentExistsForRequestedPortal")] public static bool IsContentExistsForRequestedPortal(int contentPortalId, PortalSettings portalSettings, bool checkForSiteGroup = false) { return _contentVerifier.IsContentExistsForRequestedPortal(contentPortalId, portalSettings, checkForSiteGroup); } } }
using DotNetNuke.Entities.Portals; using System; namespace Dnn.PersonaBar.Library.Helper { public class PortalHelper { private static readonly IContentVerifier _contentVerifier = new ContentVerifier(); [Obsolete("Deprecated in 9.2.1. Use IContentVerifier.IsContentExistsForRequestedPortal")] public static bool IsContentExistsForRequestedPortal(int contentPortalId, PortalSettings portalSettings, bool checkForSiteGroup = false) { return _contentVerifier.IsContentExistsForRequestedPortal(contentPortalId, portalSettings, checkForSiteGroup); } } }
Use the parameterless contructor from Obselete Portal Helper
DNN-20025: Use the parameterless contructor from Obselete Portal Helper
C#
mit
robsiera/Dnn.Platform,valadas/Dnn.Platform,EPTamminga/Dnn.Platform,valadas/Dnn.Platform,RichardHowells/Dnn.Platform,valadas/Dnn.Platform,nvisionative/Dnn.Platform,dnnsoftware/Dnn.Platform,dnnsoftware/Dnn.AdminExperience.Library,valadas/Dnn.Platform,dnnsoftware/Dnn.Platform,robsiera/Dnn.Platform,valadas/Dnn.Platform,nvisionative/Dnn.Platform,EPTamminga/Dnn.Platform,mitchelsellers/Dnn.Platform,dnnsoftware/Dnn.Platform,robsiera/Dnn.Platform,dnnsoftware/Dnn.AdminExperience.Library,mitchelsellers/Dnn.Platform,mitchelsellers/Dnn.Platform,bdukes/Dnn.Platform,RichardHowells/Dnn.Platform,RichardHowells/Dnn.Platform,dnnsoftware/Dnn.AdminExperience.Library,dnnsoftware/Dnn.Platform,bdukes/Dnn.Platform,nvisionative/Dnn.Platform,dnnsoftware/Dnn.Platform,mitchelsellers/Dnn.Platform,RichardHowells/Dnn.Platform,bdukes/Dnn.Platform,mitchelsellers/Dnn.Platform,EPTamminga/Dnn.Platform,bdukes/Dnn.Platform
4124bc7fe28d6c51b72158b7d20f471a1308c110
src/Fakes.Tests/Specs/FakeWatcher/WatcherSpecs.cs
src/Fakes.Tests/Specs/FakeWatcher/WatcherSpecs.cs
namespace TestableFileSystem.Fakes.Tests.Specs.FakeWatcher { public abstract class WatcherSpecs { protected const int NotifyWaitTimeoutMilliseconds = 500; protected const int SleepTimeToEnsureOperationHasArrivedAtWatcherConsumerLoop = 250; // TODO: Add specs for File.Encrypt/Decrypt, File.Lock/Unlock, File.Replace, Begin+EndRead/Write // TODO: Add specs for Directory.GetLogicalDrives } }
namespace TestableFileSystem.Fakes.Tests.Specs.FakeWatcher { public abstract class WatcherSpecs { protected const int NotifyWaitTimeoutMilliseconds = 1000; protected const int SleepTimeToEnsureOperationHasArrivedAtWatcherConsumerLoop = 250; // TODO: Add specs for File.Encrypt/Decrypt, File.Lock/Unlock, File.Replace, Begin+EndRead/Write // TODO: Add specs for Directory.GetLogicalDrives } }
Increase timeout to prevent cibuild failures
Increase timeout to prevent cibuild failures
C#
apache-2.0
bkoelman/TestableFileSystem
f8bde743dcf8a3180b45df7239d5a7de314de1cc
ExampleWebApp/Views/Examples/Wait.cshtml
ExampleWebApp/Views/Examples/Wait.cshtml
@{ ViewBag.Title = "ComboLoad"; } <div class="row"> <div class="col-md-12"> <h2>Example page for testing waits</h2> <p>The following combo starts with a placeholder option and after 3 seconds updates with a new item.</p> <select id="combo" > <option>Placeholder</option> </select> </div> </div> @section scripts { <script> $(document).ready(function () { var combo = $("#combo"); // Simulate loading the combo items from another source. // Wait 3 seconds then update the combo. setTimeout(function () { combo.empty(); combo.append( $("<option id=\"loaded\"></option>").text("Loaded") ); }, 3 * 1000); }); </script> }
@{ ViewBag.Title = "ComboLoad"; } <div class="row"> <div class="col-md-12"> <h2>Example page for testing waits</h2> <p class="alert alert-danger" id="message" style="display:none"></p> <div> <div class="form-group"> <label for="username">Username</label> <input type="email" class="form-control" id="username" placeholder="Username"> </div> <div class="form-group"> <label for="password">Password</label> <input type="password" class="form-control" id="password" placeholder="Password"> </div> <button type="button" class="btn btn-default" id="login">Log in</button> </div> </div> </div> @section scripts { <script> $(document).ready(function () { var loginButton = $("#login"); loginButton.on("click", function () { var usernameTxt = $("#username"), username = usernameTxt[0].value passwordTxt = $("#password"), password = passwordTxt[0].value; // Timeout to simulate making login request. setTimeout(function () { if (username === "user" && password === "password") { window.location = "/"; } else { var messageContainer = $("#message"); messageContainer.text("Invalid username and password.") messageContainer.css("display", ""); } }, 2 * 1000); }); }); </script> }
Change the wait example to a mock login page.
Change the wait example to a mock login page.
C#
mit
matthewrwilton/SeleniumExamples,matthewrwilton/SeleniumExamples
d3be7180fe2bdffe1be6f1034bdfa771ad1a34a7
GetChanges/Program.cs
GetChanges/Program.cs
using Nito.AsyncEx; using Octokit; using System; using System.Collections.Generic; using System.Linq; namespace Alteridem.GetChanges { class Program { static int Main(string[] args) { var options = new Options(); if (!CommandLine.Parser.Default.ParseArguments(args, options)) { return -1; } AsyncContext.Run(() => MainAsync(options)); //Console.WriteLine("*** Press ENTER to Exit ***"); //Console.ReadLine(); return 0; } static async void MainAsync(Options options) { var github = new GitHubApi(options.Organization, options.Repository); var milestones = await github.GetOpenMilestones(); foreach (var milestone in milestones.Where(m => m.DueOn != null && m.DueOn.Value.Subtract(DateTimeOffset.Now).TotalDays < 30)) { var milestoneIssues = await github.GetClosedIssuesForMilestone(milestone); DisplayIssuesForMilestone(options, milestone.Title, milestoneIssues); } } static void DisplayIssuesForMilestone(Options options, string milestone, IEnumerable<Issue> issues) { Console.WriteLine("## {0}", milestone); Console.WriteLine(); foreach (var issue in issues) { if(options.LinkIssues) Console.WriteLine($" * [{issue.Number:####}](https://github.com/{options.Repository}/{options.Repository}/issues/{issue.Number}) {issue.Title}"); else Console.WriteLine($" * {issue.Number:####} {issue.Title}"); } Console.WriteLine(); } } }
using Nito.AsyncEx; using Octokit; using System; using System.Collections.Generic; using System.Linq; namespace Alteridem.GetChanges { class Program { static int Main(string[] args) { var options = new Options(); if (!CommandLine.Parser.Default.ParseArguments(args, options)) { return -1; } AsyncContext.Run(() => MainAsync(options)); //Console.WriteLine("*** Press ENTER to Exit ***"); //Console.ReadLine(); return 0; } static async void MainAsync(Options options) { var github = new GitHubApi(options.Organization, options.Repository); var milestones = await github.GetOpenMilestones(); foreach (var milestone in milestones.Where(m => m.DueOn != null && m.DueOn.Value.Subtract(DateTimeOffset.Now).TotalDays < 30)) { var milestoneIssues = await github.GetClosedIssuesForMilestone(milestone); DisplayIssuesForMilestone(options, milestone.Title, milestoneIssues); } } static void DisplayIssuesForMilestone(Options options, string milestone, IEnumerable<Issue> issues) { Console.WriteLine("## {0}", milestone); Console.WriteLine(); foreach (var issue in issues) { if(options.LinkIssues) Console.WriteLine($" * [{issue.Number:####}](https://github.com/{options.Organization}/{options.Repository}/issues/{issue.Number}) {issue.Title}"); else Console.WriteLine($" * {issue.Number:####} {issue.Title}"); } Console.WriteLine(); } } }
Fix bug where repo name was used instead of organization in the links.
Fix bug where repo name was used instead of organization in the links.
C#
mit
rprouse/GetChanges
822b6cd015f5c5ebe13bb3b8ea281c0ab68d7199
Battery-Commander.Web/Models/RequestAccessModel.cs
Battery-Commander.Web/Models/RequestAccessModel.cs
using Microsoft.AspNetCore.Mvc.Rendering; using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; namespace BatteryCommander.Web.Models { public class RequestAccessModel { public String Name { get; set; } public String Email { get; set; } [Display(Name = "DOD ID")] public String DoDId { get; set; } public int Unit { get; set; } public IEnumerable<SelectListItem> Units { get; set; } } }
using Microsoft.AspNetCore.Mvc.Rendering; using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; namespace BatteryCommander.Web.Models { public class RequestAccessModel { public String Name { get; set; } public String Email { get; set; } [Display(Name = "DOD ID (10 Digits, On Your CAC)")] public String DoDId { get; set; } public int Unit { get; set; } public IEnumerable<SelectListItem> Units { get; set; } } }
Add note about what your dod is
Add note about what your dod is
C#
mit
mattgwagner/Battery-Commander,mattgwagner/Battery-Commander,mattgwagner/Battery-Commander,mattgwagner/Battery-Commander
0a4757db24e7f3e4e35bc6e4a6707db3fa1bf982
src/SFA.DAS.EAS.Web/Views/Shared/_SuccessMessage.cshtml
src/SFA.DAS.EAS.Web/Views/Shared/_SuccessMessage.cshtml
@using SFA.DAS.EAS.Web @using SFA.DAS.EAS.Web.Models @model dynamic @{ var viewModel = Model as OrchestratorResponse; } @if (!string.IsNullOrEmpty(viewModel?.FlashMessage?.Message) || !string.IsNullOrEmpty(viewModel?.FlashMessage?.SubMessage)) { <div class="grid-row"> <div class="column-full"> <div class="@viewModel.FlashMessage.SeverityCssClass"> @if (!string.IsNullOrWhiteSpace(viewModel.FlashMessage.Headline)) { <h1 class="@(viewModel.FlashMessage.Severity == FlashMessageSeverityLevel.Error ? "bold-medium" : "bold-large")">@viewModel.FlashMessage.Headline</h1> } @if (!string.IsNullOrEmpty(viewModel.FlashMessage.Message)) { <p>@Html.Raw(viewModel.FlashMessage.Message)</p> } @if (!string.IsNullOrEmpty(viewModel.FlashMessage.SubMessage)) { <p>@viewModel.FlashMessage.SubMessage</p> } @if (viewModel.FlashMessage.ErrorMessages.Any()) { <ul class="error-summary-list"> @foreach (var errorMessage in viewModel.FlashMessage.ErrorMessages) { <li> <a class="danger" href="#@errorMessage.Key">@errorMessage.Value</a> </li> } </ul> } </div> </div> </div> }
@using SFA.DAS.EAS.Web @using SFA.DAS.EAS.Web.Models @model dynamic @{ var viewModel = Model as OrchestratorResponse; } @if (!string.IsNullOrEmpty(viewModel?.FlashMessage?.Message) || !string.IsNullOrEmpty(viewModel?.FlashMessage?.SubMessage)) { <div class="grid-row"> <div class="column-full"> <div class="@viewModel.FlashMessage.SeverityCssClass"> @if (!string.IsNullOrWhiteSpace(viewModel.FlashMessage.Headline)) { <h1 class="@(viewModel.FlashMessage.Severity == FlashMessageSeverityLevel.Error ? "bold-medium" : "bold-large")">@viewModel.FlashMessage.Headline</h1> } @if (!string.IsNullOrEmpty(viewModel.FlashMessage.Message)) { <p>@Html.Raw(viewModel.FlashMessage.Message)</p> } @if (!string.IsNullOrEmpty(viewModel.FlashMessage.SubMessage)) { <p>@Html.Raw(viewModel.FlashMessage.SubMessage)</p> } @if (viewModel.FlashMessage.ErrorMessages.Any()) { <ul class="error-summary-list"> @foreach (var errorMessage in viewModel.FlashMessage.ErrorMessages) { <li> <a class="danger" href="#@errorMessage.Key">@errorMessage.Value</a> </li> } </ul> } </div> </div> </div> }
Write out raw HTML if SubMessage contains any
Write out raw HTML if SubMessage contains any
C#
mit
SkillsFundingAgency/das-employerapprenticeshipsservice,SkillsFundingAgency/das-employerapprenticeshipsservice,SkillsFundingAgency/das-employerapprenticeshipsservice
0161d607e6bb4944c991f39a2e405706efd0ae8d
Settings/LSFSettingsManager.cs
Settings/LSFSettingsManager.cs
using UnityEngine; using System.Collections; using FastCollections; #if UNITY_EDITOR using UnityEditor; #endif namespace Lockstep { public static class LSFSettingsManager { public const string DEFAULT_SETTINGS_NAME = "DefaultLockstepFrameworkSettings"; public const string SETTINGS_NAME = "LockstepFrameworkSettings"; static LSFSettings MainSettings; static LSFSettingsManager() { LSFSettings settings = Resources.Load<LSFSettings>(SETTINGS_NAME); #if UNITY_EDITOR if (settings == null) { if (Application.isPlaying == false) { settings = ScriptableObject.CreateInstance <LSFSettings>(); if (!System.IO.Directory.Exists(Application.dataPath + "/Resources")) AssetDatabase.CreateFolder("Assets", "Resources"); AssetDatabase.CreateAsset(settings, "Assets/Resources/" + SETTINGS_NAME + ".asset"); AssetDatabase.SaveAssets(); AssetDatabase.Refresh(); } else { } } #endif MainSettings = settings; if (MainSettings == null) { settings = Resources.Load<LSFSettings>(DEFAULT_SETTINGS_NAME); Debug.Log("No settings found. Loading default settings."); } } public static LSFSettings GetSettings() { return MainSettings; } } }
using UnityEngine; using System.Collections; using FastCollections; #if UNITY_EDITOR using UnityEditor; #endif namespace Lockstep { public static class LSFSettingsManager { public const string DEFAULT_SETTINGS_NAME = "DefaultLockstepFrameworkSettings"; public const string SETTINGS_NAME = "LockstepFrameworkSettings"; static LSFSettings MainSettings; static LSFSettingsManager () { Initialize (); } static void Initialize() { LSFSettings settings = Resources.Load<LSFSettings>(SETTINGS_NAME); #if UNITY_EDITOR if (settings == null) { if (Application.isPlaying == false) { settings = ScriptableObject.CreateInstance <LSFSettings>(); if (!System.IO.Directory.Exists(Application.dataPath + "/Resources")) AssetDatabase.CreateFolder("Assets", "Resources"); AssetDatabase.CreateAsset(settings, "Assets/Resources/" + SETTINGS_NAME + ".asset"); AssetDatabase.SaveAssets(); AssetDatabase.Refresh(); Debug.Log("Successfuly created new settings file."); } else { } } #endif MainSettings = settings; if (MainSettings == null) { settings = Resources.Load<LSFSettings>(DEFAULT_SETTINGS_NAME); Debug.Log("No settings found. Loading default settings."); } } public static LSFSettings GetSettings() { if (MainSettings == null) Initialize (); return MainSettings; } } }
Fix handling of deletion of settings file;
Fix handling of deletion of settings file;
C#
mit
SnpM/Lockstep-Framework
67ac57f5060232f992d85724e060fdc4e5122755
Gu.Roslyn.Asserts.Tests.Net472WithAttributes/RoslynAssertTests.cs
Gu.Roslyn.Asserts.Tests.Net472WithAttributes/RoslynAssertTests.cs
namespace Gu.Roslyn.Asserts.Tests.Net472WithAttributes { using Gu.Roslyn.Asserts.Tests.Net472WithAttributes.AnalyzersAndFixes; using NUnit.Framework; public partial class RoslynAssertTests { [Test] public void ResetMetadataReferences() { CollectionAssert.IsNotEmpty(RoslynAssert.MetadataReferences); RoslynAssert.MetadataReferences.Clear(); CollectionAssert.IsEmpty(RoslynAssert.MetadataReferences); RoslynAssert.ResetMetadataReferences(); CollectionAssert.IsNotEmpty(RoslynAssert.MetadataReferences); } [Test] public void CodeFixSingleClassOneErrorCorrectFix() { var before = @" namespace RoslynSandbox { class Foo { private readonly int ↓_value; } }"; var after = @" namespace RoslynSandbox { class Foo { private readonly int value; } }"; var analyzer = new FieldNameMustNotBeginWithUnderscore(); var fix = new DontUseUnderscoreCodeFixProvider(); RoslynAssert.CodeFix(analyzer, fix, before, after); } } }
namespace Gu.Roslyn.Asserts.Tests.Net472WithAttributes { using Gu.Roslyn.Asserts.Tests.Net472WithAttributes.AnalyzersAndFixes; using NUnit.Framework; public partial class RoslynAssertTests { [Test] public void ResetMetadataReferences() { CollectionAssert.IsNotEmpty(RoslynAssert.MetadataReferences); RoslynAssert.MetadataReferences.Clear(); CollectionAssert.IsEmpty(RoslynAssert.MetadataReferences); RoslynAssert.ResetMetadataReferences(); CollectionAssert.IsNotEmpty(RoslynAssert.MetadataReferences); } [Test] public void CodeFixSingleClassOneErrorCorrectFix() { var before = @" namespace RoslynSandbox { class C { private readonly int ↓_value; } }"; var after = @" namespace RoslynSandbox { class C { private readonly int value; } }"; var analyzer = new FieldNameMustNotBeginWithUnderscore(); var fix = new DontUseUnderscoreCodeFixProvider(); RoslynAssert.CodeFix(analyzer, fix, before, after); } } }
Rename types in test code.
Rename types in test code.
C#
mit
JohanLarsson/Gu.Roslyn.Asserts
f6cf8d71a4f93f12fa66fa5f1e31d819a657b0cf
LmpClient/Windows/Chat/ChatDrawer.cs
LmpClient/Windows/Chat/ChatDrawer.cs
using LmpClient.Localization; using LmpClient.Systems.Chat; using UnityEngine; namespace LmpClient.Windows.Chat { public partial class ChatWindow { private static string _chatInputText = string.Empty; protected override void DrawWindowContent(int windowId) { var pressedEnter = Event.current.type == EventType.KeyDown && !Event.current.shift && Event.current.character == '\n'; GUILayout.BeginVertical(); GUI.DragWindow(MoveRect); DrawChatMessageBox(); DrawTextInput(pressedEnter); GUILayout.Space(5); GUILayout.EndVertical(); } private static void DrawChatMessageBox() { GUILayout.BeginHorizontal(); _chatScrollPos = GUILayout.BeginScrollView(_chatScrollPos); GUILayout.BeginVertical(); GUILayout.FlexibleSpace(); foreach (var channelMessage in ChatSystem.Singleton.ChatMessages) GUILayout.Label(channelMessage); GUILayout.EndVertical(); GUILayout.EndScrollView(); GUILayout.EndHorizontal(); } private static void DrawTextInput(bool pressedEnter) { GUILayout.BeginHorizontal(); _chatInputText = GUILayout.TextArea(_chatInputText); if (pressedEnter || GUILayout.Button(LocalizationContainer.ChatWindowText.Send, GUILayout.Width(WindowWidth * .25f))) { if (!string.IsNullOrEmpty(_chatInputText)) { ChatSystem.Singleton.MessageSender.SendChatMsg(_chatInputText.Trim('\n')); } _chatInputText = string.Empty; } GUILayout.EndHorizontal(); } } }
using LmpClient.Localization; using LmpClient.Systems.Chat; using UnityEngine; namespace LmpClient.Windows.Chat { public partial class ChatWindow { private static string _chatInputText = string.Empty; protected override void DrawWindowContent(int windowId) { var pressedEnter = Event.current.type == EventType.KeyDown && !Event.current.shift && Event.current.character == '\n'; GUILayout.BeginVertical(); GUI.DragWindow(MoveRect); DrawChatMessageBox(); DrawTextInput(pressedEnter); GUILayout.Space(5); GUILayout.EndVertical(); } private static void DrawChatMessageBox() { GUILayout.BeginHorizontal(); _chatScrollPos = GUILayout.BeginScrollView(_chatScrollPos); GUILayout.BeginVertical(); GUILayout.FlexibleSpace(); foreach (var channelMessage in ChatSystem.Singleton.ChatMessages) GUILayout.Label(channelMessage); GUILayout.EndVertical(); GUILayout.EndScrollView(); GUILayout.EndHorizontal(); } private static void DrawTextInput(bool pressedEnter) { GUILayout.BeginHorizontal(); if (pressedEnter || GUILayout.Button(LocalizationContainer.ChatWindowText.Send, GUILayout.Width(WindowWidth * .25f))) { if (!string.IsNullOrEmpty(_chatInputText)) { ChatSystem.Singleton.MessageSender.SendChatMsg(_chatInputText.Trim('\n')); } _chatInputText = string.Empty; } else { _chatInputText = GUILayout.TextArea(_chatInputText); } GUILayout.EndHorizontal(); } } }
Make the chat input only update when enter is not pressed
Make the chat input only update when enter is not pressed
C#
mit
gavazquez/LunaMultiPlayer,DaggerES/LunaMultiPlayer,gavazquez/LunaMultiPlayer,gavazquez/LunaMultiPlayer
32aac83e5fa7ec7df8935cbd2498cd13bdb88554
Editor/DisableAfterTimeEditor.cs
Editor/DisableAfterTimeEditor.cs
using UnityEngine; using System.Collections; using UnityEditor; using OneDayGame; namespace DisableAfterTimeEx { [CustomEditor(typeof (DisableAfterTime))] public class DisableAfterTimeEditor : Editor { private SerializedProperty targetGO; private SerializedProperty delay; private void OnEnable() { targetGO = serializedObject.FindProperty("targetGO"); delay = serializedObject.FindProperty("delay"); } public override void OnInspectorGUI() { serializedObject.Update(); EditorGUILayout.PropertyField(targetGO); EditorGUILayout.PropertyField(delay); serializedObject.ApplyModifiedProperties(); } } }
using UnityEngine; using System.Collections; using UnityEditor; using OneDayGame; namespace DisableAfterTimeEx { [CustomEditor(typeof (DisableAfterTime))] public class DisableAfterTimeEditor : Editor { private SerializedProperty targetGO; private SerializedProperty delay; private void OnEnable() { targetGO = serializedObject.FindProperty("targetGO"); delay = serializedObject.FindProperty("delay"); } public override void OnInspectorGUI() { serializedObject.Update(); DrawTargetGOField(); DrawDelayField(); serializedObject.ApplyModifiedProperties(); } private void DrawDelayField() { EditorGUILayout.PropertyField( delay, new GUIContent( "Delay", "Delay before disabling target game object.")); } private void DrawTargetGOField() { EditorGUILayout.PropertyField( targetGO, new GUIContent( "Target", "Game object to be disabled.")); } } }
Add tooltips and extract inspector classes
Add tooltips and extract inspector classes
C#
mit
bartlomiejwolk/DisableAfterTime
c9c28603a7f1d0fa01f65782e26108242c0fa2d8
src/SyncTrayzor/Syncthing/ApiClient/SyncthingHttpClientHandler.cs
src/SyncTrayzor/Syncthing/ApiClient/SyncthingHttpClientHandler.cs
using NLog; using System.Net.Http; using System.Threading; using System.Threading.Tasks; using System; namespace SyncTrayzor.Syncthing.ApiClient { public class SyncthingHttpClientHandler : WebRequestHandler { private static readonly Logger logger = LogManager.GetCurrentClassLogger(); public SyncthingHttpClientHandler() { // We expect Syncthing to return invalid certs this.ServerCertificateValidationCallback = (sender, certificate, chain, sslPolicyErrors) => true; } protected override async Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) { var response = await base.SendAsync(request, cancellationToken); // We're getting null bodies from somewhere: try and figure out where var responseString = await response.Content.ReadAsStringAsync(); if (String.IsNullOrWhiteSpace(responseString)) logger.Warn($"Null response received from {request.RequestUri}. {response}. Content (again): {response.Content.ReadAsStringAsync()}"); if (response.IsSuccessStatusCode) logger.Trace(() => response.Content.ReadAsStringAsync().Result.Trim()); else logger.Warn("Non-successful status code. {0} {1}", response, (await response.Content.ReadAsStringAsync()).Trim()); return response; } } }
using NLog; using System.Net.Http; using System.Threading; using System.Threading.Tasks; using System; namespace SyncTrayzor.Syncthing.ApiClient { public class SyncthingHttpClientHandler : WebRequestHandler { private static readonly Logger logger = LogManager.GetCurrentClassLogger(); public SyncthingHttpClientHandler() { // We expect Syncthing to return invalid certs this.ServerCertificateValidationCallback = (sender, certificate, chain, sslPolicyErrors) => true; } protected override async Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) { var response = await base.SendAsync(request, cancellationToken); if (response.IsSuccessStatusCode) logger.Trace(() => response.Content.ReadAsStringAsync().Result.Trim()); else logger.Warn("Non-successful status code. {0} {1}", response, (await response.Content.ReadAsStringAsync()).Trim()); return response; } } }
Remove code which logs empty responses
Remove code which logs empty responses We solved that issue, and now it just pops up for lots of requests which have geniunely empty responses.
C#
mit
canton7/SyncTrayzor,canton7/SyncTrayzor,canton7/SyncTrayzor
d3541816a637f8ccb105622ac71027a096b9009c
LxRunOffline/Program.cs
LxRunOffline/Program.cs
using System; using System.Diagnostics; using EasyHook; namespace LxRunOffline { class Program { static void Main(string[] args) { int pId = 0; try { RemoteHooking.CreateAndInject(@"C:\Windows\System32\LxRun.exe", string.Join(" ", args), 0, "LxRunHook.dll", "LxRunHook.dll", out pId); } catch (Exception e) { Console.ForegroundColor = ConsoleColor.Yellow; Console.WriteLine("Error: Failed to launch LxRun."); Console.WriteLine(e); Environment.Exit(-1); } var process = Process.GetProcessById(pId); process.WaitForExit(); } } }
using System; using System.Diagnostics; using EasyHook; namespace LxRunOffline { class Program { static void Main(string[] args) { int pId = 0; try { RemoteHooking.CreateAndInject(@"C:\Windows\System32\LxRun.exe", string.Join(" ", args), 0, "LxRunHook.dll", "LxRunHook.dll", out pId); } catch (Exception e) { Console.ForegroundColor = ConsoleColor.Yellow; Console.WriteLine("Error: Failed to launch LxRun."); Console.WriteLine(e); Console.ResetColor(); Environment.Exit(-1); } var process = Process.GetProcessById(pId); process.WaitForExit(); } } }
Reset console color on exit.
Reset console color on exit.
C#
mit
sqc1999/LxRunOffline
a0d6e8cb97848c490ca51d802768a68996c3f2ca
QuickFont/QFontGlyph.cs
QuickFont/QFontGlyph.cs
using System; using System.Collections.Generic; using System.Text; using System.Drawing; namespace QuickFont { public sealed class QFontGlyph { /// <summary> /// Which texture page the glyph is on /// </summary> public int Page { get; private set; } /// <summary> /// The rectangle defining the glyphs position on the page /// </summary> public Rectangle Rect { get; set; } /// <summary> /// How far the glyph would need to be vertically offset to be vertically in line with the tallest glyph in the set of all glyphs /// </summary> public int YOffset { get; set; } /// <summary> /// Which character this glyph represents /// </summary> public char Character { get; private set; } public QFontGlyph (int page, Rectangle rect, int yOffset, char character) { Page = page; Rect = rect; YOffset = yOffset; Character = character; } } }
using System; using System.Collections.Generic; using System.Text; using System.Drawing; namespace QuickFont { public sealed class QFontGlyph { /// <summary> /// Which texture page the glyph is on /// </summary> public int Page { get; private set; } /// <summary> /// The rectangle defining the glyphs position on the page /// </summary> public Rectangle Rect { get; set; } /// <summary> /// How far the glyph would need to be vertically offset to be vertically in line with the tallest glyph in the set of all glyphs /// </summary> public int YOffset { get; set; } /// <summary> /// Which character this glyph represents /// </summary> public char Character { get; private set; } /// <summary> /// Indicates whether colouring should be suppressed for this glyph. /// </summary> /// <value><c>true</c> if suppress colouring; otherwise, <c>false</c>.</value> public bool SuppressColouring { get; set; } public QFontGlyph (int page, Rectangle rect, int yOffset, char character) { Page = page; Rect = rect; YOffset = yOffset; Character = character; } } }
Allow suppression of colour for specific glyphs.
Allow suppression of colour for specific glyphs.
C#
mit
SirSengir/QuickFont
58c71090998ae40865ef236c9b570b1f91eb75ea
Rhino.ServiceBus/Hosting/AbstractBootStrapper.cs
Rhino.ServiceBus/Hosting/AbstractBootStrapper.cs
using System; using System.Reflection; using Rhino.ServiceBus.Config; using Rhino.ServiceBus.Impl; namespace Rhino.ServiceBus.Hosting { public abstract class AbstractBootStrapper : IDisposable { private AbstractRhinoServiceBusConfiguration config; public virtual Assembly Assembly { get { return GetType().Assembly; } } public virtual void AfterStart() { } public virtual void InitializeContainer() { CreateContainer(); config = CreateConfiguration(); ConfigureBusFacility(config); config.Configure(); } public virtual void UseConfiguration(BusConfigurationSection configurationSection) { config.UseConfiguration(configurationSection); } public abstract void CreateContainer(); public abstract void ExecuteDeploymentActions(string user); public abstract void ExecuteEnvironmentValidationActions(); public abstract T GetInstance<T>(); protected virtual bool IsTypeAcceptableForThisBootStrapper(Type t) { return true; } protected virtual AbstractRhinoServiceBusConfiguration CreateConfiguration() { return new RhinoServiceBusConfiguration(); } protected virtual void ConfigureBusFacility(AbstractRhinoServiceBusConfiguration configuration) { } public virtual void BeforeStart() { } public abstract void Dispose(); } }
using System; using System.Reflection; using Rhino.ServiceBus.Config; using Rhino.ServiceBus.Impl; namespace Rhino.ServiceBus.Hosting { public abstract class AbstractBootStrapper : IDisposable { private AbstractRhinoServiceBusConfiguration config; public virtual Assembly Assembly { get { return GetType().Assembly; } } public virtual void InitializeContainer() { CreateContainer(); config = CreateConfiguration(); ConfigureBusFacility(config); } public virtual void UseConfiguration(BusConfigurationSection configurationSection) { config.UseConfiguration(configurationSection); } public abstract void CreateContainer(); public abstract void ExecuteDeploymentActions(string user); public abstract void ExecuteEnvironmentValidationActions(); public abstract T GetInstance<T>(); protected virtual bool IsTypeAcceptableForThisBootStrapper(Type t) { return true; } protected virtual AbstractRhinoServiceBusConfiguration CreateConfiguration() { return new RhinoServiceBusConfiguration(); } protected virtual void ConfigureBusFacility(AbstractRhinoServiceBusConfiguration configuration) { } public virtual void BeforeStart() { config.Configure(); } public virtual void AfterStart() { } public abstract void Dispose(); } }
Move config.Configure to BeforeStart which gives the overloads the chance to change it before it throw because it dose not found an configuration.
Move config.Configure to BeforeStart which gives the overloads the chance to change it before it throw because it dose not found an configuration.
C#
bsd-3-clause
hibernating-rhinos/rhino-esb,ketiko/rhino-esb
aea03409a37d3f35379bcbb94d2e68bb5abb6746
src/BloomTests/web/ReadersApiTests.cs
src/BloomTests/web/ReadersApiTests.cs
using Bloom.Api; using Bloom.Book; using Bloom.Collection; using NUnit.Framework; namespace BloomTests.web { [TestFixture] public class ReadersApiTests { private EnhancedImageServer _server; [SetUp] public void Setup() { var bookSelection = new BookSelection(); bookSelection.SelectBook(new Bloom.Book.Book()); _server = new EnhancedImageServer(bookSelection); //needed to avoid a check in the server _server.CurrentCollectionSettings = new CollectionSettings(); var controller = new ReadersApi(bookSelection); controller.RegisterWithServer(_server); } [TearDown] public void TearDown() { _server.Dispose(); _server = null; } [Test] public void IsReceivingApiCalls() { var result = ApiTest.GetString(_server,"readers/test"); Assert.That(result, Is.EqualTo("OK")); } } }
using Bloom.Api; using Bloom.Book; using Bloom.Collection; using NUnit.Framework; namespace BloomTests.web { [TestFixture] public class ReadersApiTests { private EnhancedImageServer _server; [SetUp] public void Setup() { var bookSelection = new BookSelection(); bookSelection.SelectBook(new Bloom.Book.Book()); _server = new EnhancedImageServer(bookSelection); //needed to avoid a check in the server _server.CurrentCollectionSettings = new CollectionSettings(); var controller = new ReadersApi(bookSelection); controller.RegisterWithServer(_server); } [TearDown] public void TearDown() { _server.Dispose(); _server = null; } [Test] public void IsReceivingApiCalls() { var result = ApiTest.GetString(_server,"readers/io/test"); Assert.That(result, Is.EqualTo("OK")); } } }
Fix url of api test
Fix url of api test
C#
mit
andrew-polk/BloomDesktop,JohnThomson/BloomDesktop,StephenMcConnel/BloomDesktop,StephenMcConnel/BloomDesktop,BloomBooks/BloomDesktop,gmartin7/myBloomFork,andrew-polk/BloomDesktop,gmartin7/myBloomFork,JohnThomson/BloomDesktop,gmartin7/myBloomFork,gmartin7/myBloomFork,JohnThomson/BloomDesktop,andrew-polk/BloomDesktop,gmartin7/myBloomFork,andrew-polk/BloomDesktop,StephenMcConnel/BloomDesktop,JohnThomson/BloomDesktop,BloomBooks/BloomDesktop,JohnThomson/BloomDesktop,BloomBooks/BloomDesktop,andrew-polk/BloomDesktop,BloomBooks/BloomDesktop,andrew-polk/BloomDesktop,gmartin7/myBloomFork,BloomBooks/BloomDesktop,StephenMcConnel/BloomDesktop,BloomBooks/BloomDesktop,StephenMcConnel/BloomDesktop,StephenMcConnel/BloomDesktop
4509c8bcfbcf9fc2a9d6010d707868312fc13cea
osu.Game.Rulesets.Catch/Edit/Blueprints/Components/PlacementEditablePath.cs
osu.Game.Rulesets.Catch/Edit/Blueprints/Components/PlacementEditablePath.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 osu.Game.Rulesets.Catch.Objects; using osuTK; namespace osu.Game.Rulesets.Catch.Edit.Blueprints.Components { public class PlacementEditablePath : EditablePath { private JuiceStreamPathVertex originalNewVertex; public PlacementEditablePath(Func<float, double> positionToDistance) : base(positionToDistance) { } public void AddNewVertex() { var endVertex = Vertices[^1]; int index = AddVertex(endVertex.Distance, endVertex.X); for (int i = 0; i < VertexCount; i++) { VertexStates[i].IsSelected = i == index; VertexStates[i].VertexBeforeChange = Vertices[i]; } originalNewVertex = Vertices[index]; } /// <summary> /// Move the vertex added by <see cref="AddNewVertex"/> in the last time. /// </summary> public void MoveLastVertex(Vector2 screenSpacePosition) { Vector2 position = ToRelativePosition(screenSpacePosition); double distanceDelta = PositionToDistance(position.Y) - originalNewVertex.Distance; float xDelta = position.X - originalNewVertex.X; MoveSelectedVertices(distanceDelta, xDelta); } } }
// 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 osu.Game.Rulesets.Catch.Objects; using osuTK; namespace osu.Game.Rulesets.Catch.Edit.Blueprints.Components { public class PlacementEditablePath : EditablePath { /// <summary> /// The original position of the last added vertex. /// This is not same as the last vertex of the current path because the vertex ordering can change. /// </summary> private JuiceStreamPathVertex lastVertex; public PlacementEditablePath(Func<float, double> positionToDistance) : base(positionToDistance) { } public void AddNewVertex() { var endVertex = Vertices[^1]; int index = AddVertex(endVertex.Distance, endVertex.X); for (int i = 0; i < VertexCount; i++) { VertexStates[i].IsSelected = i == index; VertexStates[i].VertexBeforeChange = Vertices[i]; } lastVertex = Vertices[index]; } /// <summary> /// Move the vertex added by <see cref="AddNewVertex"/> in the last time. /// </summary> public void MoveLastVertex(Vector2 screenSpacePosition) { Vector2 position = ToRelativePosition(screenSpacePosition); double distanceDelta = PositionToDistance(position.Y) - lastVertex.Distance; float xDelta = position.X - lastVertex.X; MoveSelectedVertices(distanceDelta, xDelta); } } }
Use the more consistent `lastVertex`, with a comment
Use the more consistent `lastVertex`, with a comment
C#
mit
peppy/osu-new,UselessToucan/osu,smoogipoo/osu,UselessToucan/osu,ppy/osu,ppy/osu,peppy/osu,NeoAdonis/osu,ppy/osu,NeoAdonis/osu,UselessToucan/osu,smoogipoo/osu,smoogipooo/osu,peppy/osu,peppy/osu,smoogipoo/osu,NeoAdonis/osu
6dbdfcc70cd9f228707977e34bb56329e97b867f
osu.Game/Online/Rooms/JoinRoomRequest.cs
osu.Game/Online/Rooms/JoinRoomRequest.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.Net.Http; using osu.Framework.IO.Network; using osu.Game.Online.API; namespace osu.Game.Online.Rooms { public class JoinRoomRequest : APIRequest { public readonly Room Room; public readonly string Password; public JoinRoomRequest(Room room, string password) { Room = room; Password = password; } protected override WebRequest CreateWebRequest() { var req = base.CreateWebRequest(); req.Method = HttpMethod.Put; return req; } // Todo: Password needs to be specified here rather than via AddParameter() because this is a PUT request. May be a framework bug. protected override string Target => $"rooms/{Room.RoomID.Value}/users/{User.Id}?password={Password}"; } }
// 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.Net.Http; using osu.Framework.IO.Network; using osu.Game.Online.API; namespace osu.Game.Online.Rooms { public class JoinRoomRequest : APIRequest { public readonly Room Room; public readonly string Password; public JoinRoomRequest(Room room, string password) { Room = room; Password = password; } protected override WebRequest CreateWebRequest() { var req = base.CreateWebRequest(); req.Method = HttpMethod.Put; req.AddParameter(@"password", Password, RequestParameterType.Query); return req; } protected override string Target => $@"rooms/{Room.RoomID.Value}/users/{User.Id}"; } }
Fix room password not being percent-encoded in join request
Fix room password not being percent-encoded in join request
C#
mit
UselessToucan/osu,ppy/osu,NeoAdonis/osu,NeoAdonis/osu,peppy/osu,UselessToucan/osu,smoogipoo/osu,NeoAdonis/osu,smoogipooo/osu,UselessToucan/osu,peppy/osu-new,smoogipoo/osu,smoogipoo/osu,peppy/osu,ppy/osu,ppy/osu,peppy/osu
d44a89e32b735164e38339e7a9fbd5cd60cba8c6
src/Editor/Editor.Client/Tools/ToolClose.cs
src/Editor/Editor.Client/Tools/ToolClose.cs
using System.ComponentModel.Composition; namespace Flood.Editor.Controls { class ToolClose : EditorTool, BarTool { [Import] DocumentManager docManager; public void OnSelect() { if (docManager.Current != null) docManager.Close(docManager.Current.Id); } public string Text { get { return "Close"; } } public string Image { get { return "close.png"; } } } }
using System.ComponentModel.Composition; namespace Flood.Editor.Controls { class ToolClose : EditorTool, BarTool { [Import] DocumentManager docManager; public void OnSelect() { //if (docManager.Current != null) // docManager.Close(docManager.Current.Id); } public string Text { get { return "Close"; } } public string Image { get { return "close.png"; } } } }
Disable document selection by id.
Disable document selection by id.
C#
bsd-2-clause
FloodProject/flood,FloodProject/flood,FloodProject/flood
73a2873d760ee61f8a642ceb911c1a2ea079cde0
GitDataExplorer/Results/ListSimpleCommitsResult.cs
GitDataExplorer/Results/ListSimpleCommitsResult.cs
using System; using System.Collections.Generic; using System.Threading.Tasks; using GitDataExplorer.Results.Commits; namespace GitDataExplorer.Results { class ListSimpleCommitsResult : IResult { public ExecutionResult ExecutionResult { get; private set; } public IList<SimpleCommitResult> Commits { get; } = new List<SimpleCommitResult>(); public void ParseResult(IList<string> lines) { var tmpList = new List<string>(); foreach (var line in lines) { if (line.StartsWith("A") || line.StartsWith("M") || line.StartsWith("R")) { tmpList.Add(line); } else { if (tmpList.Count > 0) { var result = new SimpleCommitResult(); result.ParseResult(tmpList); Commits.Add(result); } tmpList.Clear(); tmpList.Add(line); } } if (tmpList.Count > 0) { var result = new SimpleCommitResult(); result.ParseResult(tmpList); Commits.Add(result); } } } }
using System; using System.Collections.Generic; using System.Threading.Tasks; using GitDataExplorer.Results.Commits; namespace GitDataExplorer.Results { class ListSimpleCommitsResult : IResult { private char[] statusLetters = { 'M', 'A', 'R', 'C', 'D' }; public ExecutionResult ExecutionResult { get; private set; } public IList<SimpleCommitResult> Commits { get; } = new List<SimpleCommitResult>(); public void ParseResult(IList<string> lines) { var tmpList = new List<string>(); foreach (var line in lines) { if (Array.IndexOf(statusLetters, line[0]) >= 0) { tmpList.Add(line); } else { if (tmpList.Count > 0) { var result = new SimpleCommitResult(); result.ParseResult(tmpList); Commits.Add(result); } tmpList.Clear(); tmpList.Add(line); } } if (tmpList.Count > 0) { var result = new SimpleCommitResult(); result.ParseResult(tmpList); Commits.Add(result); } } } }
Add deleted and copied to the parsed statuses
Add deleted and copied to the parsed statuses
C#
apache-2.0
Thulur/GitStatisticsAnalyzer,Thulur/GitDataExplorer
35918c9970c1ca98f6ce5d654284c2a44a87b7f1
Nilgiri.Tests/Examples/Should/NotBeOk.cs
Nilgiri.Tests/Examples/Should/NotBeOk.cs
namespace Nilgiri.Examples { using Xunit; using Nilgiri.Tests.Common; using static Nilgiri.ShouldStyle; public partial class ExampleOf_Should { public class Not_Be_Ok { [Fact] public void Int32() { _(0).Should.Not.Be.Ok(); _(() => 0).Should.Not.Be.Ok(); } [Fact] public void Nullable() { _((bool?)false).Should.Not.Be.Ok(); _(() => (bool?)false).Should.Not.Be.Ok(); } [Fact] public void String() { _((string)null).Should.Not.Be.Ok(); _(() => (string)null).Should.Not.Be.Ok(); _(System.String.Empty).Should.Not.Be.Ok(); _(() => System.String.Empty).Should.Not.Be.Ok(); _("").Should.Not.Be.Ok(); _(() => "").Should.Not.Be.Ok(); _(" ").Should.Not.Be.Ok(); _(() => " ").Should.Not.Be.Ok(); } [Fact] public void ReferenceTypes() { _((StubClass)null).Should.Not.Be.Ok(); _(() => (StubClass)null).Should.Not.Be.Ok(); } } } }
namespace Nilgiri.Examples { using Xunit; using Nilgiri.Tests.Common; using static Nilgiri.ShouldStyle; public partial class ExampleOf_Should { public class Not_Be_Ok { [Fact] public void Int32() { _(0).Should.Not.Be.Ok(); _(() => 0).Should.Not.Be.Ok(); } [Fact] public void Nullable() { _((bool?)false).Should.Not.Be.Ok(); _(() => (bool?)false).Should.Not.Be.Ok(); _((bool?)null).Should.Not.Be.Ok(); _(() => (bool?)null).Should.Not.Be.Ok(); } [Fact] public void String() { _((string)null).Should.Not.Be.Ok(); _(() => (string)null).Should.Not.Be.Ok(); _(System.String.Empty).Should.Not.Be.Ok(); _(() => System.String.Empty).Should.Not.Be.Ok(); _("").Should.Not.Be.Ok(); _(() => "").Should.Not.Be.Ok(); _(" ").Should.Not.Be.Ok(); _(() => " ").Should.Not.Be.Ok(); } [Fact] public void ReferenceTypes() { _((StubClass)null).Should.Not.Be.Ok(); _(() => (StubClass)null).Should.Not.Be.Ok(); } } } }
Add missing Nullable example
Add missing Nullable example [ci skip]
C#
mit
brycekbargar/Nilgiri,brycekbargar/Nilgiri
fee4986ff8f6c739de7bd82ef2b4374216259095
Nop.Plugin.Api/Constants/WebHookNames.cs
Nop.Plugin.Api/Constants/WebHookNames.cs
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Nop.Plugin.Api.Constants { public static class WebHookNames { public const string FiltersGetAction = "FiltersGetAction"; public const string GetWebhookByIdAction = "GetWebHookByIdAction"; public const string CustomerCreated = "customer/created"; public const string CustomerUpdated = "customer/updated"; public const string CustomerDeleted = "customer/deleted"; public const string ProductCreated = "product/created"; public const string ProductUpdated = "product/updated"; public const string ProductDeleted = "product/deleted"; public const string CategoryCreated = "category/created"; public const string CategoryUpdated = "category/updated"; public const string CategoryDeleted = "category/deleted"; public const string OrderCreated = "order/created"; public const string OrderUpdated = "order/updated"; public const string OrderDeleted = "order/deleted"; } }
namespace Nop.Plugin.Api.Constants { public static class WebHookNames { public const string FiltersGetAction = "FiltersGetAction"; public const string GetWebhookByIdAction = "GetWebHookByIdAction"; public const string CustomerCreated = "customers/created"; public const string CustomerUpdated = "customers/updated"; public const string CustomerDeleted = "customers/deleted"; public const string ProductCreated = "products/created"; public const string ProductUpdated = "products/updated"; public const string ProductDeleted = "products/deleted"; public const string CategoryCreated = "categories/created"; public const string CategoryUpdated = "categories/updated"; public const string CategoryDeleted = "categories/deleted"; public const string OrderCreated = "orders/created"; public const string OrderUpdated = "orders/updated"; public const string OrderDeleted = "orders/deleted"; } }
Change the web hook names
Change the web hook names
C#
mit
SevenSpikes/api-plugin-for-nopcommerce,SevenSpikes/api-plugin-for-nopcommerce
c6c164f29e93bbe42d6d24eee60b15d4e0d4de89
DesktopWidgets/Widgets/Search/Settings.cs
DesktopWidgets/Widgets/Search/Settings.cs
using System.ComponentModel; using DesktopWidgets.WidgetBase.Settings; namespace DesktopWidgets.Widgets.Search { public class Settings : WidgetSettingsBase { public Settings() { Style.Width = 150; } [Category("General")] [DisplayName("URL Prefix")] public string BaseUrl { get; set; } = "http://"; [Category("General")] [DisplayName("URL Suffix")] public string URLSuffix { get; set; } [Category("Behavior (Hideable)")] [DisplayName("Hide On Search")] public bool HideOnSearch { get; set; } = true; } }
using System.ComponentModel; using System.Windows; using DesktopWidgets.WidgetBase.Settings; namespace DesktopWidgets.Widgets.Search { public class Settings : WidgetSettingsBase { public Settings() { Style.Width = 150; Style.FramePadding = new Thickness(0); } [Category("General")] [DisplayName("URL Prefix")] public string BaseUrl { get; set; } = "http://"; [Category("General")] [DisplayName("URL Suffix")] public string URLSuffix { get; set; } [Category("Behavior (Hideable)")] [DisplayName("Hide On Search")] public bool HideOnSearch { get; set; } = true; } }
Change "Search" "Frame Padding" option default value
Change "Search" "Frame Padding" option default value
C#
apache-2.0
danielchalmers/DesktopWidgets
a6877071f4814f1c52358dcc5b1ee716b0e719ee
wslib/Protocol/Writer/WsMessageWriter.cs
wslib/Protocol/Writer/WsMessageWriter.cs
using System; using System.Threading; using System.Threading.Tasks; namespace wslib.Protocol.Writer { public class WsMessageWriter : IDisposable { private readonly MessageType messageType; private readonly Action onDispose; private readonly IWsMessageWriteStream stream; public WsMessageWriter(MessageType messageType, Action onDispose, IWsMessageWriteStream stream) { this.messageType = messageType; this.onDispose = onDispose; this.stream = stream; } public Task WriteFrame(byte[] buffer, int offset, int count, CancellationToken cancellationToken) { var header = generateFrameHeader(false); // TODO: change opcode to continuation return stream.WriteFrame(header, buffer, offset, count, cancellationToken); } public Task CloseMessageAsync(CancellationToken cancellationToken) { var header = generateFrameHeader(true); return stream.WriteFrame(header, new byte[0], 0, 0, cancellationToken); } public Task WriteMessageAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) { var header = generateFrameHeader(true); return stream.WriteFrame(header, buffer, offset, count, cancellationToken); } private WsFrameHeader generateFrameHeader(bool finFlag) { var opcode = messageType == MessageType.Text ? WsFrameHeader.Opcodes.TEXT : WsFrameHeader.Opcodes.BINARY; return new WsFrameHeader { FIN = finFlag, OPCODE = opcode }; } public void Dispose() { stream.Dispose(); onDispose(); } } }
using System; using System.Threading; using System.Threading.Tasks; namespace wslib.Protocol.Writer { public class WsMessageWriter : IDisposable { private readonly MessageType messageType; private readonly Action onDispose; private readonly IWsMessageWriteStream stream; private bool firstFrame = true; public WsMessageWriter(MessageType messageType, Action onDispose, IWsMessageWriteStream stream) { this.messageType = messageType; this.onDispose = onDispose; this.stream = stream; } public Task WriteFrameAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) { var header = generateFrameHeader(false); firstFrame = false; return stream.WriteFrame(header, buffer, offset, count, cancellationToken); } public Task CloseMessageAsync(CancellationToken cancellationToken) { var header = generateFrameHeader(true); return stream.WriteFrame(header, new byte[0], 0, 0, cancellationToken); } public Task WriteMessageAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) { var header = generateFrameHeader(true); return stream.WriteFrame(header, buffer, offset, count, cancellationToken); } private WsFrameHeader generateFrameHeader(bool finFlag) { var opcode = firstFrame ? (messageType == MessageType.Text ? WsFrameHeader.Opcodes.TEXT : WsFrameHeader.Opcodes.BINARY) : WsFrameHeader.Opcodes.CONTINUATION; return new WsFrameHeader { FIN = finFlag, OPCODE = opcode }; } public void Dispose() { stream.Dispose(); onDispose(); } } }
Set continuation opcode for non-first frames in the writer
Set continuation opcode for non-first frames in the writer
C#
mit
Chelaris182/wslib
84aeac2049c18f6f2561978be717693d0bbe6a87
DupImage/ImageStruct.cs
DupImage/ImageStruct.cs
using System; using System.Collections.Generic; using System.IO; namespace DupImage { /// <summary> /// Structure for containing image information and hash values. /// </summary> public class ImageStruct { /// <summary> /// Construct a new ImageStruct from FileInfo. /// </summary> /// <param name="file">FileInfo to be used.</param> public ImageStruct(FileInfo file) { if (file == null) throw new ArgumentNullException(nameof(file)); ImagePath = file.FullName; // Init Hash Hash = new long[1]; } /// <summary> /// Construct a new ImageStruct from image path. /// </summary> /// <param name="pathToImage">Image location</param> public ImageStruct(String pathToImage) { ImagePath = pathToImage; // Init Hash Hash = new long[1]; } /// <summary> /// ImagePath information. /// </summary> public String ImagePath { get; private set; } /// <summary> /// Hash of the image. Uses longs instead of ulong to be CLS compliant. /// </summary> public long[] Hash { get; set; } } }
using System; using System.Collections.Generic; using System.IO; namespace DupImage { /// <summary> /// Structure for containing image information and hash values. /// </summary> public class ImageStruct { /// <summary> /// Construct a new ImageStruct from FileInfo. /// </summary> /// <param name="file">FileInfo to be used.</param> public ImageStruct(FileInfo file) { if (file == null) throw new ArgumentNullException(nameof(file)); ImagePath = file.FullName; // Init Hash Hash = new long[1]; } /// <summary> /// Construct a new ImageStruct from image path. /// </summary> /// <param name="pathToImage">Image location</param> public ImageStruct(string pathToImage) { ImagePath = pathToImage; // Init Hash Hash = new long[1]; } /// <summary> /// ImagePath information. /// </summary> public string ImagePath { get; private set; } /// <summary> /// Hash of the image. Uses longs instead of ulong to be CLS compliant. /// </summary> public long[] Hash { get; set; } } }
Use string instead of String.
Use string instead of String.
C#
unknown
Quickshot/DupImageLib,Quickshot/DupImage
f05f14fc382cf60cbc3a7f3a23669ffdc5d0fc46
src/FluentMigrator.Runner.MySql/Processors/MySql/MySqlDbFactory.cs
src/FluentMigrator.Runner.MySql/Processors/MySql/MySqlDbFactory.cs
#region License // Copyright (c) 2007-2018, FluentMigrator Project // // 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; namespace FluentMigrator.Runner.Processors.MySql { public class MySqlDbFactory : ReflectionBasedDbFactory { private static readonly TestEntry[] _entries = { new TestEntry("MySql.Data", "MySql.Data.MySqlClient.MySqlClientFactory"), new TestEntry("MySqlConnector", "MySql.Data.MySqlClient.MySqlClientFactory"), }; [Obsolete] public MySqlDbFactory() : this(serviceProvider: null) { } public MySqlDbFactory(IServiceProvider serviceProvider) : base(serviceProvider, _entries) { } } }
#region License // Copyright (c) 2007-2018, FluentMigrator Project // // 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; namespace FluentMigrator.Runner.Processors.MySql { public class MySqlDbFactory : ReflectionBasedDbFactory { private static readonly TestEntry[] _entries = { new TestEntry("MySql.Data", "MySql.Data.MySqlClient.MySqlClientFactory"), new TestEntry("MySqlConnector", "MySql.Data.MySqlClient.MySqlClientFactory"), new TestEntry("MySqlConnector", "MySqlConnector.MySqlConnectorFactory") }; [Obsolete] public MySqlDbFactory() : this(serviceProvider: null) { } public MySqlDbFactory(IServiceProvider serviceProvider) : base(serviceProvider, _entries) { } } }
Add Support for MysqlConnector 1 namespace changes
Add Support for MysqlConnector 1 namespace changes
C#
apache-2.0
stsrki/fluentmigrator,spaccabit/fluentmigrator,amroel/fluentmigrator,fluentmigrator/fluentmigrator,amroel/fluentmigrator,fluentmigrator/fluentmigrator,stsrki/fluentmigrator,spaccabit/fluentmigrator
fb4376b228a8bd0a50672d19b6314586e8fb8b13
RestImageResize/Security/HashGenerator.cs
RestImageResize/Security/HashGenerator.cs
using System; using System.Collections.Generic; using System.Linq; using System.Security.Cryptography; using System.Text; namespace RestImageResize.Security { public class HashGenerator { public string ComputeHash(string privateKey, int width, int height, ImageTransform transform) { var values = new[] { privateKey, width.ToString(), height.ToString(), transform.ToString() }; var bytes = Encoding.ASCII.GetBytes(string.Join(":", values)); var sha1 = SHA1.Create(); sha1.ComputeHash(bytes); return BitConverter.ToString(sha1.Hash).Replace("-", "").ToLower(); } } }
using System; using System.Collections.Generic; using System.Linq; using System.Security.Cryptography; using System.Text; namespace RestImageResize.Security { public class HashGenerator { public string ComputeHash(string privateKey, int width, int height, ImageTransform transform) { var values = new[] { privateKey, width.ToString(), height.ToString(), transform.ToString().ToLower() }; var bytes = Encoding.ASCII.GetBytes(string.Join(":", values)); var sha1 = SHA1.Create(); sha1.ComputeHash(bytes); return BitConverter.ToString(sha1.Hash).Replace("-", "").ToLower(); } } }
Use lowered transform value in hash computing
Use lowered transform value in hash computing
C#
mit
Romanets/RestImageResize,Romanets/RestImageResize,Romanets/RestImageResize,Romanets/RestImageResize,Romanets/RestImageResize
37aba6ed699b4a62b7b2ec784a579a4188bb1e15
Src/Client/Client.Admin.Plugins/Views/ComponentManagerPanel.xaml.cs
Src/Client/Client.Admin.Plugins/Views/ComponentManagerPanel.xaml.cs
using Client.Base; using Core.Comm; using Core.Interfaces.ServiceContracts; using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows; using System.Windows.Controls; using System.Windows.Data; using System.Windows.Documents; using System.Windows.Input; using System.Windows.Media; using System.Windows.Media.Imaging; using System.Windows.Navigation; using System.Windows.Shapes; namespace Client.Admin.Plugins { /// <summary> /// Interaction logic for ComponentManagerPanel.xaml /// </summary> [PanelMetadata(DisplayName = "Component Manager", IconPath = "images/puzzle-piece.png")] public partial class ComponentManagerPanel : PanelBase { public ComponentManagerPanel() { ViewModel = new ComponentManagerViewModel(this); InitializeComponent(); } } }
using Client.Base; using Core.Comm; using Core.Interfaces.ServiceContracts; using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows; using System.Windows.Controls; using System.Windows.Data; using System.Windows.Documents; using System.Windows.Input; using System.Windows.Media; using System.Windows.Media.Imaging; using System.Windows.Navigation; using System.Windows.Shapes; namespace Client.Admin.Plugins { /// <summary> /// Interaction logic for ComponentManagerPanel.xaml /// </summary> [PanelMetadata(DisplayName = "Component Manager", IconPath = "images/cog.png")] public partial class ComponentManagerPanel : PanelBase { public ComponentManagerPanel() { ViewModel = new ComponentManagerViewModel(this); InitializeComponent(); } } }
Change panel icon to the cog
Change panel icon to the cog
C#
mit
SAEnergy/Infrastructure,SAEnergy/Superstructure,SAEnergy/Infrastructure
9a7c7a0d253eb4c77b13484fb72ca8b4f1fd405e
Source/Solution/FormEditor/FieldHelper.cs
Source/Solution/FormEditor/FieldHelper.cs
using System.Text.RegularExpressions; namespace FormEditor { public static class FieldHelper { private static readonly Regex FormSafeNameRegex = new Regex("[ -]", RegexOptions.Compiled); public static string FormSafeName(string name) { return FormSafeNameRegex.Replace(name ?? string.Empty, "_"); } } }
using System.Text.RegularExpressions; namespace FormEditor { public static class FieldHelper { private static readonly Regex FormSafeNameRegex = new Regex("[^a-zA-Z0-9_]", RegexOptions.Compiled); public static string FormSafeName(string name) { return FormSafeNameRegex.Replace(name ?? string.Empty, "_"); } } }
Improve form safe name regex
Improve form safe name regex
C#
mit
kjac/FormEditor,kjac/FormEditor,kjac/FormEditor
0e12ae4cb2452e81e6a25868554168540a06ff55
src/ProjectEuler/Puzzles/Puzzle010.cs
src/ProjectEuler/Puzzles/Puzzle010.cs
// Copyright (c) Martin Costello, 2015. All rights reserved. // Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information. namespace MartinCostello.ProjectEuler.Puzzles { using System; using System.Linq; /// <summary> /// A class representing the solution to <c>https://projecteuler.net/problem=10</c>. This class cannot be inherited. /// </summary> internal sealed class Puzzle010 : Puzzle { /// <inheritdoc /> public override string Question => "Find the sum of all the primes below the specified value."; /// <inheritdoc /> protected override int MinimumArguments => 1; /// <inheritdoc /> protected override int SolveCore(string[] args) { int max; if (!TryParseInt32(args[0], out max) || max < 2) { Console.Error.WriteLine("The specified number is invalid."); return -1; } Answer = ParallelEnumerable.Range(2, max - 2) .Where((p) => Maths.IsPrime(p)) .Select((p) => (long)p) .Sum(); return 0; } } }
// Copyright (c) Martin Costello, 2015. All rights reserved. // Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information. namespace MartinCostello.ProjectEuler.Puzzles { using System; using System.Linq; /// <summary> /// A class representing the solution to <c>https://projecteuler.net/problem=10</c>. This class cannot be inherited. /// </summary> internal sealed class Puzzle010 : Puzzle { /// <inheritdoc /> public override string Question => "Find the sum of all the primes below the specified value."; /// <inheritdoc /> protected override int MinimumArguments => 1; /// <inheritdoc /> protected override int SolveCore(string[] args) { int max; if (!TryParseInt32(args[0], out max) || max < 2) { Console.Error.WriteLine("The specified number is invalid."); return -1; } long sum = ParallelEnumerable.Range(3, max - 3) .Where((p) => p % 2 != 0) .Where((p) => Maths.IsPrime(p)) .Select((p) => (long)p) .Sum(); Answer = sum + 2; return 0; } } }
Improve performance of puzzle 10
Improve performance of puzzle 10 Increase the throughput of the solution for puzzle 10 by skipping even numbers (which cannot be prime, except for 2).
C#
apache-2.0
martincostello/project-euler
de0923f26fb264bd6789236fe983d3db6fa1f93c
Wox.Infrastructure/Http/HttpRequest.cs
Wox.Infrastructure/Http/HttpRequest.cs
using System; using System.IO; using System.Net; using System.Text; using Wox.Plugin; namespace Wox.Infrastructure.Http { public class HttpRequest { public static string Get(string url, string encoding = "UTF8") { return Get(url, encoding, HttpProxy.Instance); } private static string Get(string url, string encoding, IHttpProxy proxy) { if (string.IsNullOrEmpty(url)) return string.Empty; HttpWebRequest request = WebRequest.Create(url) as HttpWebRequest; request.Method = "GET"; request.Timeout = 10 * 1000; if (proxy != null && proxy.Enabled && !string.IsNullOrEmpty(proxy.Server)) { if (string.IsNullOrEmpty(proxy.UserName) || string.IsNullOrEmpty(proxy.Password)) { request.Proxy = new WebProxy(proxy.Server, proxy.Port); } else { request.Proxy = new WebProxy(proxy.Server, proxy.Port) { Credentials = new NetworkCredential(proxy.UserName, proxy.Password) }; } } try { HttpWebResponse response = request.GetResponse() as HttpWebResponse; if (response != null) { Stream stream = response.GetResponseStream(); if (stream != null) { using (StreamReader reader = new StreamReader(stream, Encoding.GetEncoding(encoding))) { return reader.ReadToEnd(); } } } } catch (Exception e) { return string.Empty; } return string.Empty; } } }
using System; using System.IO; using System.Net; using System.Text; using Wox.Plugin; namespace Wox.Infrastructure.Http { public class HttpRequest { public static string Get(string url, string encoding = "UTF-8") { return Get(url, encoding, HttpProxy.Instance); } private static string Get(string url, string encoding, IHttpProxy proxy) { if (string.IsNullOrEmpty(url)) return string.Empty; HttpWebRequest request = WebRequest.Create(url) as HttpWebRequest; request.Method = "GET"; request.Timeout = 10 * 1000; if (proxy != null && proxy.Enabled && !string.IsNullOrEmpty(proxy.Server)) { if (string.IsNullOrEmpty(proxy.UserName) || string.IsNullOrEmpty(proxy.Password)) { request.Proxy = new WebProxy(proxy.Server, proxy.Port); } else { request.Proxy = new WebProxy(proxy.Server, proxy.Port) { Credentials = new NetworkCredential(proxy.UserName, proxy.Password) }; } } try { HttpWebResponse response = request.GetResponse() as HttpWebResponse; if (response != null) { Stream stream = response.GetResponseStream(); if (stream != null) { using (StreamReader reader = new StreamReader(stream, Encoding.GetEncoding(encoding))) { return reader.ReadToEnd(); } } } } catch (Exception e) { return string.Empty; } return string.Empty; } } }
Fix a http request issues.
Fix a http request issues.
C#
mit
dstiert/Wox,Launchify/Launchify,AlexCaranha/Wox,yozora-hitagi/Saber,Launchify/Launchify,18098924759/Wox,18098924759/Wox,zlphoenix/Wox,apprentice3d/Wox,sanbinabu/Wox,jondaniels/Wox,kayone/Wox,mika76/Wox,JohnTheGr8/Wox,kayone/Wox,zlphoenix/Wox,apprentice3d/Wox,kdar/Wox,danisein/Wox,yozora-hitagi/Saber,mika76/Wox,apprentice3d/Wox,shangvven/Wox,18098924759/Wox,derekforeman/Wox,kayone/Wox,gnowxilef/Wox,mika76/Wox,EmuxEvans/Wox,sanbinabu/Wox,vebin/Wox,vebin/Wox,derekforeman/Wox,dstiert/Wox,kdar/Wox,kdar/Wox,Megasware128/Wox,vebin/Wox,shangvven/Wox,jondaniels/Wox,JohnTheGr8/Wox,AlexCaranha/Wox,gnowxilef/Wox,medoni/Wox,sanbinabu/Wox,Megasware128/Wox,medoni/Wox,renzhn/Wox,dstiert/Wox,danisein/Wox,shangvven/Wox,EmuxEvans/Wox,renzhn/Wox,AlexCaranha/Wox,gnowxilef/Wox,derekforeman/Wox,EmuxEvans/Wox
9893da92ac50226235547f2c3823e9a60d9520da
Purchasing.Mvc/Views/Order/_Submit.cshtml
Purchasing.Mvc/Views/Order/_Submit.cshtml
@model OrderModifyModel @{ var submitMap = new Dictionary<string, string> {{"Request", "Create"}, {"Edit", "Save"}, {"Copy", "Save"}}; var submitText = submitMap[ViewBag.Title]; var submitTitle = ViewBag.Title == "Copy" ? "Save this order which was duplicated from an existing order" : string.Empty; } <section id="order-submit-section"> <div class="section-contents"> @if (!string.IsNullOrWhiteSpace(Model.Workgroup.Disclaimer)) { <div class="section-text"> <p><strong>Disclaimer: </strong>@Model.Workgroup.Disclaimer</p> </div> } <ul> <li><div class="editor-label">&nbsp;</div> <div class="editor-field"> <input type="submit" class="button order-submit" value="@submitText" title="@submitTitle"/> | @if (submitText == "Create") { <input type="button" class="button" value="Save For Later" id="save-btn"/> <text>|</text> } @Html.ActionLink("Cancel", "Landing", "Home", null, new {id="order-cancel"}) </div> </li> </ul> </div>
@model OrderModifyModel @{ var submitMap = new Dictionary<string, string> {{"Request", "Create"}, {"Edit", "Save"}, {"Copy", "Save"}}; var submitText = submitMap[ViewBag.Title]; var submitTitle = ViewBag.Title == "Copy" ? "Save this order which was duplicated from an existing order" : string.Empty; } <section id="order-submit-section"> <div class="section-contents"> @if (!string.IsNullOrWhiteSpace(Model.Workgroup.Disclaimer)) { <div class="section-text"> <p><strong>Disclaimer: </strong>@Model.Workgroup.Disclaimer</p> </div> } <ul> <li><div class="editor-label">&nbsp;</div> <div class="editor-field"> <input type="submit" class="button order-submit" value="@submitText" title="@submitTitle"/> | @if (submitText == "Create") { <input type="button" class="button" value="Save For Later" id="save-btn"/> <text>|</text> } @Html.ActionLink("Cancel", "Landing", "Home", new {}, new {id="order-cancel"}) @*This id is an element so the local storage gets cleared out. It is not a route value.*@ </div> </li> </ul> </div>
Make consistent and add a comment for clarification
Make consistent and add a comment for clarification
C#
mit
ucdavis/Purchasing,ucdavis/Purchasing,ucdavis/Purchasing
ae3662c392b6670dcfbdd63b9bf850e2f024d6ff
Website/Security/EnforceHttpsAttribute.cs
Website/Security/EnforceHttpsAttribute.cs
using System; using System.Web.Mvc; namespace Website.Security { [AttributeUsage(AttributeTargets.Class | AttributeTargets.Method)] public class EnforceHttpsAttribute : RequireHttpsAttribute { public override void OnAuthorization(AuthorizationContext filterContext) { if(filterContext == null) { throw new ArgumentNullException(nameof(filterContext)); } if(filterContext.HttpContext.Request.IsSecureConnection) { return; } if(string.Equals(filterContext.HttpContext.Request.Headers["X-Forwarded-Proto"], "https", StringComparison.InvariantCultureIgnoreCase)) { return; } if(filterContext.HttpContext.Request.IsLocal) { return; } HandleNonHttpsRequest(filterContext); } } }
using System; using System.Web.Mvc; namespace Website.Security { [AttributeUsage(AttributeTargets.Class | AttributeTargets.Method)] public class EnforceHttpsAttribute : RequireHttpsAttribute { public override void OnAuthorization(AuthorizationContext filterContext) { if(filterContext == null) { throw new ArgumentNullException("filterContext"); } if(filterContext.HttpContext.Request.IsSecureConnection) { return; } if(string.Equals(filterContext.HttpContext.Request.Headers["X-Forwarded-Proto"], "https", StringComparison.InvariantCultureIgnoreCase)) { return; } if(filterContext.HttpContext.Request.IsLocal) { return; } HandleNonHttpsRequest(filterContext); } } }
Remove nameof operator because it caused a build error in AppHarbor
Remove nameof operator because it caused a build error in AppHarbor Will have to investigate if AH supports c# 6 yet
C#
mit
nelsonwellswku/Yahtzee,nelsonwellswku/Yahtzee,nelsonwellswku/Yahtzee
a3136065406748f4e34a048783f5ccf061ef8100
CacheSleeve.Tests/TestSettings.cs
CacheSleeve.Tests/TestSettings.cs
using System.Collections.Generic; using CacheSleeve.Tests.TestObjects; namespace CacheSleeve.Tests { public static class TestSettings { public static string RedisHost = "localhost"; public static int RedisPort = 6379; public static string RedisPassword = null; public static int RedisDb = 0; public static string KeyPrefix = "cs."; // don't mess with George.. you'll break a lot of tests public static Monkey George = new Monkey("George") { Bananas = new List<Banana> { new Banana(4, "yellow") }}; } }
using System.Collections.Generic; using CacheSleeve.Tests.TestObjects; namespace CacheSleeve.Tests { public static class TestSettings { public static string RedisHost = "localhost"; public static int RedisPort = 6379; public static string RedisPassword = null; public static int RedisDb = 5; public static string KeyPrefix = "cs."; // don't mess with George.. you'll break a lot of tests public static Monkey George = new Monkey("George") { Bananas = new List<Banana> { new Banana(4, "yellow") }}; } }
Change test settings default Redis Db
Change test settings default Redis Db
C#
apache-2.0
jdehlin/CacheSleeve,MonoSoftware/CacheSleeve
d1a06381161223bd024ee6c80ea483834ee0b477
src/SFA.DAS.EmployerApprenticeshipsService.Domain/Configuration/HmrcConfiguration.cs
src/SFA.DAS.EmployerApprenticeshipsService.Domain/Configuration/HmrcConfiguration.cs
namespace SFA.DAS.EAS.Domain.Configuration { public class HmrcConfiguration { public string BaseUrl { get; set; } public string ClientId { get; set; } public string Scope { get; set; } public string ClientSecret { get; set; } public string ServerToken { get; set; } public string OgdSecret { get; set; } public string OgdClientId { get; set; } } }
namespace SFA.DAS.EAS.Domain.Configuration { public class HmrcConfiguration { public string BaseUrl { get; set; } public string ClientId { get; set; } public string Scope { get; set; } public string ClientSecret { get; set; } public string ServerToken { get; set; } public string OgdSecret { get; set; } public string OgdClientId { get; set; } public string AzureClientId { get; set; } public string AzureAppKey { get; set; } public string AzureResourceId { get; set; } public string AzureTenant { get; set; } public bool UseHiDataFeed { get; set; } } }
Add configuration options for HMRC to use MI Feed
Add configuration options for HMRC to use MI Feed
C#
mit
SkillsFundingAgency/das-employerapprenticeshipsservice,SkillsFundingAgency/das-employerapprenticeshipsservice,SkillsFundingAgency/das-employerapprenticeshipsservice
c4ab17da68ff73ddf5aa10e895fd52394b6fa007
src/Workspaces/Core/Portable/CodeFixes/FixAllOccurrences/WellKnownFixAllProviders.cs
src/Workspaces/Core/Portable/CodeFixes/FixAllOccurrences/WellKnownFixAllProviders.cs
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using Microsoft.CodeAnalysis.CodeActions; namespace Microsoft.CodeAnalysis.CodeFixes { /// <summary> /// Contains well known implementations of <see cref="FixAllProvider"/>. /// </summary> public static class WellKnownFixAllProviders { /// <summary> /// Default batch fix all provider. /// This provider batches all the individual diagnostic fixes across the scope of fix all action, /// computes fixes in parallel and then merges all the non-conflicting fixes into a single fix all code action. /// This fixer supports fixes for the following fix all scopes: /// <see cref="FixAllScope.Document"/>, <see cref="FixAllScope.Project"/> and <see cref="FixAllScope.Solution"/>. /// </summary> /// <remarks> /// The batch fix all provider only batches operations (i.e. <see cref="CodeActionOperation"/>) of type /// <see cref="ApplyChangesOperation"/> present within the individual diagnostic fixes. Other types of /// operations present within these fixes are ignored. /// </remarks> public static FixAllProvider BatchFixer => BatchFixAllProvider.Instance; /// <summary> /// Default batch fix all provider for simplification fixers which only add Simplifier annotations to documents. /// This provider batches all the simplifier annotation actions within a document into a single code action, /// instead of creating separate code actions for each added annotation. /// This fixer supports fixes for the following fix all scopes: /// <see cref="FixAllScope.Document"/>, <see cref="FixAllScope.Project"/> and <see cref="FixAllScope.Solution"/>. /// </summary> internal static FixAllProvider BatchSimplificationFixer => BatchSimplificationFixAllProvider.Instance; } }
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using Microsoft.CodeAnalysis.CodeActions; namespace Microsoft.CodeAnalysis.CodeFixes { /// <summary> /// Contains well known implementations of <see cref="FixAllProvider"/>. /// </summary> public static class WellKnownFixAllProviders { /// <summary> /// Default batch fix all provider. /// This provider batches all the individual diagnostic fixes across the scope of fix all action, /// computes fixes in parallel and then merges all the non-conflicting fixes into a single fix all code action. /// This fixer supports fixes for the following fix all scopes: /// <see cref="FixAllScope.Document"/>, <see cref="FixAllScope.Project"/> and <see cref="FixAllScope.Solution"/>. /// </summary> /// <remarks> /// The batch fix all provider only batches operations (i.e. <see cref="CodeActionOperation"/>) of type /// <see cref="ApplyChangesOperation"/> present within the individual diagnostic fixes. Other types of /// operations present within these fixes are ignored. /// </remarks> public static FixAllProvider BatchFixer => BatchFixAllProvider.Instance; } }
Remove static that is unused.
Remove static that is unused.
C#
mit
mgoertz-msft/roslyn,KevinRansom/roslyn,dpoeschl/roslyn,bartdesmet/roslyn,AlekseyTs/roslyn,CyrusNajmabadi/roslyn,KirillOsenkov/roslyn,tmeschter/roslyn,reaction1989/roslyn,genlu/roslyn,OmarTawfik/roslyn,eriawan/roslyn,agocke/roslyn,AlekseyTs/roslyn,CyrusNajmabadi/roslyn,swaroop-sridhar/roslyn,VSadov/roslyn,jcouv/roslyn,cston/roslyn,AmadeusW/roslyn,jmarolf/roslyn,reaction1989/roslyn,DustinCampbell/roslyn,ErikSchierboom/roslyn,VSadov/roslyn,weltkante/roslyn,eriawan/roslyn,bartdesmet/roslyn,dotnet/roslyn,tmeschter/roslyn,gafter/roslyn,CyrusNajmabadi/roslyn,swaroop-sridhar/roslyn,mgoertz-msft/roslyn,tannergooding/roslyn,panopticoncentral/roslyn,tannergooding/roslyn,paulvanbrenk/roslyn,physhi/roslyn,shyamnamboodiripad/roslyn,brettfo/roslyn,heejaechang/roslyn,jamesqo/roslyn,DustinCampbell/roslyn,ErikSchierboom/roslyn,jasonmalinowski/roslyn,stephentoub/roslyn,heejaechang/roslyn,AdamSpeight2008/roslyn-AdamSpeight2008,xasx/roslyn,tmeschter/roslyn,agocke/roslyn,DustinCampbell/roslyn,davkean/roslyn,xasx/roslyn,aelij/roslyn,abock/roslyn,cston/roslyn,nguerrera/roslyn,paulvanbrenk/roslyn,AdamSpeight2008/roslyn-AdamSpeight2008,sharwell/roslyn,mavasani/roslyn,diryboy/roslyn,jcouv/roslyn,mgoertz-msft/roslyn,heejaechang/roslyn,dpoeschl/roslyn,AmadeusW/roslyn,stephentoub/roslyn,genlu/roslyn,bkoelman/roslyn,jcouv/roslyn,jamesqo/roslyn,shyamnamboodiripad/roslyn,tannergooding/roslyn,bkoelman/roslyn,paulvanbrenk/roslyn,AmadeusW/roslyn,brettfo/roslyn,wvdd007/roslyn,sharwell/roslyn,jmarolf/roslyn,jasonmalinowski/roslyn,OmarTawfik/roslyn,KirillOsenkov/roslyn,AdamSpeight2008/roslyn-AdamSpeight2008,abock/roslyn,wvdd007/roslyn,KevinRansom/roslyn,ErikSchierboom/roslyn,sharwell/roslyn,diryboy/roslyn,physhi/roslyn,jasonmalinowski/roslyn,tmat/roslyn,panopticoncentral/roslyn,jmarolf/roslyn,physhi/roslyn,shyamnamboodiripad/roslyn,jamesqo/roslyn,MichalStrehovsky/roslyn,mavasani/roslyn,stephentoub/roslyn,aelij/roslyn,wvdd007/roslyn,abock/roslyn,weltkante/roslyn,davkean/roslyn,OmarTawfik/roslyn,nguerrera/roslyn,VSadov/roslyn,aelij/roslyn,nguerrera/roslyn,AlekseyTs/roslyn,tmat/roslyn,weltkante/roslyn,swaroop-sridhar/roslyn,reaction1989/roslyn,MichalStrehovsky/roslyn,bkoelman/roslyn,agocke/roslyn,gafter/roslyn,dotnet/roslyn,xasx/roslyn,davkean/roslyn,KevinRansom/roslyn,MichalStrehovsky/roslyn,panopticoncentral/roslyn,tmat/roslyn,dotnet/roslyn,gafter/roslyn,KirillOsenkov/roslyn,dpoeschl/roslyn,brettfo/roslyn,bartdesmet/roslyn,genlu/roslyn,diryboy/roslyn,eriawan/roslyn,mavasani/roslyn,cston/roslyn
3ca2a7767a04d2911d8244bb1d2755747e099a45
osu.Game/Screens/Ranking/Statistics/UnstableRate.cs
osu.Game/Screens/Ranking/Statistics/UnstableRate.cs
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. using System; using System.Collections.Generic; using System.Linq; using osu.Game.Rulesets.Scoring; namespace osu.Game.Screens.Ranking.Statistics { /// <summary> /// Displays the unstable rate statistic for a given play. /// </summary> public class UnstableRate : SimpleStatisticItem<double> { /// <summary> /// Creates and computes an <see cref="UnstableRate"/> statistic. /// </summary> /// <param name="hitEvents">Sequence of <see cref="HitEvent"/>s to calculate the unstable rate based on.</param> public UnstableRate(IEnumerable<HitEvent> hitEvents) : base("Unstable Rate") { var timeOffsets = hitEvents.Select(ev => ev.TimeOffset).ToArray(); Value = 10 * standardDeviation(timeOffsets); } private static double standardDeviation(double[] timeOffsets) { if (timeOffsets.Length == 0) return double.NaN; var mean = timeOffsets.Average(); var squares = timeOffsets.Select(offset => Math.Pow(offset - mean, 2)).Sum(); return Math.Sqrt(squares / timeOffsets.Length); } protected override string DisplayValue(double value) => double.IsNaN(value) ? "(not available)" : value.ToString("N2"); } }
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. using System; using System.Collections.Generic; using System.Linq; using osu.Game.Rulesets.Scoring; namespace osu.Game.Screens.Ranking.Statistics { /// <summary> /// Displays the unstable rate statistic for a given play. /// </summary> public class UnstableRate : SimpleStatisticItem<double> { /// <summary> /// Creates and computes an <see cref="UnstableRate"/> statistic. /// </summary> /// <param name="hitEvents">Sequence of <see cref="HitEvent"/>s to calculate the unstable rate based on.</param> public UnstableRate(IEnumerable<HitEvent> hitEvents) : base("Unstable Rate") { var timeOffsets = hitEvents.Where(e => !(e.HitObject.HitWindows is HitWindows.EmptyHitWindows) && e.Result != HitResult.Miss) .Select(ev => ev.TimeOffset).ToArray(); Value = 10 * standardDeviation(timeOffsets); } private static double standardDeviation(double[] timeOffsets) { if (timeOffsets.Length == 0) return double.NaN; var mean = timeOffsets.Average(); var squares = timeOffsets.Select(offset => Math.Pow(offset - mean, 2)).Sum(); return Math.Sqrt(squares / timeOffsets.Length); } protected override string DisplayValue(double value) => double.IsNaN(value) ? "(not available)" : value.ToString("N2"); } }
Exclude misses and empty window hits from UR calculation
Exclude misses and empty window hits from UR calculation
C#
mit
ppy/osu,smoogipoo/osu,NeoAdonis/osu,smoogipoo/osu,UselessToucan/osu,peppy/osu,NeoAdonis/osu,UselessToucan/osu,peppy/osu-new,smoogipoo/osu,peppy/osu,ppy/osu,NeoAdonis/osu,ppy/osu,smoogipooo/osu,UselessToucan/osu,peppy/osu
e3ef6c174e6a6fd382ab7ea27dff814b0ecafe94
Model/Flag/Impl/NoVehiclesUsageFlag.cs
Model/Flag/Impl/NoVehiclesUsageFlag.cs
using System.Collections.Generic; using Rocket.Unturned.Player; using RocketRegions.Util; using SDG.Unturned; using UnityEngine; namespace RocketRegions.Model.Flag.Impl { public class NoVehiclesUsageFlag : BoolFlag { public override string Description => "Allow/Disallow usage of vehicles in region"; private readonly Dictionary<ulong, bool> _lastVehicleStates = new Dictionary<ulong, bool>(); public override void UpdateState(List<UnturnedPlayer> players) { foreach (var player in players) { var id = PlayerUtil.GetId(player); var veh = player.Player.movement.getVehicle(); var isInVeh = veh != null; if (!_lastVehicleStates.ContainsKey(id)) _lastVehicleStates.Add(id, veh); var wasDriving = _lastVehicleStates[id]; if (!isInVeh || wasDriving || !GetValueSafe(Region.GetGroup(player))) continue; byte seat; Vector3 point; byte angle; veh.forceRemovePlayer(out seat, PlayerUtil.GetCSteamId(player), out point, out angle); veh.removePlayer(seat, point, angle, true); } } public override void OnRegionEnter(UnturnedPlayer p) { //do nothing } public override void OnRegionLeave(UnturnedPlayer p) { //do nothing } } }
using System.Collections.Generic; using Rocket.Unturned.Player; using RocketRegions.Util; using SDG.Unturned; using UnityEngine; namespace RocketRegions.Model.Flag.Impl { public class NoVehiclesUsageFlag : BoolFlag { public override string Description => "Allow/Disallow usage of vehicles in region"; public override bool SupportsGroups => true; private readonly Dictionary<ulong, bool> _lastVehicleStates = new Dictionary<ulong, bool>(); public override void UpdateState(List<UnturnedPlayer> players) { foreach (var player in players) { var group = Region.GetGroup(player); if(!GetValueSafe(group)) continue; var id = PlayerUtil.GetId(player); var veh = player.Player.movement.getVehicle(); var isInVeh = veh != null; if (!_lastVehicleStates.ContainsKey(id)) _lastVehicleStates.Add(id, veh); var wasDriving = _lastVehicleStates[id]; if (!isInVeh || wasDriving || !GetValueSafe(Region.GetGroup(player))) continue; byte seat; Vector3 point; byte angle; veh.forceRemovePlayer(out seat, PlayerUtil.GetCSteamId(player), out point, out angle); veh.removePlayer(seat, point, angle, true); } } public override void OnRegionEnter(UnturnedPlayer p) { //do nothing } public override void OnRegionLeave(UnturnedPlayer p) { //do nothing } } }
Add group support for NoVehiclesUsage
Add group support for NoVehiclesUsage
C#
agpl-3.0
Trojaner25/Rocket-Regions,Trojaner25/Rocket-Safezone
41efb49427532bb534b835f6279ddf182c95795c
src/Glimpse.Agent.Connection.Stream/Connection/StreamInvokerProxy.cs
src/Glimpse.Agent.Connection.Stream/Connection/StreamInvokerProxy.cs
using Microsoft.AspNet.SignalR.Client; using System; using System.Threading.Tasks; namespace Glimpse.Agent.Connection.Stream.Connection { public class StreamInvokerProxy : IStreamInvokerProxy { private readonly IHubProxy _hubProxy; internal StreamInvokerProxy(IHubProxy hubProxy) { _hubProxy = hubProxy; } public Task Invoke(string method, params object[] args) { return _hubProxy.Invoke(method, args); } public Task<T> Invoke<T>(string method, params object[] args) { return _hubProxy.Invoke<T>(method, args); } } }
using Microsoft.AspNet.SignalR.Client; using System; using System.Threading.Tasks; namespace Glimpse.Agent.Connection.Stream.Connection { internal class StreamInvokerProxy : IStreamInvokerProxy { private readonly IHubProxy _hubProxy; internal StreamInvokerProxy(IHubProxy hubProxy) { _hubProxy = hubProxy; } public Task Invoke(string method, params object[] args) { return _hubProxy.Invoke(method, args); } public Task<T> Invoke<T>(string method, params object[] args) { return _hubProxy.Invoke<T>(method, args); } } }
Convert invoker proxy over to be internal
Convert invoker proxy over to be internal
C#
mit
pranavkm/Glimpse.Prototype,pranavkm/Glimpse.Prototype,Glimpse/Glimpse.Prototype,Glimpse/Glimpse.Prototype,peterblazejewicz/Glimpse.Prototype,peterblazejewicz/Glimpse.Prototype,zanetdev/Glimpse.Prototype,peterblazejewicz/Glimpse.Prototype,mike-kaufman/Glimpse.Prototype,zanetdev/Glimpse.Prototype,zanetdev/Glimpse.Prototype,Glimpse/Glimpse.Prototype,pranavkm/Glimpse.Prototype,zanetdev/Glimpse.Prototype,peterblazejewicz/Glimpse.Prototype,mike-kaufman/Glimpse.Prototype,mike-kaufman/Glimpse.Prototype,mike-kaufman/Glimpse.Prototype,pranavkm/Glimpse.Prototype,mike-kaufman/Glimpse.Prototype,Glimpse/Glimpse.Prototype,peterblazejewicz/Glimpse.Prototype
768c3bc31e70272332fde096be6dfb093de0a972
osu.Game/Database/BeatmapMetadata.cs
osu.Game/Database/BeatmapMetadata.cs
using System; using osu.Game.Beatmaps; using SQLite; namespace osu.Game.Database { public class BeatmapMetadata { [PrimaryKey] public int ID { get; set; } public string Title { get; set; } public string TitleUnicode { get; set; } public string Artist { get; set; } public string ArtistUnicode { get; set; } public string Author { get; set; } public string Source { get; set; } public string Tags { get; set; } public GameMode Mode { get; set; } public int PreviewTime { get; set; } public string AudioFile { get; set; } public string BackgroundFile { get; set; } } }
using System; using osu.Game.GameModes.Play; using SQLite; namespace osu.Game.Database { public class BeatmapMetadata { [PrimaryKey] public int ID { get; set; } public string Title { get; set; } public string TitleUnicode { get; set; } public string Artist { get; set; } public string ArtistUnicode { get; set; } public string Author { get; set; } public string Source { get; set; } public string Tags { get; set; } public PlayMode Mode { get; set; } public int PreviewTime { get; set; } public string AudioFile { get; set; } public string BackgroundFile { get; set; } } }
Use PlayMode instead of GameMode
Use PlayMode instead of GameMode
C#
mit
Drezi126/osu,tacchinotacchi/osu,Damnae/osu,smoogipoo/osu,RedNesto/osu,naoey/osu,theguii/osu,DrabWeb/osu,EVAST9919/osu,NeoAdonis/osu,ppy/osu,NotKyon/lolisu,ppy/osu,DrabWeb/osu,2yangk23/osu,NeoAdonis/osu,smoogipoo/osu,ppy/osu,peppy/osu-new,2yangk23/osu,ZLima12/osu,naoey/osu,ZLima12/osu,naoey/osu,johnneijzen/osu,smoogipoo/osu,Nabile-Rahmani/osu,johnneijzen/osu,peppy/osu,UselessToucan/osu,peppy/osu,DrabWeb/osu,UselessToucan/osu,EVAST9919/osu,NeoAdonis/osu,default0/osu,peppy/osu,UselessToucan/osu,osu-RP/osu-RP,Frontear/osuKyzer,smoogipooo/osu,nyaamara/osu
02fbbc506d73036c87f3466774c2eaec0a5e987b
src/Workspaces/Core/Portable/Editing/GenerationOptions.cs
src/Workspaces/Core/Portable/Editing/GenerationOptions.cs
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using Microsoft.CodeAnalysis.Options; namespace Microsoft.CodeAnalysis.Editing { internal class GenerationOptions { public static readonly PerLanguageOption<bool> PlaceSystemNamespaceFirst = new PerLanguageOption<bool>(nameof(GenerationOptions), nameof(PlaceSystemNamespaceFirst), defaultValue: true, storageLocations: new OptionStorageLocation[] { EditorConfigStorageLocation.ForBoolOption("dotnet_sort_system_directives_first"), new RoamingProfileStorageLocation("TextEditor.%LANGUAGE%.Specific.PlaceSystemNamespaceFirst")}); public static readonly PerLanguageOption<bool> SeparateImportDirectiveGroups = new PerLanguageOption<bool>( nameof(GenerationOptions), nameof(SeparateImportDirectiveGroups), defaultValue: false, storageLocations: new OptionStorageLocation[] { EditorConfigStorageLocation.ForBoolOption("dotnet_seperate_import_directive_groups"), new RoamingProfileStorageLocation($"TextEditor.%LANGUAGE%.Specific.{nameof(SeparateImportDirectiveGroups)}")}); } }
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using Microsoft.CodeAnalysis.Options; namespace Microsoft.CodeAnalysis.Editing { internal class GenerationOptions { public static readonly PerLanguageOption<bool> PlaceSystemNamespaceFirst = new PerLanguageOption<bool>(nameof(GenerationOptions), nameof(PlaceSystemNamespaceFirst), defaultValue: true, storageLocations: new OptionStorageLocation[] { EditorConfigStorageLocation.ForBoolOption("dotnet_sort_system_directives_first"), new RoamingProfileStorageLocation("TextEditor.%LANGUAGE%.Specific.PlaceSystemNamespaceFirst")}); public static readonly PerLanguageOption<bool> SeparateImportDirectiveGroups = new PerLanguageOption<bool>( nameof(GenerationOptions), nameof(SeparateImportDirectiveGroups), defaultValue: false, storageLocations: new OptionStorageLocation[] { EditorConfigStorageLocation.ForBoolOption("dotnet_separate_import_directive_groups"), new RoamingProfileStorageLocation($"TextEditor.%LANGUAGE%.Specific.{nameof(SeparateImportDirectiveGroups)}")}); } }
Fix spelling of .editorconfig option
Fix spelling of .editorconfig option
C#
mit
tmeschter/roslyn,AdamSpeight2008/roslyn-AdamSpeight2008,sharwell/roslyn,tvand7093/roslyn,tannergooding/roslyn,mattscheffer/roslyn,jcouv/roslyn,khyperia/roslyn,gafter/roslyn,davkean/roslyn,robinsedlaczek/roslyn,orthoxerox/roslyn,physhi/roslyn,brettfo/roslyn,tmeschter/roslyn,swaroop-sridhar/roslyn,jmarolf/roslyn,AnthonyDGreen/roslyn,abock/roslyn,eriawan/roslyn,kelltrick/roslyn,diryboy/roslyn,tmat/roslyn,mavasani/roslyn,cston/roslyn,dpoeschl/roslyn,reaction1989/roslyn,bkoelman/roslyn,mavasani/roslyn,pdelvo/roslyn,AmadeusW/roslyn,CyrusNajmabadi/roslyn,mattscheffer/roslyn,VSadov/roslyn,mattscheffer/roslyn,srivatsn/roslyn,swaroop-sridhar/roslyn,davkean/roslyn,MichalStrehovsky/roslyn,physhi/roslyn,lorcanmooney/roslyn,reaction1989/roslyn,CyrusNajmabadi/roslyn,dpoeschl/roslyn,kelltrick/roslyn,aelij/roslyn,jamesqo/roslyn,kelltrick/roslyn,khyperia/roslyn,Hosch250/roslyn,stephentoub/roslyn,eriawan/roslyn,agocke/roslyn,nguerrera/roslyn,panopticoncentral/roslyn,robinsedlaczek/roslyn,sharwell/roslyn,AmadeusW/roslyn,diryboy/roslyn,tvand7093/roslyn,AlekseyTs/roslyn,jasonmalinowski/roslyn,genlu/roslyn,weltkante/roslyn,KevinRansom/roslyn,MichalStrehovsky/roslyn,DustinCampbell/roslyn,DustinCampbell/roslyn,CaptainHayashi/roslyn,Hosch250/roslyn,cston/roslyn,AlekseyTs/roslyn,eriawan/roslyn,Giftednewt/roslyn,VSadov/roslyn,mavasani/roslyn,genlu/roslyn,DustinCampbell/roslyn,sharwell/roslyn,OmarTawfik/roslyn,VSadov/roslyn,paulvanbrenk/roslyn,pdelvo/roslyn,ErikSchierboom/roslyn,jkotas/roslyn,paulvanbrenk/roslyn,khyperia/roslyn,Hosch250/roslyn,CyrusNajmabadi/roslyn,TyOverby/roslyn,tmat/roslyn,mgoertz-msft/roslyn,CaptainHayashi/roslyn,dotnet/roslyn,orthoxerox/roslyn,MattWindsor91/roslyn,Giftednewt/roslyn,physhi/roslyn,mgoertz-msft/roslyn,heejaechang/roslyn,jmarolf/roslyn,pdelvo/roslyn,TyOverby/roslyn,ErikSchierboom/roslyn,cston/roslyn,mmitche/roslyn,KirillOsenkov/roslyn,mgoertz-msft/roslyn,Giftednewt/roslyn,gafter/roslyn,AnthonyDGreen/roslyn,tvand7093/roslyn,dotnet/roslyn,jcouv/roslyn,KirillOsenkov/roslyn,xasx/roslyn,agocke/roslyn,stephentoub/roslyn,tannergooding/roslyn,dotnet/roslyn,srivatsn/roslyn,gafter/roslyn,AmadeusW/roslyn,OmarTawfik/roslyn,xasx/roslyn,heejaechang/roslyn,jamesqo/roslyn,diryboy/roslyn,dpoeschl/roslyn,AdamSpeight2008/roslyn-AdamSpeight2008,shyamnamboodiripad/roslyn,jasonmalinowski/roslyn,MattWindsor91/roslyn,bkoelman/roslyn,aelij/roslyn,KevinRansom/roslyn,ErikSchierboom/roslyn,bartdesmet/roslyn,jcouv/roslyn,agocke/roslyn,AnthonyDGreen/roslyn,AdamSpeight2008/roslyn-AdamSpeight2008,mmitche/roslyn,jmarolf/roslyn,abock/roslyn,KevinRansom/roslyn,paulvanbrenk/roslyn,OmarTawfik/roslyn,wvdd007/roslyn,bartdesmet/roslyn,jasonmalinowski/roslyn,nguerrera/roslyn,robinsedlaczek/roslyn,lorcanmooney/roslyn,xasx/roslyn,weltkante/roslyn,tannergooding/roslyn,aelij/roslyn,bkoelman/roslyn,shyamnamboodiripad/roslyn,reaction1989/roslyn,wvdd007/roslyn,brettfo/roslyn,wvdd007/roslyn,abock/roslyn,MichalStrehovsky/roslyn,stephentoub/roslyn,jkotas/roslyn,weltkante/roslyn,KirillOsenkov/roslyn,jamesqo/roslyn,swaroop-sridhar/roslyn,TyOverby/roslyn,jkotas/roslyn,heejaechang/roslyn,nguerrera/roslyn,genlu/roslyn,brettfo/roslyn,panopticoncentral/roslyn,srivatsn/roslyn,tmat/roslyn,MattWindsor91/roslyn,MattWindsor91/roslyn,davkean/roslyn,lorcanmooney/roslyn,shyamnamboodiripad/roslyn,panopticoncentral/roslyn,mmitche/roslyn,orthoxerox/roslyn,tmeschter/roslyn,CaptainHayashi/roslyn,AlekseyTs/roslyn,bartdesmet/roslyn
2ce0a8316650920744b5ff1557ea9dbe012f633b
osu.Framework/Graphics/Shaders/Uniform.cs
osu.Framework/Graphics/Shaders/Uniform.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 osu.Framework.Graphics.OpenGL; using System; namespace osu.Framework.Graphics.Shaders { public class Uniform<T> : IUniformWithValue<T> where T : struct, IEquatable<T> { public Shader Owner { get; } public string Name { get; } public int Location { get; } public bool HasChanged { get; private set; } = true; private T val; public T Value { get => val; set { if (value.Equals(val)) return; val = value; HasChanged = true; if (Owner.IsBound) Update(); } } public Uniform(Shader owner, string name, int uniformLocation) { Owner = owner; Name = name; Location = uniformLocation; } public void UpdateValue(ref T newValue) { if (newValue.Equals(val)) return; val= newValue; HasChanged = true; if (Owner.IsBound) Update(); } public void Update() { if (!HasChanged) return; GLWrapper.SetUniform(this); HasChanged = false; } ref T IUniformWithValue<T>.GetValueByRef() => ref val; T IUniformWithValue<T>.GetValue() => val; } }
// 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.OpenGL; using System; namespace osu.Framework.Graphics.Shaders { public class Uniform<T> : IUniformWithValue<T> where T : struct, IEquatable<T> { public Shader Owner { get; } public string Name { get; } public int Location { get; } public bool HasChanged { get; private set; } = true; private T val; public T Value { get => val; set { if (value.Equals(val)) return; val = value; HasChanged = true; if (Owner.IsBound) Update(); } } public Uniform(Shader owner, string name, int uniformLocation) { Owner = owner; Name = name; Location = uniformLocation; } public void UpdateValue(ref T newValue) { if (newValue.Equals(val)) return; val = newValue; HasChanged = true; if (Owner.IsBound) Update(); } public void Update() { if (!HasChanged) return; GLWrapper.SetUniform(this); HasChanged = false; } ref T IUniformWithValue<T>.GetValueByRef() => ref val; T IUniformWithValue<T>.GetValue() => val; } }
Fix formatting and remove unnecessary using
Fix formatting and remove unnecessary using
C#
mit
smoogipooo/osu-framework,peppy/osu-framework,peppy/osu-framework,smoogipooo/osu-framework,peppy/osu-framework,ppy/osu-framework,EVAST9919/osu-framework,EVAST9919/osu-framework,EVAST9919/osu-framework,ppy/osu-framework,ZLima12/osu-framework,EVAST9919/osu-framework,ZLima12/osu-framework,ppy/osu-framework
a18342b7e00c28af04ee650dbc352396e7eedb64
src/FlaUInspect/Views/MainWindow.xaml.cs
src/FlaUInspect/Views/MainWindow.xaml.cs
using System.Windows; using System.Windows.Controls; using FlaUInspect.ViewModels; namespace FlaUInspect.Views { /// <summary> /// Interaction logic for MainWindow.xaml /// </summary> public partial class MainWindow : Window { private readonly MainViewModel _vm; public MainWindow() { InitializeComponent(); Height = 550; Width = 700; Loaded += MainWindow_Loaded; _vm = new MainViewModel(); DataContext = _vm; } private void MainWindow_Loaded(object sender, System.EventArgs e) { if (!_vm.IsInitialized) { var dlg = new ChooseVersionWindow { Owner = this }; if (dlg.ShowDialog() != true) { Close(); } _vm.Initialize(dlg.SelectedAutomationType); Loaded -= MainWindow_Loaded; } } private void MenuItem_Click(object sender, RoutedEventArgs e) { Close(); } private void TreeViewSelectedHandler(object sender, RoutedEventArgs e) { var item = sender as TreeViewItem; if (item != null) { item.BringIntoView(); e.Handled = true; } } } }
using System.Reflection; using System.Windows; using System.Windows.Controls; using FlaUInspect.ViewModels; namespace FlaUInspect.Views { /// <summary> /// Interaction logic for MainWindow.xaml /// </summary> public partial class MainWindow : Window { private readonly MainViewModel _vm; public MainWindow() { InitializeComponent(); AppendVersionToTitle(); Height = 550; Width = 700; Loaded += MainWindow_Loaded; _vm = new MainViewModel(); DataContext = _vm; } private void AppendVersionToTitle() { var attr = Assembly.GetEntryAssembly().GetCustomAttribute(typeof(AssemblyInformationalVersionAttribute)) as AssemblyInformationalVersionAttribute; if (attr != null) { Title += " v" + attr.InformationalVersion; } } private void MainWindow_Loaded(object sender, System.EventArgs e) { if (!_vm.IsInitialized) { var dlg = new ChooseVersionWindow { Owner = this }; if (dlg.ShowDialog() != true) { Close(); } _vm.Initialize(dlg.SelectedAutomationType); Loaded -= MainWindow_Loaded; } } private void MenuItem_Click(object sender, RoutedEventArgs e) { Close(); } private void TreeViewSelectedHandler(object sender, RoutedEventArgs e) { var item = sender as TreeViewItem; if (item != null) { item.BringIntoView(); e.Handled = true; } } } }
Append version number to title
Append version number to title
C#
mit
maxinfet/FlaUI,Roemer/FlaUI
90c75a64cf9e30e213821706e8d54de262d2b629
osu.Game/Screens/Edit/Timing/DifficultySection.cs
osu.Game/Screens/Edit/Timing/DifficultySection.cs
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. using osu.Framework.Allocation; using osu.Framework.Bindables; using osu.Game.Beatmaps.ControlPoints; namespace osu.Game.Screens.Edit.Timing { internal class DifficultySection : Section<DifficultyControlPoint> { private SliderWithTextBoxInput<double> multiplierSlider; [BackgroundDependencyLoader] private void load() { Flow.AddRange(new[] { multiplierSlider = new SliderWithTextBoxInput<double>("Speed Multiplier") { Current = new DifficultyControlPoint().SpeedMultiplierBindable, KeyboardStep = 0.1f } }); } protected override void OnControlPointChanged(ValueChangedEvent<DifficultyControlPoint> point) { if (point.NewValue != null) { multiplierSlider.Current = point.NewValue.SpeedMultiplierBindable; multiplierSlider.Current.BindValueChanged(_ => ChangeHandler?.SaveState()); } } protected override DifficultyControlPoint CreatePoint() { var reference = Beatmap.ControlPointInfo.DifficultyPointAt(SelectedGroup.Value.Time); return new DifficultyControlPoint { SpeedMultiplier = reference.SpeedMultiplier, }; } } }
// 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.Bindables; using osu.Game.Beatmaps.ControlPoints; namespace osu.Game.Screens.Edit.Timing { internal class DifficultySection : Section<DifficultyControlPoint> { private SliderWithTextBoxInput<double> multiplierSlider; [BackgroundDependencyLoader] private void load() { Flow.AddRange(new[] { multiplierSlider = new SliderWithTextBoxInput<double>("Speed Multiplier") { Current = new DifficultyControlPoint().SpeedMultiplierBindable, KeyboardStep = 0.1f } }); } protected override void OnControlPointChanged(ValueChangedEvent<DifficultyControlPoint> point) { if (point.NewValue != null) { var selectedPointBindable = point.NewValue.SpeedMultiplierBindable; // there may be legacy control points, which contain infinite precision for compatibility reasons (see LegacyDifficultyControlPoint). // generally that level of precision could only be set by externally editing the .osu file, so at the point // a user is looking to update this within the editor it should be safe to obliterate this additional precision. double expectedPrecision = new DifficultyControlPoint().SpeedMultiplierBindable.Precision; if (selectedPointBindable.Precision < expectedPrecision) selectedPointBindable.Precision = expectedPrecision; multiplierSlider.Current = selectedPointBindable; multiplierSlider.Current.BindValueChanged(_ => ChangeHandler?.SaveState()); } } protected override DifficultyControlPoint CreatePoint() { var reference = Beatmap.ControlPointInfo.DifficultyPointAt(SelectedGroup.Value.Time); return new DifficultyControlPoint { SpeedMultiplier = reference.SpeedMultiplier, }; } } }
Fix legacy control point precision having an adverse effect on the editor
Fix legacy control point precision having an adverse effect on the editor
C#
mit
peppy/osu,UselessToucan/osu,ppy/osu,peppy/osu,ppy/osu,smoogipooo/osu,peppy/osu-new,smoogipoo/osu,smoogipoo/osu,UselessToucan/osu,NeoAdonis/osu,ppy/osu,smoogipoo/osu,NeoAdonis/osu,NeoAdonis/osu,peppy/osu,UselessToucan/osu
d6fce070c2591858ce190d40a1781651df44ebac
src/Ensconce.Console/Backup.cs
src/Ensconce.Console/Backup.cs
using System.IO; using System.IO.Compression; namespace Ensconce.Console { internal static class Backup { internal static void DoBackup() { if (File.Exists(Arguments.BackupDestination) && Arguments.BackupOverwrite) { File.Delete(Arguments.BackupDestination); } ZipFile.CreateFromDirectory(Arguments.BackupSource, Arguments.BackupDestination, CompressionLevel.Optimal, false); } } }
using System.IO; using System.IO.Compression; namespace Ensconce.Console { internal static class Backup { internal static void DoBackup() { var backupSource = Arguments.BackupSource.Render(); var backupDestination = Arguments.BackupDestination.Render(); if (File.Exists(backupDestination) && Arguments.BackupOverwrite) { File.Delete(backupDestination); } ZipFile.CreateFromDirectory(backupSource, backupDestination, CompressionLevel.Optimal, false); } } }
Add tag replacement on backup paths
Add tag replacement on backup paths
C#
mit
15below/Ensconce,BlythMeister/Ensconce,15below/Ensconce,BlythMeister/Ensconce
d88649ecd2dbea412381a38cfcb4692fd166f13d
src/CommonAssemblyInfo.cs
src/CommonAssemblyInfo.cs
using System.Reflection; using System.Runtime.InteropServices; [assembly: AssemblyCompany("Yevgeniy Shunevych")] [assembly: AssemblyProduct("Atata Framework")] [assembly: AssemblyCopyright("© Yevgeniy Shunevych 2019")] [assembly: AssemblyCulture("")] [assembly: ComVisible(false)] [assembly: AssemblyVersion("1.0.0")] [assembly: AssemblyFileVersion("1.0.0")]
using System.Reflection; using System.Runtime.InteropServices; [assembly: AssemblyCompany("Yevgeniy Shunevych")] [assembly: AssemblyProduct("Atata Framework")] [assembly: AssemblyCopyright("© Yevgeniy Shunevych 2020")] [assembly: AssemblyCulture("")] [assembly: ComVisible(false)] [assembly: AssemblyVersion("1.0.0")] [assembly: AssemblyFileVersion("1.0.0")]
Increment projects copyright year to 2020
Increment projects copyright year to 2020
C#
apache-2.0
atata-framework/atata-sample-app-tests
0a8eeff2955e57895ee5f90eda6db8d6b947a396
PluginTest/TestPlugin.cs
PluginTest/TestPlugin.cs
using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace PluginTest { public class TestPlugin { } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using UnityEngine; namespace PluginTest { public class TestPlugin : MonoBehaviour { private void Start() { Debug.Log("Start called"); } } }
Add a stronger dependency on UnityEngine for testing.
Add a stronger dependency on UnityEngine for testing. This makes it easier to test what happens if ReferencePath is used, but removed.
C#
mit
PrecisionMojo/Unity3D.DLLs
771d6f8074051e4fe3d21ed1b28169ffa7b6c3bb
src/Hyde.IntegrationTest/DecoratedItem.cs
src/Hyde.IntegrationTest/DecoratedItem.cs
using TechSmith.Hyde.Common.DataAnnotations; namespace TechSmith.Hyde.IntegrationTest { /// <summary> /// Class with decorated partition and row key properties, for testing purposes. /// </summary> class DecoratedItem { [PartitionKey] public string Id { get; set; } [RowKey] public string Name { get; set; } public int Age { get; set; } } class DecoratedItemEntity : Microsoft.WindowsAzure.Storage.Table.TableEntity { public string Id { get; set; } public string Name { get; set; } public int Age { get; set; } } }
using System.Data.Services.Common; using TechSmith.Hyde.Common.DataAnnotations; namespace TechSmith.Hyde.IntegrationTest { /// <summary> /// Class with decorated partition and row key properties, for testing purposes. /// </summary> class DecoratedItem { [PartitionKey] public string Id { get; set; } [RowKey] public string Name { get; set; } public int Age { get; set; } } [DataServiceKey( "PartitionKey", "RowKey")] class DecoratedItemEntity : Microsoft.WindowsAzure.Storage.Table.TableEntity { public string Id { get; set; } public string Name { get; set; } public int Age { get; set; } } }
Update test entity with attribute to denote partition/row key
Update test entity with attribute to denote partition/row key
C#
bsd-3-clause
dontjee/hyde
55567d498b037dbfd9887bc231d8aff12519a15b
themes/Docs/Samson/Shared/_Infobar.cshtml
themes/Docs/Samson/Shared/_Infobar.cshtml
@{ string baseEditUrl = Context.String(DocsKeys.BaseEditUrl); FilePath editFilePath = Model.FilePath(Wyam.Web.WebKeys.EditFilePath); if(!string.IsNullOrWhiteSpace(baseEditUrl) && editFilePath != null) { string editUrl = baseEditUrl + editFilePath.FullPath; <div><p><a href="@editUrl"><i class="fa fa-pencil-square" aria-hidden="true"></i> Edit Content</a></p></div> } <div id="infobar-headings"></div> }
@{ string baseEditUrl = Context.String(DocsKeys.BaseEditUrl); FilePath editFilePath = Model.FilePath(Wyam.Web.WebKeys.EditFilePath); if(!string.IsNullOrWhiteSpace(baseEditUrl) && editFilePath != null) { if (!baseEditUrl[baseEditUrl.Length - 1].equals('/')) { baseEditUrl += "/"; } string editUrl = baseEditUrl + editFilePath.FullPath; <div><p><a href="@editUrl"><i class="fa fa-pencil-square" aria-hidden="true"></i> Edit Content</a></p></div> } <div id="infobar-headings"></div> }
Add handling for missing /
Add handling for missing / If `DocsKeys.BaseEditUrl` in `config.wyam` is missing a forward slash at the end, a malformed edit address is produced. For example, `Settings[DocsKeys.BaseEditUrl] = "https://code.luzfaltex.com"` Will result in a url like: `https://code.luzfaltex.comlegal/privacy/index.md`
C#
mit
Wyamio/Wyam,Wyamio/Wyam,Wyamio/Wyam
915d0afb898e56bc56e6ecd6f693296be6c29e1f
a/Program.cs
a/Program.cs
using System; using System.Net; namespace a { class Program { //Code is dirty, who cares, it's C#. static void Main(string[] args) { //IPHostEntry heserver = Dns.GetHostEntry(Dns.GetHostName()); //foreach (IPAddress curAdd in heserver.AddressList) //{ Server server = new Server(IPAddress.Loopback, 5000); server.Start(); Console.WriteLine("Press q to exit"); while (true) { try { char c = (char)Console.ReadLine()[0]; if (c == 'q') { server.Stop(); break; } } catch (Exception) { //who cares ? } } //} } } }
using System; using System.Net; namespace a { class Program { //Code is dirty, who cares, it's C#. static void Main(string[] args) { Server server = new Server(IPAddress.Any, 5000); server.Start(); Console.WriteLine("Press q to exit"); while (true) { try { if (Console.ReadKey().KeyChar == 'q') { server.Stop(); return; } } catch (Exception) { //who cares ? } } } } }
Fix problems with launching and exiting the app
Fix problems with launching and exiting the app
C#
mit
ParriauxMaxime/assignement3
b98f655eca1b80c9926b0ba11cb19708443a2ece
BobTheBuilder.Tests/BuildFacts.cs
BobTheBuilder.Tests/BuildFacts.cs
using Ploeh.AutoFixture.Xunit; using Xunit; using Xunit.Extensions; namespace BobTheBuilder.Tests { public class BuildFacts { [Fact] public void CreateADynamicInstanceOfTheRequestedType() { var sut = A.BuilderFor<SampleType>(); var result = sut.Build(); Assert.IsAssignableFrom<dynamic>(result); Assert.IsAssignableFrom<SampleType>(result); } [Theory, AutoData] public void SetStringStateByName(string expected) { var sut = A.BuilderFor<SampleType>(); sut.WithStringProperty(expected); SampleType result = sut.Build(); Assert.Equal(expected, result.StringProperty); } [Theory, AutoData] public void SetIntStateByName(int expected) { var sut = A.BuilderFor<SampleType>(); sut.WithIntProperty(expected); SampleType result = sut.Build(); Assert.Equal(expected, result.IntProperty); } } }
using System; using Ploeh.AutoFixture.Xunit; using Xunit; using Xunit.Extensions; namespace BobTheBuilder.Tests { public class BuildFacts { [Fact] public void CreateADynamicInstanceOfTheRequestedType() { var sut = A.BuilderFor<SampleType>(); var result = sut.Build(); Assert.IsAssignableFrom<dynamic>(result); Assert.IsAssignableFrom<SampleType>(result); } [Theory, AutoData] public void SetStringStateByName(string expected) { var sut = A.BuilderFor<SampleType>(); sut.WithStringProperty(expected); SampleType result = sut.Build(); Assert.Equal(expected, result.StringProperty); } [Theory, AutoData] public void SetIntStateByName(int expected) { var sut = A.BuilderFor<SampleType>(); sut.WithIntProperty(expected); SampleType result = sut.Build(); Assert.Equal(expected, result.IntProperty); } [Theory, AutoData] public void SetComplexStateByName(Exception expected) { var sut = A.BuilderFor<SampleType>(); sut.WithComplexProperty(expected); SampleType result = sut.Build(); Assert.Equal(expected, result.ComplexProperty); } } }
Add unit test for complex types.
Add unit test for complex types. This Just WorksTM because complex types with parameterless constructors can be easily created via reflection.
C#
apache-2.0
alastairs/BobTheBuilder,fffej/BobTheBuilder
c28adfcbf1e3b3cb1afa9a5b0940156f05c75a7b
src/SixLabors.Fonts/Tables/AdvancedTypographic/Shapers/ShaperFactory.cs
src/SixLabors.Fonts/Tables/AdvancedTypographic/Shapers/ShaperFactory.cs
// Copyright (c) Six Labors. // Licensed under the Apache License, Version 2.0. using SixLabors.Fonts.Unicode; namespace SixLabors.Fonts.Tables.AdvancedTypographic.Shapers { internal static class ShaperFactory { /// <summary> /// Creates a Shaper based on the given script language. /// </summary> /// <param name="script">The script language.</param> /// <returns>A shaper for the given script.</returns> public static BaseShaper Create(Script script) { switch (script) { case Script.Arabic: return new ArabicShaper(); default: return new DefaultShaper(); } } } }
// Copyright (c) Six Labors. // Licensed under the Apache License, Version 2.0. using SixLabors.Fonts.Unicode; namespace SixLabors.Fonts.Tables.AdvancedTypographic.Shapers { internal static class ShaperFactory { /// <summary> /// Creates a Shaper based on the given script language. /// </summary> /// <param name="script">The script language.</param> /// <returns>A shaper for the given script.</returns> public static BaseShaper Create(Script script) { switch (script) { case Script.Arabic: case Script.Mongolian: case Script.Syriac: case Script.Nko: case Script.PhagsPa: case Script.Mandaic: case Script.Manichaean: case Script.PsalterPahlavi: return new ArabicShaper(); default: return new DefaultShaper(); } } } }
Add additional script languages which use the arabic shaper
Add additional script languages which use the arabic shaper
C#
apache-2.0
SixLabors/Fonts
019160398ae26aa3a48ffefb6ae03f8d2ed6bfb7
Lbookshelf/ViewModels/SettingsFileSystemViewModel.cs
Lbookshelf/ViewModels/SettingsFileSystemViewModel.cs
using Lbookshelf.Business; using Microsoft.Expression.Interactivity.Core; using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Input; using System.Configuration; using Lbookshelf.Utils; using Lbookshelf.Models; using Lapps.Utils; using Lapps.Utils.Collections; namespace Lbookshelf.ViewModels { public class SettingsFileSystemViewModel : ObservableObject { public SettingsFileSystemViewModel() { CleanCommand = new ActionCommand( () => { var used = BookManager.Instance.Books.Select(b => Path.Combine(Environment.CurrentDirectory, b.Thumbnail)); var cached = Directory.GetFiles(Path.Combine(Environment.CurrentDirectory, "Images")); var disused = cached.Except(used).ToArray(); if (disused.Length > 0) { disused.ForEach(p => File.Delete(p)); DialogService.ShowDialog(String.Format("{0} disused thumbnails were removed.", disused.Length)); } else { DialogService.ShowDialog("All thumbnails are in use."); } }); } public string RootDirectory { get { return StorageManager.Instance.RootDirectory; } set { StorageManager.Instance.RootDirectory = value; SettingManager.Default.RootDirectory = StorageManager.Instance.RootDirectory; SettingManager.Default.Save(); } } public ICommand CleanCommand { get; private set; } } }
using Lbookshelf.Business; using Microsoft.Expression.Interactivity.Core; using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Input; using System.Configuration; using Lbookshelf.Utils; using Lbookshelf.Models; using Lapps.Utils; using Lapps.Utils.Collections; namespace Lbookshelf.ViewModels { public class SettingsFileSystemViewModel : ObservableObject { public SettingsFileSystemViewModel() { CleanCommand = new ActionCommand( () => { var used = BookManager.Instance.Books.Select(b => Path.Combine(Environment.CurrentDirectory, b.Thumbnail)); var cached = Directory .GetFiles(Path.Combine(Environment.CurrentDirectory, "Images")) .Where(p => Path.GetFileName(p) != "DefaultThumbnail.jpg"); var disused = cached.Except(used).ToArray(); if (disused.Length > 0) { disused.ForEach(p => File.Delete(p)); DialogService.ShowDialog(String.Format("{0} disused thumbnails were removed.", disused.Length)); } else { DialogService.ShowDialog("All thumbnails are in use."); } }); } public string RootDirectory { get { return StorageManager.Instance.RootDirectory; } set { StorageManager.Instance.RootDirectory = value; SettingManager.Default.RootDirectory = StorageManager.Instance.RootDirectory; SettingManager.Default.Save(); } } public ICommand CleanCommand { get; private set; } } }
Fix a bug: When clean up disused images, the DefaultThumbnail.jpg could be removed by mistake if all books have their own images.
Fix a bug: When clean up disused images, the DefaultThumbnail.jpg could be removed by mistake if all books have their own images.
C#
mit
allenlooplee/Lbookshelf
dc14cc14cf7b37097785a327fb24603e332b7dd9
Trappist/src/Promact.Trappist.Repository/Questions/QuestionRepository.cs
Trappist/src/Promact.Trappist.Repository/Questions/QuestionRepository.cs
using System.Collections.Generic; using Promact.Trappist.DomainModel.Models.Question; using System.Linq; using Promact.Trappist.DomainModel.DbContext; namespace Promact.Trappist.Repository.Questions { public class QuestionRepository : IQuestionRepository { private readonly TrappistDbContext _dbContext; public QuestionRepository(TrappistDbContext dbContext) { _dbContext = dbContext; } /// <summary> /// Get all questions /// </summary> /// <returns>Question list</returns> public List<SingleMultipleAnswerQuestion> GetAllQuestions() { var questions = _dbContext.SingleMultipleAnswerQuestion.ToList(); return questions; } /// <summary> /// Add single multiple answer question into SingleMultipleAnswerQuestion model /// </summary> /// <param name="singleMultipleAnswerQuestion"></param> /// <param name="singleMultipleAnswerQuestionOption"></param> public void AddSingleMultipleAnswerQuestion(SingleMultipleAnswerQuestion singleMultipleAnswerQuestion, SingleMultipleAnswerQuestionOption singleMultipleAnswerQuestionOption) { _dbContext.SingleMultipleAnswerQuestion.Add(singleMultipleAnswerQuestion); _dbContext.SingleMultipleAnswerQuestionOption.Add(singleMultipleAnswerQuestionOption); _dbContext.SaveChanges(); } } }
using System.Collections.Generic; using Promact.Trappist.DomainModel.Models.Question; using System.Linq; using Promact.Trappist.DomainModel.DbContext; namespace Promact.Trappist.Repository.Questions { public class QuestionRepository : IQuestionRepository { private readonly TrappistDbContext _dbContext; public QuestionRepository(TrappistDbContext dbContext) { _dbContext = dbContext; } /// <summary> /// Get all questions /// </summary> /// <returns>Question list</returns> public List<SingleMultipleAnswerQuestion> GetAllQuestions() { var questions = _dbContext.SingleMultipleAnswerQuestion.ToList(); return questions; } /// <summary> /// Add single multiple answer question into SingleMultipleAnswerQuestion model /// </summary> /// <param name="singleMultipleAnswerQuestion"></param> /// <param name="singleMultipleAnswerQuestionOption"></param> public void AddSingleMultipleAnswerQuestion(SingleMultipleAnswerQuestion singleMultipleAnswerQuestion, SingleMultipleAnswerQuestionOption singleMultipleAnswerQuestionOption) { _dbContext.SingleMultipleAnswerQuestion.Add(singleMultipleAnswerQuestion); _dbContext.SingleMultipleAnswerQuestionOption.Add(singleMultipleAnswerQuestionOption); _dbContext.SaveChanges(); } } }
Create server side API for single multiple answer question
Create server side API for single multiple answer question
C#
mit
Promact/trappist,Promact/trappist,Promact/trappist,Promact/trappist,Promact/trappist
6e21c36ef373b14f7bd882f5de78861aa1ee4f7c
Trappist/src/Promact.Trappist.Repository/Questions/QuestionRepository.cs
Trappist/src/Promact.Trappist.Repository/Questions/QuestionRepository.cs
using System.Collections.Generic; using Promact.Trappist.DomainModel.Models.Question; using System.Linq; using Promact.Trappist.DomainModel.DbContext; namespace Promact.Trappist.Repository.Questions { public class QuestionRepository : IQuestionRespository { private readonly TrappistDbContext _dbContext; public QuestionRepository(TrappistDbContext dbContext) { _dbContext = dbContext; } /// <summary> /// Get all questions /// </summary> /// <returns>Question list</returns> public List<SingleMultipleAnswerQuestion> GetAllQuestions() { var question = _dbContext.SingleMultipleAnswerQuestion.ToList(); return question; } /// <summary> /// Add single multiple answer question into model /// </summary> /// <param name="singleMultipleAnswerQuestion"></param> /// <param name="singleMultipleAnswerQuestionOption"></param> public void AddSingleMultipleAnswerQuestion(SingleMultipleAnswerQuestion singleMultipleAnswerQuestion, SingleMultipleAnswerQuestionOption[] singleMultipleAnswerQuestionOption) { _dbContext.SingleMultipleAnswerQuestion.Add(singleMultipleAnswerQuestion); foreach(SingleMultipleAnswerQuestionOption singleMultipleAnswerQuestionOptionElement in singleMultipleAnswerQuestionOption) { singleMultipleAnswerQuestionOptionElement.SingleMultipleAnswerQuestionID = singleMultipleAnswerQuestion.Id; _dbContext.SingleMultipleAnswerQuestionOption.Add(singleMultipleAnswerQuestionOptionElement); } _dbContext.SaveChanges(); } } }
using System.Collections.Generic; using Promact.Trappist.DomainModel.Models.Question; using System.Linq; using Promact.Trappist.DomainModel.DbContext; namespace Promact.Trappist.Repository.Questions { public class QuestionRepository : IQuestionRespository { private readonly TrappistDbContext _dbContext; public QuestionRepository(TrappistDbContext dbContext) { _dbContext = dbContext; } /// <summary> /// Get all questions /// </summary> /// <returns>Question list</returns> public List<SingleMultipleAnswerQuestion> GetAllQuestions() { var question = _dbContext.SingleMultipleAnswerQuestion.ToList(); return question; } /// <summary> /// Add single multiple answer question into model /// </summary> /// <param name="singleMultipleAnswerQuestion"></param> /// <param name="singleMultipleAnswerQuestionOption"></param> public void AddSingleMultipleAnswerQuestion(SingleMultipleAnswerQuestion singleMultipleAnswerQuestion, SingleMultipleAnswerQuestionOption[] singleMultipleAnswerQuestionOption) { _dbContext.SingleMultipleAnswerQuestion.Add(singleMultipleAnswerQuestion); foreach(SingleMultipleAnswerQuestionOption singleMultipleAnswerQuestionOptionElement in singleMultipleAnswerQuestionOption) { singleMultipleAnswerQuestionOptionElement.SingleMultipleAnswerQuestionID = singleMultipleAnswerQuestion.Id; _dbContext.SingleMultipleAnswerQuestionOption.Add(singleMultipleAnswerQuestionOptionElement); } _dbContext.SaveChanges(); } } }
Update server side API for single multiple answer question
Update server side API for single multiple answer question
C#
mit
Promact/trappist,Promact/trappist,Promact/trappist,Promact/trappist,Promact/trappist
dca96e519b975162bec46762864676401465ea21
src/MailTrace.Host.Selfhost/Program.cs
src/MailTrace.Host.Selfhost/Program.cs
namespace MailTrace.Host.Selfhost { using System; using MailTrace.Data.Postgresql; using MailTrace.Host; using MailTrace.Host.Data; using Microsoft.Owin.Hosting; internal static class Program { private static void Main(string[] args) { const string baseAddress = "http://localhost:9900/"; Startup.PostConfigureKernel += kernel => { kernel.Bind<TraceContext>().To<PostgresqlTraceContext>(); }; Console.WriteLine("Running Migration..."); var context = new PostgresqlTraceContext(); context.Migrate(); using (WebApp.Start<Startup>(baseAddress)) { Console.WriteLine("Ready."); Console.ReadLine(); } } } }
namespace MailTrace.Host.Selfhost { using System; using System.Linq; using MailTrace.Data.Postgresql; using MailTrace.Host.Data; using Microsoft.Owin.Hosting; internal static class Program { private static void Main(string[] args) { var baseAddress = args.FirstOrDefault() ?? "http://localhost:9900"; Startup.PostConfigureKernel += kernel => { kernel.Bind<TraceContext>().To<PostgresqlTraceContext>(); }; Console.WriteLine("Running Migration..."); var context = new PostgresqlTraceContext(); context.Migrate(); using (WebApp.Start<Startup>(baseAddress)) { Console.WriteLine("Ready."); Console.ReadLine(); } } } }
Allow bind interface to be customized.
Allow bind interface to be customized.
C#
mit
Silvenga/MailTrace,Silvenga/MailTrace,Silvenga/MailTrace
776ffbcbdcb6eaa8e32f989a7527bc8a201362dc
src/Avalonia.Visuals/Platform/AlphaFormat.cs
src/Avalonia.Visuals/Platform/AlphaFormat.cs
namespace Avalonia.Platform { public enum AlphaFormat { Premul, Unpremul, Opaque } }
namespace Avalonia.Platform { /// <summary> /// Describes how to interpret the alpha component of a pixel. /// </summary> public enum AlphaFormat { /// <summary> /// All pixels have their alpha premultiplied in their color components. /// </summary> Premul, /// <summary> /// All pixels have their color components stored without any regard to the alpha. e.g. this is the default configuration for PNG images. /// </summary> Unpremul, /// <summary> /// All pixels are stored as opaque. /// </summary> Opaque } }
Add documentation for alpha format.
Add documentation for alpha format.
C#
mit
SuperJMN/Avalonia,grokys/Perspex,AvaloniaUI/Avalonia,jkoritzinsky/Avalonia,akrisiun/Perspex,wieslawsoltes/Perspex,wieslawsoltes/Perspex,SuperJMN/Avalonia,wieslawsoltes/Perspex,jkoritzinsky/Avalonia,jkoritzinsky/Avalonia,jkoritzinsky/Avalonia,AvaloniaUI/Avalonia,SuperJMN/Avalonia,SuperJMN/Avalonia,AvaloniaUI/Avalonia,AvaloniaUI/Avalonia,grokys/Perspex,jkoritzinsky/Avalonia,wieslawsoltes/Perspex,wieslawsoltes/Perspex,jkoritzinsky/Avalonia,AvaloniaUI/Avalonia,wieslawsoltes/Perspex,Perspex/Perspex,SuperJMN/Avalonia,AvaloniaUI/Avalonia,AvaloniaUI/Avalonia,SuperJMN/Avalonia,Perspex/Perspex,jkoritzinsky/Perspex,wieslawsoltes/Perspex,jkoritzinsky/Avalonia,SuperJMN/Avalonia
9e33face791c92f4281f5bd74a6f1735aa6b08d0
Source/Tests/TraktApiSharp.Tests/Experimental/Requests/Users/OAuth/TraktUserCustomListItemsRemoveRequestTests.cs
Source/Tests/TraktApiSharp.Tests/Experimental/Requests/Users/OAuth/TraktUserCustomListItemsRemoveRequestTests.cs
namespace TraktApiSharp.Tests.Experimental.Requests.Users.OAuth { using FluentAssertions; using Microsoft.VisualStudio.TestTools.UnitTesting; using TraktApiSharp.Experimental.Requests.Users.OAuth; using TraktApiSharp.Objects.Post.Users.CustomListItems; using TraktApiSharp.Objects.Post.Users.CustomListItems.Responses; [TestClass] public class TraktUserCustomListItemsRemoveRequestTests { [TestMethod, TestCategory("Requests"), TestCategory("Users")] public void TestTraktUserCustomListItemsRemoveRequestIsNotAbstract() { typeof(TraktUserCustomListItemsRemoveRequest).IsAbstract.Should().BeFalse(); } [TestMethod, TestCategory("Requests"), TestCategory("Users")] public void TestTraktUserCustomListItemsRemoveRequestIsSealed() { typeof(TraktUserCustomListItemsRemoveRequest).IsSealed.Should().BeTrue(); } [TestMethod, TestCategory("Requests"), TestCategory("Users")] public void TestTraktUserCustomListItemsRemoveRequestIsSubclassOfATraktUsersPostByIdRequest() { typeof(TraktUserCustomListItemsRemoveRequest).IsSubclassOf(typeof(ATraktUsersPostByIdRequest<TraktUserCustomListItemsRemovePostResponse, TraktUserCustomListItemsPost>)).Should().BeTrue(); } } }
namespace TraktApiSharp.Tests.Experimental.Requests.Users.OAuth { using FluentAssertions; using Microsoft.VisualStudio.TestTools.UnitTesting; using TraktApiSharp.Experimental.Requests.Users.OAuth; using TraktApiSharp.Objects.Post.Users.CustomListItems; using TraktApiSharp.Objects.Post.Users.CustomListItems.Responses; using TraktApiSharp.Requests; [TestClass] public class TraktUserCustomListItemsRemoveRequestTests { [TestMethod, TestCategory("Requests"), TestCategory("Users")] public void TestTraktUserCustomListItemsRemoveRequestIsNotAbstract() { typeof(TraktUserCustomListItemsRemoveRequest).IsAbstract.Should().BeFalse(); } [TestMethod, TestCategory("Requests"), TestCategory("Users")] public void TestTraktUserCustomListItemsRemoveRequestIsSealed() { typeof(TraktUserCustomListItemsRemoveRequest).IsSealed.Should().BeTrue(); } [TestMethod, TestCategory("Requests"), TestCategory("Users")] public void TestTraktUserCustomListItemsRemoveRequestIsSubclassOfATraktUsersPostByIdRequest() { typeof(TraktUserCustomListItemsRemoveRequest).IsSubclassOf(typeof(ATraktUsersPostByIdRequest<TraktUserCustomListItemsRemovePostResponse, TraktUserCustomListItemsPost>)).Should().BeTrue(); } [TestMethod, TestCategory("Requests"), TestCategory("Users")] public void TestTraktUserCustomListItemsRemoveRequestHasAuthorizationRequired() { var request = new TraktUserCustomListItemsRemoveRequest(null); request.AuthorizationRequirement.Should().Be(TraktAuthorizationRequirement.Required); } } }
Add test for authorization requirement in TraktUserCustomListItemsRemoveRequest
Add test for authorization requirement in TraktUserCustomListItemsRemoveRequest
C#
mit
henrikfroehling/TraktApiSharp
cb23202a308041d4f0dcdf95bc466ab548c695c6
Amry.Gst.Web/Controllers/HomeController.cs
Amry.Gst.Web/Controllers/HomeController.cs
using System.Web.Mvc; using Amry.Gst.Properties; using WebMarkupMin.Mvc.ActionFilters; namespace Amry.Gst.Web.Controllers { public class HomeController : Controller { const int OneWeek = 604800; const int OneYear = 31536000; [Route, MinifyHtml, OutputCache(Duration = OneWeek)] public ActionResult Index() { return View(); } [Route("about"), MinifyHtml, OutputCache(Duration = OneYear)] public ActionResult About() { return View(); } [Route("api"), MinifyHtml, OutputCache(Duration = OneYear)] public ActionResult Api() { return View(); } [Route("ver")] public ActionResult Version() { return Content("Version: " + AssemblyInfoConstants.Version, "text/plain"); } } }
using System.Web.Mvc; using Amry.Gst.Properties; using WebMarkupMin.Mvc.ActionFilters; namespace Amry.Gst.Web.Controllers { public class HomeController : Controller { const int OneWeek = 604800; const int OneYear = 31536000; [Route, MinifyHtml, OutputCache(Duration = OneWeek)] public ActionResult Index() { return View(); } [Route("about"), MinifyHtml, OutputCache(Duration = OneYear)] public ActionResult About() { return View(); } [Route("api"), MinifyHtml, OutputCache(Duration = OneYear)] public ActionResult Api() { return View(); } [Route("ver")] public ActionResult Version() { return Content(AssemblyInfoConstants.Version, "text/plain"); } } }
Revert "Change controller action to debug Kudu issue .."
Revert "Change controller action to debug Kudu issue .." This reverts commit 84cebcdc1d49c04c1060fa779b4872b2f208c233.
C#
mit
ShamsulAmry/Malaysia-GST-Checker
820ce9e8455feb15c8114457f82cf9fa9cf74461
Core/Handling/General/FileDialogHandler.cs
Core/Handling/General/FileDialogHandler.cs
using System.Collections.Generic; using System.IO; using System.Linq; using System.Windows.Forms; using CefSharp; namespace TweetDuck.Core.Handling.General{ sealed class FileDialogHandler : IDialogHandler{ public bool OnFileDialog(IWebBrowser browserControl, IBrowser browser, CefFileDialogMode mode, string title, string defaultFilePath, List<string> acceptFilters, int selectedAcceptFilter, IFileDialogCallback callback){ CefFileDialogMode dialogType = mode & CefFileDialogMode.TypeMask; if (dialogType == CefFileDialogMode.Open || dialogType == CefFileDialogMode.OpenMultiple){ string allFilters = string.Join(";", acceptFilters.Select(filter => "*"+filter)); using(OpenFileDialog dialog = new OpenFileDialog{ AutoUpgradeEnabled = true, DereferenceLinks = true, Multiselect = dialogType == CefFileDialogMode.OpenMultiple, Title = "Open Files", Filter = $"All Supported Formats ({allFilters})|{allFilters}|All Files (*.*)|*.*" }){ if (dialog.ShowDialog() == DialogResult.OK){ callback.Continue(acceptFilters.FindIndex(filter => filter == Path.GetExtension(dialog.FileName)), dialog.FileNames.ToList()); } else{ callback.Cancel(); } callback.Dispose(); } return true; } else{ callback.Dispose(); return false; } } } }
using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Windows.Forms; using CefSharp; namespace TweetDuck.Core.Handling.General{ sealed class FileDialogHandler : IDialogHandler{ public bool OnFileDialog(IWebBrowser browserControl, IBrowser browser, CefFileDialogMode mode, string title, string defaultFilePath, List<string> acceptFilters, int selectedAcceptFilter, IFileDialogCallback callback){ CefFileDialogMode dialogType = mode & CefFileDialogMode.TypeMask; if (dialogType == CefFileDialogMode.Open || dialogType == CefFileDialogMode.OpenMultiple){ string allFilters = string.Join(";", acceptFilters.Select(filter => "*"+filter)); using(OpenFileDialog dialog = new OpenFileDialog{ AutoUpgradeEnabled = true, DereferenceLinks = true, Multiselect = dialogType == CefFileDialogMode.OpenMultiple, Title = "Open Files", Filter = $"All Supported Formats ({allFilters})|{allFilters}|All Files (*.*)|*.*" }){ if (dialog.ShowDialog() == DialogResult.OK){ string ext = Path.GetExtension(dialog.FileName); callback.Continue(acceptFilters.FindIndex(filter => filter.Equals(ext, StringComparison.OrdinalIgnoreCase)), dialog.FileNames.ToList()); } else{ callback.Cancel(); } callback.Dispose(); } return true; } else{ callback.Dispose(); return false; } } } }
Fix uploading files with uppercase extensions
Fix uploading files with uppercase extensions
C#
mit
chylex/TweetDuck,chylex/TweetDuck,chylex/TweetDuck,chylex/TweetDuck
7f38dca1abe2a14c183f81b931cd63a550214865
Translator/Translator/Translator.Build.cs
Translator/Translator/Translator.Build.cs
using System; using System.Diagnostics; namespace Bridge.Translator { public partial class Translator { protected static readonly char ps = System.IO.Path.DirectorySeparatorChar; protected virtual string GetBuilderPath() { switch (Environment.OSVersion.Platform) { case PlatformID.Win32NT: return Environment.GetEnvironmentVariable("windir") + ps + "Microsoft.NET" + ps + "Framework" + ps + this.MSBuildVersion + ps + "msbuild"; default: throw (Exception)Bridge.Translator.Exception.Create("Unsupported platform - {0}", Environment.OSVersion.Platform); } } protected virtual string GetBuilderArguments() { switch (Environment.OSVersion.Platform) { case PlatformID.Win32NT: return String.Format(" \"{0}\" /t:Rebuild /p:Configuation={1}", Location, this.Configuration); default: throw (Exception)Bridge.Translator.Exception.Create("Unsupported platform - {0}", Environment.OSVersion.Platform); } } protected virtual void BuildAssembly() { var info = new ProcessStartInfo() { FileName = this.GetBuilderPath(), Arguments = this.GetBuilderArguments() }; info.WindowStyle = ProcessWindowStyle.Hidden; using (var p = Process.Start(info)) { p.WaitForExit(); if (p.ExitCode != 0) { Bridge.Translator.Exception.Throw("Compilation was not successful, exit code - " + p.ExitCode); } } } } }
using System; using System.Diagnostics; namespace Bridge.Translator { public partial class Translator { protected static readonly char ps = System.IO.Path.DirectorySeparatorChar; protected virtual string GetBuilderPath() { switch (Environment.OSVersion.Platform) { case PlatformID.Win32NT: return Environment.GetEnvironmentVariable("windir") + ps + "Microsoft.NET" + ps + "Framework" + ps + "v" + this.MSBuildVersion + ps + "msbuild"; default: throw (Exception)Bridge.Translator.Exception.Create("Unsupported platform - {0}", Environment.OSVersion.Platform); } } protected virtual string GetBuilderArguments() { switch (Environment.OSVersion.Platform) { case PlatformID.Win32NT: return String.Format(" \"{0}\" /t:Rebuild /p:Configuation={1}", Location, this.Configuration); default: throw (Exception)Bridge.Translator.Exception.Create("Unsupported platform - {0}", Environment.OSVersion.Platform); } } protected virtual void BuildAssembly() { var info = new ProcessStartInfo() { FileName = this.GetBuilderPath(), Arguments = this.GetBuilderArguments(), UseShellExecute = true }; info.WindowStyle = ProcessWindowStyle.Hidden; using (var p = Process.Start(info)) { p.WaitForExit(); if (p.ExitCode != 0) { Bridge.Translator.Exception.Throw("Compilation was not successful, exit code - " + p.ExitCode); } } } } }
Correct builder path - .Net Framework folder starts from "v"
Correct builder path - .Net Framework folder starts from "v"
C#
apache-2.0
AndreyZM/Bridge,AndreyZM/Bridge,AndreyZM/Bridge,bridgedotnet/Bridge,bridgedotnet/Bridge,bridgedotnet/Bridge,bridgedotnet/Bridge,AndreyZM/Bridge
4e2224ca4d4c91079868bb4f5d98b1ef45691334
RedGate.AppHost.Server/ChildProcessFactory.cs
RedGate.AppHost.Server/ChildProcessFactory.cs
namespace RedGate.AppHost.Server { public class ChildProcessFactory { public IChildProcessHandle Create(string assemblyName, bool openDebugConsole, bool is64Bit, bool monitorHostProcess) { IProcessStartOperation processStarter; if (is64Bit) { processStarter = new ProcessStarter64Bit(); } else { processStarter = new ProcessStarter32Bit(); } return new RemotedProcessBootstrapper( new StartProcessWithTimeout( new StartProcessWithJobSupport( processStarter))).Create(assemblyName, openDebugConsole, monitorHostProcess); } // the methods below are to support legacy versions of the API to the Create() method public IChildProcessHandle Create(string assemblyName, bool openDebugConsole, bool is64Bit) { return Create(assemblyName, openDebugConsole, false, false); } public IChildProcessHandle Create(string assemblyName, bool openDebugConsole) { return Create(assemblyName, openDebugConsole, false); } public IChildProcessHandle Create(string assemblyName) { return Create(assemblyName, false, false); } } }
namespace RedGate.AppHost.Server { public class ChildProcessFactory { public IChildProcessHandle Create(string assemblyName, bool openDebugConsole, bool is64Bit, bool monitorHostProcess) { IProcessStartOperation processStarter; if (is64Bit) { processStarter = new ProcessStarter64Bit(); } else { processStarter = new ProcessStarter32Bit(); } return new RemotedProcessBootstrapper( new StartProcessWithTimeout( new StartProcessWithJobSupport( processStarter))).Create(assemblyName, openDebugConsole, monitorHostProcess); } // the methods below are to support legacy versions of the API to the Create() method public IChildProcessHandle Create(string assemblyName, bool openDebugConsole, bool is64Bit) { return Create(assemblyName, openDebugConsole, is64Bit, false); } public IChildProcessHandle Create(string assemblyName, bool openDebugConsole) { return Create(assemblyName, openDebugConsole, false); } public IChildProcessHandle Create(string assemblyName) { return Create(assemblyName, false, false); } } }
Fix for assuming any legacy call is 32-bit
Fix for assuming any legacy call is 32-bit
C#
apache-2.0
nycdotnet/RedGate.AppHost,red-gate/RedGate.AppHost
8be0dec2c4fab0deca694537470cf7252ba16df6
Core/EntityCore/DynamicEntity/DatabaseStructure/EntityDatabaseStructure.cs
Core/EntityCore/DynamicEntity/DatabaseStructure/EntityDatabaseStructure.cs
using System.Text; using Models = EntityCore.Initialization.Metadata.Models; namespace EntityCore.DynamicEntity { internal class EntityDatabaseStructure { public static string GenerateCreateTableSqlQuery(Models.Entity entity) { var createTable = new StringBuilder(); createTable.AppendFormat("CREATE TABLE [{0}] (Id int IDENTITY(1,1) NOT NULL, ", entity.Name); foreach (var attribute in entity.Attributes) { createTable.AppendFormat("{0} {1}{2} {3} {4}, ", attribute.Name, attribute.Type.SqlServerName, attribute.Length == null ? string.Empty : "(" + attribute.Length.ToString() + ")", attribute.IsNullable ? "NULL" : string.Empty, attribute.DefaultValue != null ? "DEFAULT(" + attribute.DefaultValue + ")" : string.Empty); } createTable.AppendFormat("CONSTRAINT [PK_{0}] PRIMARY KEY CLUSTERED", entity.Name); createTable.AppendFormat("(Id ASC) WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF," + "ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]) ON [PRIMARY]"); return createTable.ToString(); } } }
using EntityCore.Proxy.Metadata; using System.Text; namespace EntityCore.DynamicEntity { internal class EntityDatabaseStructure { public static string GenerateCreateTableSqlQuery(IEntity entity) { var createTable = new StringBuilder(); createTable.AppendFormat("CREATE TABLE [{0}] (Id int IDENTITY(1,1) NOT NULL, ", entity.Name); foreach (var attribute in entity.Attributes) { createTable.AppendFormat("{0} {1}{2} {3} {4}, ", attribute.Name, attribute.Type.SqlServerName, attribute.Length == null ? string.Empty : "(" + attribute.Length.ToString() + ")", (attribute.IsNullable ?? true) ? "NULL" : string.Empty, attribute.DefaultValue != null ? "DEFAULT(" + attribute.DefaultValue + ")" : string.Empty); } createTable.AppendFormat("CONSTRAINT [PK_{0}] PRIMARY KEY CLUSTERED", entity.Name); createTable.AppendFormat("(Id ASC) WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF," + "ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]) ON [PRIMARY]"); return createTable.ToString(); } } }
Use of metadata proxies to generate table.
Use of metadata proxies to generate table.
C#
mit
xaviermonin/EntityCore
189491de6ecf6f8f2a4b465853ed01a3ff262544
Properties/AssemblyInfo.cs
Properties/AssemblyInfo.cs
using System; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; [assembly: AssemblyTitle("Autofac.Configuration")] [assembly: AssemblyDescription("Autofac XML Configuration Support")] [assembly: InternalsVisibleTo("Autofac.Tests.Configuration, PublicKey=00240000048000009400000006020000002400005253413100040000010001008728425885ef385e049261b18878327dfaaf0d666dea3bd2b0e4f18b33929ad4e5fbc9087e7eda3c1291d2de579206d9b4292456abffbe8be6c7060b36da0c33b883e3878eaf7c89fddf29e6e27d24588e81e86f3a22dd7b1a296b5f06fbfb500bbd7410faa7213ef4e2ce7622aefc03169b0324bcd30ccfe9ac8204e4960be6")] [assembly: ComVisible(false)]
using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; [assembly: AssemblyTitle("Autofac.Configuration")] [assembly: InternalsVisibleTo("Autofac.Tests.Configuration, PublicKey=00240000048000009400000006020000002400005253413100040000010001008728425885ef385e049261b18878327dfaaf0d666dea3bd2b0e4f18b33929ad4e5fbc9087e7eda3c1291d2de579206d9b4292456abffbe8be6c7060b36da0c33b883e3878eaf7c89fddf29e6e27d24588e81e86f3a22dd7b1a296b5f06fbfb500bbd7410faa7213ef4e2ce7622aefc03169b0324bcd30ccfe9ac8204e4960be6")] [assembly: ComVisible(false)]
Build script now writes the package name and version into the AssemblyDescription attibute. This allows the package information to be seen in Visual Studio avoiding confusion with the assembly version that remains at the major.
Build script now writes the package name and version into the AssemblyDescription attibute. This allows the package information to be seen in Visual Studio avoiding confusion with the assembly version that remains at the major.
C#
mit
jango2015/Autofac.Configuration,autofac/Autofac.Configuration
8c9d39700d66af8c12ff2a82a46f39a8ea241b19
osu.iOS/Application.cs
osu.iOS/Application.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 UIKit; namespace osu.iOS { public static class Application { public static void Main(string[] args) { UIApplication.Main(args, "GameUIApplication", "AppDelegate"); } } }
// 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.iOS; using UIKit; namespace osu.iOS { public static class Application { public static void Main(string[] args) { UIApplication.Main(args, typeof(GameUIApplication), typeof(AppDelegate)); } } }
Update deprecated code in iOS main entry
Update deprecated code in iOS main entry
C#
mit
smoogipoo/osu,NeoAdonis/osu,peppy/osu,ppy/osu,NeoAdonis/osu,peppy/osu,smoogipooo/osu,ppy/osu,smoogipoo/osu,NeoAdonis/osu,smoogipoo/osu,ppy/osu,peppy/osu
7cc66a2f336d1da21c95a142894a7e09cad9c300
AltFunding/Properties/AssemblyInfo.cs
AltFunding/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("AltFunding")] [assembly: AssemblyDescription("")] #if DEBUG [assembly: AssemblyConfiguration("Debug")] #else [assembly: AssemblyConfiguration("Release")] #endif [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("AltFunding")] [assembly: AssemblyCopyright("Copyright © 2016 nanathan")] [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("2c84adb4-a8b2-453a-941a-dca4e9383182")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("0.1")] [assembly: AssemblyFileVersion("0.1.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("AltFunding")] [assembly: AssemblyDescription("")] #if DEBUG [assembly: AssemblyConfiguration("Debug")] #else [assembly: AssemblyConfiguration("Release")] #endif [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("AltFunding")] [assembly: AssemblyCopyright("Copyright © 2016 nanathan")] [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("2c84adb4-a8b2-453a-941a-dca4e9383182")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("0.2")] [assembly: AssemblyFileVersion("0.2.0")]
Update assembly info for development of the next version
Update assembly info for development of the next version
C#
mit
nanathan/AltFunding
6861b7f9d994ddc3c1a7e9ef046f64447fff32ce
Idiot/Net/Credentials.cs
Idiot/Net/Credentials.cs
using System; using Microsoft.SPOT; namespace Idiot.Net { class Credentials { } }
using System; using Microsoft.SPOT; using System.Text; using GHIElectronics.NETMF.Net; namespace Idiot.Net { public class Credentials { private string username; private string password; public Credentials(string username, string password) { this.username = username; this.password = password; this.AuthorizationHeader = this.toAuthorizationHeader(); } /// <summary> /// Basic authorization header value to be used for server authentication /// </summary> public string AuthorizationHeader { get; private set; } private string toAuthorizationHeader() { return "Basic " + ConvertBase64.ToBase64String(Encoding.UTF8.GetBytes(this.username + ":" + this.password)); } } }
Add credentials class for user authorization
Add credentials class for user authorization
C#
mit
tenevdev/idiot-netmf-sdk
f4a1b293db9d18ca0816b6067bbfedf5b1cb0a27
SNPPlib/SNPPlib/PagerCollection.cs
SNPPlib/SNPPlib/PagerCollection.cs
using System; using System.Collections.Generic; using System.Collections.ObjectModel; namespace SNPPlib { public class PagerCollection : Collection<string> { public PagerCollection() { Pagers = new List<string>(); } internal IList<string> Pagers { get; set; } public new void Add(string pager) { if (!SnppClientProtocol.PagerIdFormat.IsMatch(pager)) throw new ArgumentException("Pager ids must be numeric.", "pager"); Pagers.Add(pager); } public void AddRange(IEnumerable<string> pagers) { foreach (var pager in pagers) { if (!SnppClientProtocol.PagerIdFormat.IsMatch(pager)) throw new ArgumentException("Pager ids must be numeric.", "pager"); Pagers.Add(pager); } } public override string ToString() { return String.Join(", ", Pagers); } protected override void InsertItem(int index, string pager) { if (!SnppClientProtocol.PagerIdFormat.IsMatch(pager)) throw new ArgumentException("Pager ids must be numeric.", "pager"); Pagers.Insert(index, pager); } protected override void SetItem(int index, string pager) { if (!SnppClientProtocol.PagerIdFormat.IsMatch(pager)) throw new ArgumentException("Pager ids must be numeric.", "pager"); Pagers[index] = pager; } } }
using System; using System.Collections.Generic; using System.Collections.ObjectModel; namespace SNPPlib { public class PagerCollection : Collection<string> { public PagerCollection() { Pagers = new List<string>(); } internal IList<string> Pagers { get; set; } public new void Add(string pager) { if (!SnppClientProtocol.PagerIdFormat.IsMatch(pager)) throw new ArgumentException(Resource.PagerIdNumeric, "pager"); Pagers.Add(pager); } public void AddRange(IEnumerable<string> pagers) { foreach (var pager in pagers) { if (!SnppClientProtocol.PagerIdFormat.IsMatch(pager)) throw new ArgumentException(Resource.PagerIdNumeric, "pager"); Pagers.Add(pager); } } public override string ToString() { return String.Join(", ", Pagers); } protected override void InsertItem(int index, string pager) { if (!SnppClientProtocol.PagerIdFormat.IsMatch(pager)) throw new ArgumentException(Resource.PagerIdNumeric, "pager"); Pagers.Insert(index, pager); } protected override void SetItem(int index, string pager) { if (!SnppClientProtocol.PagerIdFormat.IsMatch(pager)) throw new ArgumentException(Resource.PagerIdNumeric, "pager"); Pagers[index] = pager; } } }
Change missed exception message to resource.
Change missed exception message to resource.
C#
mit
PCFDev/SNPPlib
15e67e171ae5b33f6406a285225b0498328b2e99
Source/DriftUe4PluginServer.Target.cs
Source/DriftUe4PluginServer.Target.cs
// Copyright 1998-2014 Epic Games, Inc. All Rights Reserved. using UnrealBuildTool; using System.Collections.Generic; public class DriftUe4PluginServerTarget : TargetRules { public DriftUe4PluginServerTarget(TargetInfo Target) { Type = TargetType.Server; } // // TargetRules interface. // public override void SetupBinaries( TargetInfo Target, ref List<UEBuildBinaryConfiguration> OutBuildBinaryConfigurations, ref List<string> OutExtraModuleNames ) { base.SetupBinaries(Target, ref OutBuildBinaryConfigurations, ref OutExtraModuleNames); OutExtraModuleNames.Add("DriftUe4Plugin"); } public override bool GetSupportedPlatforms(ref List<UnrealTargetPlatform> OutPlatforms) { // It is valid for only server platforms return UnrealBuildTool.UnrealBuildTool.GetAllServerPlatforms(ref OutPlatforms, false); } }
// Copyright 1998-2014 Epic Games, Inc. All Rights Reserved. using UnrealBuildTool; using System.Collections.Generic; public class DriftUe4PluginServerTarget : TargetRules { public DriftUe4PluginServerTarget(TargetInfo Target) { Type = TargetType.Server; } // // TargetRules interface. // public override void SetupBinaries( TargetInfo Target, ref List<UEBuildBinaryConfiguration> OutBuildBinaryConfigurations, ref List<string> OutExtraModuleNames ) { base.SetupBinaries(Target, ref OutBuildBinaryConfigurations, ref OutExtraModuleNames); OutExtraModuleNames.Add("DriftUe4Plugin"); } }
Remove use of obsolete function
Remove use of obsolete function
C#
mit
dgnorth/DriftUe4Plugin,dgnorth/DriftUe4Plugin,dgnorth/DriftUe4Plugin,dgnorth/DriftUe4Plugin
3c9a0e8143230c5b4639bf3906d3e02eb898e674
LBD2OBJ/Program.cs
LBD2OBJ/Program.cs
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace LBD2OBJ { class Program { static void Main(string[] args) { } } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.IO; using LBD2OBJ.Types; namespace LBD2OBJ { class Program { static void Main(string[] args) { Console.WriteLine("LBD2OBJ - Made by Figglewatts 2015"); foreach (string arg in args) { if (Path.GetExtension(arg).ToLower().Equals("tmd")) { // convert from tmd } else if (Path.GetExtension(arg).ToLower().Equals("lbd")) { // convert from lbd } else { Console.WriteLine("Invalid input file. Extension: {0} not recognized.", Path.GetExtension(arg)); } } Console.Write("Press ENTER to exit..."); Console.ReadLine(); } public static void ConvertTMD(string path) { Console.WriteLine("Converting TMD..."); TMD tmd; bool fixP; // if true, pointers are fixed i.e. non-relative using (BinaryReader b = new BinaryReader(File.Open(path, FileMode.Open))) { tmd.header = readHeader(b); fixP = (tmd.header.flags & 1) == 1 ? true : false; tmd.objTable = new OBJECT[tmd.header.numObjects]; for (int i = 0; i < tmd.header.numObjects; i++) { tmd.objTable[i] = readObject(b); } } } private static TMDHEADER readHeader(BinaryReader b) { TMDHEADER tmdHeader; tmdHeader.ID = b.ReadUInt32(); tmdHeader.flags = b.ReadUInt32(); tmdHeader.numObjects = b.ReadUInt32(); return tmdHeader; } private static OBJECT readObject(BinaryReader b) { OBJECT obj; obj.vertTop = b.ReadUInt32(); obj.numVerts = b.ReadUInt32(); obj.normTop = b.ReadUInt32(); obj.numNorms = b.ReadUInt32(); obj.primTop = b.ReadUInt32(); obj.numPrims = b.ReadUInt32(); obj.scale = b.ReadInt32(); return obj; } } }
Add beginnings of a method to parse TMD files
Add beginnings of a method to parse TMD files
C#
mit
Figglewatts/LBD2OBJ
1cf3f61d2b2c6ad51a006bc4204c1dd0761b3a7e
src/GitReleaseNotes/ArgumentVerifier.cs
src/GitReleaseNotes/ArgumentVerifier.cs
using System; namespace GitReleaseNotes { public class ArgumentVerifier { public static bool VerifyArguments(GitReleaseNotesArguments arguments) { if (arguments.IssueTracker == null) { Console.WriteLine("The IssueTracker argument must be provided, see help (/?) for possible options"); { return false; } } if (string.IsNullOrEmpty(arguments.OutputFile) || !arguments.OutputFile.EndsWith(".md")) { Console.WriteLine("Specify an output file (*.md) [/OutputFile ...]"); { return false; } } return true; } } }
using System; namespace GitReleaseNotes { public class ArgumentVerifier { public static bool VerifyArguments(GitReleaseNotesArguments arguments) { if (arguments.IssueTracker == null) { Console.WriteLine("The IssueTracker argument must be provided, see help (/?) for possible options"); { return false; } } if ((string.IsNullOrEmpty(arguments.OutputFile) || !arguments.OutputFile.EndsWith(".md")) && !arguments.Publish) { Console.WriteLine("Specify an output file (*.md) [/OutputFile ...]"); { return false; } } return true; } } }
Allow publish without outputting a .md file
Allow publish without outputting a .md file
C#
mit
bendetat/GitReleaseNotes,JakeGinnivan/GitReleaseNotes,bendetat/GitReleaseNotes,GitTools/GitReleaseNotes,JakeGinnivan/GitReleaseNotes,theleancoder/GitReleaseNotes,JakeGinnivan/GitReleaseNotes,MacDennis76/GitReleaseNotes,GitTools/GitReleaseNotes,theleancoder/GitReleaseNotes,MacDennis76/GitReleaseNotes
083e4335a903053c0b1a23041bd5f5a6cbf6bfc6
src/Website/Views/Shared/_Footer.cshtml
src/Website/Views/Shared/_Footer.cshtml
@model SiteOptions <hr /> <footer> <p> &copy; @Model.Metadata.Author.Name @DateTimeOffset.UtcNow.Year | <a id="link-status" href="@Model.ExternalLinks.Status.AbsoluteUri" target="_blank" title="View site uptime information"> Site Status &amp; Uptime </a> | Built from <a id="link-git" href="@Model.Metadata.Repository/commit/@GitMetadata.Commit" title="View commit @GitMetadata.Commit on GitHub"> @string.Join(string.Empty, GitMetadata.Commit.Take(7)) </a> on <a href="@Model.Metadata.Repository/tree/@GitMetadata.Branch" title="View branch @GitMetadata.Branch on GitHub"> @GitMetadata.Branch </a> | Sponsored by <a id="link-browserstack" href="https://www.browserstack.com/"> <noscript> <img src="~/assets/img/browserstack.svg" viewBox="0 0 428.5 92.3" height="20" alt="Sponsored by BrowserStack" title="Sponsored by BrowserStack" asp-append-version="true" /> </noscript> <lazyimg src="~/assets/img/browserstack.svg" viewBox="0 0 428.5 92.3" height="20" alt="Sponsored by BrowserStack" title="Sponsored by BrowserStack" /> </a> </p> </footer>
@model SiteOptions <hr /> <footer> <p> &copy; @Model.Metadata.Author.Name @DateTimeOffset.UtcNow.Year | <a id="link-status" href="@Model.ExternalLinks.Status.AbsoluteUri" target="_blank" title="View site uptime information"> Site Status &amp; Uptime </a> | Built from <a id="link-git-commit" href="@Model.Metadata.Repository/commit/@GitMetadata.Commit" title="View commit @GitMetadata.Commit on GitHub"> @string.Join(string.Empty, GitMetadata.Commit.Take(7)) </a> on <a id="link-git-branch" href="@Model.Metadata.Repository/tree/@GitMetadata.Branch" title="View branch @GitMetadata.Branch on GitHub"> @GitMetadata.Branch </a> | Sponsored by <a id="link-browserstack" href="https://www.browserstack.com/"> <noscript> <img src="~/assets/img/browserstack.svg" viewBox="0 0 428.5 92.3" height="20" alt="Sponsored by BrowserStack" title="Sponsored by BrowserStack" asp-append-version="true" /> </noscript> <lazyimg src="~/assets/img/browserstack.svg" viewBox="0 0 428.5 92.3" height="20" alt="Sponsored by BrowserStack" title="Sponsored by BrowserStack" /> </a> </p> </footer>
Add Ids to footer links
Add Ids to footer links Add Ids to the links in the footer for Git metadata.
C#
apache-2.0
martincostello/website,martincostello/website,martincostello/website,martincostello/website
c84695c3462f46a720ea43504ab5118be2580a70
IronFoundry.Warden.Service/Constants.cs
IronFoundry.Warden.Service/Constants.cs
namespace IronFoundry.Warden.Service { public static class Constants { public const string DisplayName = "Iron Foundry Warden Service"; public const string ServiceName = "ironfoundry.warden"; } }
namespace IronFoundry.Warden.Service { public static class Constants { public const string DisplayName = "Iron Foundry Warden Service"; public const string ServiceName = "IronFoundry.Warden"; } }
Fix casing of warden service.
Fix casing of warden service.
C#
apache-2.0
cloudfoundry/IronFrame,cloudfoundry/IronFrame,stefanschneider/IronFrame,cloudfoundry-incubator/IronFrame,cloudfoundry-incubator/if_warden,cloudfoundry-incubator/if_warden,stefanschneider/IronFrame,cloudfoundry-incubator/IronFrame
78f9692401e189d03b508a3cac4c04d1475e69bb
KuduSync.NET/Logger.cs
KuduSync.NET/Logger.cs
using System; using System.IO; using System.Text; namespace KuduSync.NET { public class Logger : IDisposable { private const int KeepAliveLogTimeInSeconds = 20; private int _logCounter = 0; private StreamWriter _writer; private int _maxLogLines; private DateTime _nextLogTime; /// <summary> /// Logger class /// </summary> /// <param name="maxLogLines">sets the verbosity, 0 is verbose, less is quiet, more is the number of maximum log lines to write.</param> public Logger(int maxLogLines) { var stream = Console.OpenStandardOutput(); _writer = new StreamWriter(stream); _maxLogLines = maxLogLines; } public void Log(string format, params object[] args) { if (_maxLogLines == 0 || _logCounter < _maxLogLines) { _writer.WriteLine(format, args); } else if (_logCounter == _maxLogLines) { _writer.WriteLine("Omitting next output lines..."); } else { // Make sure some output is still logged every 20 seconds if (DateTime.Now >= _nextLogTime) { _writer.WriteLine("Working..."); _nextLogTime = DateTime.Now.Add(TimeSpan.FromSeconds(KeepAliveLogTimeInSeconds)); } } _logCounter++; } public void Dispose() { if (_writer != null) { _writer.Dispose(); _writer = null; } } } }
using System; using System.IO; using System.Text; namespace KuduSync.NET { public class Logger : IDisposable { private const int KeepAliveLogTimeInSeconds = 20; private int _logCounter = 0; private StreamWriter _writer; private int _maxLogLines; private DateTime _nextLogTime; /// <summary> /// Logger class /// </summary> /// <param name="maxLogLines">sets the verbosity, 0 is verbose, less is quiet, more is the number of maximum log lines to write.</param> public Logger(int maxLogLines) { var stream = Console.OpenStandardOutput(); _writer = new StreamWriter(stream); _maxLogLines = maxLogLines; } public void Log(string format, params object[] args) { bool logged = false; if (_maxLogLines == 0 || _logCounter < _maxLogLines) { _writer.WriteLine(format, args); } else if (_logCounter == _maxLogLines) { _writer.WriteLine("Omitting next output lines..."); logged = true; } else { // Make sure some output is still logged every 20 seconds if (DateTime.Now >= _nextLogTime) { _writer.WriteLine("Processed {0} files...", _logCounter - 1); logged = true; } } if (logged) { _writer.Flush(); _nextLogTime = DateTime.Now.Add(TimeSpan.FromSeconds(KeepAliveLogTimeInSeconds)); } _logCounter++; } public void Dispose() { if (_writer != null) { _writer.Dispose(); _writer = null; } } } }
Fix flushing issue and added number of files being processed.
Fix flushing issue and added number of files being processed.
C#
apache-2.0
projectkudu/KuduSync.NET,kostrse/KuduSync.NET,uQr/KuduSync.NET,kostrse/KuduSync.NET,projectkudu/KuduSync.NET,uQr/KuduSync.NET
27fab71a1c105fcbf088d070907217a9cfada889
src/Pather.CSharp/PathElements/Property.cs
src/Pather.CSharp/PathElements/Property.cs
using System; using System.Collections.Generic; using System.Linq; using System.Reflection; using System.Text.RegularExpressions; using System.Threading.Tasks; namespace Pather.CSharp.PathElements { public class Property : IPathElement { public static bool IsApplicable(string pathElement) { return Regex.IsMatch(pathElement, @"\w+"); } private string property; public Property(string property) { this.property = property; } public object Apply(object target) { PropertyInfo p = target.GetType().GetProperty(property); if (p == null) throw new ArgumentException($"The property {property} could not be found."); var result = p.GetValue(target); return result; } } }
using System; using System.Collections.Generic; using System.Linq; using System.Reflection; using System.Text.RegularExpressions; using System.Threading.Tasks; namespace Pather.CSharp.PathElements { public class Property : IPathElement { private string property; public Property(string property) { this.property = property; } public object Apply(object target) { PropertyInfo p = target.GetType().GetProperty(property); if (p == null) throw new ArgumentException($"The property {property} could not be found."); var result = p.GetValue(target); return result; } } }
Remove unnecessary static method IsApplicable
Remove unnecessary static method IsApplicable This method became unnecessary because of the factory.
C#
mit
Domysee/Pather.CSharp
c3ba5011960f5d200f8d96bb7d8573ec48c895ec
EOLib.IO/Map/MapEffect.cs
EOLib.IO/Map/MapEffect.cs
// Original Work Copyright (c) Ethan Moffat 2014-2016 // This file is subject to the GPL v2 License // For additional details, see the LICENSE file namespace EOLib.IO.Map { public enum MapEffect : byte { None = 0, HPDrain = 1, TPDrain = 2, Quake = 3 } }
// Original Work Copyright (c) Ethan Moffat 2014-2016 // This file is subject to the GPL v2 License // For additional details, see the LICENSE file namespace EOLib.IO.Map { public enum MapEffect : byte { None = 0, HPDrain = 1, TPDrain = 2, Quake1 = 3, Quake2 = 4, Quake3 = 5, Quake4 = 6 } }
Add more quakes to map effect
Add more quakes to map effect
C#
mit
ethanmoffat/EndlessClient
559e46f2d695d39d124dbf79124b841fa7c191b7
src/Foo.Web/Controllers/HomeController.cs
src/Foo.Web/Controllers/HomeController.cs
using System; using System.Web.Mvc; namespace Foo.Web.Controllers { public class HomeController : Controller { public ActionResult Index() { throw new NotImplementedException(); } } }
using System; using System.Web.Mvc; namespace Foo.Web.Controllers { public class HomeController : Controller { public ActionResult Index() { return View(); } } }
Return view from index action
Return view from index action
C#
mit
appharbor/foo,appharbor/foo
b124b3df7f63560e6ad08702c022c386035c86e1
PlatformSamples/AspNetCoreMvc/Controllers/HomeController.cs
PlatformSamples/AspNetCoreMvc/Controllers/HomeController.cs
using System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Threading.Tasks; using Microsoft.AspNetCore.Mvc; using AspNetCoreMvc.Models; using Ooui; using Ooui.AspNetCore; namespace AspNetCoreMvc.Controllers { public class HomeController : Controller { public IActionResult Index() { var element = new Label { Text = "Hello Oooooui from Controller" }; return new ElementResult (element); } public IActionResult About() { ViewData["Message"] = "Your application description page."; return View(); } public IActionResult Contact() { ViewData["Message"] = "Your contact page."; return View(); } public IActionResult Error() { return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier }); } } }
using System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Threading.Tasks; using Microsoft.AspNetCore.Mvc; using AspNetCoreMvc.Models; using Ooui; using Ooui.AspNetCore; namespace AspNetCoreMvc.Controllers { public class HomeController : Controller { public IActionResult Index() { var count = 0; var head = new Heading { Text = "Ooui!" }; var label = new Label { Text = "0" }; var btn = new Button { Text = "Increase" }; btn.Clicked += (sender, e) => { count++; label.Text = count.ToString (); }; var div = new Div (); div.AppendChild (head); div.AppendChild (label); div.AppendChild (btn); return new ElementResult (div); } public IActionResult About() { ViewData["Message"] = "Your application description page."; return View(); } public IActionResult Contact() { ViewData["Message"] = "Your contact page."; return View(); } public IActionResult Error() { return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier }); } } }
Make the ASP.NET demo more interesting
Make the ASP.NET demo more interesting
C#
mit
praeclarum/Ooui,praeclarum/Ooui,praeclarum/Ooui
b4d4f5456c762f7867ef5a3db4e814a125348f38
osu.Game.Tests/Visual/Gameplay/TestSceneFailJudgement.cs
osu.Game.Tests/Visual/Gameplay/TestSceneFailJudgement.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.Rulesets; using osu.Game.Rulesets.Mods; using osu.Game.Rulesets.Scoring; using osu.Game.Screens.Play; namespace osu.Game.Tests.Visual.Gameplay { public class TestSceneFailJudgement : TestSceneAllRulesetPlayers { protected override Player CreatePlayer(Ruleset ruleset) { SelectedMods.Value = Array.Empty<Mod>(); return new FailPlayer(); } protected override void AddCheckSteps() { AddUntilStep("wait for fail", () => Player.HasFailed); AddUntilStep("wait for multiple judged objects", () => ((FailPlayer)Player).DrawableRuleset.Playfield.AllHitObjects.Count(h => h.AllJudged) > 1); AddAssert("total judgements == 1", () => ((FailPlayer)Player).HealthProcessor.JudgedHits >= 1); } private class FailPlayer : TestPlayer { public new HealthProcessor HealthProcessor => base.HealthProcessor; public FailPlayer() : base(false, false) { } protected override void LoadComplete() { base.LoadComplete(); HealthProcessor.FailConditions += (_, __) => true; } } } }
// 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.Rulesets; using osu.Game.Rulesets.Mods; using osu.Game.Rulesets.Scoring; using osu.Game.Scoring; using osu.Game.Screens.Play; namespace osu.Game.Tests.Visual.Gameplay { public class TestSceneFailJudgement : TestSceneAllRulesetPlayers { protected override Player CreatePlayer(Ruleset ruleset) { SelectedMods.Value = Array.Empty<Mod>(); return new FailPlayer(); } protected override void AddCheckSteps() { AddUntilStep("wait for fail", () => Player.HasFailed); AddUntilStep("wait for multiple judgements", () => ((FailPlayer)Player).ScoreProcessor.JudgedHits > 1); AddAssert("total number of results == 1", () => { var score = new ScoreInfo(); ((FailPlayer)Player).ScoreProcessor.PopulateScore(score); return score.Statistics.Values.Sum() == 1; }); } private class FailPlayer : TestPlayer { public new HealthProcessor HealthProcessor => base.HealthProcessor; public FailPlayer() : base(false, false) { } protected override void LoadComplete() { base.LoadComplete(); HealthProcessor.FailConditions += (_, __) => true; } } } }
Fix broken fail judgement test
Fix broken fail judgement test
C#
mit
NeoAdonis/osu,smoogipoo/osu,UselessToucan/osu,smoogipooo/osu,peppy/osu,ppy/osu,UselessToucan/osu,ppy/osu,peppy/osu,ppy/osu,smoogipoo/osu,peppy/osu-new,NeoAdonis/osu,smoogipoo/osu,UselessToucan/osu,peppy/osu,NeoAdonis/osu
5bd600e626a59f92fbeaa2246022fa79fdc645e1
source/Cosmos.Kernel.LogTail/ErrorStrippingFileStream.cs
source/Cosmos.Kernel.LogTail/ErrorStrippingFileStream.cs
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.IO; namespace Cosmos.Kernel.LogTail { public class ErrorStrippingFileStream : FileStream { public ErrorStrippingFileStream(string file) : base(file, FileMode.Open, FileAccess.ReadWrite, FileShare.Delete | FileShare.ReadWrite) { } public override int ReadByte() { int result; while ((result = base.ReadByte()) == 0) ; return result; } public override int Read(byte[] array, int offset, int count) { int i; for (i = 0; i < count; i++) { int b = ReadByte(); if (b == -1) return i; array[offset + i] = (byte) b; } return i; } } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.IO; namespace Cosmos.Kernel.LogTail { public class ErrorStrippingFileStream : FileStream { public ErrorStrippingFileStream(string file) : base(file, FileMode.Open, FileAccess.Read, FileShare.Delete | FileShare.ReadWrite) { } public override int ReadByte() { int result; while ((result = base.ReadByte()) == 0) ; return result; } public override int Read(byte[] array, int offset, int count) { int i; for (i = 0; i < count; i++) { int b = ReadByte(); if (b == -1) return i; array[offset + i] = (byte) b; } return i; } } }
Make sure you run the log after qemu starts... But it works.
Make sure you run the log after qemu starts... But it works.
C#
bsd-3-clause
kant2002/Cosmos-1,MyvarHD/Cosmos,jp2masa/Cosmos,zhangwenquan/Cosmos,CosmosOS/Cosmos,Cyber4/Cosmos,Cyber4/Cosmos,MetSystem/Cosmos,MyvarHD/Cosmos,MetSystem/Cosmos,MetSystem/Cosmos,zarlo/Cosmos,tgiphil/Cosmos,trivalik/Cosmos,CosmosOS/Cosmos,zarlo/Cosmos,kant2002/Cosmos-1,zhangwenquan/Cosmos,zdimension/Cosmos,CosmosOS/Cosmos,sgetaz/Cosmos,MyvarHD/Cosmos,sgetaz/Cosmos,trivalik/Cosmos,zdimension/Cosmos,sgetaz/Cosmos,fanoI/Cosmos,jp2masa/Cosmos,MetSystem/Cosmos,zdimension/Cosmos,fanoI/Cosmos,tgiphil/Cosmos,kant2002/Cosmos-1,zdimension/Cosmos,MyvarHD/Cosmos,MetSystem/Cosmos,trivalik/Cosmos,Cyber4/Cosmos,zhangwenquan/Cosmos,Cyber4/Cosmos,fanoI/Cosmos,Cyber4/Cosmos,kant2002/Cosmos-1,sgetaz/Cosmos,tgiphil/Cosmos,sgetaz/Cosmos,zarlo/Cosmos,zhangwenquan/Cosmos,zarlo/Cosmos,zhangwenquan/Cosmos,zdimension/Cosmos,MyvarHD/Cosmos,CosmosOS/Cosmos,jp2masa/Cosmos
f9603eefe5fed7e02c040a0e12a4b27541e4aa60
osu.Game/Input/Bindings/RealmKeyBinding.cs
osu.Game/Input/Bindings/RealmKeyBinding.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 osu.Framework.Input.Bindings; using osu.Game.Database; using Realms; namespace osu.Game.Input.Bindings { [MapTo(nameof(KeyBinding))] public class RealmKeyBinding : RealmObject, IHasGuidPrimaryKey, IKeyBinding { [PrimaryKey] public string StringGuid { get; set; } [Ignored] public Guid ID { get => Guid.Parse(StringGuid); set => StringGuid = value.ToString(); } public int? RulesetID { get; set; } public int? Variant { get; set; } public KeyCombination KeyCombination { get => KeyCombinationString; set => KeyCombinationString = value.ToString(); } public object Action { get => ActionInt; set => ActionInt = (int)value; } [MapTo(nameof(Action))] public int ActionInt { get; set; } [MapTo(nameof(KeyCombination))] public string KeyCombinationString { get; set; } } }
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. using System; using osu.Framework.Input.Bindings; using osu.Game.Database; using Realms; namespace osu.Game.Input.Bindings { [MapTo(nameof(KeyBinding))] public class RealmKeyBinding : RealmObject, IHasGuidPrimaryKey, IKeyBinding { [PrimaryKey] public Guid ID { get; set; } public int? RulesetID { get; set; } public int? Variant { get; set; } public KeyCombination KeyCombination { get => KeyCombinationString; set => KeyCombinationString = value.ToString(); } public object Action { get => ActionInt; set => ActionInt = (int)value; } [MapTo(nameof(Action))] public int ActionInt { get; set; } [MapTo(nameof(KeyCombination))] public string KeyCombinationString { get; set; } } }
Revert "Switch Guid implementation temporarily to avoid compile time error"
Revert "Switch Guid implementation temporarily to avoid compile time error" This reverts commit 4d976094d1c69613ef581828d638ffdb04a48984.
C#
mit
smoogipooo/osu,NeoAdonis/osu,UselessToucan/osu,smoogipoo/osu,NeoAdonis/osu,peppy/osu,UselessToucan/osu,ppy/osu,smoogipoo/osu,smoogipoo/osu,UselessToucan/osu,NeoAdonis/osu,ppy/osu,peppy/osu,peppy/osu-new,ppy/osu,peppy/osu
ee82455506a09e554268af1039dd014291a3314b
src/MsgPack/Serialization/DefaultSerializers/NonGenericDictionarySerializer.cs
src/MsgPack/Serialization/DefaultSerializers/NonGenericDictionarySerializer.cs
using System; using System.Collections; namespace MsgPack.Serialization.DefaultSerializers { /// <summary> /// Dictionary interface serializer. /// </summary> internal sealed class NonGenericDictionarySerializer : MessagePackSerializer<IDictionary> { private readonly System_Collections_DictionaryEntryMessagePackSerializer _entrySerializer; private readonly IMessagePackSerializer _collectionDeserializer; public NonGenericDictionarySerializer( SerializationContext ownerContext, Type targetType ) : base( ownerContext ) { this._entrySerializer = new System_Collections_DictionaryEntryMessagePackSerializer( ownerContext ); this._collectionDeserializer = ownerContext.GetSerializer( targetType ); } protected internal override void PackToCore( Packer packer, IDictionary objectTree ) { packer.PackMapHeader( objectTree.Count ); foreach ( DictionaryEntry item in objectTree ) { this._entrySerializer.PackToCore( packer, item ); } } protected internal override IDictionary UnpackFromCore( Unpacker unpacker ) { return this._collectionDeserializer.UnpackFrom( unpacker ) as IDictionary; } } }
using System; using System.Collections; using System.Runtime.Serialization; namespace MsgPack.Serialization.DefaultSerializers { /// <summary> /// Dictionary interface serializer. /// </summary> internal sealed class NonGenericDictionarySerializer : MessagePackSerializer<IDictionary> { private readonly IMessagePackSerializer _collectionDeserializer; public NonGenericDictionarySerializer( SerializationContext ownerContext, Type targetType ) : base( ownerContext ) { this._collectionDeserializer = ownerContext.GetSerializer( targetType ); } protected internal override void PackToCore( Packer packer, IDictionary objectTree ) { packer.PackMapHeader( objectTree.Count ); foreach ( DictionaryEntry item in objectTree ) { if ( !( item.Key is MessagePackObject ) ) { throw new SerializationException("Non generic dictionary may contain only MessagePackObject typed key."); } ( item.Key as IPackable ).PackToMessage( packer, null ); if ( !( item.Value is MessagePackObject ) ) { throw new SerializationException("Non generic dictionary may contain only MessagePackObject typed value."); } ( item.Value as IPackable ).PackToMessage( packer, null ); } } protected internal override IDictionary UnpackFromCore( Unpacker unpacker ) { return this._collectionDeserializer.UnpackFrom( unpacker ) as IDictionary; } } }
Fix non-generic dictionary serializer does not pack key value pair correctly.
Fix non-generic dictionary serializer does not pack key value pair correctly.
C#
apache-2.0
undeadlabs/msgpack-cli,scopely/msgpack-cli,modulexcite/msgpack-cli,msgpack/msgpack-cli,modulexcite/msgpack-cli,msgpack/msgpack-cli,scopely/msgpack-cli,undeadlabs/msgpack-cli
c5852c3b174c14f4cbe6c79a50f4cd0df13d4eef
BackOffice.Worker/CProductAlwaysFailingReportWorker.cs
BackOffice.Worker/CProductAlwaysFailingReportWorker.cs
using BackOffice.Jobs.Interfaces; using BackOffice.Jobs.Reports; using System; namespace BackOffice.Worker { public class CProductAlwaysFailingReportWorker : IJobWorker { private readonly AlwaysFailingReport report; public CProductAlwaysFailingReportWorker(AlwaysFailingReport report) { this.report = report; } public void Start() { throw new NotImplementedException(); } } }
using BackOffice.Jobs.Interfaces; using BackOffice.Jobs.Reports; using System; using System.Threading; namespace BackOffice.Worker { public class CProductAlwaysFailingReportWorker : IJobWorker { private readonly AlwaysFailingReport report; public CProductAlwaysFailingReportWorker(AlwaysFailingReport report) { this.report = report; } public void Start() { Thread.Sleep(10 * 1000); throw new NotImplementedException(); } } }
Add 10s delay for always failing worker
Add 10s delay for always failing worker
C#
mit
Rosiv/backoffice,Rosiv/backoffice,Rosiv/backoffice
586fdaa5a69a212e1a80d28a6ace73df681d939f
src/NBench.VisualStudio.TestAdapter/NBenchTestDiscoverer.cs
src/NBench.VisualStudio.TestAdapter/NBenchTestDiscoverer.cs
namespace NBench.VisualStudio.TestAdapter { using Microsoft.VisualStudio.TestPlatform.ObjectModel.Adapter; using Microsoft.VisualStudio.TestPlatform.ObjectModel.Logging; using System; using System.Collections.Generic; using System.Linq; public class NBenchTestDiscoverer : ITestDiscoverer { public void DiscoverTests(IEnumerable<string> sources, IDiscoveryContext discoveryContext, IMessageLogger logger, ITestCaseDiscoverySink discoverySink) { if (sources == null) { throw new ArgumentNullException("sources", "The sources collection you have passed in is null. The source collection must be populated."); } else if (!sources.Any()) { throw new ArgumentException("The sources collection you have passed in is empty. The source collection must be populated.", "sources"); } throw new NotImplementedException(); } } }
namespace NBench.VisualStudio.TestAdapter { using Microsoft.VisualStudio.TestPlatform.ObjectModel.Adapter; using Microsoft.VisualStudio.TestPlatform.ObjectModel.Logging; using System; using System.Collections.Generic; using System.Linq; public class NBenchTestDiscoverer : ITestDiscoverer { public void DiscoverTests(IEnumerable<string> sources, IDiscoveryContext discoveryContext, IMessageLogger logger, ITestCaseDiscoverySink discoverySink) { if (sources == null) { throw new ArgumentNullException("sources", "The sources collection you have passed in is null. The source collection must be populated."); } else if (!sources.Any()) { throw new ArgumentException("The sources collection you have passed in is empty. The source collection must be populated.", "sources"); } else if (discoveryContext == null) { throw new ArgumentNullException("discoveryContext", "The discovery context you have passed in is null. The discovery context must not be null."); } throw new NotImplementedException(); } } }
Make the discovery context null tests pass.
Make the discovery context null tests pass.
C#
apache-2.0
SeanFarrow/NBench.VisualStudio
4e21336a5c575618d5ef98dfc9928ba29b2e25c9
src/Moq.Proxy.Generator/ProxyDiscoverer.cs
src/Moq.Proxy.Generator/ProxyDiscoverer.cs
using System; using System.Collections.Generic; using System.Collections.Immutable; using System.Threading; using System.Threading.Tasks; using Microsoft.CodeAnalysis; namespace Moq.Proxy { public class ProxyDiscoverer { public async Task<IImmutableSet<ImmutableArray<ITypeSymbol>>> DiscoverProxiesAsync(Project project, CancellationToken cancellationToken = default(CancellationToken)) { var discoverer = project.LanguageServices.GetRequiredService<IProxyDiscoverer>(); var compilation = await project.GetCompilationAsync(cancellationToken); var proxyGeneratorSymbol = compilation.GetTypeByMetadataName(typeof(ProxyGeneratorAttribute).FullName); // TODO: message. if (proxyGeneratorSymbol == null) throw new InvalidOperationException(); var proxies = new List<ImmutableArray<ITypeSymbol>>(); foreach (var document in project.Documents) { var discovered = await discoverer.DiscoverProxiesAsync(document, proxyGeneratorSymbol, cancellationToken); proxies.AddRange(discovered); } return proxies.ToImmutableHashSet(StructuralComparer<ImmutableArray<ITypeSymbol>>.Default); } } }
using System; using System.Collections.Generic; using System.Collections.Immutable; using System.Threading; using System.Threading.Tasks; using Microsoft.CodeAnalysis; namespace Moq.Proxy { public class ProxyDiscoverer { public async Task<IImmutableSet<ImmutableArray<ITypeSymbol>>> DiscoverProxiesAsync(Project project, CancellationToken cancellationToken = default(CancellationToken)) { var discoverer = project.LanguageServices.GetRequiredService<IProxyDiscoverer>(); var compilation = await project.GetCompilationAsync(cancellationToken); var proxyGeneratorSymbol = compilation.GetTypeByMetadataName(typeof(ProxyGeneratorAttribute).FullName); // TODO: message. if (proxyGeneratorSymbol == null) throw new InvalidOperationException(); var proxies = new HashSet<ImmutableArray<ITypeSymbol>>(StructuralComparer<ImmutableArray<ITypeSymbol>>.Default); foreach (var document in project.Documents) { var discovered = await discoverer.DiscoverProxiesAsync(document, proxyGeneratorSymbol, cancellationToken); foreach (var proxy in discovered) { proxies.Add(proxy); } } return proxies.ToImmutableHashSet(StructuralComparer<ImmutableArray<ITypeSymbol>>.Default); } } }
Reduce memory usage by using a hashset instead of a list
Reduce memory usage by using a hashset instead of a list This would prevent accumulating multiple references to the same type symbol.
C#
apache-2.0
Moq/moq
a2c7ee20055cf9db0ce13d3b8458ea2a17b8c4a5
Src/Roflcopter.Plugin/TodoItems/TodoItemsCountDummyAction.cs
Src/Roflcopter.Plugin/TodoItems/TodoItemsCountDummyAction.cs
using System.Linq; using JetBrains.ActionManagement; using JetBrains.Annotations; using JetBrains.Application.DataContext; using JetBrains.ReSharper.Features.Inspections.Actions; using JetBrains.UI.ActionsRevised; namespace Roflcopter.Plugin.TodoItems { [Action(nameof(TodoItemsCountDummyAction), Id = 944208914)] public class TodoItemsCountDummyAction : IExecutableAction, IInsertLast<TodoExplorerActionBarActionGroup> { public bool Update(IDataContext context, ActionPresentation presentation, [CanBeNull] DelegateUpdate nextUpdate) { var todoItemsCountProvider = context.GetComponent<TodoItemsCountProvider>(); var todoItemsCounts = todoItemsCountProvider.TodoItemsCounts; if (todoItemsCounts == null) presentation.Text = null; else presentation.Text = string.Join(", ", todoItemsCounts.Select(x => $"{x.Definition}: {x.Count}")); return false; } public void Execute(IDataContext context, [CanBeNull] DelegateExecute nextExecute) { } } }
using System.Linq; using JetBrains.ActionManagement; using JetBrains.Annotations; using JetBrains.Application.DataContext; using JetBrains.ReSharper.Features.Inspections.Actions; using JetBrains.UI.ActionsRevised; namespace Roflcopter.Plugin.TodoItems { [ActionGroup(nameof(TodoItemsCountDummyActionGroup), ActionGroupInsertStyles.Separated, Id = 944208910)] public class TodoItemsCountDummyActionGroup : IAction, IInsertLast<TodoExplorerActionBarActionGroup> { public TodoItemsCountDummyActionGroup(TodoItemsCountDummyAction _) { } } [Action(nameof(TodoItemsCountDummyAction), Id = 944208920)] public class TodoItemsCountDummyAction : IExecutableAction { public bool Update(IDataContext context, ActionPresentation presentation, [CanBeNull] DelegateUpdate nextUpdate) { var todoItemsCountProvider = context.GetComponent<TodoItemsCountProvider>(); var todoItemsCounts = todoItemsCountProvider.TodoItemsCounts; if (todoItemsCounts == null) presentation.Text = null; else presentation.Text = string.Join(", ", todoItemsCounts.Select(x => $"{x.Definition}: {x.Count}")); return false; } public void Execute(IDataContext context, [CanBeNull] DelegateExecute nextExecute) { } } }
Add separator before action item in tool bar
Add separator before action item in tool bar
C#
mit
ulrichb/Roflcopter,ulrichb/Roflcopter
b920ecd7fdbd9ed7fa3cba950fdc336978eee56e
PalasoUIWindowsForms.Tests/FontTests/FontHelperTests.cs
PalasoUIWindowsForms.Tests/FontTests/FontHelperTests.cs
using System; using System.Drawing; using System.Linq; using NUnit.Framework; using Palaso.UI.WindowsForms; namespace PalasoUIWindowsForms.Tests.FontTests { [TestFixture] public class FontHelperTests { [SetUp] public void SetUp() { // setup code goes here } [TearDown] public void TearDown() { // tear down code goes here } [Test] public void MakeFont_FontName_ValidFont() { Font sourceFont = SystemFonts.DefaultFont; Font returnFont = FontHelper.MakeFont(sourceFont.FontFamily.Name); Assert.AreEqual(sourceFont.FontFamily.Name, returnFont.FontFamily.Name); } [Test] public void MakeFont_FontNameAndStyle_ValidFont() { // use Times New Roman foreach (var family in FontFamily.Families.Where(family => family.Name == "Times New Roman")) { Font sourceFont = new Font(family, 10f, FontStyle.Regular); Font returnFont = FontHelper.MakeFont(sourceFont, FontStyle.Bold); Assert.AreEqual(sourceFont.FontFamily.Name, returnFont.FontFamily.Name); Assert.AreEqual(FontStyle.Bold, returnFont.Style & FontStyle.Bold); break; } } } }
using System; using System.Drawing; using System.Linq; using NUnit.Framework; using Palaso.UI.WindowsForms; namespace PalasoUIWindowsForms.Tests.FontTests { [TestFixture] public class FontHelperTests { [SetUp] public void SetUp() { // setup code goes here } [TearDown] public void TearDown() { // tear down code goes here } [Test] public void MakeFont_FontName_ValidFont() { Font sourceFont = SystemFonts.DefaultFont; Font returnFont = FontHelper.MakeFont(sourceFont.FontFamily.Name); Assert.AreEqual(sourceFont.FontFamily.Name, returnFont.FontFamily.Name); } [Test] public void MakeFont_FontNameAndStyle_ValidFont() { // use Times New Roman foreach (var family in FontFamily.Families.Where(family => family.Name == "Times New Roman")) { Font sourceFont = new Font(family, 10f, FontStyle.Regular); Font returnFont = FontHelper.MakeFont(sourceFont, FontStyle.Bold); Assert.AreEqual(sourceFont.FontFamily.Name, returnFont.FontFamily.Name); Assert.AreEqual(FontStyle.Bold, returnFont.Style & FontStyle.Bold); break; } Assert.IsTrue(true); } } }
Fix mono bug in the FontHelper class
Fix mono bug in the FontHelper class
C#
mit
gmartin7/libpalaso,gmartin7/libpalaso,JohnThomson/libpalaso,mccarthyrb/libpalaso,chrisvire/libpalaso,glasseyes/libpalaso,andrew-polk/libpalaso,gtryus/libpalaso,andrew-polk/libpalaso,darcywong00/libpalaso,gmartin7/libpalaso,sillsdev/libpalaso,ermshiperete/libpalaso,ddaspit/libpalaso,marksvc/libpalaso,tombogle/libpalaso,JohnThomson/libpalaso,andrew-polk/libpalaso,hatton/libpalaso,sillsdev/libpalaso,gtryus/libpalaso,glasseyes/libpalaso,darcywong00/libpalaso,hatton/libpalaso,marksvc/libpalaso,marksvc/libpalaso,ddaspit/libpalaso,ddaspit/libpalaso,mccarthyrb/libpalaso,andrew-polk/libpalaso,gtryus/libpalaso,gmartin7/libpalaso,ermshiperete/libpalaso,tombogle/libpalaso,glasseyes/libpalaso,JohnThomson/libpalaso,JohnThomson/libpalaso,ddaspit/libpalaso,gtryus/libpalaso,chrisvire/libpalaso,tombogle/libpalaso,ermshiperete/libpalaso,sillsdev/libpalaso,chrisvire/libpalaso,glasseyes/libpalaso,hatton/libpalaso,hatton/libpalaso,ermshiperete/libpalaso,mccarthyrb/libpalaso,chrisvire/libpalaso,sillsdev/libpalaso,darcywong00/libpalaso,mccarthyrb/libpalaso,tombogle/libpalaso
4e4c3cc52f95d2cdd18a04065bd2b1f29097f470
src/ProblemDetails/Mvc/MvcBuilderExtensions.cs
src/ProblemDetails/Mvc/MvcBuilderExtensions.cs
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.ApplicationModels; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection.Extensions; using Microsoft.Extensions.Options; using MvcProblemDetailsFactory = Microsoft.AspNetCore.Mvc.Infrastructure.ProblemDetailsFactory; namespace Hellang.Middleware.ProblemDetails.Mvc { public static class MvcBuilderExtensions { /// <summary> /// Adds conventions to turn off MVC's built-in <see cref="ApiBehaviorOptions.ClientErrorMapping"/>, /// adds a <see cref="ProducesErrorResponseTypeAttribute"/> to all actions with in controllers with an /// <see cref="ApiControllerAttribute"/> and a result filter that transforms <see cref="ObjectResult"/> /// containing a <see cref="string"/> to <see cref="ProblemDetails"/> responses. /// </summary> /// <param name="builder">The <see cref="IMvcBuilder"/>.</param> /// <returns>The <see cref="IMvcBuilder"/>.</returns> public static IMvcBuilder AddProblemDetailsConventions(this IMvcBuilder builder) { // Forward the MVC problem details factory registration to the factory used by the middleware. builder.Services.TryAddSingleton<MvcProblemDetailsFactory>(p => p.GetRequiredService<ProblemDetailsFactory>()); builder.Services.TryAddEnumerable( ServiceDescriptor.Transient<IConfigureOptions<ApiBehaviorOptions>, ProblemDetailsApiBehaviorOptionsSetup>()); builder.Services.TryAddEnumerable( ServiceDescriptor.Transient<IApplicationModelProvider, ProblemDetailsApplicationModelProvider>()); return builder; } } }
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.ApplicationModels; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection.Extensions; using Microsoft.Extensions.Options; using MvcProblemDetailsFactory = Microsoft.AspNetCore.Mvc.Infrastructure.ProblemDetailsFactory; namespace Hellang.Middleware.ProblemDetails.Mvc { public static class MvcBuilderExtensions { /// <summary> /// Adds conventions to turn off MVC's built-in <see cref="ApiBehaviorOptions.ClientErrorMapping"/>, /// adds a <see cref="ProducesErrorResponseTypeAttribute"/> to all actions with in controllers with an /// <see cref="ApiControllerAttribute"/> and a result filter that transforms <see cref="ObjectResult"/> /// containing a <see cref="string"/> to <see cref="ProblemDetails"/> responses. /// </summary> /// <param name="builder">The <see cref="IMvcBuilder"/>.</param> /// <returns>The <see cref="IMvcBuilder"/>.</returns> public static IMvcBuilder AddProblemDetailsConventions(this IMvcBuilder builder) { // Forward the MVC problem details factory registration to the factory used by the middleware. builder.Services.Replace( ServiceDescriptor.Singleton<MvcProblemDetailsFactory>(p => p.GetRequiredService<ProblemDetailsFactory>())); builder.Services.TryAddEnumerable( ServiceDescriptor.Transient<IConfigureOptions<ApiBehaviorOptions>, ProblemDetailsApiBehaviorOptionsSetup>()); builder.Services.TryAddEnumerable( ServiceDescriptor.Transient<IApplicationModelProvider, ProblemDetailsApplicationModelProvider>()); return builder; } } }
Replace the existing ProblemDetailsFactory from MVC
Replace the existing ProblemDetailsFactory from MVC
C#
mit
khellang/Middleware,khellang/Middleware
e00179f3c92dd16e3e2ad2b9c7281fd19f90d3f6
glib/GLib.cs
glib/GLib.cs
// Copyright 2006 Alp Toker <alp@atoker.com> // This software is made available under the MIT License // See COPYING for details using System; //using GLib; //using Gtk; using NDesk.DBus; using NDesk.GLib; using org.freedesktop.DBus; namespace NDesk.DBus { //FIXME: this API needs review and de-unixification public static class DApplication { public static bool Dispatch (IOChannel source, IOCondition condition, IntPtr data) { //Console.Error.WriteLine ("Dispatch " + source.UnixFd + " " + condition); connection.Iterate (); //Console.Error.WriteLine ("Dispatch done"); return true; } public static Connection Connection { get { return connection; } } static Connection connection; static Bus bus; public static void Init () { connection = new Connection (); //ObjectPath opath = new ObjectPath ("/org/freedesktop/DBus"); //string name = "org.freedesktop.DBus"; /* bus = connection.GetObject<Bus> (name, opath); bus.NameAcquired += delegate (string acquired_name) { Console.Error.WriteLine ("NameAcquired: " + acquired_name); }; string myName = bus.Hello (); Console.Error.WriteLine ("myName: " + myName); */ IOChannel channel = new IOChannel ((int)connection.sock.Handle); IO.AddWatch (channel, IOCondition.In, Dispatch); } } }
// Copyright 2006 Alp Toker <alp@atoker.com> // This software is made available under the MIT License // See COPYING for details using System; //using GLib; //using Gtk; using NDesk.DBus; using NDesk.GLib; using org.freedesktop.DBus; namespace NDesk.DBus { //FIXME: this API needs review and de-unixification public static class DApplication { public static bool Dispatch (IOChannel source, IOCondition condition, IntPtr data) { //Console.Error.WriteLine ("Dispatch " + source.UnixFd + " " + condition); connection.Iterate (); //Console.Error.WriteLine ("Dispatch done"); return true; } static Connection connection; public static Connection Connection { get { return connection; } } public static void Init () { connection = new Connection (); IOChannel channel = new IOChannel ((int)connection.sock.Handle); IO.AddWatch (channel, IOCondition.In, Dispatch); } } }
Remove dead private and comments
Remove dead private and comments
C#
mit
mono/dbus-sharp-glib,mono/dbus-sharp-glib
80bd4b04f9ee2644f0ba6b1f4b816f2c78e20036
osu-database-reader/Components/HitObjects/HitObjectSlider.cs
osu-database-reader/Components/HitObjects/HitObjectSlider.cs
using System.Collections.Generic; using System.Diagnostics; namespace osu_database_reader.Components.HitObjects { public class HitObjectSlider : HitObject { public CurveType CurveType; public List<Vector2> Points = new List<Vector2>(); //does not include initial point! public int RepeatCount; public double Length; //seems to be length in o!p, so it doesn't have to be calculated? public void ParseSliderSegments(string sliderString) { string[] split = sliderString.Split('|'); foreach (var s in split) { if (s.Length == 1) { //curve type switch (s[0]) { case 'L': CurveType = CurveType.Linear; break; case 'C': CurveType = CurveType.Catmull; break; case 'P': CurveType = CurveType.Perfect; break; case 'B': CurveType = CurveType.Bezier; break; } continue; } string[] split2 = s.Split(':'); Debug.Assert(split2.Length == 2); Points.Add(new Vector2( int.Parse(split2[0]), int.Parse(split2[1]))); } } } }
using System.Collections.Generic; using System.Diagnostics; namespace osu_database_reader.Components.HitObjects { public class HitObjectSlider : HitObject { public CurveType CurveType; public List<Vector2> Points = new List<Vector2>(); //does not include initial point! public int RepeatCount; public double Length; //seems to be length in o!p, so it doesn't have to be calculated? public void ParseSliderSegments(string sliderString) { string[] split = sliderString.Split('|'); foreach (var s in split) { if (s.Length == 1) { //curve type switch (s[0]) { case 'L': CurveType = CurveType.Linear; break; case 'C': CurveType = CurveType.Catmull; break; case 'P': CurveType = CurveType.Perfect; break; case 'B': CurveType = CurveType.Bezier; break; } continue; } string[] split2 = s.Split(':'); Debug.Assert(split2.Length == 2); Points.Add(new Vector2( int.Parse(split2[0]), int.Parse(split2[1]))); } } } }
Make CodeFactor happy at the cost of my own happiness (code unfolding)
Make CodeFactor happy at the cost of my own happiness (code unfolding)
C#
mit
HoLLy-HaCKeR/osu-database-reader
b80acbf059ab4ba69b9e8dbd4444c0735b5c310c
build/Lifetime.cs
build/Lifetime.cs
using Cake.Common; using Cake.Frosting; namespace Build { public sealed class Lifetime : FrostingLifetime<Context> { public override void Setup(Context context) { context.Configuration = context.Argument("configuration", "Release"); context.BaseDir = context.Environment.WorkingDirectory; context.SourceDir = context.BaseDir.Combine("src"); context.BuildDir = context.BaseDir.Combine("build"); context.CakeToolsDir = context.BaseDir.Combine("tools/cake"); context.LibraryDir = context.SourceDir.Combine("VGAudio"); context.CliDir = context.SourceDir.Combine("VGAudio.Cli"); context.TestsDir = context.SourceDir.Combine("VGAudio.Tests"); context.BenchmarkDir = context.SourceDir.Combine("VGAudio.Benchmark"); context.UwpDir = context.SourceDir.Combine("VGAudio.Uwp"); context.SlnFile = context.SourceDir.CombineWithFilePath("VGAudio.sln"); context.TestsCsproj = context.TestsDir.CombineWithFilePath("VGAudio.Tests.csproj"); context.PublishDir = context.BaseDir.Combine("Publish"); context.LibraryPublishDir = context.PublishDir.Combine("NuGet"); context.CliPublishDir = context.PublishDir.Combine("cli"); context.UwpPublishDir = context.PublishDir.Combine("uwp"); context.ReleaseCertThumbprint = "2043012AE523F7FA0F77A537387633BEB7A9F4DD"; } } }
using Cake.Common; using Cake.Frosting; namespace Build { public sealed class Lifetime : FrostingLifetime<Context> { public override void Setup(Context context) { context.Configuration = context.Argument("configuration", "Release"); context.BaseDir = context.Environment.WorkingDirectory; context.SourceDir = context.BaseDir.Combine("src"); context.BuildDir = context.BaseDir.Combine("build"); context.CakeToolsDir = context.BaseDir.Combine("tools/cake"); context.LibraryDir = context.SourceDir.Combine("VGAudio"); context.CliDir = context.SourceDir.Combine("VGAudio.Cli"); context.TestsDir = context.SourceDir.Combine("VGAudio.Tests"); context.BenchmarkDir = context.SourceDir.Combine("VGAudio.Benchmark"); context.UwpDir = context.SourceDir.Combine("VGAudio.Uwp"); context.SlnFile = context.SourceDir.CombineWithFilePath("VGAudio.sln"); context.TestsCsproj = context.TestsDir.CombineWithFilePath("VGAudio.Tests.csproj"); context.PublishDir = context.BaseDir.Combine($"bin/{(context.IsReleaseBuild ? "release" : "debug")}"); context.LibraryPublishDir = context.PublishDir.Combine("NuGet"); context.CliPublishDir = context.PublishDir.Combine("cli"); context.UwpPublishDir = context.PublishDir.Combine("uwp"); context.ReleaseCertThumbprint = "2043012AE523F7FA0F77A537387633BEB7A9F4DD"; } } }
Use separate output directories for debug and release builds
Use separate output directories for debug and release builds
C#
mit
Thealexbarney/VGAudio,Thealexbarney/VGAudio,Thealexbarney/LibDspAdpcm,Thealexbarney/LibDspAdpcm
6fa4efdd422d80373e2de91fb3712fc311616160
src/ExternalTemplates.AspNet/IGeneratorOptions.Default.cs
src/ExternalTemplates.AspNet/IGeneratorOptions.Default.cs
using System; namespace ExternalTemplates { /// <summary> /// Default generator options. /// </summary> public class GeneratorOptions : IGeneratorOptions { /// <summary> /// Gets the path relative to the web root where the templates are stored. /// Default is "/Content/templates". /// </summary> public string VirtualPath { get; set; } = "/Content/templates"; /// <summary> /// Gets the extension of the templates. /// Default is ".tmpl.html". /// </summary> public string Extension { get; set; } = ".tmpl.html"; /// <summary> /// Gets the post string to add to the end of the script tag's id following its name. /// Default is "-tmpl". /// </summary> public string PostString { get; set; } = "-tmpl"; } }
using System; namespace ExternalTemplates { /// <summary> /// Default generator options. /// </summary> public class GeneratorOptions : IGeneratorOptions { /// <summary> /// Gets the path relative to the web root where the templates are stored. /// Default is "Content/templates". /// </summary> public string VirtualPath { get; set; } = "Content/templates"; /// <summary> /// Gets the extension of the templates. /// Default is ".tmpl.html". /// </summary> public string Extension { get; set; } = ".tmpl.html"; /// <summary> /// Gets the post string to add to the end of the script tag's id following its name. /// Default is "-tmpl". /// </summary> public string PostString { get; set; } = "-tmpl"; } }
Fix the default virtual path
Fix the default virtual path The virtual path shouldn't start with a slash.
C#
mit
mrahhal/ExternalTemplates
456e18cdcb50ddb64bded8ef5a0820a5b848f7f2
testproj/UnitTest1.cs
testproj/UnitTest1.cs
namespace testproj { using JetBrains.dotMemoryUnit; using NUnit.Framework; [TestFixture] public class UnitTest1 { [Test] public void TestMethod1() { dotMemory.Check( memory => { Assert.AreEqual(10, memory.ObjectsCount); }); } } }
namespace testproj { using System; using JetBrains.dotMemoryUnit; using NUnit.Framework; [TestFixture] public class UnitTest1 { [Test] public void TestMethod1() { dotMemory.Check( memory => { var str1 = "1"; var str2 = "2"; var str3 = "3"; Assert.LessOrEqual(2, memory.ObjectsCount); Console.WriteLine(str1 + str2 + str3); }); } } }
Fix test in the testproj
Fix test in the testproj
C#
apache-2.0
JetBrains/teamcity-dotmemory,JetBrains/teamcity-dotmemory
a6d99737e8b8907f0b429e87d49b27f38da3bd13
source/Graphite.System/ServiceInstaller.designer.cs
source/Graphite.System/ServiceInstaller.designer.cs
using System.ComponentModel; using System.ServiceProcess; using System.Configuration.Install; namespace Graphite.System { public partial class ServiceInstaller { private IContainer components = null; private global::System.ServiceProcess.ServiceInstaller serviceInstaller; private ServiceProcessInstaller serviceProcessInstaller; protected override void Dispose(bool disposing) { if (disposing && (this.components != null)) { this.components.Dispose(); } base.Dispose(disposing); } private void InitializeComponent() { this.serviceInstaller = new global::System.ServiceProcess.ServiceInstaller(); this.serviceProcessInstaller = new ServiceProcessInstaller(); // // serviceInstaller // this.serviceInstaller.Description = "Graphite System Monitoring"; this.serviceInstaller.DisplayName = "Graphite System Monitoring"; this.serviceInstaller.ServiceName = "GraphiteSystemMonitoring"; this.serviceInstaller.StartType = ServiceStartMode.Automatic; // // serviceProcessInstaller // this.serviceProcessInstaller.Account = ServiceAccount.LocalSystem; this.serviceProcessInstaller.Password = null; this.serviceProcessInstaller.Username = null; // // ServiceInstaller // this.Installers.AddRange(new Installer[] { this.serviceInstaller, this.serviceProcessInstaller }); } } }
using System.ComponentModel; using System.ServiceProcess; using System.Configuration.Install; namespace Graphite.System { public partial class ServiceInstaller { private IContainer components = null; private global::System.ServiceProcess.ServiceInstaller serviceInstaller; private ServiceProcessInstaller serviceProcessInstaller; protected override void Dispose(bool disposing) { if (disposing && (this.components != null)) { this.components.Dispose(); } base.Dispose(disposing); } private void InitializeComponent() { this.serviceInstaller = new global::System.ServiceProcess.ServiceInstaller(); this.serviceProcessInstaller = new ServiceProcessInstaller(); // // serviceInstaller // this.serviceInstaller.Description = "Graphite System Monitoring"; this.serviceInstaller.DisplayName = "Graphite System Monitoring"; this.serviceInstaller.ServiceName = "GraphiteSystemMonitoring"; this.serviceInstaller.StartType = ServiceStartMode.Automatic; this.serviceInstaller.DelayedAutoStart = true; // // serviceProcessInstaller // this.serviceProcessInstaller.Account = ServiceAccount.LocalSystem; this.serviceProcessInstaller.Password = null; this.serviceProcessInstaller.Username = null; // // ServiceInstaller // this.Installers.AddRange(new Installer[] { this.serviceInstaller, this.serviceProcessInstaller }); } } }
Install service with "delayed auto start".
Install service with "delayed auto start".
C#
mit
PeteGoo/graphite-client,peschuster/graphite-client
62f1af61fef25d02e116dda01f7b1b42e0ec3601
src/TagLib/IFD/Tags/Nikon3MakerNoteEntryTag.cs
src/TagLib/IFD/Tags/Nikon3MakerNoteEntryTag.cs
// // Nikon3MakerNoteEntryTag.cs: // // Author: // Ruben Vermeersch (ruben@savanne.be) // // Copyright (C) 2010 Ruben Vermeersch // // This library is free software; you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License version // 2.1 as published by the Free Software Foundation. // // This library is distributed in the hope that it will be useful, but // WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 // USA // namespace TagLib.IFD.Tags { /// <summary> /// Nikon format 3 makernote tags. /// Based on http://www.exiv2.org/tags-nikon.html /// </summary> public enum Nikon3MakerNoteEntryTag : ushort { /// <summary> /// Offset to an IFD containing a preview image. (Hex: 0x0011) /// </summary> Preview = 16, } }
// // Nikon3MakerNoteEntryTag.cs: // // Author: // Ruben Vermeersch (ruben@savanne.be) // // Copyright (C) 2010 Ruben Vermeersch // // This library is free software; you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License version // 2.1 as published by the Free Software Foundation. // // This library is distributed in the hope that it will be useful, but // WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 // USA // namespace TagLib.IFD.Tags { /// <summary> /// Nikon format 3 makernote tags. /// Based on http://www.exiv2.org/tags-nikon.html /// </summary> public enum Nikon3MakerNoteEntryTag : ushort { /// <summary> /// Offset to an IFD containing a preview image. (Hex: 0x0011) /// </summary> Preview = 17, } }
Fix wrong value for the Preview tag.
Fix wrong value for the Preview tag.
C#
lgpl-2.1
punker76/taglib-sharp,mono/taglib-sharp,hwahrmann/taglib-sharp,punker76/taglib-sharp,Clancey/taglib-sharp,archrival/taglib-sharp,CamargoR/taglib-sharp,Clancey/taglib-sharp,hwahrmann/taglib-sharp,CamargoR/taglib-sharp,Clancey/taglib-sharp,archrival/taglib-sharp