commit
stringlengths
40
40
subject
stringlengths
4
1.73k
repos
stringlengths
5
127k
old_file
stringlengths
2
751
new_file
stringlengths
2
751
new_contents
stringlengths
1
8.98k
old_contents
stringlengths
0
6.59k
license
stringclasses
13 values
lang
stringclasses
23 values
e3cc4561abcc0b8a7ec9b0c53e36c3339cb8c6a9
add bullet marker in OsuMarkdownListItem
peppy/osu,UselessToucan/osu,ppy/osu,UselessToucan/osu,peppy/osu-new,smoogipoo/osu,NeoAdonis/osu,smoogipoo/osu,peppy/osu,UselessToucan/osu,ppy/osu,smoogipoo/osu,NeoAdonis/osu,ppy/osu,NeoAdonis/osu,peppy/osu,smoogipooo/osu
osu.Game/Graphics/Containers/Markdown/OsuMarkdownListItem.cs
osu.Game/Graphics/Containers/Markdown/OsuMarkdownListItem.cs
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Containers.Markdown; using osuTK; namespace osu.Game.Graphics.Containers.Markdown { public class OsuMarkdownListItem : CompositeDrawable { private const float default_left_padding = 20; [Resolved] private IMarkdownTextComponent parentTextComponent { get; set; } public FillFlowContainer Content { get; } public OsuMarkdownListItem() { AutoSizeAxes = Axes.Y; RelativeSizeAxes = Axes.X; Padding = new MarginPadding { Left = default_left_padding }; InternalChildren = new Drawable[] { Content = new FillFlowContainer { AutoSizeAxes = Axes.Y, RelativeSizeAxes = Axes.X, Direction = FillDirection.Vertical, Spacing = new Vector2(10, 10), } }; } [BackgroundDependencyLoader] private void load() { var marker = parentTextComponent.CreateSpriteText(); marker.Text = "●"; marker.Font = OsuFont.GetFont(size: marker.Font.Size / 2); marker.Origin = Anchor.Centre; marker.X = -default_left_padding / 2; marker.Y = marker.Font.Size; AddInternal(marker); } } }
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osuTK; namespace osu.Game.Graphics.Containers.Markdown { public class OsuMarkdownListItem : CompositeDrawable { private const float default_left_padding = 20; public FillFlowContainer Content { get; } public OsuMarkdownListItem() { AutoSizeAxes = Axes.Y; RelativeSizeAxes = Axes.X; Padding = new MarginPadding { Left = default_left_padding }; InternalChildren = new Drawable[] { Content = new FillFlowContainer { AutoSizeAxes = Axes.Y, RelativeSizeAxes = Axes.X, Direction = FillDirection.Vertical, Spacing = new Vector2(10, 10), } }; } } }
mit
C#
bf9a80a70db65254495557eead9861acbe88f164
Update EmployerFinanceDbContext.cs
SkillsFundingAgency/das-employerapprenticeshipsservice,SkillsFundingAgency/das-employerapprenticeshipsservice,SkillsFundingAgency/das-employerapprenticeshipsservice
src/SFA.DAS.EmployerFinance/Data/EmployerFinanceDbContext.cs
src/SFA.DAS.EmployerFinance/Data/EmployerFinanceDbContext.cs
using SFA.DAS.EmployerFinance.Models; using SFA.DAS.EmployerFinance.Models.Payments; using SFA.DAS.EmployerFinance.Models.Transaction; using SFA.DAS.EntityFramework; using System.Collections.Generic; using System.Data.Common; using System.Data.Entity; using System.Data.Entity.ModelConfiguration.Conventions; using System.Threading.Tasks; using SFA.DAS.EmployerFinance.Models.Account; namespace SFA.DAS.EmployerFinance.Data { [DbConfigurationType(typeof(SqlAzureDbConfiguration))] public class EmployerFinanceDbContext : DbContext { public virtual DbSet<HealthCheck> HealthChecks { get; set; } public virtual DbSet<PeriodEnd> PeriodEnds { get; set; } public virtual DbSet<TransactionLineEntity> Transactions { get; set; } public virtual DbSet<Account> Accounts { get; set; } static EmployerFinanceDbContext() { Database.SetInitializer<EmployerFinanceDbContext>(null); } public EmployerFinanceDbContext(string nameOrConnectionString) : base(nameOrConnectionString) { } public EmployerFinanceDbContext(DbConnection connection, DbTransaction transaction = null) : base(connection, false) { if (transaction == null) Database.BeginTransaction(); else Database.UseTransaction(transaction); } protected EmployerFinanceDbContext() { } public virtual Task<List<T>> SqlQueryAsync<T>(string query, params object[] parameters) { return Database.SqlQuery<T>(query, parameters).ToListAsync(); } protected override void OnModelCreating(DbModelBuilder modelBuilder) { modelBuilder.Conventions.Remove<PluralizingTableNameConvention>(); modelBuilder.HasDefaultSchema("employer_financial"); modelBuilder.Entity<HealthCheck>().ToTable("HealthChecks", "dbo"); modelBuilder.Entity<TransactionLineEntity>().ToTable("TransactionLine"); modelBuilder.Entity<TransactionLineEntity>().HasKey(t => t.Id); } } }
using SFA.DAS.EmployerFinance.Models; using SFA.DAS.EmployerFinance.Models.Payments; using SFA.DAS.EmployerFinance.Models.Transaction; using SFA.DAS.EntityFramework; using System.Collections.Generic; using System.Data.Common; using System.Data.Entity; using System.Data.Entity.ModelConfiguration.Conventions; using System.Threading.Tasks; using SFA.DAS.EmployerFinance.Models.Account; namespace SFA.DAS.EmployerFinance.Data { [DbConfigurationType(typeof(SqlAzureDbConfiguration))] public class EmployerFinanceDbContext : DbContext { public virtual DbSet<HealthCheck> HealthChecks { get; set; } public virtual DbSet<PeriodEnd> PeriodEnds { get; set; } public virtual DbSet<TransactionLineEntity> Transactions { get; set; } public virtual DbSet<Account> Accounts { get; set; } static EmployerFinanceDbContext() { Database.SetInitializer<EmployerFinanceDbContext>(null); } public EmployerFinanceDbContext(string nameOrConnectionString) : base(nameOrConnectionString) { } public EmployerFinanceDbContext(DbConnection connection, DbTransaction transaction) : base(connection, false) { Database.UseTransaction(transaction); } protected EmployerFinanceDbContext() { } public virtual Task<List<T>> SqlQueryAsync<T>(string query, params object[] parameters) { return Database.SqlQuery<T>(query, parameters).ToListAsync(); } protected override void OnModelCreating(DbModelBuilder modelBuilder) { modelBuilder.Conventions.Remove<PluralizingTableNameConvention>(); modelBuilder.HasDefaultSchema("employer_financial"); modelBuilder.Entity<HealthCheck>().ToTable("HealthChecks", "dbo"); modelBuilder.Entity<TransactionLineEntity>().ToTable("TransactionLine"); modelBuilder.Entity<TransactionLineEntity>().HasKey(t => t.Id); } } }
mit
C#
5f5773b0c02e2190ac7d94b3ce84008c9a85a63c
Handle for multiple picked media relations
KevinJump/Umbraco-CMS,madsoulswe/Umbraco-CMS,NikRimington/Umbraco-CMS,JimBobSquarePants/Umbraco-CMS,arknu/Umbraco-CMS,leekelleher/Umbraco-CMS,arknu/Umbraco-CMS,robertjf/Umbraco-CMS,robertjf/Umbraco-CMS,KevinJump/Umbraco-CMS,madsoulswe/Umbraco-CMS,abjerner/Umbraco-CMS,marcemarc/Umbraco-CMS,KevinJump/Umbraco-CMS,hfloyd/Umbraco-CMS,dawoe/Umbraco-CMS,tcmorris/Umbraco-CMS,abryukhov/Umbraco-CMS,leekelleher/Umbraco-CMS,leekelleher/Umbraco-CMS,mattbrailsford/Umbraco-CMS,dawoe/Umbraco-CMS,abryukhov/Umbraco-CMS,marcemarc/Umbraco-CMS,madsoulswe/Umbraco-CMS,arknu/Umbraco-CMS,tcmorris/Umbraco-CMS,robertjf/Umbraco-CMS,hfloyd/Umbraco-CMS,dawoe/Umbraco-CMS,arknu/Umbraco-CMS,tcmorris/Umbraco-CMS,hfloyd/Umbraco-CMS,dawoe/Umbraco-CMS,abryukhov/Umbraco-CMS,tcmorris/Umbraco-CMS,mattbrailsford/Umbraco-CMS,hfloyd/Umbraco-CMS,JimBobSquarePants/Umbraco-CMS,umbraco/Umbraco-CMS,dawoe/Umbraco-CMS,umbraco/Umbraco-CMS,bjarnef/Umbraco-CMS,abjerner/Umbraco-CMS,JimBobSquarePants/Umbraco-CMS,leekelleher/Umbraco-CMS,leekelleher/Umbraco-CMS,mattbrailsford/Umbraco-CMS,umbraco/Umbraco-CMS,robertjf/Umbraco-CMS,NikRimington/Umbraco-CMS,umbraco/Umbraco-CMS,bjarnef/Umbraco-CMS,KevinJump/Umbraco-CMS,robertjf/Umbraco-CMS,hfloyd/Umbraco-CMS,bjarnef/Umbraco-CMS,bjarnef/Umbraco-CMS,tcmorris/Umbraco-CMS,KevinJump/Umbraco-CMS,mattbrailsford/Umbraco-CMS,JimBobSquarePants/Umbraco-CMS,JimBobSquarePants/Umbraco-CMS,marcemarc/Umbraco-CMS,abjerner/Umbraco-CMS,abjerner/Umbraco-CMS,abryukhov/Umbraco-CMS,marcemarc/Umbraco-CMS,tcmorris/Umbraco-CMS,NikRimington/Umbraco-CMS,marcemarc/Umbraco-CMS
src/Umbraco.Web/PropertyEditors/MediaPickerPropertyEditor.cs
src/Umbraco.Web/PropertyEditors/MediaPickerPropertyEditor.cs
using System.Collections.Generic; using Umbraco.Core; using Umbraco.Core.Logging; using Umbraco.Core.Models.Editors; using Umbraco.Core.PropertyEditors; namespace Umbraco.Web.PropertyEditors { /// <summary> /// Represents a media picker property editor. /// </summary> [DataEditor( Constants.PropertyEditors.Aliases.MediaPicker, EditorType.PropertyValue | EditorType.MacroParameter, "Media Picker", "mediapicker", ValueType = ValueTypes.Text, Group = Constants.PropertyEditors.Groups.Media, Icon = Constants.Icons.MediaImage)] public class MediaPickerPropertyEditor : DataEditor { /// <summary> /// Initializes a new instance of the <see cref="MediaPickerPropertyEditor"/> class. /// </summary> public MediaPickerPropertyEditor(ILogger logger) : base(logger) { } /// <inheritdoc /> protected override IConfigurationEditor CreateConfigurationEditor() => new MediaPickerConfigurationEditor(); protected override IDataValueEditor CreateValueEditor() => new MediaPickerPropertyValueEditor(Attribute); internal class MediaPickerPropertyValueEditor : DataValueEditor, IDataValueReference { public MediaPickerPropertyValueEditor(DataEditorAttribute attribute) : base(attribute) { } public IEnumerable<UmbracoEntityReference> GetReferences(object value) { var asString = value is string str ? str : value?.ToString(); if (string.IsNullOrEmpty(asString)) yield break; foreach (var udiStr in asString.Split(',')) { if (Udi.TryParse(udiStr, out var udi)) yield return new UmbracoEntityReference(udi); } } } } }
using System.Collections.Generic; using Umbraco.Core; using Umbraco.Core.Logging; using Umbraco.Core.Models.Editors; using Umbraco.Core.PropertyEditors; namespace Umbraco.Web.PropertyEditors { /// <summary> /// Represents a media picker property editor. /// </summary> [DataEditor( Constants.PropertyEditors.Aliases.MediaPicker, EditorType.PropertyValue | EditorType.MacroParameter, "Media Picker", "mediapicker", ValueType = ValueTypes.Text, Group = Constants.PropertyEditors.Groups.Media, Icon = Constants.Icons.MediaImage)] public class MediaPickerPropertyEditor : DataEditor { /// <summary> /// Initializes a new instance of the <see cref="MediaPickerPropertyEditor"/> class. /// </summary> public MediaPickerPropertyEditor(ILogger logger) : base(logger) { } /// <inheritdoc /> protected override IConfigurationEditor CreateConfigurationEditor() => new MediaPickerConfigurationEditor(); protected override IDataValueEditor CreateValueEditor() => new MediaPickerPropertyValueEditor(Attribute); internal class MediaPickerPropertyValueEditor : DataValueEditor, IDataValueReference { public MediaPickerPropertyValueEditor(DataEditorAttribute attribute) : base(attribute) { } public IEnumerable<UmbracoEntityReference> GetReferences(object value) { var asString = value is string str ? str : value?.ToString(); if (string.IsNullOrEmpty(asString)) yield break; if (Udi.TryParse(asString, out var udi)) yield return new UmbracoEntityReference(udi); } } } }
mit
C#
bb6563d256ccf17c3b43bf1bbb383a41270a8fa1
Set v1.0.2.0
yck1509/dnlib,ZixiangBoy/dnlib,jorik041/dnlib,Arthur2e5/dnlib,0xd4d/dnlib,picrap/dnlib,modulexcite/dnlib,ilkerhalil/dnlib,kiootic/dnlib
src/Properties/AssemblyInfo.cs
src/Properties/AssemblyInfo.cs
/* Copyright (C) 2012-2014 de4dot@gmail.com Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ using System.Reflection; using System.Runtime.InteropServices; #if THREAD_SAFE [assembly: AssemblyTitle("dnlib (thread safe)")] #else [assembly: AssemblyTitle("dnlib")] #endif [assembly: AssemblyDescription(".NET assembly reader/writer")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("dnlib")] [assembly: AssemblyCopyright("Copyright (C) 2012-2014 de4dot@gmail.com")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] [assembly: ComVisible(false)] [assembly: AssemblyVersion("1.0.2.0")] [assembly: AssemblyFileVersion("1.0.2.0")]
/* Copyright (C) 2012-2014 de4dot@gmail.com Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ using System.Reflection; using System.Runtime.InteropServices; #if THREAD_SAFE [assembly: AssemblyTitle("dnlib (thread safe)")] #else [assembly: AssemblyTitle("dnlib")] #endif [assembly: AssemblyDescription(".NET assembly reader/writer")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("dnlib")] [assembly: AssemblyCopyright("Copyright (C) 2012-2014 de4dot@gmail.com")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] [assembly: ComVisible(false)] [assembly: AssemblyVersion("1.0.1.0")] [assembly: AssemblyFileVersion("1.0.1.0")]
mit
C#
fd16b25656f63d8aff6946977f0e1d6a231d7b20
Bump version to 0.1.1
exira/ges-runner
src/Properties/AssemblyInfo.cs
src/Properties/AssemblyInfo.cs
// <auto-generated/> using System.Reflection; [assembly: AssemblyTitleAttribute("ges-runner")] [assembly: AssemblyProductAttribute("Exira.EventStore.Runner")] [assembly: AssemblyDescriptionAttribute("Exira.EventStore.Runner is a wrapper that uses Topshelf to run EventStore as a Windows Service")] [assembly: AssemblyVersionAttribute("0.1.1")] [assembly: AssemblyFileVersionAttribute("0.1.1")] [assembly: AssemblyMetadataAttribute("githash","d38ad61ff673ca34d69cb9e63b23de502372e70c")] namespace System { internal static class AssemblyVersionInformation { internal const string Version = "0.1.1"; } }
// <auto-generated/> using System.Reflection; [assembly: AssemblyTitleAttribute("ges-runner")] [assembly: AssemblyProductAttribute("Exira.EventStore.Runner")] [assembly: AssemblyDescriptionAttribute("Exira.EventStore.Runner is a wrapper that uses Topshelf to run EventStore as a Windows Service")] [assembly: AssemblyVersionAttribute("0.1.0")] [assembly: AssemblyFileVersionAttribute("0.1.0")] [assembly: AssemblyMetadataAttribute("githash","dbdde047cf8aef5f672843ffa02286a9c38f3bc1")] namespace System { internal static class AssemblyVersionInformation { internal const string Version = "0.1.0"; } }
mit
C#
fff8755548a3cf0245ae4defb678ff0ba7bf124a
revert GetComputerName implementation in HttpContextClientInfoProvider
aspnetboilerplate/aspnetboilerplate,aspnetboilerplate/aspnetboilerplate,aspnetboilerplate/aspnetboilerplate,aspnetboilerplate/aspnetboilerplate
src/Abp.AspNetCore/AspNetCore/Mvc/Auditing/HttpContextClientInfoProvider.cs
src/Abp.AspNetCore/AspNetCore/Mvc/Auditing/HttpContextClientInfoProvider.cs
using Abp.Auditing; using Castle.Core.Logging; using Microsoft.AspNetCore.Http; using System; using System.Net; namespace Abp.AspNetCore.Mvc.Auditing { public class HttpContextClientInfoProvider : IClientInfoProvider { public string BrowserInfo => GetBrowserInfo(); public string ClientIpAddress => GetClientIpAddress(); public string ComputerName => GetComputerName(); public ILogger Logger { get; set; } private readonly IHttpContextAccessor _httpContextAccessor; /// <summary> /// Creates a new <see cref="HttpContextClientInfoProvider"/>. /// </summary> public HttpContextClientInfoProvider(IHttpContextAccessor httpContextAccessor) { _httpContextAccessor = httpContextAccessor; Logger = NullLogger.Instance; } protected virtual string GetBrowserInfo() { var httpContext = _httpContextAccessor.HttpContext; return httpContext?.Request?.Headers?["User-Agent"]; } protected virtual string GetClientIpAddress() { try { var httpContext = _httpContextAccessor.HttpContext; return httpContext?.Connection?.RemoteIpAddress?.ToString(); } catch (Exception ex) { Logger.Warn(ex.ToString()); } return null; } protected virtual string GetComputerName() { return null; } } }
using Abp.Auditing; using Castle.Core.Logging; using Microsoft.AspNetCore.Http; using System; using System.Net; namespace Abp.AspNetCore.Mvc.Auditing { public class HttpContextClientInfoProvider : IClientInfoProvider { public string BrowserInfo => GetBrowserInfo(); public string ClientIpAddress => GetClientIpAddress(); public string ComputerName => GetComputerName(); public ILogger Logger { get; set; } private readonly IHttpContextAccessor _httpContextAccessor; /// <summary> /// Creates a new <see cref="HttpContextClientInfoProvider"/>. /// </summary> public HttpContextClientInfoProvider(IHttpContextAccessor httpContextAccessor) { _httpContextAccessor = httpContextAccessor; Logger = NullLogger.Instance; } protected virtual string GetBrowserInfo() { var httpContext = _httpContextAccessor.HttpContext; return httpContext?.Request?.Headers?["User-Agent"]; } protected virtual string GetClientIpAddress() { try { var httpContext = _httpContextAccessor.HttpContext; return httpContext?.Connection?.RemoteIpAddress?.ToString(); } catch (Exception ex) { Logger.Warn(ex.ToString()); } return null; } protected virtual string GetComputerName() { try { var httpContext = _httpContextAccessor.HttpContext; var remoteIpAddress = httpContext?.Connection?.RemoteIpAddress; if (remoteIpAddress is null) return null; return Dns.GetHostEntry(remoteIpAddress).HostName; } catch (Exception ex) { Logger.Warn(ex.ToString()); } return null; } } }
mit
C#
6d079c028f9e5fdda2b8f08bcac104997c135c72
clean up code
Wentao-Xu/GraphEngine,Wentao-Xu/GraphEngine,Wentao-Xu/GraphEngine,Wentao-Xu/GraphEngine
samples/DataImporter/GraphEngine.DataImporter/TSLCompiler.cs
samples/DataImporter/GraphEngine.DataImporter/TSLCompiler.cs
using System; using System.Collections.Generic; using System.CodeDom.Compiler; using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; using System.Text; using System.Threading.Tasks; using Trinity.TSL; namespace GraphEngine.DataImporter { class TSLCompiler { public string Compile(string fpath) { string exePath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); Process process = new Process(); process.StartInfo = new ProcessStartInfo("MSBuild.exe", Path.Combine(exePath, "TSLCompiler.csproj") + " /p:TSLRoot=" + fpath); process.Start(); process.WaitForExit(); return exePath + "\\bin\\Release\\TSLAssembly.dll"; } } }
using System; using System.Collections.Generic; using System.CodeDom.Compiler; using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; using System.Text; using System.Threading.Tasks; using Trinity.TSL; namespace GraphEngine.DataImporter { class TSLCompiler { public string Compile(string fpath) { string exePath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); string s = Path.Combine(exePath, "TSLCompiler.csproj"); Console.WriteLine(s); Process process = new Process(); process.StartInfo = new ProcessStartInfo("MSBuild.exe", Path.Combine(exePath, "TSLCompiler.csproj") + " /p:TSLRoot=" + fpath); process.Start(); process.WaitForExit(); return exePath + "\\bin\\Release\\TSLAssembly.dll"; } } }
mit
C#
2c44f897209505213a3d2d02cbf622a771cf0133
Update Program.cs
vishipayyallore/CSharp-DotNet-Core-Samples
LearningDesignPatterns/Source/DataStructures/LinkedLists/LinkedList.Demos/Program.cs
LearningDesignPatterns/Source/DataStructures/LinkedLists/LinkedList.Demos/Program.cs
using System; using static System.Console; namespace LinkedList.Demos { class Program { static void Main(string[] args) { DisplayMonths(); var node = new Node { Value = 101 }; WriteLine(node); node.NextNode = new Node { Value = 102 }; WriteLine(node.NextNode); //GCHandle handle = GCHandle.Alloc(node, GCHandleType.WeakTrackResurrection); //IntPtr address = GCHandle.ToIntPtr(handle); //WriteLine($"Value: {node.Value} at Address: {address}"); WriteLine("\n\nPress any key ..."); ReadKey(); } private static void DisplayMonths() { for(var month=1; month <=12; month++) { WriteLine($"{month}. {new DateTime(DateTime.Now.Year, month, 1).ToString("MMMM")}"); } } } }
using System; using static System.Console; namespace LinkedList.Demos { class Program { static void Main(string[] args) { DisplayMonths(); var node = new Node { Value = 101 }; WriteLine(node); //GCHandle handle = GCHandle.Alloc(node, GCHandleType.WeakTrackResurrection); //IntPtr address = GCHandle.ToIntPtr(handle); //WriteLine($"Value: {node.Value} at Address: {address}"); WriteLine("\n\nPress any key ..."); ReadKey(); } private static void DisplayMonths() { for(var month=1; month <=12; month++) { WriteLine($"{month}. {new DateTime(DateTime.Now.Year, month, 1).ToString("MMMM")}"); } } } }
apache-2.0
C#
f071e1bdea12436f08f4babee159f39346ad7c3a
Set main application name to product name.
xibosignage/xibo-dotnetclient,dasgarner/xibo-dotnetclient
MainForm.Designer.cs
MainForm.Designer.cs
using System.Windows.Forms; using XiboClient.Properties; namespace XiboClient { partial class MainForm { /// <summary> /// Required designer variable. /// </summary> private System.ComponentModel.IContainer components = null; /// <summary> /// Clean up any resources being used. /// </summary> /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> protected override void Dispose(bool disposing) { if (disposing && (components != null)) { components.Dispose(); } base.Dispose(disposing); } #region Windows Form Designer generated code /// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainForm)); this.SuspendLayout(); // // MainForm // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.BackColor = System.Drawing.Color.Black; this.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center; this.ClientSize = new System.Drawing.Size(1024, 768); this.DoubleBuffered = global::XiboClient.ApplicationSettings.Default.DoubleBuffering; this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; this.Icon = System.Drawing.Icon.ExtractAssociatedIcon(Application.ExecutablePath); this.Name = "MainForm"; this.Text = Application.ProductName; this.WindowState = System.Windows.Forms.FormWindowState.Maximized; this.Load += new System.EventHandler(this.MainForm_Load); this.ResumeLayout(false); } #endregion } }
using System.Windows.Forms; using XiboClient.Properties; namespace XiboClient { partial class MainForm { /// <summary> /// Required designer variable. /// </summary> private System.ComponentModel.IContainer components = null; /// <summary> /// Clean up any resources being used. /// </summary> /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> protected override void Dispose(bool disposing) { if (disposing && (components != null)) { components.Dispose(); } base.Dispose(disposing); } #region Windows Form Designer generated code /// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainForm)); this.SuspendLayout(); // // MainForm // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.BackColor = System.Drawing.Color.Black; this.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center; this.ClientSize = new System.Drawing.Size(1024, 768); this.DoubleBuffered = global::XiboClient.ApplicationSettings.Default.DoubleBuffering; this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; this.Icon = System.Drawing.Icon.ExtractAssociatedIcon(Application.ExecutablePath); this.Name = "MainForm"; this.Text = "Xibo Client"; this.WindowState = System.Windows.Forms.FormWindowState.Maximized; this.Load += new System.EventHandler(this.MainForm_Load); this.ResumeLayout(false); } #endregion } }
agpl-3.0
C#
648549fa8822bc80ca27b6c40a9312fdbe500e61
Test for Autodetect which should have been included before
jskeet/google-cloud-dotnet,chrisdunelm/gcloud-dotnet,iantalarico/google-cloud-dotnet,jskeet/google-cloud-dotnet,googleapis/google-cloud-dotnet,jskeet/google-cloud-dotnet,benwulfe/google-cloud-dotnet,chrisdunelm/google-cloud-dotnet,evildour/google-cloud-dotnet,benwulfe/google-cloud-dotnet,chrisdunelm/google-cloud-dotnet,evildour/google-cloud-dotnet,evildour/google-cloud-dotnet,iantalarico/google-cloud-dotnet,iantalarico/google-cloud-dotnet,chrisdunelm/google-cloud-dotnet,googleapis/google-cloud-dotnet,jskeet/google-cloud-dotnet,googleapis/google-cloud-dotnet,jskeet/gcloud-dotnet,benwulfe/google-cloud-dotnet,jskeet/google-cloud-dotnet
apis/Google.Cloud.BigQuery.V2/Google.Cloud.BigQuery.V2.Tests/UploadCsvOptionsTest.cs
apis/Google.Cloud.BigQuery.V2/Google.Cloud.BigQuery.V2.Tests/UploadCsvOptionsTest.cs
// Copyright 2016 Google Inc. All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. using Google.Apis.Bigquery.v2.Data; using Xunit; namespace Google.Cloud.BigQuery.V2.Tests { public class UploadCsvOptionsTest { [Fact] public void ModifyRequest() { var options = new UploadCsvOptions { AllowJaggedRows = true, AllowQuotedNewlines = true, AllowTrailingColumns = true, CreateDisposition = CreateDisposition.CreateIfNeeded, FieldDelimiter = "!", MaxBadRecords = 10, Quote = "'", SkipLeadingRows = 5, WriteDisposition = WriteDisposition.WriteAppend, Autodetect = true }; JobConfigurationLoad config = new JobConfigurationLoad(); options.ModifyConfiguration(config); Assert.Equal(true, config.AllowJaggedRows); Assert.Equal(true, config.AllowQuotedNewlines); Assert.Equal(true, config.IgnoreUnknownValues); Assert.Equal("CREATE_IF_NEEDED", config.CreateDisposition); Assert.Equal("!", config.FieldDelimiter); Assert.Equal(10, config.MaxBadRecords); Assert.Equal("'", config.Quote); Assert.Equal(5, config.SkipLeadingRows); Assert.Equal("WRITE_APPEND", config.WriteDisposition); Assert.True(config.Autodetect); } } }
// Copyright 2016 Google Inc. All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. using Google.Apis.Bigquery.v2.Data; using Xunit; namespace Google.Cloud.BigQuery.V2.Tests { public class UploadCsvOptionsTest { [Fact] public void ModifyRequest() { var options = new UploadCsvOptions { AllowJaggedRows = true, AllowQuotedNewlines = true, AllowTrailingColumns = true, CreateDisposition = CreateDisposition.CreateIfNeeded, FieldDelimiter = "!", MaxBadRecords = 10, Quote = "'", SkipLeadingRows = 5, WriteDisposition = WriteDisposition.WriteAppend }; JobConfigurationLoad config = new JobConfigurationLoad(); options.ModifyConfiguration(config); Assert.Equal(true, config.AllowJaggedRows); Assert.Equal(true, config.AllowQuotedNewlines); Assert.Equal(true, config.IgnoreUnknownValues); Assert.Equal("CREATE_IF_NEEDED", config.CreateDisposition); Assert.Equal("!", config.FieldDelimiter); Assert.Equal(10, config.MaxBadRecords); Assert.Equal("'", config.Quote); Assert.Equal(5, config.SkipLeadingRows); Assert.Equal("WRITE_APPEND", config.WriteDisposition); } } }
apache-2.0
C#
8b96a18d8dacbd7e35eda5bf5b89f419eadefdef
Add missing request assignment in exception
mdsol/mauth-client-dotnet
src/Medidata.MAuth.Core/MAuthRequestRetrier.cs
src/Medidata.MAuth.Core/MAuthRequestRetrier.cs
using System; using System.Collections.Generic; using System.Linq; #if !NETSTANDARD1_4 using System.Net.Cache; #endif using System.Net.Http; using System.Threading.Tasks; namespace Medidata.MAuth.Core { internal class MAuthRequestRetrier { private readonly HttpClient client; private RetriedRequestException exception; public MAuthRequestRetrier(MAuthOptionsBase options) { var signingHandler = new MAuthSigningHandler(options: new MAuthSigningOptions() { ApplicationUuid = options.ApplicationUuid, PrivateKey = options.PrivateKey }, innerHandler: options.MAuthServerHandler ?? #if NETSTANDARD1_4 new HttpClientHandler() #else new WebRequestHandler() { CachePolicy = new RequestCachePolicy(RequestCacheLevel.Default) } #endif ); client = new HttpClient(signingHandler); client.Timeout = TimeSpan.FromSeconds(options.AuthenticateRequestTimeoutSeconds); } public async Task<HttpResponseMessage> GetSuccessfulResponse(Guid applicationUuid, Func<Guid, HttpRequestMessage> requestFactory, int remainingAttempts) { var request = requestFactory?.Invoke(applicationUuid); if (request == null) throw new ArgumentNullException( "No request function provided or the provided request function resulted null request.", nameof(requestFactory) ); exception = exception ?? new RetriedRequestException( $"Could not get a successful response from the MAuth Service after {remainingAttempts} attempts. " + "Please see the responses for each attempt in the exception's Responses field.") { Request = request }; if (remainingAttempts == 0) throw exception; var result = await client.SendAsync(request).ConfigureAwait(continueOnCapturedContext: false); exception.Responses.Add(result); return result.IsSuccessStatusCode ? result : await GetSuccessfulResponse(applicationUuid, requestFactory, remainingAttempts - 1); } } }
using System; using System.Collections.Generic; using System.Linq; #if !NETSTANDARD1_4 using System.Net.Cache; #endif using System.Net.Http; using System.Threading.Tasks; namespace Medidata.MAuth.Core { internal class MAuthRequestRetrier { private readonly HttpClient client; private RetriedRequestException exception; public MAuthRequestRetrier(MAuthOptionsBase options) { var signingHandler = new MAuthSigningHandler(options: new MAuthSigningOptions() { ApplicationUuid = options.ApplicationUuid, PrivateKey = options.PrivateKey }, innerHandler: options.MAuthServerHandler ?? #if NETSTANDARD1_4 new HttpClientHandler() #else new WebRequestHandler() { CachePolicy = new RequestCachePolicy(RequestCacheLevel.Default) } #endif ); client = new HttpClient(signingHandler); client.Timeout = TimeSpan.FromSeconds(options.AuthenticateRequestTimeoutSeconds); } public async Task<HttpResponseMessage> GetSuccessfulResponse(Guid applicationUuid, Func<Guid, HttpRequestMessage> requestFactory, int remainingAttempts) { var request = requestFactory?.Invoke(applicationUuid); if (request == null) throw new ArgumentNullException( "No request function provided or the provided request function resulted null request.", nameof(requestFactory) ); exception = exception ?? new RetriedRequestException( $"Could not get a successful response from the MAuth Service after {remainingAttempts} attempts. " + "Please see the responses for each attempt in the exception's Responses field."); if (remainingAttempts == 0) throw exception; var result = await client.SendAsync(request).ConfigureAwait(continueOnCapturedContext: false); exception.Responses.Add(result); return result.IsSuccessStatusCode ? result : await GetSuccessfulResponse(applicationUuid, requestFactory, remainingAttempts - 1); } } }
mit
C#
537583537c65a572a991c8b711b3e0d554685356
Add the bind attributes property and method to the interface.
izrik/ChamberLib,izrik/ChamberLib,izrik/ChamberLib
IShaderProgram.cs
IShaderProgram.cs
using System; using System.Collections.Generic; namespace ChamberLib { public interface IShaderProgram { string Name { get; } void Apply(); void UnApply(); IShaderStage VertexShader { get; } IShaderStage FragmentShader { get; } IEnumerable<string> BindAttributes { get; } void SetBindAttributes(IEnumerable<string> bindattrs); void SetUniform(string name, bool value); void SetUniform(string name, byte value); void SetUniform(string name, sbyte value); void SetUniform(string name, short value); void SetUniform(string name, ushort value); void SetUniform(string name, int value); void SetUniform(string name, uint value); void SetUniform(string name, float value); void SetUniform(string name, double value); void SetUniform(string name, Vector2 value); void SetUniform(string name, Vector3 value); void SetUniform(string name, Vector4 value); void SetUniform(string name, Matrix value); } }
using System; namespace ChamberLib { public interface IShaderProgram { string Name { get; } void Apply(); void UnApply(); IShaderStage VertexShader { get; } IShaderStage FragmentShader { get; } void SetUniform(string name, bool value); void SetUniform(string name, byte value); void SetUniform(string name, sbyte value); void SetUniform(string name, short value); void SetUniform(string name, ushort value); void SetUniform(string name, int value); void SetUniform(string name, uint value); void SetUniform(string name, float value); void SetUniform(string name, double value); void SetUniform(string name, Vector2 value); void SetUniform(string name, Vector3 value); void SetUniform(string name, Vector4 value); void SetUniform(string name, Matrix value); } }
lgpl-2.1
C#
e15164e8dd4cddacc2caf0b29fc7d2352b211239
Enable NRT
bartdesmet/roslyn,diryboy/roslyn,weltkante/roslyn,KevinRansom/roslyn,diryboy/roslyn,sharwell/roslyn,dotnet/roslyn,sharwell/roslyn,CyrusNajmabadi/roslyn,bartdesmet/roslyn,mavasani/roslyn,jasonmalinowski/roslyn,shyamnamboodiripad/roslyn,jasonmalinowski/roslyn,weltkante/roslyn,CyrusNajmabadi/roslyn,bartdesmet/roslyn,dotnet/roslyn,sharwell/roslyn,mavasani/roslyn,shyamnamboodiripad/roslyn,weltkante/roslyn,mavasani/roslyn,jasonmalinowski/roslyn,CyrusNajmabadi/roslyn,shyamnamboodiripad/roslyn,diryboy/roslyn,KevinRansom/roslyn,dotnet/roslyn,KevinRansom/roslyn
src/Analyzers/CSharp/Analyzers/UseImplicitOrExplicitType/CSharpUseExplicitTypeDiagnosticAnalyzer.cs
src/Analyzers/CSharp/Analyzers/UseImplicitOrExplicitType/CSharpUseExplicitTypeDiagnosticAnalyzer.cs
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. using Microsoft.CodeAnalysis.CSharp.Utilities; using Microsoft.CodeAnalysis.Diagnostics; namespace Microsoft.CodeAnalysis.CSharp.Diagnostics.TypeStyle { [DiagnosticAnalyzer(LanguageNames.CSharp)] internal sealed class CSharpUseExplicitTypeDiagnosticAnalyzer : CSharpTypeStyleDiagnosticAnalyzerBase { private static readonly LocalizableString s_Title = new LocalizableResourceString(nameof(CSharpAnalyzersResources.Use_explicit_type), CSharpAnalyzersResources.ResourceManager, typeof(CSharpAnalyzersResources)); private static readonly LocalizableString s_Message = new LocalizableResourceString(nameof(CSharpAnalyzersResources.Use_explicit_type_instead_of_var), CSharpAnalyzersResources.ResourceManager, typeof(CSharpAnalyzersResources)); protected override CSharpTypeStyleHelper Helper => CSharpUseExplicitTypeHelper.Instance; public CSharpUseExplicitTypeDiagnosticAnalyzer() : base(diagnosticId: IDEDiagnosticIds.UseExplicitTypeDiagnosticId, enforceOnBuild: EnforceOnBuildValues.UseExplicitType, title: s_Title, message: s_Message) { } } }
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. #nullable disable using Microsoft.CodeAnalysis.CSharp.Utilities; using Microsoft.CodeAnalysis.Diagnostics; namespace Microsoft.CodeAnalysis.CSharp.Diagnostics.TypeStyle { [DiagnosticAnalyzer(LanguageNames.CSharp)] internal sealed class CSharpUseExplicitTypeDiagnosticAnalyzer : CSharpTypeStyleDiagnosticAnalyzerBase { private static readonly LocalizableString s_Title = new LocalizableResourceString(nameof(CSharpAnalyzersResources.Use_explicit_type), CSharpAnalyzersResources.ResourceManager, typeof(CSharpAnalyzersResources)); private static readonly LocalizableString s_Message = new LocalizableResourceString(nameof(CSharpAnalyzersResources.Use_explicit_type_instead_of_var), CSharpAnalyzersResources.ResourceManager, typeof(CSharpAnalyzersResources)); protected override CSharpTypeStyleHelper Helper => CSharpUseExplicitTypeHelper.Instance; public CSharpUseExplicitTypeDiagnosticAnalyzer() : base(diagnosticId: IDEDiagnosticIds.UseExplicitTypeDiagnosticId, enforceOnBuild: EnforceOnBuildValues.UseExplicitType, title: s_Title, message: s_Message) { } } }
mit
C#
f596e51a1cd43a12354c95c867469efa2dd4cf4f
Implement RunspaceConfiguration.Formats
ForNeVeR/Pash,ForNeVeR/Pash,mrward/Pash,Jaykul/Pash,WimObiwan/Pash,WimObiwan/Pash,WimObiwan/Pash,sillvan/Pash,ForNeVeR/Pash,ForNeVeR/Pash,sburnicki/Pash,sburnicki/Pash,sillvan/Pash,WimObiwan/Pash,mrward/Pash,mrward/Pash,sburnicki/Pash,sillvan/Pash,Jaykul/Pash,mrward/Pash,Jaykul/Pash,sillvan/Pash,sburnicki/Pash,Jaykul/Pash
Source/System.Management/Automation/Runspaces/RunspaceConfiguration.cs
Source/System.Management/Automation/Runspaces/RunspaceConfiguration.cs
// Copyright (C) Pash Contributors. License: GPL/BSD. See https://github.com/Pash-Project/Pash/ using System; using System.Management.Automation; namespace System.Management.Automation.Runspaces { public abstract class RunspaceConfiguration { private RunspaceConfigurationEntryCollection<CmdletConfigurationEntry> cmdlets; private RunspaceConfigurationEntryCollection<ProviderConfigurationEntry> providers; private RunspaceConfigurationEntryCollection<TypeConfigurationEntry> types; private RunspaceConfigurationEntryCollection<FormatConfigurationEntry> formats; public abstract string ShellId { get; } protected RunspaceConfiguration () { } public virtual RunspaceConfigurationEntryCollection<CmdletConfigurationEntry> Cmdlets { get { if (this.cmdlets == null) { this.cmdlets = new RunspaceConfigurationEntryCollection<CmdletConfigurationEntry> (); } return this.cmdlets; } } public virtual RunspaceConfigurationEntryCollection<ProviderConfigurationEntry> Providers { get { if (this.providers == null) { this.providers = new RunspaceConfigurationEntryCollection<ProviderConfigurationEntry> (); } return this.providers; } } internal TypeTable TypeTable { get { throw new NotImplementedException (); } } public virtual RunspaceConfigurationEntryCollection<TypeConfigurationEntry> Types { get { if (this.types == null) { this.types = new RunspaceConfigurationEntryCollection<TypeConfigurationEntry> (); } return this.types; } } public virtual RunspaceConfigurationEntryCollection<FormatConfigurationEntry> Formats { get { if (this.formats == null) { this.formats = new RunspaceConfigurationEntryCollection<FormatConfigurationEntry> (); } return this.formats; } } public virtual RunspaceConfigurationEntryCollection<ScriptConfigurationEntry> Scripts { get { throw new NotImplementedException (); } } public virtual RunspaceConfigurationEntryCollection<ScriptConfigurationEntry> InitializationScripts { get { throw new NotImplementedException (); } } public virtual RunspaceConfigurationEntryCollection<AssemblyConfigurationEntry> Assemblies { get { throw new NotImplementedException (); } } public virtual AuthorizationManager AuthorizationManager { get { throw new NotImplementedException (); } } public static RunspaceConfiguration Create (string assemblyName) { return null; } public static RunspaceConfiguration Create (string consoleFilePath, out PSConsoleLoadException warnings) { warnings = null; return null; } public static RunspaceConfiguration Create () { return RunspaceFactory.DefaultRunspaceConfiguration; } public PSSnapInInfo AddPSSnapIn (string name, out PSSnapInException warning) { throw new NotImplementedException (); } public PSSnapInInfo RemovePSSnapIn (string name, out PSSnapInException warning) { throw new NotImplementedException (); } } }
// Copyright (C) Pash Contributors. License: GPL/BSD. See https://github.com/Pash-Project/Pash/ using System; using System.Management.Automation; namespace System.Management.Automation.Runspaces { public abstract class RunspaceConfiguration { private RunspaceConfigurationEntryCollection<CmdletConfigurationEntry> cmdlets; private RunspaceConfigurationEntryCollection<ProviderConfigurationEntry> providers; private RunspaceConfigurationEntryCollection<TypeConfigurationEntry> types; public abstract string ShellId { get; } protected RunspaceConfiguration () { } public virtual RunspaceConfigurationEntryCollection<CmdletConfigurationEntry> Cmdlets { get { if (this.cmdlets == null) { this.cmdlets = new RunspaceConfigurationEntryCollection<CmdletConfigurationEntry> (); } return this.cmdlets; } } public virtual RunspaceConfigurationEntryCollection<ProviderConfigurationEntry> Providers { get { if (this.providers == null) { this.providers = new RunspaceConfigurationEntryCollection<ProviderConfigurationEntry> (); } return this.providers; } } internal TypeTable TypeTable { get { throw new NotImplementedException (); } } public virtual RunspaceConfigurationEntryCollection<TypeConfigurationEntry> Types { get { if (this.types == null) { this.types = new RunspaceConfigurationEntryCollection<TypeConfigurationEntry> (); } return this.types; } } public virtual RunspaceConfigurationEntryCollection<FormatConfigurationEntry> Formats { get { throw new NotImplementedException (); } } public virtual RunspaceConfigurationEntryCollection<ScriptConfigurationEntry> Scripts { get { throw new NotImplementedException (); } } public virtual RunspaceConfigurationEntryCollection<ScriptConfigurationEntry> InitializationScripts { get { throw new NotImplementedException (); } } public virtual RunspaceConfigurationEntryCollection<AssemblyConfigurationEntry> Assemblies { get { throw new NotImplementedException (); } } public virtual AuthorizationManager AuthorizationManager { get { throw new NotImplementedException (); } } public static RunspaceConfiguration Create (string assemblyName) { return null; } public static RunspaceConfiguration Create (string consoleFilePath, out PSConsoleLoadException warnings) { warnings = null; return null; } public static RunspaceConfiguration Create () { return RunspaceFactory.DefaultRunspaceConfiguration; } public PSSnapInInfo AddPSSnapIn (string name, out PSSnapInException warning) { throw new NotImplementedException (); } public PSSnapInInfo RemovePSSnapIn (string name, out PSSnapInException warning) { throw new NotImplementedException (); } } }
bsd-3-clause
C#
f7a2ff9585aa9a71207c10703ad74695d2f95f8a
Add page node tests
PioneerCode/pioneer-pagination,PioneerCode/pioneer-pagination,PioneerCode/pioneer-pagination
test/Pioneer.Pagination.Tests/PageNodeTests.cs
test/Pioneer.Pagination.Tests/PageNodeTests.cs
using System.Linq; using Xunit; namespace Pioneer.Pagination.Tests { /// <summary> /// Page Node Tests /// </summary> public class PageNodeTests { private readonly PaginatedMetaService _sut = new PaginatedMetaService(); [Fact] public void CollectionSizeZeroReturnsValidObject() { var result = _sut.GetMetaData(0, 1, 1); Assert.True(result.Pages.Count == 0, "Zero Size Valid Object"); Assert.True(!result.NextPage.Display, "Zero Size Valid Object"); Assert.True(!result.PreviousPage.Display, "Zero Size Valid Object"); } [Fact] public void Full() { var result = _sut.GetMetaData(10, 1, 1); Assert.True(result.Pages.Count == 5, "5 Pages"); } [Fact] public void FullMiddlePageEqualsSelectedPage() { var result = _sut.GetMetaData(10, 5, 1); Assert.True(result.Pages[2].PageNumber == 5, "Middle page in full collection should equal the page selected"); } [Fact] public void FullMiddlePageIsCurrent() { var result = _sut.GetMetaData(10, 5, 1); Assert.True(result.Pages[2].IsCurrent, "Middle page in full collection should equal the current page"); } [Fact] public void StartShiftAfterThree() { var result = _sut.GetMetaData(10, 1, 1); Assert.True(result.Pages[0].IsCurrent, "First index should be current"); result = _sut.GetMetaData(10, 2, 1); Assert.True(result.Pages[1].IsCurrent, "Second index should be current"); result = _sut.GetMetaData(10, 3, 1); Assert.True(result.Pages[2].IsCurrent, "Third index should be current"); result = _sut.GetMetaData(10, 4, 1); Assert.True(result.Pages[2].IsCurrent, "Middle index should be current"); } [Fact] public void EndShiftThreeFromEnd() { var result = _sut.GetMetaData(10, 10, 1); Assert.True(result.Pages[4].IsCurrent, "Last index should be current"); result = _sut.GetMetaData(10, 9, 1); Assert.True(result.Pages[3].IsCurrent, "Second from last index should be current"); result = _sut.GetMetaData(10, 8, 1); Assert.True(result.Pages[2].IsCurrent, "Third from last index should be current"); result = _sut.GetMetaData(10, 7, 1); Assert.True(result.Pages[2].IsCurrent, "Middle index should be current"); } [Fact] public void PartialEqualsCurrentCount() { var result = _sut.GetMetaData(2, 2, 1); Assert.True(result.Pages.Count == 2, "Count should equal total collection"); } [Fact] public void PartialLastIsSelected() { var result = _sut.GetMetaData(2, 2, 1); Assert.True(result.Pages[1].IsCurrent, "Last index should be current"); } [Fact] public void PreviousPagePageOneIndexBeforeFirstNumericShown() { var result = _sut.GetMetaData(100, 6, 10); Assert.True(result.PreviousPage.PageNumber == result.Pages.First(x => x.IsCurrent).PageNumber - 1, string.Format("Expected: Previous Page number == {0}", result.Pages.First(x => x.IsCurrent).PageNumber - 1)); } } }
using System; namespace Pioneer.Pagination.Tests { public class PageNodeTests { } }
mit
C#
dddf62c35eabcd01f45fa9673bdc667500667068
Split Pascal cased property names into words
PiranhaCMS/piranha.core,PiranhaCMS/piranha.core,PiranhaCMS/piranha.core,PiranhaCMS/piranha.core
core/Piranha.Manager/Areas/Manager/Views/Shared/EditorTemplates/Block.cshtml
core/Piranha.Manager/Areas/Manager/Views/Shared/EditorTemplates/Block.cshtml
@using Piranha.Extend; @using Piranha.Manager.Manager; @using System.Text.RegularExpressions; @model Block @foreach(var name in Model.GetFieldNames()) { var label = Regex.Replace(name, "(\\B[A-Z])", " $1"); <div class="form-group"> <label>@label</label> @Html.Editor(name) </div> }
@using Piranha.Extend; @using Piranha.Manager.Manager; @model Block @foreach(var name in Model.GetFieldNames()) { <div class="form-group"> <label>@name</label> @Html.Editor(name) </div> }
mit
C#
fc0ca56b52bae3c4dcfd126592fabdc9e9d9836f
Remove EF core namespaces.
aspnetboilerplate/module-zero-core-template,aspnetboilerplate/module-zero-core-template,abdllhbyrktr/module-zero-core-template,aspnetboilerplate/module-zero-core-template,aspnetboilerplate/module-zero-core-template,abdllhbyrktr/module-zero-core-template,abdllhbyrktr/module-zero-core-template,abdllhbyrktr/module-zero-core-template,abdllhbyrktr/module-zero-core-template,aspnetboilerplate/module-zero-core-template
test/AbpCompanyName.AbpProjectName.Tests/AbpProjectNameTestModule.cs
test/AbpCompanyName.AbpProjectName.Tests/AbpProjectNameTestModule.cs
using System; using Abp.Modules; using Abp.MultiTenancy; using Abp.TestBase; using Abp.Zero.Configuration; using AbpCompanyName.AbpProjectName.EntityFramework; using Castle.MicroKernel.Registration; using NSubstitute; namespace AbpCompanyName.AbpProjectName.Tests { [DependsOn( typeof(AbpProjectNameApplicationModule), typeof(AbpProjectNameEntityFrameworkModule), typeof(AbpTestBaseModule) )] public class AbpProjectNameTestModule : AbpModule { public override void PreInitialize() { Configuration.UnitOfWork.Timeout = TimeSpan.FromMinutes(30); //Use database for language management Configuration.Modules.Zero().LanguageManagement.EnableDbLocalization(); RegisterFakeService<IAbpZeroDbMigrator>(); } private void RegisterFakeService<TService>() where TService : class { IocManager.IocContainer.Register( Component.For<TService>() .UsingFactoryMethod(() => Substitute.For<TService>()) .LifestyleSingleton() ); } } }
using System; using System.Reflection; using Abp.Modules; using Abp.MultiTenancy; using Abp.TestBase; using Abp.Zero.Configuration; using AbpCompanyName.AbpProjectName.EntityFramework; using Castle.MicroKernel.Registration; using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.DependencyInjection; using NSubstitute; namespace AbpCompanyName.AbpProjectName.Tests { [DependsOn( typeof(AbpProjectNameApplicationModule), typeof(AbpProjectNameEntityFrameworkModule), typeof(AbpTestBaseModule) )] public class AbpProjectNameTestModule : AbpModule { public override void PreInitialize() { Configuration.UnitOfWork.Timeout = TimeSpan.FromMinutes(30); //Use database for language management Configuration.Modules.Zero().LanguageManagement.EnableDbLocalization(); RegisterFakeService<IAbpZeroDbMigrator>(); } private void RegisterFakeService<TService>() where TService : class { IocManager.IocContainer.Register( Component.For<TService>() .UsingFactoryMethod(() => Substitute.For<TService>()) .LifestyleSingleton() ); } } }
mit
C#
24d3acd089a45cb5aa9c7d0ec58c9f5b3d6bbea6
use screenshots directory
OlegKleyman/AlphaDev,OlegKleyman/AlphaDev,OlegKleyman/AlphaDev
tests/integration/AlphaDev.Web.Tests.Integration/SeleniumNotifier.cs
tests/integration/AlphaDev.Web.Tests.Integration/SeleniumNotifier.cs
using System.IO; using System.Text.RegularExpressions; using LightBDD.Core.Metadata; using LightBDD.Core.Notification; using LightBDD.Core.Results; using OpenQA.Selenium; namespace AlphaDev.Web.Tests.Integration { public class SeleniumNotifier : IScenarioProgressNotifier { private readonly ITakesScreenshot _screenshotTaker; private IScenarioInfo _scenario; public SeleniumNotifier(ITakesScreenshot screenshotTaker) { _screenshotTaker = screenshotTaker; } public void NotifyScenarioStart(IScenarioInfo scenario) { _scenario = scenario; } public void NotifyScenarioFinished(IScenarioResult scenario) { } public void NotifyStepStart(IStepInfo step) { TakeScreenshot(step, "before"); } public void NotifyStepFinished(IStepResult step) { TakeScreenshot(step.Info, "after"); } public void NotifyStepComment(IStepInfo step, string comment) { } private void TakeScreenshot(IStepInfo step, string suffix) { if (_screenshotTaker != null) { const string screenshotsDirectoryName = "screenshots"; if (!Directory.Exists(screenshotsDirectoryName)) { Directory.CreateDirectory(screenshotsDirectoryName); } var escapedStepFileName = Regex.Replace(step.Name.ToString(), $@"[{string.Join(string.Empty, Path.GetInvalidFileNameChars())}]", string.Empty, RegexOptions.Compiled); _screenshotTaker.GetScreenshot() ?.SaveAsFile( $@"{screenshotsDirectoryName}/{_scenario.Name}{escapedStepFileName}{step.Number}{suffix}.png", ScreenshotImageFormat.Png); } } } }
using System.IO; using System.Text.RegularExpressions; using LightBDD.Core.Metadata; using LightBDD.Core.Notification; using LightBDD.Core.Results; using OpenQA.Selenium; namespace AlphaDev.Web.Tests.Integration { public class SeleniumNotifier : IScenarioProgressNotifier { private readonly ITakesScreenshot _screenshotTaker; private IScenarioInfo _scenario; public SeleniumNotifier(ITakesScreenshot screenshotTaker) { _screenshotTaker = screenshotTaker; } public void NotifyScenarioStart(IScenarioInfo scenario) { _scenario = scenario; } public void NotifyScenarioFinished(IScenarioResult scenario) { } public void NotifyStepStart(IStepInfo step) { TakeScreenshot(step, "before"); } public void NotifyStepFinished(IStepResult step) { TakeScreenshot(step.Info, "after"); } public void NotifyStepComment(IStepInfo step, string comment) { } private void TakeScreenshot(IStepInfo step, string suffix) { var replace = Regex.Replace(step.Name.ToString(), $@"[{string.Join(string.Empty, Path.GetInvalidFileNameChars())}]", string.Empty, RegexOptions.Compiled); _screenshotTaker?.GetScreenshot() ?.SaveAsFile($"{_scenario.Name}{replace}{step.Number}{suffix}.png", ScreenshotImageFormat.Png); } } }
unlicense
C#
2ae1b0be01562702d8bc70abee944eeec8e670a1
add button to the home page, change text to be more user friendly
SoftwareFans/AstroPhotoGallery,SoftwareFans/AstroPhotoGallery,SoftwareFans/AstroPhotoGallery
AstroPhotoGallery/AstroPhotoGallery/Views/Shared/Error.cshtml
AstroPhotoGallery/AstroPhotoGallery/Views/Shared/Error.cshtml
@model System.Web.Mvc.HandleErrorInfo @{ ViewBag.Title = "An undefined error"; } <h2>@ViewBag.Title</h2> <br /> <div class="row"> <div class="col-sm-12"> <div> <div class="well well-sm text-center" style="font-size: 35px; color: #e74c3c; word-wrap: break-word;"> <p>An undefined error has occurred.</p> <p>Please go back to the home page or any other page from the site.</p> @Html.ActionLink("Back to the home page", "Index", "Home", null, new { @class = "btn btn-default btn-lg" }) </div> </div> </div> </div> <br />
@model System.Web.Mvc.HandleErrorInfo @{ ViewBag.Title = "Error"; } <h1 class="text-danger">Error.</h1> <h2 class="text-danger">An error occurred while processing your request.</h2>
mit
C#
937402df22e5491cef5e44b3ac91a8eaf6394eff
Fix byte ordering used to construct Guids in RandomUuidFactory.
brendanjbaker/Bakery
src/Bakery/RandomUuidFactory.cs
src/Bakery/RandomUuidFactory.cs
namespace Bakery { using Security; using System; public class RandomUuidFactory : IUuidFactory { private readonly IRandom random; public RandomUuidFactory(IRandom random) { this.random = random; } public Uuid Create() { var bytes = random.GetBytes(16); bytes[7] |= 0x40; bytes[7] &= 0x4f; bytes[8] |= 0x80; bytes[8] &= 0xbf; return new Uuid(new Guid(bytes)); } } }
namespace Bakery { using Security; using System; public class RandomUuidFactory : IUuidFactory { private readonly IRandom random; public RandomUuidFactory(IRandom random) { this.random = random; } public Uuid Create() { var bytes = random.GetBytes(16); bytes[6] |= 0x40; bytes[6] &= 0x4f; bytes[8] |= 0x80; bytes[8] &= 0xbf; return new Uuid(new Guid(bytes)); } } }
mit
C#
07ddff871fe257e85a0a5b94c0562b78dab88094
Verify that predecessors are significant.
michaellperry/Correspondence
Desktop/UpdateControls.Correspondence.UnitTest/CaptureTest.cs
Desktop/UpdateControls.Correspondence.UnitTest/CaptureTest.cs
using System.Text; using Microsoft.VisualStudio.TestTools.UnitTesting; using UpdateControls.Correspondence.Mementos; namespace UpdateControls.Correspondence.UnitTest { [TestClass] public class CaptureTest { [TestMethod] public void HashCodeIsConsistent() { FactMemento memento = new FactMemento(new CorrespondenceFactType("FacetedWorlds.MyCon.Model.Conference", 1)); UTF8Encoding encoding = new UTF8Encoding(); byte[] bytes = encoding.GetBytes("B1E0F2BB4CF24C2492B872112042797E"); memento.Data = new byte[bytes.Length + 2]; memento.Data[0] = 0; memento.Data[1] = (byte)bytes.Length; for (int i = 0; i < bytes.Length; i++) memento.Data[i + 2] = bytes[i]; int hashCode = memento.GetHashCode(); Assert.AreEqual(0x03f5afb5, hashCode); } [TestMethod] public void PredecessorHashCodeIsConsistentToo() { FactMemento memento = new FactMemento(new CorrespondenceFactType("FacetedWorlds.MyCon.Model.Attendee", 1)); memento.Data = new byte[0]; memento.AddPredecessor(new RoleMemento(new CorrespondenceFactType("FacetedWorlds.MyCon.Model.Identity", 1), "identity", null, false), new FactID { key = 1 }); memento.AddPredecessor(new RoleMemento(new CorrespondenceFactType("FacetedWorlds.MyCon.Model.Conference", 1), "conference", null, false), new FactID { key = 2 }); int hashCode = memento.GetHashCode(); Assert.AreEqual(-1244599490, hashCode); } [TestMethod] public void SmallChangeInRoleNameCausesBigChangeInHash() { FactMemento memento = new FactMemento(new CorrespondenceFactType("FacetedWorlds.MyCon.Model.Attendee", 1)); memento.Data = new byte[0]; memento.AddPredecessor(new RoleMemento(new CorrespondenceFactType("FacetedWorlds.MyCon.Model.Identity", 1), "identitz", null, false), new FactID { key = 1 }); memento.AddPredecessor(new RoleMemento(new CorrespondenceFactType("FacetedWorlds.MyCon.Model.Conference", 1), "conference", null, false), new FactID { key = 2 }); int hashCode = memento.GetHashCode(); Assert.AreEqual(752466564, hashCode); } } }
using System.Text; using Microsoft.VisualStudio.TestTools.UnitTesting; using UpdateControls.Correspondence.Mementos; namespace UpdateControls.Correspondence.UnitTest { [TestClass] public class CaptureTest { [TestMethod] public void HashCodeIsConsistent() { FactMemento memento = new FactMemento(new CorrespondenceFactType("FacetedWorlds.MyCon.Model.Conference", 1)); UTF8Encoding encoding = new UTF8Encoding(); byte[] bytes = encoding.GetBytes("B1E0F2BB4CF24C2492B872112042797E"); memento.Data = new byte[bytes.Length + 2]; memento.Data[0] = 0; memento.Data[1] = (byte)bytes.Length; for (int i = 0; i < bytes.Length; i++) memento.Data[i + 2] = bytes[i]; int hashCode = memento.GetHashCode(); Assert.AreEqual(0x03f5afb5, hashCode); } } }
mit
C#
4bcaf2b1f93589989e525bc0787f434c876023ed
Update PrimaryPointerHandlerExample.cs
DDReaper/MixedRealityToolkit-Unity,killerantz/HoloToolkit-Unity,killerantz/HoloToolkit-Unity,killerantz/HoloToolkit-Unity,killerantz/HoloToolkit-Unity
Assets/MixedRealityToolkit.Examples/Demos/Input/Scenes/PrimaryPointer/PrimaryPointerHandlerExample.cs
Assets/MixedRealityToolkit.Examples/Demos/Input/Scenes/PrimaryPointer/PrimaryPointerHandlerExample.cs
// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See LICENSE in the project root for license information. using Microsoft.MixedReality.Toolkit; using Microsoft.MixedReality.Toolkit.Input; using UnityEngine; namespace Microsoft.MixedReality.Toolkit.Examples.Demos { // Simple example script that subscribes to primary pointer changes and applies a cursor highlight to the current one. public class PrimaryPointerHandlerExample : MonoBehaviour { public GameObject CursorHighlight; private void OnEnable() { MixedRealityToolkit.InputSystem?.FocusProvider?.SubscribeToPrimaryPointerChanged(OnPrimaryPointerChanged, true); } private void OnPrimaryPointerChanged(IMixedRealityPointer oldPointer, IMixedRealityPointer newPointer) { if (CursorHighlight != null) { if (newPointer != null) { Transform parentTransform = newPointer.BaseCursor?.GameObjectReference?.transform; // If there's no cursor try using the controller pointer transform instead if (parentTransform == null) { var controllerPointer = newPointer as BaseControllerPointer; parentTransform = controllerPointer?.transform; } if (parentTransform != null) { CursorHighlight.transform.SetParent(parentTransform, false); CursorHighlight.SetActive(true); return; } } CursorHighlight.SetActive(false); CursorHighlight.transform.SetParent(null, false); } } private void OnDisable() { MixedRealityToolkit.InputSystem?.FocusProvider?.UnsubscribeFromPrimaryPointerChanged(OnPrimaryPointerChanged); OnPrimaryPointerChanged(null, null); } } }
using Microsoft.MixedReality.Toolkit; using Microsoft.MixedReality.Toolkit.Input; using UnityEngine; namespace Microsoft.MixedReality.Toolkit.Examples.Demos { // Simple example script that subscribes to primary pointer changes and applies a cursor highlight to the current one. public class PrimaryPointerHandlerExample : MonoBehaviour { public GameObject CursorHighlight; private void OnEnable() { MixedRealityToolkit.InputSystem?.FocusProvider?.SubscribeToPrimaryPointerChanged(OnPrimaryPointerChanged, true); } private void OnPrimaryPointerChanged(IMixedRealityPointer oldPointer, IMixedRealityPointer newPointer) { if (CursorHighlight != null) { if (newPointer != null) { Transform parentTransform = newPointer.BaseCursor?.GameObjectReference?.transform; // If there's no cursor try using the controller pointer transform instead if (parentTransform == null) { var controllerPointer = newPointer as BaseControllerPointer; parentTransform = controllerPointer?.transform; } if (parentTransform != null) { CursorHighlight.transform.SetParent(parentTransform, false); CursorHighlight.SetActive(true); return; } } CursorHighlight.SetActive(false); CursorHighlight.transform.SetParent(null, false); } } private void OnDisable() { MixedRealityToolkit.InputSystem?.FocusProvider?.UnsubscribeFromPrimaryPointerChanged(OnPrimaryPointerChanged); OnPrimaryPointerChanged(null, null); } } }
mit
C#
aaa22d068a6381195a02948aa57cd161756d1cff
Fix potential memory leak
fomalsd/unitystation,fomalsd/unitystation,krille90/unitystation,Necromunger/unitystation,fomalsd/unitystation,Necromunger/unitystation,krille90/unitystation,Necromunger/unitystation,fomalsd/unitystation,fomalsd/unitystation,Necromunger/unitystation,krille90/unitystation,Necromunger/unitystation,fomalsd/unitystation,fomalsd/unitystation,Necromunger/unitystation
UnityProject/Assets/Scripts/WaitFor.cs
UnityProject/Assets/Scripts/WaitFor.cs
using System.Collections.Generic; using UnityEngine; public static class WaitFor { public static readonly WaitForEndOfFrame EndOfFrame = new WaitForEndOfFrame(); public static readonly WaitForFixedUpdate FixedUpdate = new WaitForFixedUpdate(); private static Dictionary<float, WaitForSeconds> cachedWaitForSeconds = new Dictionary<float, WaitForSeconds>(); private static Dictionary<float, WaitForSecondsRealtime> cachedWaitForSecondsRealtime = new Dictionary<float, WaitForSecondsRealtime>(); static WaitFor() { EventManager.AddHandler(EVENT.RoundStarted, RoundStarted); } private static void RoundStarted() { Clear(); } public static WaitForSeconds Seconds(float seconds){ if(!cachedWaitForSeconds.ContainsKey(seconds)){ cachedWaitForSeconds[seconds] = new WaitForSeconds(seconds); } return cachedWaitForSeconds[seconds]; } public static WaitForSecondsRealtime SecondsRealtime(float seconds){ if(!cachedWaitForSecondsRealtime.ContainsKey(seconds)){ cachedWaitForSecondsRealtime[seconds] = new WaitForSecondsRealtime(seconds); } return cachedWaitForSecondsRealtime[seconds]; } public static void Clear(){ cachedWaitForSeconds.Clear(); cachedWaitForSecondsRealtime.Clear(); } }
using System.Collections.Generic; using UnityEngine; public static class WaitFor { public static readonly WaitForEndOfFrame EndOfFrame = new WaitForEndOfFrame(); public static readonly WaitForFixedUpdate FixedUpdate = new WaitForFixedUpdate(); private static Dictionary<float, WaitForSeconds> cachedWaitForSeconds = new Dictionary<float, WaitForSeconds>(); private static Dictionary<float, WaitForSecondsRealtime> cachedWaitForSecondsRealtime = new Dictionary<float, WaitForSecondsRealtime>(); public static WaitForSeconds Seconds(float seconds){ if(!cachedWaitForSeconds.ContainsKey(seconds)){ cachedWaitForSeconds[seconds] = new WaitForSeconds(seconds); } return cachedWaitForSeconds[seconds]; } public static WaitForSecondsRealtime SecondsRealtime(float seconds){ if(!cachedWaitForSecondsRealtime.ContainsKey(seconds)){ cachedWaitForSecondsRealtime[seconds] = new WaitForSecondsRealtime(seconds); } return cachedWaitForSecondsRealtime[seconds]; } }
agpl-3.0
C#
9cd3e67b7935a7b8c5b058ebbfce67ec3b338336
Implement GatherProperties so the Alembic Clip does not change the scene in a persistent way anymore.
unity3d-jp/AlembicImporter,unity3d-jp/AlembicImporter,unity3d-jp/AlembicImporter
proto.com.unity.formats.alembic/Runtime/Scripts/Timeline/AlembicShotAsset.cs
proto.com.unity.formats.alembic/Runtime/Scripts/Timeline/AlembicShotAsset.cs
using System; using UnityEngine; using UnityEngine.Formats.Alembic.Importer; using UnityEngine.Playables; using UnityEngine.Timeline; namespace UnityEngine.Formats.Alembic.Timeline { [System.ComponentModel.DisplayName("Alembic Shot")] internal class AlembicShotAsset : PlayableAsset, ITimelineClipAsset, IPropertyPreview { AlembicStreamPlayer m_stream; [Tooltip("Alembic asset to play")] [SerializeField] private ExposedReference<AlembicStreamPlayer> streamPlayer; public ExposedReference<AlembicStreamPlayer> StreamPlayer { get { return streamPlayer; } set { streamPlayer = value; } } [Tooltip("Amount of time to clip off the end of the alembic asset from playback.")] [SerializeField] private float endOffset; public float EndOffset { get { return endOffset; } set { endOffset = value; } } public ClipCaps clipCaps { get { return ClipCaps.Extrapolation | ClipCaps.Looping | ClipCaps.SpeedMultiplier | ClipCaps.ClipIn; } } public override Playable CreatePlayable(PlayableGraph graph, GameObject owner) { var playable = ScriptPlayable<AlembicShotPlayable>.Create(graph); var behaviour = playable.GetBehaviour(); m_stream = StreamPlayer.Resolve(graph.GetResolver()); behaviour.streamPlayer = m_stream; return playable; } public override double duration { get { return m_stream == null ? 0 : m_stream.duration; } } public void GatherProperties(PlayableDirector director, IPropertyCollector driver) { var streamComponent = streamPlayer.Resolve(director); if (streamComponent != null) { driver.AddFromName<AlembicStreamPlayer>(streamComponent.gameObject,"currentTime"); } } } }
using System; using UnityEngine; using UnityEngine.Formats.Alembic.Importer; using UnityEngine.Playables; using UnityEngine.Timeline; namespace UnityEngine.Formats.Alembic.Timeline { [System.ComponentModel.DisplayName("Alembic Shot")] internal class AlembicShotAsset : PlayableAsset, ITimelineClipAsset { AlembicStreamPlayer m_stream; [Tooltip("Alembic asset to play")] [SerializeField] private ExposedReference<AlembicStreamPlayer> streamPlayer; public ExposedReference<AlembicStreamPlayer> StreamPlayer { get { return streamPlayer; } set { streamPlayer = value; } } [Tooltip("Amount of time to clip off the end of the alembic asset from playback.")] [SerializeField] private float endOffset; public float EndOffset { get { return endOffset; } set { endOffset = value; } } public ClipCaps clipCaps { get { return ClipCaps.Extrapolation | ClipCaps.Looping | ClipCaps.SpeedMultiplier | ClipCaps.ClipIn; } } public override Playable CreatePlayable(PlayableGraph graph, GameObject owner) { var playable = ScriptPlayable<AlembicShotPlayable>.Create(graph); var behaviour = playable.GetBehaviour(); m_stream = StreamPlayer.Resolve(graph.GetResolver()); behaviour.streamPlayer = m_stream; return playable; } public override double duration { get { return m_stream == null ? 0 : m_stream.duration; } } } }
mit
C#
9aca0afe80e1d3e905a152b91ec0f5803e2245e3
Index EPiServer content link
Qobra/Solr.Net,jango2015/Solr.Net
Solr.EPiServer/Solr.EPiServer/DefaultSolrContentRepository.cs
Solr.EPiServer/Solr.EPiServer/DefaultSolrContentRepository.cs
using System; using System.Collections.Generic; using System.Globalization; using System.Threading.Tasks; using EPiServer; using EPiServer.Core; using EPiServer.ServiceLocation; using Solr.Client; using Solr.Client.WebService; namespace Solr.EPiServer { [ServiceConfiguration(ServiceType = typeof(ISolrContentRepository), Lifecycle = ServiceInstanceScope.HttpContext)] public class DefaultSolrContentRepository : ISolrContentRepository { private readonly ISolrConfiguration _solrConfiguration; public DefaultSolrContentRepository(ISolrConfiguration solrConfiguration) { _solrConfiguration = solrConfiguration; } public async Task Add(ContentReference contentReference) { var contentRepository = ServiceLocator.Current.GetInstance<IContentRepository>(); var languageBranches = contentRepository.GetLanguageBranches<IContent>(contentReference); var documentContent = new Dictionary<string, object> {{"id", contentReference.ID}}; foreach (var languageBranch in languageBranches) { var fieldResolver = new EpiSolrFieldResolver(new CultureInfo(languageBranch.Property.LanguageBranch)); foreach (var propertyInfo in languageBranch.GetType().GetProperties()) { if (propertyInfo.PropertyType == typeof (string)) { documentContent.Add( fieldResolver.GetFieldName(propertyInfo), propertyInfo.GetValue(languageBranch)); } } } var updateRepository = new DefaultSolrRepository(_solrConfiguration); await updateRepository.Add(documentContent); } public SolrQuery<TContent> Query<TContent>(string query, CultureInfo language = null) where TContent : IContent, new() { var fieldResolver = new EpiSolrFieldResolver(language ?? LanguageSelector.AutoDetect(false).Language); var queryRepository = new DefaultSolrRepository(_solrConfiguration, fieldResolver); return queryRepository.Get<TContent>(query); } public async Task Remove(ContentReference contentReference) { throw new NotImplementedException(); //var updateRepository = new DefaultSolrRepository(_solrConfiguration); //await updateRepository.Remove(contentReference.ID); } } }
using System.Globalization; using System.Threading.Tasks; using EPiServer.Core; using EPiServer.ServiceLocation; using Solr.Client; using Solr.Client.Serialization; using Solr.Client.WebService; namespace Solr.EPiServer { [ServiceConfiguration(ServiceType = typeof(ISolrContentRepository), Lifecycle = ServiceInstanceScope.HttpContext)] public class DefaultSolrContentRepository : ISolrContentRepository { private readonly ISolrConfiguration _solrConfiguration; public DefaultSolrContentRepository(ISolrConfiguration solrConfiguration) { _solrConfiguration = solrConfiguration; } public async Task Add(ContentReference contentReference) { var updateRepository = new DefaultSolrRepository(_solrConfiguration); await updateRepository.Add(contentReference); } public SolrQuery<TContent> Query<TContent>(string query, CultureInfo language = null) where TContent : IContent, new() { var fieldResolver = new EpiSolrFieldResolver(language ?? LanguageSelector.AutoDetect(false).Language); var queryRepository = new DefaultSolrRepository(_solrConfiguration, fieldResolver); return queryRepository.Get<TContent>(query); } public async Task Remove(ContentReference contentReference) { var updateRepository = new DefaultSolrRepository(_solrConfiguration); await updateRepository.Remove(contentReference.ID); } } }
mit
C#
a71bf80265b506af478693736ab8c394905edc24
Align enum values
bfloydgsn/unitytesttools,bfloydgsn/unitytesttools
Assets/UnityTestTools/Assertions/CheckMethod.cs
Assets/UnityTestTools/Assertions/CheckMethod.cs
using System; namespace UnityTest { [Flags] public enum CheckMethod { AfterPeriodOfTime = 1 << 0, Start = 1 << 1, Update = 1 << 2, FixedUpdate = 1 << 3, LateUpdate = 1 << 4, OnDestroy = 1 << 5, OnEnable = 1 << 6, OnDisable = 1 << 7, OnControllerColliderHit = 1 << 8, OnParticleCollision = 1 << 9, OnJointBreak = 1 << 10, OnBecameInvisible = 1 << 11, OnBecameVisible = 1 << 12, OnTriggerEnter = 1 << 13, OnTriggerExit = 1 << 14, OnTriggerStay = 1 << 15, OnCollisionEnter = 1 << 16, OnCollisionExit = 1 << 17, OnCollisionStay = 1 << 18, OnTriggerEnter2D = 1 << 19, OnTriggerExit2D = 1 << 20, OnTriggerStay2D = 1 << 21, OnCollisionEnter2D = 1 << 22, OnCollisionExit2D = 1 << 23, OnCollisionStay2D = 1 << 24, } }
using System; namespace UnityTest { [Flags] public enum CheckMethod { AfterPeriodOfTime = 1 << 0, Start = 1 << 1, Update = 1 << 2, FixedUpdate = 1 << 3, LateUpdate = 1 << 4, OnDestroy = 1 << 5, OnEnable = 1 << 6, OnDisable = 1 << 7, OnControllerColliderHit = 1 << 8, OnParticleCollision = 1 << 9, OnJointBreak = 1 << 10, OnBecameInvisible = 1 << 11, OnBecameVisible = 1 << 12, OnTriggerEnter = 1 << 13, OnTriggerExit = 1 << 14, OnTriggerStay = 1 << 15, OnCollisionEnter = 1 << 16, OnCollisionExit = 1 << 17, OnCollisionStay = 1 << 18, OnTriggerEnter2D = 1 << 19, OnTriggerExit2D = 1 << 20, OnTriggerStay2D = 1 << 21, OnCollisionEnter2D = 1 << 22, OnCollisionExit2D = 1 << 23, OnCollisionStay2D = 1 << 24, } }
mit
C#
7a0edd195bfdcdf02cfbc0413ad12a89f4dae2a7
add MessageAttachment
AndyPook/Slack
SlackAPI/RTMMessages/Message.cs
SlackAPI/RTMMessages/Message.cs
using System; using System.Collections.Generic; namespace Pook.SlackAPI.RTMMessages { public class Message : SlackSocketMessage { public virtual string subtype { get; set; } public string user; public string channel; public string text; public string team; public string ts; public IList<MessageAttachment> attachments; public Message() { type = "message"; } } public class MessageAttachment { public string title; public string text; public bool mrkdwn; public string fallback; } public class BotMessage : Message { public override string subtype => "bot_message"; public string bot_id; } }
using System; namespace Pook.SlackAPI.RTMMessages { public class Message : SlackSocketMessage { public string user; public string channel; public string text; public string team; public string ts; public Message() { type = "message"; } } public class BotMessage : Message { public string subtype => "bot_message"; public string bot_id; } }
mit
C#
b0102a5c56359ca5edc4469113f0412921656f96
Add documentation
fluentmigrator/fluentmigrator,amroel/fluentmigrator,fluentmigrator/fluentmigrator,stsrki/fluentmigrator,spaccabit/fluentmigrator,spaccabit/fluentmigrator,stsrki/fluentmigrator,amroel/fluentmigrator
src/FluentMigrator.Extensions.Postgres/Postgres/PostgresExtensions.Filter.cs
src/FluentMigrator.Extensions.Postgres/Postgres/PostgresExtensions.Filter.cs
#region License // Copyright (c) 2020, 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 FluentMigrator.Builders.Create.Index; using FluentMigrator.Infrastructure; using FluentMigrator.Infrastructure.Extensions; namespace FluentMigrator.Postgres { public static partial class PostgresExtensions { public const string IndexFilter = "PostgresIndexFilter"; /// <summary> /// The constraint expression for a partial index. /// </summary> /// <param name="expression"></param> /// <param name="filter">The constraint expression</param> /// <returns>The next step</returns> public static ICreateIndexOptionsSyntax Filter(this ICreateIndexOptionsSyntax expression, string filter) { var additionalFeatures = expression as ISupportAdditionalFeatures; additionalFeatures.SetAdditionalFeature(IndexFilter, filter); return expression; } } }
#region License // Copyright (c) 2020, 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 FluentMigrator.Builders.Create.Index; using FluentMigrator.Infrastructure; using FluentMigrator.Infrastructure.Extensions; namespace FluentMigrator.Postgres { public static partial class PostgresExtensions { public const string IndexFilter = "PostgresIndexFilter"; public static ICreateIndexOptionsSyntax Filter(this ICreateIndexOptionsSyntax expression, string filter) { var additionalFeatures = expression as ISupportAdditionalFeatures; additionalFeatures.SetAdditionalFeature(IndexFilter, filter); return expression; } } }
apache-2.0
C#
9aa1f1f33b7ac7ae6737d10ae8365f2f12e179a7
Fix NullReferenceException in leaderboard
stuartleeks/nether,vflorusso/nether,vflorusso/nether,stuartleeks/nether,ankodu/nether,stuartleeks/nether,navalev/nether,ankodu/nether,ankodu/nether,vflorusso/nether,vflorusso/nether,ankodu/nether,stuartleeks/nether,vflorusso/nether,oliviak/nether,krist00fer/nether,MicrosoftDX/nether,navalev/nether,stuartleeks/nether,navalev/nether,navalev/nether
src/Nether.Web/Features/Leaderboard/Models/Leaderboard/LeaderboardGetResponseModel.cs
src/Nether.Web/Features/Leaderboard/Models/Leaderboard/LeaderboardGetResponseModel.cs
// Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. using System.Collections.Generic; using Nether.Data.Leaderboard; using Newtonsoft.Json; using System.ComponentModel; namespace Nether.Web.Features.Leaderboard.Models.Leaderboard { public class LeaderboardGetResponseModel { public List<LeaderboardEntry> Entries { get; set; } [JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)] [DefaultValue((object)null)] public LeaderboardEntry CurrentPlayer { get; set; } public class LeaderboardEntry { public static LeaderboardEntry Map(GameScore score, string currentGamertag) { if (score == null) return null; return new LeaderboardEntry { Gamertag = score.Gamertag, Score = score.Score, Rank = score.Rank, IsCurrentPlayer = currentGamertag == score.Gamertag }; } /// <summary> /// Gamertag /// </summary> public string Gamertag { get; set; } /// <summary> /// Scores /// </summary> public int Score { get; set; } /// <summary> /// Player rank /// </summary> public long Rank { get; set; } /// <summary> /// True if the score is for the current player /// </summary> [JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)] [DefaultValue(false)] public bool IsCurrentPlayer { get; set; } } } }
// Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. using System.Collections.Generic; using Nether.Data.Leaderboard; using Newtonsoft.Json; using System.ComponentModel; namespace Nether.Web.Features.Leaderboard.Models.Leaderboard { public class LeaderboardGetResponseModel { public List<LeaderboardEntry> Entries { get; set; } [JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)] [DefaultValue((object)null)] public LeaderboardEntry CurrentPlayer { get; set; } public class LeaderboardEntry { public static LeaderboardEntry Map(GameScore score, string currentGamertag) { return new LeaderboardEntry { Gamertag = score.Gamertag, Score = score.Score, Rank = score.Rank, IsCurrentPlayer = currentGamertag == score.Gamertag }; } /// <summary> /// Gamertag /// </summary> public string Gamertag { get; set; } /// <summary> /// Scores /// </summary> public int Score { get; set; } /// <summary> /// Player rank /// </summary> public long Rank { get; set; } /// <summary> /// True if the score is for the current player /// </summary> [JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)] [DefaultValue(false)] public bool IsCurrentPlayer { get; set; } } } }
mit
C#
8562000aaa3a1726bd65e19e4d0a547e80054259
Test Cases
jefking/King.B-Trak
King.BTrak.Unit.Test/TableStorageReaderTests.cs
King.BTrak.Unit.Test/TableStorageReaderTests.cs
namespace King.BTrak.Unit.Test { using King.Azure.Data; using NSubstitute; using NUnit.Framework; using System; [TestFixture] public class TableStorageReaderTests { [Test] public void Constructor() { var resources = Substitute.For<IAzureStorageResources>(); var tableName = Guid.NewGuid().ToString(); new TableStorageReader(resources, tableName); } [Test] [ExpectedException(typeof(ArgumentNullException))] public void ConstructorStorageResourcesNull() { var tableName = Guid.NewGuid().ToString(); new TableStorageReader(null, tableName); } [Test] [ExpectedException(typeof(ArgumentException))] public void ConstructorTableNameNull() { var resources = Substitute.For<IAzureStorageResources>(); new TableStorageReader(resources, null); } [Test] public void IsITableStorageReader() { var resources = Substitute.For<IAzureStorageResources>(); var tableName = Guid.NewGuid().ToString(); Assert.IsNotNull(new TableStorageReader(resources, tableName) as ITableStorageReader); } } }
namespace King.BTrak.Unit.Test { using NUnit.Framework; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; [TestFixture] public class TableStorageReaderTests { } }
mit
C#
558cc870397589757ee3233c7bd017dfabc065f9
Replace first TestObjectBuilderBuilder unit test with two tests to make the tests less brittle.
tdpreece/TestObjectBuilderCsharp
TestObjectBuilderTests/Tests/TestObjectBuilderBuilderTests.cs
TestObjectBuilderTests/Tests/TestObjectBuilderBuilderTests.cs
using System; using System.Collections.Generic; using System.Linq; using System.Text; using NUnit.Framework; using TestObjectBuilder; namespace TestObjectBuilderTests.Tests { public class TestObjectBuilderBuilderTests { [TestFixture] public class CreateNewObject { [Test] public void ProductBuilderCreateBuildsObjectsOfTypeProduct() { // Arrange // Act ITestObjBuilder<ProductWithoutProperties> builder = TestObjectBuilderBuilder<ProductWithoutProperties>.CreateNewObject(); // Assert Assert.AreSame(typeof(ProductWithoutProperties), builder.GetType().GetMethod("Build").ReturnType); } [Test] public void ProductBuilderHasNoPropertiesWhenProductHasNoProperties() { // Arrange // Act ITestObjBuilder<ProductWithoutProperties> builder = TestObjectBuilderBuilder<ProductWithoutProperties>.CreateNewObject(); // Assert Assert.AreEqual(0, builder.GetType().GetProperties().Count()); } } } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using NUnit.Framework; using TestObjectBuilder; namespace TestObjectBuilderTests.Tests { public class TestObjectBuilderBuilderTests { [TestFixture] public class CreateNewObject { [Test] public void CreatesProductWithoutPropertiesAndAZeroArgConstructor() { // Arrange ITestObjBuilder<ProductWithoutProperties> builder = TestObjectBuilderBuilder<ProductWithoutProperties>.CreateNewObject(); // Act ProductWithoutProperties product = builder.Build(); // Assert Assert.NotNull(product); } } } }
mit
C#
5b55a915b9c266f3906385894908d341006bc5b9
fix getting cloud instance
yar229/WebDavMailRuCloud
WebDavMailRuCloudStore/Cloud.cs
WebDavMailRuCloudStore/Cloud.cs
using System; using System.Collections; using System.Collections.Concurrent; using System.Collections.Generic; using System.Net; using MailRuCloudApi; using MailRuCloudApi.Api; using NWebDav.Server.Http; namespace YaR.WebDavMailRu.CloudStore { public static class Cloud { public static void Init(string userAgent = "") { if (!string.IsNullOrEmpty(userAgent)) ConstSettings.UserAgent = userAgent; } private static readonly ConcurrentDictionary<string, MailRuCloud> CloudCache = new ConcurrentDictionary<string, MailRuCloud>(); public static MailRuCloud Instance(IHttpContext context) { HttpListenerBasicIdentity identity = (HttpListenerBasicIdentity)context.Session.Principal.Identity; string key = identity.Name + identity.Password; MailRuCloud cloud; if (CloudCache.TryGetValue(key, out cloud)) return cloud; cloud = new SplittedCloud(identity.Name, identity.Password); if (!CloudCache.TryAdd(key, cloud)) CloudCache.TryGetValue(key, out cloud); return cloud; } } }
using System; using System.Collections; using System.Collections.Concurrent; using System.Collections.Generic; using System.Net; using MailRuCloudApi; using MailRuCloudApi.Api; using NWebDav.Server.Http; namespace YaR.WebDavMailRu.CloudStore { public static class Cloud { public static void Init(string userAgent = "") { if (!string.IsNullOrEmpty(userAgent)) ConstSettings.UserAgent = userAgent; } private static readonly ConcurrentDictionary<string, MailRuCloud> CloudCache = new ConcurrentDictionary<string, MailRuCloud>(); public static MailRuCloud Instance(IHttpContext context) { HttpListenerBasicIdentity identity = (HttpListenerBasicIdentity)context.Session.Principal.Identity; //Console.WriteLine(identity.Name); //Console.WriteLine(identity.Password); string key = identity.Name + identity.Password; MailRuCloud cloud; if (!CloudCache.TryGetValue(key, out cloud)) { cloud = new SplittedCloud(identity.Name, identity.Password); CloudCache.TryAdd(key, cloud); } return cloud; } } }
mit
C#
c1cd19ea3c5393f83be0ad992d5a00c2290d3c72
Bump version 1.2.6.0 -> 1.2.7.0 (for transformers support).
EliotVU/Unreal-Library
src/Properties/AssemblyInfo.cs
src/Properties/AssemblyInfo.cs
using System.Reflection; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle( "UELib" )] [assembly: AssemblyDescription( "A library for parsing Unreal Engine packages." )] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany( "EliotVU" )] [assembly: AssemblyProduct( "UELib" )] [assembly: AssemblyCopyright( "© 2009-2015 Eliot van Uytfanghe. All rights reserved." )] [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( "0eb1c54e-8955-4c8d-98d3-16285f114f16" )] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion( "1.2.7.0" )] [assembly: AssemblyFileVersion( "1.2.7.0" )]
using System.Reflection; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle( "UELib" )] [assembly: AssemblyDescription( "A library for parsing Unreal Engine packages." )] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany( "EliotVU" )] [assembly: AssemblyProduct( "UELib" )] [assembly: AssemblyCopyright( "© 2009-2014 Eliot van Uytfanghe. All rights reserved." )] [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( "0eb1c54e-8955-4c8d-98d3-16285f114f16" )] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion( "1.2.6.0" )] [assembly: AssemblyFileVersion( "1.2.6.0" )]
mit
C#
6034680b36b49c790ea70f987bc4ed1649555862
Fix incorrect namespace for UI component.
dneelyep/MonoGameUtils
MonoGameUtils/UI/GameComponents/UIFPSCounter.cs
MonoGameUtils/UI/GameComponents/UIFPSCounter.cs
using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using MonoGameUtils.Diagnostics; namespace MonoGameUtils.UI.GameComponents { public class UIFPSCounter : DrawableGameComponent { private FPSCounter _fpsCounter = new FPSCounter(); private SpriteBatch _spriteBatch; private SpriteFont _font; private Vector2 _topLeftPoint; private Vector2 _avgFPSLocation; private readonly Color _fontColor = Color.Black; public UIFPSCounter(Game game, SpriteFont font, Vector2 topLeftPoint, SpriteBatch spriteBatch) : base(game) { _spriteBatch = spriteBatch; _font = font; _topLeftPoint = topLeftPoint; _avgFPSLocation = Vector2.Add(_topLeftPoint, new Vector2(0, 20)); } public override void Update(GameTime gameTime) { _fpsCounter.Update(gameTime); base.Update(gameTime); } public override void Draw(GameTime gameTime) { _spriteBatch.DrawString(_font, "Current FPS: " + _fpsCounter.CurrentFPS, _topLeftPoint, _fontColor); _spriteBatch.DrawString(_font, "Avg FPS: " + _fpsCounter.AverageFPS, _avgFPSLocation, _fontColor); base.Draw(gameTime); } } }
using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using MonoGameUtils.Diagnostics; namespace PCGame.GameComponents { public class UIFPSCounter : DrawableGameComponent { private FPSCounter _fpsCounter = new FPSCounter(); private SpriteBatch _spriteBatch; private SpriteFont _font; private Vector2 _topLeftPoint; private Vector2 _avgFPSLocation; private readonly Color _fontColor = Color.Black; public UIFPSCounter(Game game, SpriteFont font, Vector2 topLeftPoint, SpriteBatch spriteBatch) : base(game) { _spriteBatch = spriteBatch; _font = font; _topLeftPoint = topLeftPoint; _avgFPSLocation = Vector2.Add(_topLeftPoint, new Vector2(0, 20)); } public override void Update(GameTime gameTime) { _fpsCounter.Update(gameTime); base.Update(gameTime); } public override void Draw(GameTime gameTime) { _spriteBatch.DrawString(_font, "Current FPS: " + _fpsCounter.CurrentFPS, _topLeftPoint, _fontColor); _spriteBatch.DrawString(_font, "Avg FPS: " + _fpsCounter.AverageFPS, _avgFPSLocation, _fontColor); base.Draw(gameTime); } } }
mit
C#
85d07d6be2469aec5ba5e8dabd59f561b2ac652e
Tweak the latest news view.
bigfont/orchard-cms-modules-and-themes,bigfont/orchard-cms-modules-and-themes,bigfont/orchard-cms-modules-and-themes,bigfont/orchard-cms-modules-and-themes,bigfont/orchard-cms-modules-and-themes
Orchard.Source.1.8.1/src/Orchard.Web/Themes/LccNetwork.Bootstrap/Views/ProjectionWidgetLatestNews.cshtml
Orchard.Source.1.8.1/src/Orchard.Web/Themes/LccNetwork.Bootstrap/Views/ProjectionWidgetLatestNews.cshtml
@using System.Dynamic; @using System.Linq; @using Orchard.ContentManagement; @using Orchard.Utility.Extensions; @functions { dynamic GetMainPartFromContentItem(ContentItem item) { // get the ContentPart that has the same name as the item's ContentType // so that we can access the item fields. var contentType = item.TypeDefinition.Name; var parts = item.Parts as List<ContentPart>; return parts.First(p => p.PartDefinition.Name.Equals(contentType)); return mainPart; } dynamic GetMediaPartFromMediaLibraryPickerField(dynamic field, int index = 0) { return field != null && field.MediaParts != null && field.MediaParts.Count >= index ? field.MediaParts[index] : null; } } @helper CreateImgFromMediaPart(dynamic mediaPart) { var imgSrc = mediaPart != null ? mediaPart.MediaUrl : string.Empty; var imgAlt = mediaPart != null ? mediaPart.AlternateText : string.Empty; <img src="@Display.ResizeMediaUrl(Width: 116, Height: 65, Mode: "crop", Alignment: "middlecenter", Path: imgSrc)"> } @{ var items = (Model.ContentItems as IEnumerable<ContentItem>); var cssClass = items.First().TypeDefinition.Name.HtmlClassify(); <div class="@cssClass"> <div class="row"> @foreach (ContentItem item in items) { var itemDisplayUrl = Url.ItemDisplayUrl(item); // get the mainPart, so we can access the item's fields dynamic mainPart = GetMainPartFromContentItem(item); var mediaPart = GetMediaPartFromMediaLibraryPickerField(mainPart.Image, 0); var shortTitle = mainPart.ShortTitle.Value; var summary = mainPart.Summary.Value; // keep in mind that our theme has a grid with 36 columns <div class="col-md-6"> @CreateImgFromMediaPart(mediaPart) <h6>@shortTitle</h6> <p>@summary</p> <a href="@itemDisplayUrl">View</a> </div> } </div> </div> }
@using System.Dynamic; @using System.Linq; @using Orchard.ContentManagement; @using Orchard.Utility.Extensions; @functions { dynamic GetMainPartFromContentItem(ContentItem item) { // get the ContentPart that has the same name as the item's ContentType // so that we can access the item fields. var contentType = item.TypeDefinition.Name; var parts = item.Parts as List<ContentPart>; return parts.First(p => p.PartDefinition.Name.Equals(contentType)); return mainPart; } dynamic GetMediaPartFromMediaLibraryPickerField(dynamic field, int index = 0) { var mediaPart = field != null && field.MediaParts != null && field.MediaParts.Count >= index ? field.MediaParts[index] : null; return mediaPart; } } @helper CreateImgFromMediaPart(dynamic mediaPart) { var imgSrc = mediaPart != null ? mediaPart.MediaUrl : string.Empty; var imgAlt = mediaPart != null ? mediaPart.AlternateText : string.Empty; <img src="@Display.ResizeMediaUrl(Width: 116, Height: 65, Mode: "crop", Alignment: "middlecenter", Path: imgSrc)"> } @{ var items = (Model.ContentItems as IEnumerable<ContentItem>); var cssClass = items.First().TypeDefinition.Name.HtmlClassify(); <div class="@cssClass"> <div class="row"> @foreach (ContentItem item in items) { var itemDisplayUrl = Url.ItemDisplayUrl(item); // get the mainPart, so we can access the item's fields dynamic mainPart = GetMainPartFromContentItem(item); var mediaPart = GetMediaPartFromMediaLibraryPickerField(mainPart.Image, 0); var shortTitle = mainPart.ShortTitle.Value; var summary = mainPart.Summary.Value; // keep in mind that our theme has a grid with 36 columns <div class="col-md-6"> @CreateImgFromMediaPart(mediaPart) <h6>@shortTitle</h6> <p>@summary</p> <a href="@itemDisplayUrl">View</a> </div> } </div> </div> }
bsd-3-clause
C#
664acca29a81fee2df3cca9d75f5e7a02ef4c0eb
Remove "redundant" parenthesis
Nabile-Rahmani/osu-framework,paparony03/osu-framework,ZLima12/osu-framework,paparony03/osu-framework,DrabWeb/osu-framework,Tom94/osu-framework,ppy/osu-framework,naoey/osu-framework,Tom94/osu-framework,peppy/osu-framework,default0/osu-framework,peppy/osu-framework,ppy/osu-framework,EVAST9919/osu-framework,DrabWeb/osu-framework,EVAST9919/osu-framework,Nabile-Rahmani/osu-framework,naoey/osu-framework,EVAST9919/osu-framework,default0/osu-framework,peppy/osu-framework,ppy/osu-framework,smoogipooo/osu-framework,DrabWeb/osu-framework,smoogipooo/osu-framework,ZLima12/osu-framework,EVAST9919/osu-framework
osu.Framework/Input/MouseState.cs
osu.Framework/Input/MouseState.cs
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>. // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu-framework/master/LICENCE using System; using OpenTK; using OpenTK.Input; using System.Linq; namespace osu.Framework.Input { public class MouseState : IMouseState { private const int mouse_button_count = (int)MouseButton.LastButton; public bool[] PressedButtons = new bool[mouse_button_count]; public IMouseState NativeState => this; public IMouseState LastState { get; set; } public virtual int WheelDelta => Wheel - LastState?.Wheel ?? 0; public int Wheel { get; set; } public bool HasMainButtonPressed => IsPressed(MouseButton.Left) || IsPressed(MouseButton.Right); public bool HasAnyButtonPressed => PressedButtons.Any(b => b); public Vector2 Delta => Position - LastPosition; public Vector2 Position { get; protected set; } public Vector2 LastPosition => LastState?.Position ?? Position; public Vector2? PositionMouseDown { get; set; } public IMouseState Clone() { var clone = (MouseState)MemberwiseClone(); clone.PressedButtons = new bool[mouse_button_count]; Array.Copy(PressedButtons, clone.PressedButtons, mouse_button_count); clone.LastState = null; return clone; } public bool IsPressed(MouseButton button) => PressedButtons[(int)button]; public void SetPressed(MouseButton button, bool pressed) => PressedButtons[(int)button] = pressed; } }
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>. // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu-framework/master/LICENCE using System; using OpenTK; using OpenTK.Input; using System.Linq; namespace osu.Framework.Input { public class MouseState : IMouseState { private const int mouse_button_count = (int)MouseButton.LastButton; public bool[] PressedButtons = new bool[mouse_button_count]; public IMouseState NativeState => this; public IMouseState LastState { get; set; } public virtual int WheelDelta => (Wheel - LastState?.Wheel) ?? 0; public int Wheel { get; set; } public bool HasMainButtonPressed => IsPressed(MouseButton.Left) || IsPressed(MouseButton.Right); public bool HasAnyButtonPressed => PressedButtons.Any(b => b); public Vector2 Delta => Position - LastPosition; public Vector2 Position { get; protected set; } public Vector2 LastPosition => LastState?.Position ?? Position; public Vector2? PositionMouseDown { get; set; } public IMouseState Clone() { var clone = (MouseState)MemberwiseClone(); clone.PressedButtons = new bool[mouse_button_count]; Array.Copy(PressedButtons, clone.PressedButtons, mouse_button_count); clone.LastState = null; return clone; } public bool IsPressed(MouseButton button) => PressedButtons[(int)button]; public void SetPressed(MouseButton button, bool pressed) => PressedButtons[(int)button] = pressed; } }
mit
C#
07a1df3e6018d6be4438f6c0ad350d72b8b73127
fix warning
weltkante/roslyn,weltkante/roslyn,diryboy/roslyn,jasonmalinowski/roslyn,mavasani/roslyn,shyamnamboodiripad/roslyn,CyrusNajmabadi/roslyn,bartdesmet/roslyn,CyrusNajmabadi/roslyn,CyrusNajmabadi/roslyn,shyamnamboodiripad/roslyn,dotnet/roslyn,weltkante/roslyn,jasonmalinowski/roslyn,mavasani/roslyn,KevinRansom/roslyn,dotnet/roslyn,sharwell/roslyn,sharwell/roslyn,shyamnamboodiripad/roslyn,mavasani/roslyn,jasonmalinowski/roslyn,KevinRansom/roslyn,bartdesmet/roslyn,sharwell/roslyn,diryboy/roslyn,bartdesmet/roslyn,diryboy/roslyn,dotnet/roslyn,KevinRansom/roslyn
src/Features/LanguageServer/Protocol/ExternalAccess/VSCode/API/VSCodeAnalyzerLoader.cs
src/Features/LanguageServer/Protocol/ExternalAccess/VSCode/API/VSCodeAnalyzerLoader.cs
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. using System; using System.Composition; using Microsoft.CodeAnalysis.Diagnostics; using Microsoft.CodeAnalysis.Host.Mef; using Microsoft.CodeAnalysis.SolutionCrawler; namespace Microsoft.CodeAnalysis.LanguageServer.ExternalAccess.VSCode.API; [Export(typeof(VSCodeAnalyzerLoader)), Shared] internal class VSCodeAnalyzerLoader { private readonly IDiagnosticAnalyzerService _analyzerService; private readonly DiagnosticService _diagnosticService; [ImportingConstructor] [Obsolete(MefConstruction.ImportingConstructorMessage, error: true)] public VSCodeAnalyzerLoader(IDiagnosticAnalyzerService analyzerService, IDiagnosticService diagnosticService) { _analyzerService = analyzerService; _diagnosticService = (DiagnosticService)diagnosticService; } public void InitializeDiagnosticsServices(Workspace workspace) { _ = ((IIncrementalAnalyzerProvider)_analyzerService).CreateIncrementalAnalyzer(workspace); _diagnosticService.Register((IDiagnosticUpdateSource)_analyzerService); } public static IAnalyzerAssemblyLoader CreateAnalyzerAssemblyLoader() { return new DefaultAnalyzerAssemblyLoader(); } }
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. using System; using System.Composition; using Microsoft.CodeAnalysis.Diagnostics; using Microsoft.CodeAnalysis.Host.Mef; using Microsoft.CodeAnalysis.SolutionCrawler; namespace Microsoft.CodeAnalysis.LanguageServer.ExternalAccess.VSCode.API; [Export(typeof(VSCodeAnalyzerLoader)), Shared] internal class VSCodeAnalyzerLoader { private readonly IDiagnosticAnalyzerService _analyzerService; private readonly DiagnosticService _diagnosticService; private IIncrementalAnalyzer? _incrementalAnalyzer; [ImportingConstructor] [Obsolete(MefConstruction.ImportingConstructorMessage, error: true)] public VSCodeAnalyzerLoader(IDiagnosticAnalyzerService analyzerService, IDiagnosticService diagnosticService) { _analyzerService = analyzerService; _diagnosticService = (DiagnosticService)diagnosticService; } public void InitializeDiagnosticsServices(Workspace workspace) { _incrementalAnalyzer = ((IIncrementalAnalyzerProvider)_analyzerService).CreateIncrementalAnalyzer(workspace); _diagnosticService.Register((IDiagnosticUpdateSource)_analyzerService); } public static IAnalyzerAssemblyLoader CreateAnalyzerAssemblyLoader() { return new DefaultAnalyzerAssemblyLoader(); } }
mit
C#
f6173fe682720c4f1131cd14399e5228850c4be7
Update Assets/MixedRealityToolkit/Definitions/SpatialAwareness/SpatialAwarenessSurfaceTypes.cs
killerantz/HoloToolkit-Unity,killerantz/HoloToolkit-Unity,killerantz/HoloToolkit-Unity,DDReaper/MixedRealityToolkit-Unity,killerantz/HoloToolkit-Unity
Assets/MixedRealityToolkit/Definitions/SpatialAwareness/SpatialAwarenessSurfaceTypes.cs
Assets/MixedRealityToolkit/Definitions/SpatialAwareness/SpatialAwarenessSurfaceTypes.cs
// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See LICENSE in the project root for license information. namespace Microsoft.MixedReality.Toolkit.SpatialAwareness { /// <summary> /// Enumeration defining the types of planar surfaces that are supported by the spatial awareness surface finding subsystem. /// </summary> [System.Flags] public enum SpatialAwarenessSurfaceTypes { /// <summary> /// An unknown / unsupported type of surface. /// </summary> Unknown = 1 << 0, /// <summary> /// The environment’s floor. /// </summary> Floor = 1 << 1, /// <summary> /// The environment’s ceiling. /// </summary> Ceiling = 1 << 2, /// <summary> /// A wall within the user’s space. /// </summary> Wall = 1 << 3, /// <summary> /// A raised, horizontal surface such as a shelf. /// </summary> /// <remarks> /// Platforms, like floors, that can be used for placing objects /// requiring a horizontal surface. /// </remarks> Platform = 1 << 4, /// <summary> /// A surface that isn't a Platform but are known as objects (not unknown) /// </summary> /// <remarks> /// These objects may be windows, monitors, stairs, etc. /// </remarks> Background = 1 << 5, /// <summary> /// A boundless world mesh. /// </summary> World = 1 << 6, /// <summary> /// Objects for which we have no observations /// </summary> CompletelyInferred = 1 << 7 } }
// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See LICENSE in the project root for license information. namespace Microsoft.MixedReality.Toolkit.SpatialAwareness { /// <summary> /// Enumeration defining the types of planar surfaces that are supported by the spatial awareness surface finding subsystem. /// </summary> [System.Flags] public enum SpatialAwarenessSurfaceTypes { /// <summary> /// An unknown / unsupported type of surface. /// </summary> Unknown = 1 << 0, /// <summary> /// The environment’s floor. /// </summary> Floor = 1 << 1, /// <summary> /// The environment’s ceiling. /// </summary> Ceiling = 1 << 2, /// <summary> /// A wall within the user’s space. /// </summary> Wall = 1 << 3, /// <summary> /// A raised, horizontal surface such as a shelf. /// </summary> /// <remarks> /// Platforms, like floors, that can be used for placing objects /// requiring a horizontal surface. /// </remarks> Platform = 1 << 4, /// <summary> /// A surface that isn't a Platform but are known as objects (not unknown) /// </summary> /// <remarks> /// These objets may be windows, monitors, stairs, etc. /// </remarks> Background = 1 << 5, /// <summary> /// A boundless world mesh. /// </summary> World = 1 << 6, /// <summary> /// Objects for which we have no observations /// </summary> CompletelyInferred = 1 << 7 } }
mit
C#
8c4eb9d6a016160d0eaf8c3c6993596952c1a807
fix match team name doesnt display
sgermosen/TorneoPredicciones,sgermosen/TorneoPredicciones,sgermosen/TorneoPredicciones
CompeTournament.Backend/Persistence/Implementations/GroupRepository.cs
CompeTournament.Backend/Persistence/Implementations/GroupRepository.cs
using System.Linq; using System.Threading.Tasks; using CompeTournament.Backend.Data; using CompeTournament.Backend.Data.Entities; using CompeTournament.Backend.Persistence.Contracts; using Microsoft.EntityFrameworkCore; namespace CompeTournament.Backend.Persistence.Implementations { public class GroupRepository : Repository<Group>, IGroupRepository { private readonly ApplicationDbContext _context; //private readonly IUserHelper _userHelper; //public GroupRepository(ApplicationDbContext context, IUserHelper userHelper) : base(context) //{ // _context = context; // _userHelper = userHelper; //} public GroupRepository(ApplicationDbContext context) : base(context) { _context = context; } public IQueryable<Group> GetWithType() { return _context.Groups .Include(p => p.TournamentType) .AsNoTracking(); } public async Task<Group> GetByIdWithChildrens(int key) { var entity = await Context.Groups.Where(p => p.Id == key) .Include(p => p.Leagues) .Include(p => p.Matches).ThenInclude(p => p.Local) .Include(p => p.Matches).ThenInclude(p => p.Visitor) .FirstOrDefaultAsync(); return entity; } } }
using System.Linq; using System.Threading.Tasks; using CompeTournament.Backend.Data; using CompeTournament.Backend.Data.Entities; using CompeTournament.Backend.Persistence.Contracts; using Microsoft.EntityFrameworkCore; namespace CompeTournament.Backend.Persistence.Implementations { public class GroupRepository : Repository<Group>, IGroupRepository { private readonly ApplicationDbContext _context; //private readonly IUserHelper _userHelper; //public GroupRepository(ApplicationDbContext context, IUserHelper userHelper) : base(context) //{ // _context = context; // _userHelper = userHelper; //} public GroupRepository(ApplicationDbContext context) : base(context) { _context = context; } public IQueryable<Group> GetWithType() { return _context.Groups .Include(p => p.TournamentType) .AsNoTracking(); } public async Task<Group> GetByIdWithChildrens(int key) { var entity = await Context.Groups.Where(p => p.Id == key) .Include(p => p.Leagues) .Include(p => p.Matches) .FirstOrDefaultAsync(); return entity; } } }
mit
C#
a0f3f38403ce7b90d294d1b4a397c36b6f144140
Update KeyGenerator.cs
tiesont/machinekey-generator,tiesont/machinekey-generator,tiesont/machinekey-generator
MachineKeyGenerator/MachineKeyGenerator.Web/Components/KeyGenerator.cs
MachineKeyGenerator/MachineKeyGenerator.Web/Components/KeyGenerator.cs
using System; using System.Collections.Generic; using System.Linq; using System.Security.Cryptography; using System.Text; using System.Threading.Tasks; namespace MachineKeyGenerator.Web { public class KeyGenerator { public string GenerateKey(int length, bool useUpperCase = true) { byte[] buffer = new byte[length]; var randomNumberGenerator = new RNGCryptoServiceProvider(); randomNumberGenerator.GetBytes(buffer); return ToHexString(buffer, useUpperCase); } private static string ToHexString(byte[] bytes, bool useUpperCase = false) { var hex = string.Concat(bytes.Select(b => b.ToString(useUpperCase ? "X2" : "x2"))); return hex; } } }
using System; using System.Collections.Generic; using System.Linq; using System.Security.Cryptography; using System.Text; using System.Threading.Tasks; namespace MachineKeyGenerator.Web { public class KeyGenerator { public string GenerateKey(int length, bool useUpperCase = true) { byte[] buffer = new byte[length]; var randomNumberGenerator = new RNGCryptoServiceProvider(); randomNumberGenerator.GetBytes(buffer); return ToHexString(buffer, true); } private static string ToHexString(byte[] bytes, bool useUpperCase = false) { var hex = string.Concat(bytes.Select(b => b.ToString(useUpperCase ? "X2" : "x2"))); return hex; } } }
mit
C#
0478e828ffe4d97fdac85d49fd780104786be229
add WebKit statuses in Atom feed
mayuki/PlatformStatusTracker,mayuki/PlatformStatusTracker,mayuki/PlatformStatusTracker
PlatformStatusTracker/PlatformStatusTracker.Web/Views/Home/Feed.cshtml
PlatformStatusTracker/PlatformStatusTracker.Web/Views/Home/Feed.cshtml
@model PlatformStatusTracker.Web.ViewModels.Home.HomeIndexViewModel @using System.Globalization @using System.Text @using PlatformStatusTracker.Core.Data @using PlatformStatusTracker.Core.Model @using PlatformStatusTracker.Web.ViewModels.Home @{ Layout = null; } @*<?xml version="1.0" encoding="utf-8"?>*@ <feed xmlns="http://www.w3.org/2005/Atom"> <title>Browser Platform Status Tracker</title> <link href="@Url.Action("Index", "Home", new object(), "http")" /> <updated>@Model.LastUpdatedAt.ToString("yyyy-MM-dd'T'HH:mm:ss.fffK", DateTimeFormatInfo.InvariantInfo)</updated> <author> <name>Mayuki Sawatari</name> </author> <id>@Url.Action("Index", "Home", new object(), "http")</id> @foreach (var date in Model.Dates.OrderByDescending(x => x)) { <entry> <title>@date.ToString("yyyy-MM-dd", CultureInfo.GetCultureInfo("en-us"))</title> <link href="@Url.Action("Changes", "Home", new { Date = date.ToString("yyyy-MM-dd") }, "http")" /> <id>@Url.Action("Changes", "Home", new { Date = date.ToString("yyyy-MM-dd") }, "http")</id> <updated>@date.ToString("yyyy-MM-dd'T'HH:mm:ss.fffK", DateTimeFormatInfo.InvariantInfo)</updated> <content type="html"> @Html.Partial("Partial/ChangeSets", new ChangeSetsViewModel { IeChangeSet = Model.IeChangeSetsByDate.ContainsKey(date) ? Model.IeChangeSetsByDate[date] : null, ChromeChangeSet = Model.ChromeChangeSetsByDate.ContainsKey(date) ? Model.ChromeChangeSetsByDate[date] : null, WebKitWebCoreChangeSet = Model.WebKitWebCoreChangeSetsByDate.ContainsKey(date) ? Model.WebKitWebCoreChangeSetsByDate[date] : null, WebKitJavaScriptCoreChangeSet = Model.WebKitJavaScriptCoreChangeSetsByDate.ContainsKey(date) ? Model.WebKitJavaScriptCoreChangeSetsByDate[date] : null, }).ToHtmlString()@* Escaped HTML *@ </content> </entry> } </feed>
@model PlatformStatusTracker.Web.ViewModels.Home.HomeIndexViewModel @using System.Globalization @using System.Text @using PlatformStatusTracker.Core.Data @using PlatformStatusTracker.Core.Model @using PlatformStatusTracker.Web.ViewModels.Home @{ Layout = null; } @*<?xml version="1.0" encoding="utf-8"?>*@ <feed xmlns="http://www.w3.org/2005/Atom"> <title>Browser Platform Status Tracker</title> <link href="@Url.Action("Index", "Home", new object(), "http")" /> <updated>@Model.LastUpdatedAt.ToString("yyyy-MM-dd'T'HH:mm:ss.fffK", DateTimeFormatInfo.InvariantInfo)</updated> <author> <name>Mayuki Sawatari</name> </author> <id>@Url.Action("Index", "Home", new object(), "http")</id> @foreach (var date in Model.Dates.OrderByDescending(x => x)) { <entry> <title>@date.ToString("yyyy-MM-dd", CultureInfo.GetCultureInfo("en-us"))</title> <link href="@Url.Action("Changes", "Home", new { Date = date.ToString("yyyy-MM-dd") }, "http")" /> <id>@Url.Action("Changes", "Home", new { Date = date.ToString("yyyy-MM-dd") }, "http")</id> <updated>@date.ToString("yyyy-MM-dd'T'HH:mm:ss.fffK", DateTimeFormatInfo.InvariantInfo)</updated> <content type="html"> @Html.Partial("Partial/ChangeSets", new ChangeSetsViewModel { IeChangeSet = Model.IeChangeSetsByDate.ContainsKey(date) ? Model.IeChangeSetsByDate[date] : null, ChromeChangeSet = Model.ChromeChangeSetsByDate.ContainsKey(date) ? Model.ChromeChangeSetsByDate[date] : null, }).ToHtmlString()@* Escaped HTML *@ </content> </entry> } </feed>
mit
C#
b86712014151bb78d6e6adfd35b8499d78ff8f83
Add additional hole punch logging
Mako88/dxx-tracker
RebirthTracker/RebirthTracker/PacketHandlers/HolePunchPacketHandler.cs
RebirthTracker/RebirthTracker/PacketHandlers/HolePunchPacketHandler.cs
using Microsoft.EntityFrameworkCore; using System; using System.Linq; using System.Net.Sockets; using System.Threading.Tasks; namespace RebirthTracker.PacketHandlers { /// <summary> /// Request a game host try a hole punch /// </summary> [Opcode(26)] public class HolePunchPacketHandler : IPacketHandler { /// <summary> /// Constructor called through reflection in PacketHandlerFactory /// </summary> public HolePunchPacketHandler() { } /// <summary> /// Handle the packet /// </summary> public async Task Handle(UdpReceiveResult result) { var peer = result.RemoteEndPoint; await Logger.Log("Hole Punch").ConfigureAwait(false); ushort gameID = BitConverter.ToUInt16(result.Buffer, 1); await Logger.Log($"Got Game ID {gameID}").ConfigureAwait(false); Game game; using (var db = new GameContext()) { game = (await db.Games.Where(x => x.ID == gameID).ToListAsync().ConfigureAwait(false)).FirstOrDefault(); } Packet packet; if (game != null) { await Logger.Log("Sending hole punch packet").ConfigureAwait(false); packet = new Packet(26, $"{peer.Address}/{peer.Port}"); await packet.Send(Globals.MainClient, game.Endpoint).ConfigureAwait(false); return; } await Logger.Log("Couldn't fetch game").ConfigureAwait(false); packet = new Packet(27, gameID); await packet.Send(Globals.MainClient, peer).ConfigureAwait(false); } } }
using Microsoft.EntityFrameworkCore; using System; using System.Linq; using System.Net.Sockets; using System.Threading.Tasks; namespace RebirthTracker.PacketHandlers { /// <summary> /// Request a game host try a hole punch /// </summary> [Opcode(26)] public class HolePunchPacketHandler : IPacketHandler { /// <summary> /// Constructor called through reflection in PacketHandlerFactory /// </summary> public HolePunchPacketHandler() { } /// <summary> /// Handle the packet /// </summary> public async Task Handle(UdpReceiveResult result) { var peer = result.RemoteEndPoint; await Logger.Log("Hole Punch").ConfigureAwait(false); ushort gameID = BitConverter.ToUInt16(result.Buffer, 1); await Logger.Log($"Got Game ID {gameID}"); Game game; using (var db = new GameContext()) { game = (await db.Games.Where(x => x.ID == gameID).ToListAsync().ConfigureAwait(false)).FirstOrDefault(); } Packet packet; if (game != null) { packet = new Packet(26, $"{peer.Address}/{peer.Port}"); await packet.Send(Globals.MainClient, game.Endpoint).ConfigureAwait(false); return; } packet = new Packet(27, gameID); await packet.Send(Globals.MainClient, peer).ConfigureAwait(false); } } }
mit
C#
3458f380dcd295ec65b2821adb4292384fa38621
Use var instead.
dlemstra/line-bot-sdk-dotnet,dlemstra/line-bot-sdk-dotnet
src/LineBot/Messages/Template/Actions/Extensions/ITemplateActionExtensions.cs
src/LineBot/Messages/Template/Actions/Extensions/ITemplateActionExtensions.cs
// Copyright 2017-2018 Dirk Lemstra (https://github.com/dlemstra/line-bot-sdk-dotnet) // // Dirk Lemstra licenses this file to you under the Apache License, // version 2.0 (the "License"); you may not use this file except in compliance // with the License. You may obtain a copy of the License at: // // https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, WITHOUT // WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the // License for the specific language governing permissions and limitations // under the License. using System; using System.Collections.Generic; namespace Line { internal static class ITemplateActionExtensions { public static void CheckActionType(this ITemplateAction self) { if (self is PostbackAction) return; if (self is MessageAction) return; if (self is UriAction) return; throw new NotSupportedException($"The template action type is invalid. Supported types are: {nameof(PostbackAction)}, {nameof(MessageAction)} and {nameof(UriAction)}."); } public static void Validate(this IEnumerable<ITemplateAction> self) { foreach (var action in self) { action.Validate(); } } } }
// Copyright 2017-2018 Dirk Lemstra (https://github.com/dlemstra/line-bot-sdk-dotnet) // // Dirk Lemstra licenses this file to you under the Apache License, // version 2.0 (the "License"); you may not use this file except in compliance // with the License. You may obtain a copy of the License at: // // https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, WITHOUT // WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the // License for the specific language governing permissions and limitations // under the License. using System; using System.Collections.Generic; namespace Line { internal static class ITemplateActionExtensions { public static void CheckActionType(this ITemplateAction self) { if (self is PostbackAction) return; if (self is MessageAction) return; if (self is UriAction) return; throw new NotSupportedException($"The template action type is invalid. Supported types are: {nameof(PostbackAction)}, {nameof(MessageAction)} and {nameof(UriAction)}."); } public static void Validate(this IEnumerable<ITemplateAction> self) { foreach (ITemplateAction action in self) { action.Validate(); } } } }
apache-2.0
C#
f7d659bff85b20acbecf72beb6a32d8b3452f682
add tests
juna0613/Autod
tests/AutodTest/AadTest.cs
tests/AutodTest/AadTest.cs
using System; using NUnit.Framework; using Autod.Core; namespace AutodTest { [TestFixture] public class AadTest { [Test] public void AadTest1() { var x0 = new Aad(4.0); var x1 = new Aad(2.0); var y = F(x0, x1); Assert.That(y.Value, Is.EqualTo(66)); Assert.That(y.Derivative(x0), Is.EqualTo(24.5)); Assert.That(y.Derivative(x1), Is.EqualTo(23)); } [Test] public void AadTest2() { var x0 = new Aad(2.0); var x1 = new Aad(3.0); var x2 = new Aad(4.0); var y = Aad.Exp(x0) * x1; Assert.That(y.Value, Is.EqualTo(Math.Exp(2.0) * 3)); Assert.That(y.Derivative(x0), Is.EqualTo(Math.Exp(2.0) * 3)); Assert.That(y.Derivative(x1), Is.EqualTo(Math.Exp(2.0))); Assert.That(y.Derivative(x2), Is.EqualTo(0.0)); } private static Aad F(Aad x0, Aad x1) { return 2.0 * x0 * x0 - 3 * x0 / x1 + 5 * x0 * x1; } } }
using System; using NUnit.Framework; using Autod.Core; namespace AutodTest { [TestFixture] public class AadTest { [Test] public void AadTest1() { var x0 = new Aad(4.0); var x1 = new Aad(2.0); var y = F(x0, x1); Assert.That(y.Value, Is.EqualTo(66)); Assert.That(y.Derivative(x0), Is.EqualTo(24.5)); Assert.That(y.Derivative(x1), Is.EqualTo(23)); } private static Aad F(Aad x0, Aad x1) { return 2.0 * x0 * x0 - 3 * x0 / x1 + 5 * x0 * x1; } } }
mit
C#
2eda23d58b1b6343a62d2cf57932e61be6976c1b
Make sure that authorization of TraktCalendarAllDVDMoviesRequest is not required
henrikfroehling/TraktApiSharp
Source/Tests/TraktApiSharp.Tests/Experimental/Requests/Calendars/TraktCalendarAllDVDMoviesRequestTests.cs
Source/Tests/TraktApiSharp.Tests/Experimental/Requests/Calendars/TraktCalendarAllDVDMoviesRequestTests.cs
namespace TraktApiSharp.Tests.Experimental.Requests.Calendars { using FluentAssertions; using Microsoft.VisualStudio.TestTools.UnitTesting; using TraktApiSharp.Experimental.Requests.Calendars; using TraktApiSharp.Objects.Get.Calendars; using TraktApiSharp.Requests; [TestClass] public class TraktCalendarAllDVDMoviesRequestTests { [TestMethod, TestCategory("Requests"), TestCategory("Calendars"), TestCategory("Without OAuth"), TestCategory("Movies")] public void TestTraktCalendarAllDVDMoviesRequestIsNotAbstract() { typeof(TraktCalendarAllDVDMoviesRequest).IsAbstract.Should().BeFalse(); } [TestMethod, TestCategory("Requests"), TestCategory("Calendars"), TestCategory("Without OAuth"), TestCategory("Movies")] public void TestTraktCalendarAllDVDMoviesRequestIsSealed() { typeof(TraktCalendarAllDVDMoviesRequest).IsSealed.Should().BeTrue(); } [TestMethod, TestCategory("Requests"), TestCategory("Calendars"), TestCategory("Without OAuth"), TestCategory("Movies")] public void TestTraktCalendarAllDVDMoviesRequestIsSubclassOfATraktCalendarAllRequest() { typeof(TraktCalendarAllDVDMoviesRequest).IsSubclassOf(typeof(ATraktCalendarAllRequest<TraktCalendarMovie>)).Should().BeTrue(); } [TestMethod, TestCategory("Requests"), TestCategory("Calendars"), TestCategory("Without OAuth"), TestCategory("Movies")] public void TestTraktCalendarAllDVDMoviesRequestHasAuthorizationNotRequired() { var request = new TraktCalendarAllDVDMoviesRequest(null); request.AuthorizationRequirement.Should().Be(TraktAuthorizationRequirement.NotRequired); } } }
namespace TraktApiSharp.Tests.Experimental.Requests.Calendars { using FluentAssertions; using Microsoft.VisualStudio.TestTools.UnitTesting; using TraktApiSharp.Experimental.Requests.Calendars; using TraktApiSharp.Objects.Get.Calendars; [TestClass] public class TraktCalendarAllDVDMoviesRequestTests { [TestMethod, TestCategory("Requests"), TestCategory("Calendars"), TestCategory("Without OAuth"), TestCategory("Movies")] public void TestTraktCalendarAllDVDMoviesRequestIsNotAbstract() { typeof(TraktCalendarAllDVDMoviesRequest).IsAbstract.Should().BeFalse(); } [TestMethod, TestCategory("Requests"), TestCategory("Calendars"), TestCategory("Without OAuth"), TestCategory("Movies")] public void TestTraktCalendarAllDVDMoviesRequestIsSealed() { typeof(TraktCalendarAllDVDMoviesRequest).IsSealed.Should().BeTrue(); } [TestMethod, TestCategory("Requests"), TestCategory("Calendars"), TestCategory("Without OAuth"), TestCategory("Movies")] public void TestTraktCalendarAllDVDMoviesRequestIsSubclassOfATraktCalendarAllRequest() { typeof(TraktCalendarAllDVDMoviesRequest).IsSubclassOf(typeof(ATraktCalendarAllRequest<TraktCalendarMovie>)).Should().BeTrue(); } } }
mit
C#
68de7526b2f2217eac914745d036fb5de8f120cd
Fix the new project structure where SMO calls are independant of the SqlServer version
Seddryck/NBi,Seddryck/NBi
NBi.Core/Decoration/DataEngineering/Commands/SqlServer/BatchRunnerProvider.cs
NBi.Core/Decoration/DataEngineering/Commands/SqlServer/BatchRunnerProvider.cs
using NBi.Extensibility.Decoration.DataEngineering; using System; using System.Collections.Generic; using System.Data.SqlClient; using System.IO; using System.Linq; using System.Reflection; using System.Text; using System.Threading.Tasks; namespace NBi.Core.Decoration.DataEngineering { class BatchRunnerProvider { public IBatchRunnerFactory Instantiate(string version) { var directory = AssemblyDirectory; var filename = $"NBi.Core.SqlServer.dll"; var filepath = $"{directory}\\{filename}"; if (!File.Exists(filepath)) throw new InvalidOperationException($"Can't find the dll for version '{version}' in '{directory}'. NBi was expecting to find a dll named '{filename}'."); var assembly = Assembly.LoadFrom(filepath); var types = assembly.GetTypes() .Where(m => m.IsClass && m.GetInterface(typeof(IBatchRunnerFactory).Name) != null); if (types.Count() == 0) throw new InvalidOperationException($"Can't find a class implementing '{typeof(IBatchRunnerFactory).Name}' in '{assembly.FullName}'."); if (types.Count() > 1) throw new InvalidOperationException($"Found more than one class implementing '{typeof(IBatchRunnerFactory).Name}' in '{assembly.FullName}'."); return Activator.CreateInstance(types.ElementAt(0)) as IBatchRunnerFactory; } private static string AssemblyDirectory { get { string codeBase = Assembly.GetExecutingAssembly().CodeBase; UriBuilder uri = new UriBuilder(codeBase); string path = Uri.UnescapeDataString(uri.Path); return Path.GetDirectoryName(path); } } } }
using NBi.Extensibility.Decoration.DataEngineering; using System; using System.Collections.Generic; using System.Data.SqlClient; using System.IO; using System.Linq; using System.Reflection; using System.Text; using System.Threading.Tasks; namespace NBi.Core.Decoration.DataEngineering { class BatchRunnerProvider { public IBatchRunnerFactory Instantiate(string version) { var directory = AssemblyDirectory; var filename = $"NBi.Core.{version}.dll"; var filepath = $"{directory}\\{filename}"; if (!File.Exists(filepath)) throw new InvalidOperationException($"Can't find the dll for version '{version}' in '{directory}'. NBi was expecting to find a dll named '{filename}'."); var assembly = Assembly.LoadFrom(filepath); var types = assembly.GetTypes() .Where(m => m.IsClass && m.GetInterface(typeof(IBatchRunnerFactory).Name) != null); if (types.Count() == 0) throw new InvalidOperationException($"Can't find a class implementing '{typeof(IBatchRunnerFactory).Name}' in '{assembly.FullName}'."); if (types.Count() > 1) throw new InvalidOperationException($"Found more than one class implementing '{typeof(IBatchRunnerFactory).Name}' in '{assembly.FullName}'."); return Activator.CreateInstance(types.ElementAt(0)) as IBatchRunnerFactory; } private static string AssemblyDirectory { get { string codeBase = Assembly.GetExecutingAssembly().CodeBase; UriBuilder uri = new UriBuilder(codeBase); string path = Uri.UnescapeDataString(uri.Path); return Path.GetDirectoryName(path); } } } }
apache-2.0
C#
f8b85c57b2c99978a7b5156a0900c96b611c69e8
Update FOAEvents.cs
BarryFogarty/Merchello,Merchello/Merchello.Bazaar,MindfireTechnology/Merchello,BluefinDigital/Merchello,ProNotion/Merchello,Merchello/Merchello,BarryFogarty/Merchello,clausjensen/Merchello,rasmusjp/Merchello,MindfireTechnology/Merchello,ProNotion/Merchello,Merchello/Merchello.Bazaar,BarryFogarty/Merchello,rasmusjp/Merchello,bjarnef/Merchello,Merchello/Merchello,doronuziel71/Merchello,Merchello/Merchello.Bazaar,BluefinDigital/Merchello,ProNotion/Merchello,doronuziel71/Merchello,bjarnef/Merchello,rasmusjp/Merchello,BarryFogarty/Merchello,doronuziel71/Merchello,BluefinDigital/Merchello,clausjensen/Merchello,BluefinDigital/Merchello,clausjensen/Merchello,bjarnef/Merchello,MindfireTechnology/Merchello,Merchello/Merchello
Plugin/Shipping/FreeOverAmount/src/Merchello.Plugin.Shipping.FOA/FOAEvents.cs
Plugin/Shipping/FreeOverAmount/src/Merchello.Plugin.Shipping.FOA/FOAEvents.cs
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Merchello.Core.Models; using Merchello.Core.Services; using Merchello.Plugin.Shipping.FOA.Models; using Newtonsoft.Json; using Umbraco.Core; using Umbraco.Core.Events; using Umbraco.Core.Logging; namespace Merchello.Plugin.Shipping.FOA { public class FOAEvents : ApplicationEventHandler { protected override void ApplicationStarted(UmbracoApplicationBase umbracoApplication, ApplicationContext applicationContext) { base.ApplicationStarted(umbracoApplication, applicationContext); LogHelper.Info<FOAEvents>("Initializing Free Over Amount Shipping provider registration binding events"); GatewayProviderService.Saving += delegate(IGatewayProviderService sender, SaveEventArgs<IGatewayProviderSettings> args) { var key = new Guid("9ACEE07C-94A7-4D28-8193-6BD7D221A902"); var provider = args.SavedEntities.FirstOrDefault(x => key == x.Key && !x.HasIdentity); if (provider == null) return; provider.ExtendedData.SaveProcessorSettings(new FoaProcessorSettings()); }; } } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Merchello.Core.Models; using Merchello.Core.Services; using Merchello.Plugin.Shipping.FOA.Models; using Newtonsoft.Json; using Umbraco.Core; using Umbraco.Core.Events; using Umbraco.Core.Logging; namespace Merchello.Plugin.Shipping.FOA { public class FedExEvents : ApplicationEventHandler { protected override void ApplicationStarted(UmbracoApplicationBase umbracoApplication, ApplicationContext applicationContext) { base.ApplicationStarted(umbracoApplication, applicationContext); LogHelper.Info<FedExEvents>("Initializing Free Over Amount Shipping provider registration binding events"); GatewayProviderService.Saving += delegate(IGatewayProviderService sender, SaveEventArgs<IGatewayProviderSettings> args) { var key = new Guid("9ACEE07C-94A7-4D28-8193-6BD7D221A902"); var provider = args.SavedEntities.FirstOrDefault(x => key == x.Key && !x.HasIdentity); if (provider == null) return; provider.ExtendedData.SaveProcessorSettings(new FoaProcessorSettings()); }; } } }
mit
C#
982843aff56d34f2bfb9f532a9b0465031f4172d
Add user photo to users list
davidebbo/ForumScorer
ForumScorer/Users.cshtml
ForumScorer/Users.cshtml
@using ForumModels; @{ string usersFile = Server.MapPath("~/App_Data/users.json"); var userList = new UserList(usersFile); } <table class="table"> <thead> <tr class="lead"> <th></th> <th></th> <th>Name</th> <th>MSDN Name</th> <th>StackOverflow ID</th> </tr> </thead> @{int count = 0; } @foreach (var user in userList.Users) { count++; <tr class="lead"> <td width="20px">@count</td> <td width="20px"><img src="https://i1.social.s-msft.com/profile/u/avatar.jpg?displayname=@user.MSDNName" /></td> <td>@user.Name</td> <td><a href="https://social.msdn.microsoft.com/Profile/@user.MSDNName/activity">@user.MSDNName</a></td> <td><a href="http://stackoverflow.com/users/@user.StackOverflowID?tab=reputation">@user.StackOverflowID</a></td> </tr> } </table>
@using ForumModels; @{ string usersFile = Server.MapPath("~/App_Data/users.json"); var userList = new UserList(usersFile); } <table class="table"> <thead> <tr class="lead"> <th></th> <th>Name</th> <th>MSDN Name</th> <th>StackOverflow ID</th> </tr> </thead> @{int count = 0; } @foreach (var user in userList.Users) { count++; <tr class="lead"> <td>@count</td> <td>@user.Name</td> <td><a href="https://social.msdn.microsoft.com/Profile/@user.MSDNName/activity">@user.MSDNName</a></td> <td><a href="http://stackoverflow.com/users/@user.StackOverflowID?tab=reputation">@user.StackOverflowID</a></td> </tr> } </table>
apache-2.0
C#
c5c03ef2bc6b20fc717c3e9a5b9ebe0ccdcf00a3
Update connector assembly version
yakumo/BotBuilder,stevengum97/BotBuilder,yakumo/BotBuilder,stevengum97/BotBuilder,stevengum97/BotBuilder,yakumo/BotBuilder,msft-shahins/BotBuilder,msft-shahins/BotBuilder,stevengum97/BotBuilder,msft-shahins/BotBuilder,msft-shahins/BotBuilder,yakumo/BotBuilder
CSharp/Library/Microsoft.Bot.Connector.NetFramework/Properties/AssemblyInfo.cs
CSharp/Library/Microsoft.Bot.Connector.NetFramework/Properties/AssemblyInfo.cs
using System.Reflection; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("Microsoft.Bot.Connector")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Microsoft Corporation")] [assembly: AssemblyProduct("Microsoft Bot Framework")] [assembly: AssemblyCopyright("Copyright © Microsoft Corporation 2016")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("9f1a81ee-c6fe-474e-a3e2-c581435d55bf")] // 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("3.5.3.2")] [assembly: AssemblyFileVersion("3.5.3.2")]
using System.Reflection; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("Microsoft.Bot.Connector")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Microsoft Corporation")] [assembly: AssemblyProduct("Microsoft Bot Framework")] [assembly: AssemblyCopyright("Copyright © Microsoft Corporation 2016")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("9f1a81ee-c6fe-474e-a3e2-c581435d55bf")] // 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("3.5.3.1")] [assembly: AssemblyFileVersion("3.5.3.1")]
mit
C#
1c578f285accf3f17168708ba5c6aa1fd402f6ec
Disable playlist start button when attempts have been exhausted
smoogipoo/osu,ppy/osu,peppy/osu,NeoAdonis/osu,smoogipoo/osu,smoogipooo/osu,smoogipoo/osu,peppy/osu,peppy/osu,NeoAdonis/osu,ppy/osu,ppy/osu,NeoAdonis/osu
osu.Game/Screens/OnlinePlay/Playlists/PlaylistsReadyButton.cs
osu.Game/Screens/OnlinePlay/Playlists/PlaylistsReadyButton.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.Allocation; using osu.Framework.Bindables; using osu.Game.Beatmaps; using osu.Game.Graphics; using osu.Game.Online.Rooms; using osu.Game.Screens.OnlinePlay.Components; namespace osu.Game.Screens.OnlinePlay.Playlists { public class PlaylistsReadyButton : ReadyButton { [Resolved(typeof(Room), nameof(Room.EndDate))] private Bindable<DateTimeOffset?> endDate { get; set; } [Resolved] private IBindable<WorkingBeatmap> gameBeatmap { get; set; } public PlaylistsReadyButton() { Text = "Start"; } [BackgroundDependencyLoader] private void load(OsuColour colours) { BackgroundColour = colours.Green; Triangles.ColourDark = colours.Green; Triangles.ColourLight = colours.GreenLight; } private bool hasRemainingAttempts = true; protected override void LoadComplete() { base.LoadComplete(); userScore.BindValueChanged(aggregate => { if (maxAttempts.Value == null) return; int remaining = maxAttempts.Value.Value - aggregate.NewValue.PlaylistItemAttempts.Sum(a => a.Attempts); hasRemainingAttempts = remaining > 0; }); } protected override void Update() { base.Update(); Enabled.Value = hasRemainingAttempts && enoughTimeLeft; } private bool enoughTimeLeft => // This should probably consider the length of the currently selected item, rather than a constant 30 seconds. endDate.Value != null && DateTimeOffset.UtcNow.AddSeconds(30).AddMilliseconds(gameBeatmap.Value.Track.Length) < endDate.Value; } }
// 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.Allocation; using osu.Framework.Bindables; using osu.Game.Beatmaps; using osu.Game.Graphics; using osu.Game.Online.Rooms; using osu.Game.Screens.OnlinePlay.Components; namespace osu.Game.Screens.OnlinePlay.Playlists { public class PlaylistsReadyButton : ReadyButton { [Resolved(typeof(Room), nameof(Room.EndDate))] private Bindable<DateTimeOffset?> endDate { get; set; } [Resolved] private IBindable<WorkingBeatmap> gameBeatmap { get; set; } public PlaylistsReadyButton() { Text = "Start"; } [BackgroundDependencyLoader] private void load(OsuColour colours) { BackgroundColour = colours.Green; Triangles.ColourDark = colours.Green; Triangles.ColourLight = colours.GreenLight; } protected override void Update() { base.Update(); Enabled.Value = endDate.Value != null && DateTimeOffset.UtcNow.AddSeconds(30).AddMilliseconds(gameBeatmap.Value.Track.Length) < endDate.Value; } } }
mit
C#
955375b99e3d61afbd392caafc93fce34c7b584e
Update ApplyChangesOperation doc comments
FICTURE7/roslyn,mavasani/roslyn,Maxwe11/roslyn,vslsnap/roslyn,bkoelman/roslyn,tannergooding/roslyn,khellang/roslyn,davkean/roslyn,jhendrixMSFT/roslyn,genlu/roslyn,mattscheffer/roslyn,dpen2000/roslyn,heejaechang/roslyn,droyad/roslyn,physhi/roslyn,jeremymeng/roslyn,AdamSpeight2008/roslyn-AdamSpeight2008,budcribar/roslyn,supriyantomaftuh/roslyn,brettfo/roslyn,ljw1004/roslyn,russpowers/roslyn,jeffanders/roslyn,BugraC/roslyn,OmniSharp/roslyn,furesoft/roslyn,kelltrick/roslyn,DinoV/roslyn,enginekit/roslyn,vcsjones/roslyn,hanu412/roslyn,DinoV/roslyn,weltkante/roslyn,zooba/roslyn,mseamari/Stuff,pdelvo/roslyn,Pvlerick/roslyn,AmadeusW/roslyn,BugraC/roslyn,mgoertz-msft/roslyn,AlexisArce/roslyn,khellang/roslyn,reaction1989/roslyn,oocx/roslyn,jonatassaraiva/roslyn,AlekseyTs/roslyn,MattWindsor91/roslyn,jasonmalinowski/roslyn,stebet/roslyn,lorcanmooney/roslyn,orthoxerox/roslyn,swaroop-sridhar/roslyn,ValentinRueda/roslyn,jkotas/roslyn,ahmedshuhel/roslyn,natgla/roslyn,KashishArora/Roslyn,EricArndt/roslyn,OmarTawfik/roslyn,KevinRansom/roslyn,dpoeschl/roslyn,pjmagee/roslyn,michalhosala/roslyn,ljw1004/roslyn,jamesqo/roslyn,moozzyk/roslyn,jcouv/roslyn,huoxudong125/roslyn,jhendrixMSFT/roslyn,KamalRathnayake/roslyn,CaptainHayashi/roslyn,VitalyTVA/roslyn,MichalStrehovsky/roslyn,a-ctor/roslyn,mattwar/roslyn,jhendrixMSFT/roslyn,grianggrai/roslyn,REALTOBIZ/roslyn,mirhagk/roslyn,jroggeman/roslyn,Maxwe11/roslyn,srivatsn/roslyn,chenxizhang/roslyn,shyamnamboodiripad/roslyn,SeriaWei/roslyn,mseamari/Stuff,antonssonj/roslyn,KiloBravoLima/roslyn,GuilhermeSa/roslyn,FICTURE7/roslyn,vslsnap/roslyn,JakeGinnivan/roslyn,DustinCampbell/roslyn,tannergooding/roslyn,doconnell565/roslyn,vcsjones/roslyn,HellBrick/roslyn,KiloBravoLima/roslyn,AlexisArce/roslyn,mattwar/roslyn,weltkante/roslyn,panopticoncentral/roslyn,ilyes14/roslyn,jaredpar/roslyn,MichalStrehovsky/roslyn,drognanar/roslyn,stjeong/roslyn,mmitche/roslyn,shyamnamboodiripad/roslyn,paulvanbrenk/roslyn,jmarolf/roslyn,ilyes14/roslyn,Inverness/roslyn,magicbing/roslyn,jeffanders/roslyn,evilc0des/roslyn,zmaruo/roslyn,dovzhikova/roslyn,cybernet14/roslyn,davkean/roslyn,Giftednewt/roslyn,a-ctor/roslyn,enginekit/roslyn,KiloBravoLima/roslyn,sharwell/roslyn,thomaslevesque/roslyn,gafter/roslyn,KirillOsenkov/roslyn,ericfe-ms/roslyn,ValentinRueda/roslyn,CyrusNajmabadi/roslyn,aelij/roslyn,OmniSharp/roslyn,GuilhermeSa/roslyn,robinsedlaczek/roslyn,kienct89/roslyn,mseamari/Stuff,furesoft/roslyn,sharwell/roslyn,nemec/roslyn,TyOverby/roslyn,stjeong/roslyn,drognanar/roslyn,lisong521/roslyn,nagyistoce/roslyn,sharadagrawal/TestProject2,krishnarajbb/roslyn,3F/roslyn,tang7526/roslyn,natidea/roslyn,MatthieuMEZIL/roslyn,dsplaisted/roslyn,dovzhikova/roslyn,moozzyk/roslyn,stebet/roslyn,cston/roslyn,kuhlenh/roslyn,panopticoncentral/roslyn,Pvlerick/roslyn,wvdd007/roslyn,jbhensley/roslyn,Shiney/roslyn,huoxudong125/roslyn,mattscheffer/roslyn,Giftednewt/roslyn,agocke/roslyn,nagyistoce/roslyn,physhi/roslyn,swaroop-sridhar/roslyn,managed-commons/roslyn,Giten2004/roslyn,bbarry/roslyn,reaction1989/roslyn,paladique/roslyn,KashishArora/Roslyn,Giten2004/roslyn,krishnarajbb/roslyn,robinsedlaczek/roslyn,RipCurrent/roslyn,oocx/roslyn,hanu412/roslyn,khyperia/roslyn,brettfo/roslyn,supriyantomaftuh/roslyn,davkean/roslyn,kienct89/roslyn,wvdd007/roslyn,tannergooding/roslyn,yjfxfjch/roslyn,marksantos/roslyn,tsdl2013/roslyn,rchande/roslyn,magicbing/roslyn,dsplaisted/roslyn,JakeGinnivan/roslyn,jcouv/roslyn,MavenRain/roslyn,DanielRosenwasser/roslyn,weltkante/roslyn,DustinCampbell/roslyn,paulvanbrenk/roslyn,MichalStrehovsky/roslyn,Inverness/roslyn,AlekseyTs/roslyn,kuhlenh/roslyn,xasx/roslyn,lorcanmooney/roslyn,eriawan/roslyn,poizan42/roslyn,Giftednewt/roslyn,OmarTawfik/roslyn,garryforreg/roslyn,CaptainHayashi/roslyn,AlekseyTs/roslyn,gafter/roslyn,paladique/roslyn,yjfxfjch/roslyn,michalhosala/roslyn,bbarry/roslyn,furesoft/roslyn,REALTOBIZ/roslyn,xoofx/roslyn,tang7526/roslyn,BugraC/roslyn,mirhagk/roslyn,thomaslevesque/roslyn,stjeong/roslyn,stebet/roslyn,budcribar/roslyn,MihaMarkic/roslyn-prank,tvand7093/roslyn,srivatsn/roslyn,jaredpar/roslyn,devharis/roslyn,VShangxiao/roslyn,jroggeman/roslyn,jonatassaraiva/roslyn,CaptainHayashi/roslyn,dsplaisted/roslyn,dpoeschl/roslyn,akrisiun/roslyn,rchande/roslyn,v-codeel/roslyn,jkotas/roslyn,rgani/roslyn,khyperia/roslyn,russpowers/roslyn,natgla/roslyn,chenxizhang/roslyn,doconnell565/roslyn,AArnott/roslyn,AdamSpeight2008/roslyn-AdamSpeight2008,VitalyTVA/roslyn,TyOverby/roslyn,CyrusNajmabadi/roslyn,a-ctor/roslyn,doconnell565/roslyn,abock/roslyn,evilc0des/roslyn,ericfe-ms/roslyn,drognanar/roslyn,basoundr/roslyn,antiufo/roslyn,jeffanders/roslyn,mattwar/roslyn,bkoelman/roslyn,VSadov/roslyn,yjfxfjch/roslyn,DustinCampbell/roslyn,rgani/roslyn,pjmagee/roslyn,antiufo/roslyn,bbarry/roslyn,taylorjonl/roslyn,xasx/roslyn,AArnott/roslyn,cybernet14/roslyn,CyrusNajmabadi/roslyn,TyOverby/roslyn,jbhensley/roslyn,jasonmalinowski/roslyn,Hosch250/roslyn,KevinRansom/roslyn,OmniSharp/roslyn,natidea/roslyn,pdelvo/roslyn,mattscheffer/roslyn,aelij/roslyn,jroggeman/roslyn,jrharmon/roslyn,jasonmalinowski/roslyn,yeaicc/roslyn,panopticoncentral/roslyn,GuilhermeSa/roslyn,KamalRathnayake/roslyn,tsdl2013/roslyn,lisong521/roslyn,balajikris/roslyn,devharis/roslyn,MatthieuMEZIL/roslyn,KevinRansom/roslyn,jcouv/roslyn,tmat/roslyn,abock/roslyn,wvdd007/roslyn,KevinH-MS/roslyn,KevinH-MS/roslyn,basoundr/roslyn,YOTOV-LIMITED/roslyn,marksantos/roslyn,michalhosala/roslyn,VSadov/roslyn,cston/roslyn,danielcweber/roslyn,amcasey/roslyn,VPashkov/roslyn,tmeschter/roslyn,kelltrick/roslyn,sharadagrawal/TestProject2,genlu/roslyn,devharis/roslyn,huoxudong125/roslyn,AdamSpeight2008/roslyn-AdamSpeight2008,MattWindsor91/roslyn,droyad/roslyn,heejaechang/roslyn,AArnott/roslyn,jrharmon/roslyn,KevinH-MS/roslyn,eriawan/roslyn,zmaruo/roslyn,mgoertz-msft/roslyn,jeremymeng/roslyn,zooba/roslyn,sharadagrawal/Roslyn,taylorjonl/roslyn,rchande/roslyn,jmarolf/roslyn,SeriaWei/roslyn,vcsjones/roslyn,zooba/roslyn,AlexisArce/roslyn,ljw1004/roslyn,EricArndt/roslyn,antonssonj/roslyn,dotnet/roslyn,managed-commons/roslyn,nguerrera/roslyn,dotnet/roslyn,YOTOV-LIMITED/roslyn,gafter/roslyn,dpen2000/roslyn,OmarTawfik/roslyn,AmadeusW/roslyn,reaction1989/roslyn,jaredpar/roslyn,bartdesmet/roslyn,evilc0des/roslyn,akrisiun/roslyn,xoofx/roslyn,mavasani/roslyn,jonatassaraiva/roslyn,natgla/roslyn,MavenRain/roslyn,abock/roslyn,VShangxiao/roslyn,KirillOsenkov/roslyn,pdelvo/roslyn,basoundr/roslyn,FICTURE7/roslyn,poizan42/roslyn,dpoeschl/roslyn,lorcanmooney/roslyn,tmeschter/roslyn,sharwell/roslyn,amcasey/roslyn,ilyes14/roslyn,HellBrick/roslyn,jbhensley/roslyn,v-codeel/roslyn,lisong521/roslyn,moozzyk/roslyn,jkotas/roslyn,marksantos/roslyn,eriawan/roslyn,ErikSchierboom/roslyn,swaroop-sridhar/roslyn,antiufo/roslyn,MihaMarkic/roslyn-prank,jrharmon/roslyn,AnthonyDGreen/roslyn,ValentinRueda/roslyn,oberxon/roslyn,sharadagrawal/TestProject2,russpowers/roslyn,Hosch250/roslyn,RipCurrent/roslyn,cston/roslyn,nagyistoce/roslyn,bartdesmet/roslyn,kienct89/roslyn,ahmedshuhel/roslyn,YOTOV-LIMITED/roslyn,oberxon/roslyn,aanshibudhiraja/Roslyn,nemec/roslyn,VShangxiao/roslyn,KamalRathnayake/roslyn,MavenRain/roslyn,xasx/roslyn,Inverness/roslyn,thomaslevesque/roslyn,VPashkov/roslyn,jmarolf/roslyn,xoofx/roslyn,REALTOBIZ/roslyn,robinsedlaczek/roslyn,yeaicc/roslyn,EricArndt/roslyn,mavasani/roslyn,chenxizhang/roslyn,stephentoub/roslyn,orthoxerox/roslyn,VSadov/roslyn,shyamnamboodiripad/roslyn,Shiney/roslyn,enginekit/roslyn,KashishArora/Roslyn,khyperia/roslyn,grianggrai/roslyn,tvand7093/roslyn,heejaechang/roslyn,aanshibudhiraja/Roslyn,stephentoub/roslyn,amcasey/roslyn,mgoertz-msft/roslyn,tmat/roslyn,ahmedshuhel/roslyn,balajikris/roslyn,oocx/roslyn,paladique/roslyn,rgani/roslyn,MattWindsor91/roslyn,ErikSchierboom/roslyn,Shiney/roslyn,khellang/roslyn,tmat/roslyn,aanshibudhiraja/Roslyn,mirhagk/roslyn,brettfo/roslyn,RipCurrent/roslyn,garryforreg/roslyn,HellBrick/roslyn,paulvanbrenk/roslyn,dotnet/roslyn,srivatsn/roslyn,vslsnap/roslyn,KirillOsenkov/roslyn,Pvlerick/roslyn,physhi/roslyn,VitalyTVA/roslyn,pjmagee/roslyn,leppie/roslyn,3F/roslyn,MihaMarkic/roslyn-prank,sharadagrawal/Roslyn,krishnarajbb/roslyn,oberxon/roslyn,diryboy/roslyn,supriyantomaftuh/roslyn,dpen2000/roslyn,JakeGinnivan/roslyn,v-codeel/roslyn,DinoV/roslyn,stephentoub/roslyn,natidea/roslyn,grianggrai/roslyn,danielcweber/roslyn,agocke/roslyn,taylorjonl/roslyn,MatthieuMEZIL/roslyn,3F/roslyn,MattWindsor91/roslyn,tmeschter/roslyn,droyad/roslyn,tvand7093/roslyn,jamesqo/roslyn,danielcweber/roslyn,DanielRosenwasser/roslyn,jamesqo/roslyn,hanu412/roslyn,antonssonj/roslyn,AnthonyDGreen/roslyn,jeremymeng/roslyn,sharadagrawal/Roslyn,bartdesmet/roslyn,Giten2004/roslyn,mmitche/roslyn,poizan42/roslyn,genlu/roslyn,DanielRosenwasser/roslyn,agocke/roslyn,dovzhikova/roslyn,mmitche/roslyn,AnthonyDGreen/roslyn,diryboy/roslyn,tang7526/roslyn,magicbing/roslyn,AmadeusW/roslyn,nguerrera/roslyn,tsdl2013/roslyn,Hosch250/roslyn,VPashkov/roslyn,Maxwe11/roslyn,ericfe-ms/roslyn,cybernet14/roslyn,garryforreg/roslyn,orthoxerox/roslyn,diryboy/roslyn,nguerrera/roslyn,managed-commons/roslyn,yeaicc/roslyn,leppie/roslyn,akrisiun/roslyn,SeriaWei/roslyn,aelij/roslyn,leppie/roslyn,nemec/roslyn,bkoelman/roslyn,kuhlenh/roslyn,balajikris/roslyn,budcribar/roslyn,ErikSchierboom/roslyn,zmaruo/roslyn,kelltrick/roslyn
src/Workspaces/Core/Portable/CodeActions/Operations/ApplyChangesOperation.cs
src/Workspaces/Core/Portable/CodeActions/Operations/ApplyChangesOperation.cs
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; using System.Threading; using System.Threading.Tasks; namespace Microsoft.CodeAnalysis.CodeActions { /// <summary> /// A <see cref="CodeActionOperation"/> for applying solution changes to a workspace. /// <see cref="CodeAction.GetOperationsAsync(CancellationToken)"/> may return at most one /// <see cref="ApplyChangesOperation"/>. Hosts may provide custom handling for /// <see cref="ApplyChangesOperation"/>s, but if a <see cref="CodeAction"/> requires custom /// host behavior not supported by a single <see cref="ApplyChangesOperation"/>, then instead: /// <list type="bullet"> /// <description><text>Implement a custom <see cref="CodeAction"/> and <see cref="CodeActionOperation"/>s</text></description> /// <description><text>Do not return any <see cref="ApplyChangesOperation"/> from <see cref="CodeAction.GetOperationsAsync(CancellationToken)"/></text></description> /// <description><text>Directly apply any workspace edits</text></description> /// <description><text>Handle any custom host behavior</text></description> /// <description><text>Produce a preview for <see cref="CodeAction.GetPreviewOperationsAsync(CancellationToken)"/> /// by creating a custom <see cref="PreviewOperation"/> or returning a single <see cref="ApplyChangesOperation"/> /// to use the built-in preview mechanism</text></description> /// </list> /// </summary> public sealed class ApplyChangesOperation : CodeActionOperation { private readonly Solution _changedSolution; public ApplyChangesOperation(Solution changedSolution) { if (changedSolution == null) { throw new ArgumentNullException("changedSolution"); } _changedSolution = changedSolution; } public Solution ChangedSolution { get { return _changedSolution; } } public override void Apply(Workspace workspace, CancellationToken cancellationToken) { workspace.TryApplyChanges(_changedSolution); } } }
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; using System.Threading; using System.Threading.Tasks; namespace Microsoft.CodeAnalysis.CodeActions { /// <summary> /// A <see cref="CodeActionOperation"/> for applying solution changes to a workspace. /// </summary> public sealed class ApplyChangesOperation : CodeActionOperation { private readonly Solution _changedSolution; public ApplyChangesOperation(Solution changedSolution) { if (changedSolution == null) { throw new ArgumentNullException("changedSolution"); } _changedSolution = changedSolution; } public Solution ChangedSolution { get { return _changedSolution; } } public override void Apply(Workspace workspace, CancellationToken cancellationToken) { workspace.TryApplyChanges(_changedSolution); } } }
mit
C#
1f7270482ce3fe7d69389c3de1ba4cd80ed3157f
Annotate return value for consumers
smoogipooo/osu-framework,ppy/osu-framework,smoogipooo/osu-framework,peppy/osu-framework,peppy/osu-framework,peppy/osu-framework,ppy/osu-framework,ppy/osu-framework
osu.Framework/Extensions/ObjectExtensions/ObjectExtensions.cs
osu.Framework/Extensions/ObjectExtensions/ObjectExtensions.cs
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. #nullable enable using System.Diagnostics; using System.Diagnostics.CodeAnalysis; namespace osu.Framework.Extensions.ObjectExtensions { /// <summary> /// Extensions that apply to all objects. /// </summary> public static class ObjectExtensions { /// <summary> /// Coerces a nullable object as non-nullable. This is an alternative to the C# 8 null-forgiving operator "<c>!</c>". /// </summary> /// <remarks> /// This should only be used when an assertion or other handling is not a reasonable alternative. /// </remarks> /// <param name="obj">The nullable object.</param> /// <typeparam name="T">The type of the object.</typeparam> /// <returns>The non-nullable object corresponding to <paramref name="obj"/>.</returns> public static T AsNonNull<T>(this T? obj) where T : class { Debug.Assert(obj != null); return obj; } /// <summary> /// If the given object is null. /// </summary> public static bool IsNull<T>([NotNullWhen(false)] this T obj) => ReferenceEquals(obj, null); /// <summary> /// <c>true</c> if the given object is not null, <c>false</c> otherwise. /// </summary> public static bool IsNotNull<T>([NotNullWhen(true)] this T obj) => !ReferenceEquals(obj, null); } }
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. #nullable enable using System.Diagnostics; namespace osu.Framework.Extensions.ObjectExtensions { /// <summary> /// Extensions that apply to all objects. /// </summary> public static class ObjectExtensions { /// <summary> /// Coerces a nullable object as non-nullable. This is an alternative to the C# 8 null-forgiving operator "<c>!</c>". /// </summary> /// <remarks> /// This should only be used when an assertion or other handling is not a reasonable alternative. /// </remarks> /// <param name="obj">The nullable object.</param> /// <typeparam name="T">The type of the object.</typeparam> /// <returns>The non-nullable object corresponding to <paramref name="obj"/>.</returns> public static T AsNonNull<T>(this T? obj) where T : class { Debug.Assert(obj != null); return obj; } /// <summary> /// If the given object is null. /// </summary> public static bool IsNull<T>(this T obj) => ReferenceEquals(obj, null); /// <summary> /// <c>true</c> if the given object is not null, <c>false</c> otherwise. /// </summary> public static bool IsNotNull<T>(this T obj) => !ReferenceEquals(obj, null); } }
mit
C#
ae07df0dea08463297b215e1ac2a3b2138d15dfb
Fix for Unload/Reload project bug - https://github.com/ppittle/pMixins/issues/11
ppittle/pMixins,ppittle/pMixins,ppittle/pMixins
CopaceticSoftware.CodeGenerator.StarterKit/Infrastructure/VisualStudioSolution/MicrosoftBuildProjectLoader.cs
CopaceticSoftware.CodeGenerator.StarterKit/Infrastructure/VisualStudioSolution/MicrosoftBuildProjectLoader.cs
//----------------------------------------------------------------------- // <copyright file="MicrosoftBuildProjectLoader.cs" company="Copacetic Software"> // Copyright (c) Copacetic Software. // <author>Philip Pittle</author> // <date>Tuesday, May 6, 2014 9:01:51 PM</date> // Licensed under the Apache License, Version 2.0, // you may not use this file except in compliance with this License. // // You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an 'AS IS' BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // </copyright> //----------------------------------------------------------------------- using System; using System.Linq; using System.Reflection; using CopaceticSoftware.CodeGenerator.StarterKit.Extensions; using log4net; using Microsoft.Build.Evaluation; using Project = Microsoft.Build.Evaluation.Project; namespace CopaceticSoftware.CodeGenerator.StarterKit.Infrastructure.VisualStudioSolution { public interface IMicrosoftBuildProjectLoader { Project LoadMicrosoftBuildProject(string projectFileName); } public class MicrosoftBuildProjectLoader : IMicrosoftBuildProjectLoader { private static readonly ILog _log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); private static readonly object _lock = new object(); public MicrosoftBuildProjectLoader(IVisualStudioEventProxy visualStudioEventProxy) { //Make sure there aren't any latent project references visualStudioEventProxy.OnProjectRemoved += (sender, args) => RemoveAllReferencesToProject(args.ProjectFullPath); } private void RemoveAllReferencesToProject(string projectFileName) { lock (_lock) try { _log.InfoFormat("OnProjectAdded: Clear ProjectCollection for [{0}]", projectFileName); ProjectCollection.GlobalProjectCollection.GetLoadedProjects(projectFileName) .Map(p => ProjectCollection.GlobalProjectCollection.UnloadProject(p)); } catch (Exception e) { _log.Error(string.Format("Exception trying to unload Project [{0}] : {1}", projectFileName, e.Message)); } } public Project LoadMicrosoftBuildProject(string projectFileName) { lock (_lock) { var loadedProjects = ProjectCollection.GlobalProjectCollection.GetLoadedProjects(projectFileName) //Create a copy incase the collection is modified externally during iteration .ToArray(); return loadedProjects.Any() ? loadedProjects.First() : new Project(projectFileName); } } } }
//----------------------------------------------------------------------- // <copyright file="MicrosoftBuildProjectLoader.cs" company="Copacetic Software"> // Copyright (c) Copacetic Software. // <author>Philip Pittle</author> // <date>Tuesday, May 6, 2014 9:01:51 PM</date> // Licensed under the Apache License, Version 2.0, // you may not use this file except in compliance with this License. // // You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an 'AS IS' BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // </copyright> //----------------------------------------------------------------------- using System; using System.Linq; using System.Reflection; using CopaceticSoftware.CodeGenerator.StarterKit.Extensions; using log4net; using Microsoft.Build.Evaluation; using Project = Microsoft.Build.Evaluation.Project; namespace CopaceticSoftware.CodeGenerator.StarterKit.Infrastructure.VisualStudioSolution { public interface IMicrosoftBuildProjectLoader { Project LoadMicrosoftBuildProject(string projectFileName); } public class MicrosoftBuildProjectLoader : IMicrosoftBuildProjectLoader { private static readonly ILog _log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); private static readonly object _lock = new object(); public Project LoadMicrosoftBuildProject(string projectFileName) { lock (_lock) { var loadedProjects = ProjectCollection.GlobalProjectCollection.GetLoadedProjects(projectFileName) //Create a copy incase the collection is modified externally during iteration .ToArray(); return loadedProjects.Any() ? loadedProjects.First() : new Project(projectFileName); } } } }
apache-2.0
C#
3bd840bda4d273f2910e6ce18a000cbe731c0682
test second 'good' commit'
MatthewKapteyn/SubmoduleTest
SubmoduleTest/Program.cs
SubmoduleTest/Program.cs
using System; //using Huawei_Unlock; namespace SubmoduleTest { class Program { static void Main(string[] args) { Console.WriteLine("Hello World!"); //Test.HW_ALGO_SELECTOR("This_is_a_15_digit_imei_jk"); Console.WriteLine("Made second change to SubmoduleTest"); Console.WriteLine("Made third change to SubmoduleTest"); // I've got a lovely bunch of cocnuts - we don't want this line - its terrible - but we don't know that yet // oh boy, what now? i really like this commit, it looks amazeballs // what grant chance, this one is even better than the last - oops, i have premonition of DOOOM } } }
using System; //using Huawei_Unlock; namespace SubmoduleTest { class Program { static void Main(string[] args) { Console.WriteLine("Hello World!"); //Test.HW_ALGO_SELECTOR("This_is_a_15_digit_imei_jk"); Console.WriteLine("Made second change to SubmoduleTest"); Console.WriteLine("Made third change to SubmoduleTest"); // I've got a lovely bunch of cocnuts - we don't want this line - its terrible - but we don't know that yet // oh boy, what now? i really like this commit, it looks amazeballs } } }
unlicense
C#
e8f41eb800a3435d785a1b3b5d7472b00b142230
remove wrong Obsolete attribute
SorenZ/Alamut.DotNet
src/Alamut.Helpers/Attribute/Helper.cs
src/Alamut.Helpers/Attribute/Helper.cs
using System; using System.Collections.Generic; using System.ComponentModel; using System.Linq; using System.Reflection; namespace Alamut.Helpers.Attribute { public static class Helper { /// <summary> /// gets display properties by property name /// </summary> /// <param name="properties"></param> /// <param name="type"></param> /// <returns></returns> public static Dictionary<string, string> GetDisplayNameByProperties(IEnumerable<string> properties, Type type) { return type.GetMembers() .Where(q => q.GetCustomAttributes(typeof(DisplayNameAttribute), true).Any()) .Join(properties, info => info.Name, s => s, (info, s) => new { Property = s, DisplayName = GetAttribute<DisplayNameAttribute>(info).DisplayName }) .ToDictionary(x => x.Property, x => x.DisplayName); } /// <summary> /// recommended for getting custom attribute in invocation /// </summary> /// <typeparam name="T">attribute</typeparam> /// <param name="memberInfo"></param> /// <returns>attribute information if exist, otherwise null.</returns> /// <see cref="http://stackoverflow.com/questions/2536675/access-custom-attribute-on-method-from-castle-windsor-interceptor"/> public static T GetAttribute<T>(MemberInfo memberInfo) where T : class { return memberInfo.GetCustomAttribute(typeof(T), true) as T; } [Obsolete("use EnumExtensions.GetAttribute instead")] public static T GetAttribute<T>(System.Enum enumValue) where T : System.Attribute { var memberInfo = enumValue.GetType() .GetMember(enumValue.ToString()) .FirstOrDefault(); var attribute = (T) memberInfo? .GetCustomAttributes(typeof(T), false) .FirstOrDefault(); return attribute; } } }
using System; using System.Collections.Generic; using System.ComponentModel; using System.Linq; using System.Reflection; namespace Alamut.Helpers.Attribute { public static class Helper { /// <summary> /// gets display properties by property name /// </summary> /// <param name="properties"></param> /// <param name="type"></param> /// <returns></returns> public static Dictionary<string, string> GetDisplayNameByProperties(IEnumerable<string> properties, Type type) { return type.GetMembers() .Where(q => q.GetCustomAttributes(typeof(DisplayNameAttribute), true).Any()) .Join(properties, info => info.Name, s => s, (info, s) => new { Property = s, DisplayName = GetAttribute<DisplayNameAttribute>(info).DisplayName }) .ToDictionary(x => x.Property, x => x.DisplayName); } /// <summary> /// recommended for getting custom attribute in invocation /// </summary> /// <typeparam name="T">attribute</typeparam> /// <param name="memberInfo"></param> /// <returns>attribute information if exist, otherwise null.</returns> /// <see cref="http://stackoverflow.com/questions/2536675/access-custom-attribute-on-method-from-castle-windsor-interceptor"/> [Obsolete("use EnumExtensions.GetAttribute instead")] public static T GetAttribute<T>(MemberInfo memberInfo) where T : class { return memberInfo.GetCustomAttribute(typeof(T), true) as T; } [Obsolete("use EnumExtensions.GetAttribute instead")] public static T GetAttribute<T>(System.Enum enumValue) where T : System.Attribute { var memberInfo = enumValue.GetType() .GetMember(enumValue.ToString()) .FirstOrDefault(); var attribute = (T) memberInfo? .GetCustomAttributes(typeof(T), false) .FirstOrDefault(); return attribute; } } }
mit
C#
42e49ef4bcb15989258cac2b09440ce2226f220d
correct comment
cbovar/ConvNetSharp
src/ConvNetSharp.Flow/Ops/LeakyRelu.cs
src/ConvNetSharp.Flow/Ops/LeakyRelu.cs
using System; using System.Collections.Generic; using ConvNetSharp.Volume; namespace ConvNetSharp.Flow.Ops { /// <summary> /// Implements LeakyReLU nonlinearity elementwise /// x -> x > 0, x, otherwise alpha * x /// </summary> /// <typeparam name="T"></typeparam> public class LeakyRelu<T> : Op<T> where T : struct, IEquatable<T>, IFormattable { public LeakyRelu(ConvNetSharp<T> graph, Dictionary<string, object> data) : base(graph) { this.Alpha = (T) Convert.ChangeType(data["Alpha"], typeof(T)); } public LeakyRelu(ConvNetSharp<T> graph, Op<T> x, T alpha) : base(graph) { this.Alpha = alpha; AddParent(x); } public T Alpha { get; set; } public override string Representation => "LeakyRelu"; public override void Differentiate() { var x = this.Parents[0]; x.RegisterDerivate(this.Graph.LeakyReluGradient(this, this.Derivate, this.Alpha)); } public override Volume<T> Evaluate(Session<T> session) { if (!this.IsDirty) { return this.Result; } this.IsDirty = false; var x = this.Parents[0].Evaluate(session); if (this.Result == null || !Equals(this.Result.Shape, x.Shape)) { this.Result?.Dispose(); this.Result = BuilderInstance<T>.Volume.SameAs(x.Shape); } x.DoLeakyRelu(this.Result, this.Alpha); return this.Result; } public override Dictionary<string, object> GetData() { var data = base.GetData(); data["Alpha"] = this.Alpha; return data; } public override string ToString() { return $"LeakyRelu({this.Parents[0]})"; } } }
using System; using System.Collections.Generic; using ConvNetSharp.Volume; namespace ConvNetSharp.Flow.Ops { /// <summary> /// Implements LeakyReLU nonlinearity elementwise /// x -> x > 0, x, otherwise 0.01x /// </summary> /// <typeparam name="T"></typeparam> public class LeakyRelu<T> : Op<T> where T : struct, IEquatable<T>, IFormattable { public LeakyRelu(ConvNetSharp<T> graph, Dictionary<string, object> data) : base(graph) { this.Alpha = (T) Convert.ChangeType(data["Alpha"], typeof(T)); } public LeakyRelu(ConvNetSharp<T> graph, Op<T> x, T alpha) : base(graph) { this.Alpha = alpha; AddParent(x); } public T Alpha { get; set; } public override string Representation => "LeakyRelu"; public override void Differentiate() { var x = this.Parents[0]; x.RegisterDerivate(this.Graph.LeakyReluGradient(this, this.Derivate, this.Alpha)); } public override Volume<T> Evaluate(Session<T> session) { if (!this.IsDirty) { return this.Result; } this.IsDirty = false; var x = this.Parents[0].Evaluate(session); if (this.Result == null || !Equals(this.Result.Shape, x.Shape)) { this.Result?.Dispose(); this.Result = BuilderInstance<T>.Volume.SameAs(x.Shape); } x.DoLeakyRelu(this.Result, this.Alpha); return this.Result; } public override Dictionary<string, object> GetData() { var data = base.GetData(); data["Alpha"] = this.Alpha; return data; } public override string ToString() { return $"LeakyRelu({this.Parents[0]})"; } } }
mit
C#
e655c3a5f1c5c643773fab9f775483d82db3a872
Add `void ExecuteWithin(Action action)` method to `UIComponentScopeCache`
YevgeniyShunevych/Atata,YevgeniyShunevych/Atata,atata-framework/atata,atata-framework/atata
src/Atata/Components/UIComponentScopeCache.cs
src/Atata/Components/UIComponentScopeCache.cs
using System; using System.Collections.Generic; using OpenQA.Selenium; namespace Atata { internal class UIComponentScopeCache { private readonly Dictionary<UIComponent, Dictionary<Visibility, IWebElement>> _accessChainItems = new Dictionary<UIComponent, Dictionary<Visibility, IWebElement>>(); public bool IsAccessChainActive { get; private set; } public bool TryGet(UIComponent component, Visibility visibility, out IWebElement scope) { scope = null; return _accessChainItems.TryGetValue(component, out Dictionary<Visibility, IWebElement> visibiltyElementMap) && visibiltyElementMap.TryGetValue(visibility, out scope); } public bool AcquireActivationOfAccessChain() { if (IsAccessChainActive) return false; IsAccessChainActive = true; return true; } public void AddToAccessChain(UIComponent component, Visibility visibility, IWebElement scope) { if (IsAccessChainActive) { if (!_accessChainItems.TryGetValue(component, out Dictionary<Visibility, IWebElement> visibiltyElementMap)) { visibiltyElementMap = new Dictionary<Visibility, IWebElement>(); _accessChainItems.Add(component, visibiltyElementMap); } visibiltyElementMap[visibility] = scope; } } public void ReleaseAccessChain() { _accessChainItems.Clear(); IsAccessChainActive = false; } public void Clear() { ReleaseAccessChain(); } public void ExecuteWithin(Action action) { action.CheckNotNull(nameof(action)); bool isActivatedAccessChainCache = AcquireActivationOfAccessChain(); if (isActivatedAccessChainCache) { try { action.Invoke(); } finally { ReleaseAccessChain(); } } else { action.Invoke(); } } } }
using System.Collections.Generic; using OpenQA.Selenium; namespace Atata { internal class UIComponentScopeCache { private readonly Dictionary<UIComponent, Dictionary<Visibility, IWebElement>> _accessChainItems = new Dictionary<UIComponent, Dictionary<Visibility, IWebElement>>(); public bool IsAccessChainActive { get; private set; } public bool TryGet(UIComponent component, Visibility visibility, out IWebElement scope) { scope = null; return _accessChainItems.TryGetValue(component, out Dictionary<Visibility, IWebElement> visibiltyElementMap) && visibiltyElementMap.TryGetValue(visibility, out scope); } public bool AcquireActivationOfAccessChain() { if (IsAccessChainActive) return false; IsAccessChainActive = true; return true; } public void AddToAccessChain(UIComponent component, Visibility visibility, IWebElement scope) { if (IsAccessChainActive) { if (!_accessChainItems.TryGetValue(component, out Dictionary<Visibility, IWebElement> visibiltyElementMap)) { visibiltyElementMap = new Dictionary<Visibility, IWebElement>(); _accessChainItems.Add(component, visibiltyElementMap); } visibiltyElementMap[visibility] = scope; } } public void ReleaseAccessChain() { _accessChainItems.Clear(); IsAccessChainActive = false; } public void Clear() { ReleaseAccessChain(); } } }
apache-2.0
C#
f2426448c1c890e922287a177c7e898c2d0bf8b2
Remove unused DependentProperties property
Krusen/ErgastApi.Net
src/ErgastApi/Client/UrlSegmentInfo.cs
src/ErgastApi/Client/UrlSegmentInfo.cs
using System; using System.Collections.Generic; namespace ErgastApi.Client { public class UrlSegmentInfo : IComparable<UrlSegmentInfo> { public int? Order { get; set; } public string Name { get; set; } public string Value { get; set; } public bool IsTerminator { get; set; } public int CompareTo(UrlSegmentInfo other) { if (ReferenceEquals(this, other)) return 0; if (ReferenceEquals(null, other)) return 1; var comparisons = new Func<UrlSegmentInfo, int>[] { CompareTerminator, CompareOrder, CompareName }; foreach (var compareTo in comparisons) { var value = compareTo(other); if (value != 0) return value; } return 0; } private int CompareTerminator(UrlSegmentInfo other) { if (IsTerminator) return 1; if (other.IsTerminator) return -1; return 0; } private int CompareOrder(UrlSegmentInfo other) { if (Order == null) return 1; if (other.Order == null) return -1; return Order.Value.CompareTo(other.Order.Value); } private int CompareName(UrlSegmentInfo other) { return string.Compare(Name, other.Name, StringComparison.OrdinalIgnoreCase); } } }
using System; using System.Collections.Generic; namespace ErgastApi.Client { public class UrlSegmentInfo : IComparable<UrlSegmentInfo> { public int? Order { get; set; } public string Name { get; set; } public string Value { get; set; } public bool IsTerminator { get; set; } public IEnumerable<string> DependentPropertyNames { get; set; } = new List<string>(); public int CompareTo(UrlSegmentInfo other) { if (ReferenceEquals(this, other)) return 0; if (ReferenceEquals(null, other)) return 1; var comparisons = new Func<UrlSegmentInfo, int>[] { CompareTerminator, CompareOrder, CompareName }; foreach (var compareTo in comparisons) { var value = compareTo(other); if (value != 0) return value; } return 0; } private int CompareTerminator(UrlSegmentInfo other) { if (IsTerminator) return 1; if (other.IsTerminator) return -1; return 0; } private int CompareOrder(UrlSegmentInfo other) { if (Order == null) return 1; if (other.Order == null) return -1; return Order.Value.CompareTo(other.Order.Value); } private int CompareName(UrlSegmentInfo other) { return string.Compare(Name, other.Name, StringComparison.OrdinalIgnoreCase); } } }
unlicense
C#
7696643b3ed53b0de0a5d3a372e7ad02b69547ee
Update JimBennett.cs
MabroukENG/planetxamarin,stvansolano/planetxamarin,planetxamarin/planetxamarin,planetxamarin/planetxamarin,beraybentesen/planetxamarin,MabroukENG/planetxamarin,planetxamarin/planetxamarin,planetxamarin/planetxamarin,beraybentesen/planetxamarin,MabroukENG/planetxamarin,stvansolano/planetxamarin,stvansolano/planetxamarin,beraybentesen/planetxamarin
src/Firehose.Web/Authors/JimBennett.cs
src/Firehose.Web/Authors/JimBennett.cs
using System; using System.Collections.Generic; using Firehose.Web.Infrastructure; namespace Firehose.Web.Authors { public class JimBennett : IAmAMicrosoftMVP, IAmAXamarinMVP { public string FirstName => "Jim"; public string LastName => "Bennett"; public string Title => "published author and software engineer at EROAD"; public string StateOrRegion => "Auckland, New Zealand"; public string EmailAddress => "jim@jimbobbennett.io"; public string TwitterHandle => "jimbobbennett"; public Uri WebSite => new Uri("https://jimbobbennett.io/"); public IEnumerable<Uri> FeedUris { get { yield return new Uri("https://www.jimbobbennett.io/rss"); } } DateTime IAmAXamarinMVP.FirstAwarded => new DateTime(2016, 1, 1); DateTime IAmAMicrosoftMVP.FirstAwarded => new DateTime(2017, 1, 1); public string GravatarHash => ""; } }
using System; using System.Collections.Generic; using Firehose.Web.Infrastructure; namespace Firehose.Web.Authors { public class JimBennett : IAmAMicrosoftMVP, IAmAXamarinMVP { public string FirstName => "Jim"; public string LastName => "Bennett"; public string Title => "Mobile developer at EROAD"; public string StateOrRegion => "Auckland, New Zealand"; public string EmailAddress => "jim@jimbobbennett.io"; public string TwitterHandle => "jimbobbennett"; public Uri WebSite => new Uri("https://jimbobbennett.io/"); public IEnumerable<Uri> FeedUris { get { yield return new Uri("https://www.jimbobbennett.io/rss"); } } DateTime IAmAXamarinMVP.FirstAwarded => new DateTime(2016, 1, 1); DateTime IAmAMicrosoftMVP.FirstAwarded => new DateTime(2017, 1, 1); public string GravatarHash => ""; } }
mit
C#
5dd8dac192054ab39d7561f7d8223619ad531f1a
Correct error message for missing test connection string
mysticmind/marten,ericgreenmix/marten,JasperFx/Marten,ericgreenmix/marten,jokokko/marten,jokokko/marten,mdissel/Marten,ericgreenmix/marten,mysticmind/marten,jokokko/marten,JasperFx/Marten,jokokko/marten,mdissel/Marten,jokokko/marten,JasperFx/Marten,ericgreenmix/marten,mysticmind/marten,mysticmind/marten
src/Marten.Testing/ConnectionSource.cs
src/Marten.Testing/ConnectionSource.cs
using System; namespace Marten.Testing { public class ConnectionSource : ConnectionFactory { public static readonly string ConnectionString = Environment.GetEnvironmentVariable("marten_testing_database"); static ConnectionSource() { if (ConnectionString.IsEmpty()) throw new Exception( "You need to set the connection string for your local Postgresql database in the environment variable 'marten_testing_database'"); } public ConnectionSource() : base(ConnectionString) { } } }
using System; using Baseline; namespace Marten.Testing { public class ConnectionSource : ConnectionFactory { public static readonly string ConnectionString = Environment.GetEnvironmentVariable("marten_testing_database"); static ConnectionSource() { if (ConnectionString.IsEmpty()) throw new Exception( "You need to set the connection string for your local Postgresql database in the environment variable 'marten-testing-database'"); } public ConnectionSource() : base(ConnectionString) { } } }
mit
C#
1a420a4108577165c3953da796a4cc6612a799aa
Define type interface for IGraph
DasAllFolks/SharpGraphs
Graph/IGraph.cs
Graph/IGraph.cs
using System; namespace Graph { public interface IGraph<E, V> : IEquatable<IGraph<E, V>> where E: IEdge<V> { } }
namespace Graph { public interface IGraph<T> { } }
apache-2.0
C#
e16121cc8472b8bdc3d975305f42df6c8cba0390
Add XML comments
YevgeniyShunevych/Atata,YevgeniyShunevych/Atata,atata-framework/atata,atata-framework/atata
src/Atata/Attributes/Triggers/VerifyTitleSettingsAttribute.cs
src/Atata/Attributes/Triggers/VerifyTitleSettingsAttribute.cs
using System; namespace Atata { /// <summary> /// Defines the settings to apply for the <see cref="VerifyTitleAttribute"/> trigger. /// </summary> [AttributeUsage(AttributeTargets.Assembly)] public class VerifyTitleSettingsAttribute : TermSettingsAttribute { public VerifyTitleSettingsAttribute(TermCase termCase = TermCase.Inherit) : base(termCase) { } public VerifyTitleSettingsAttribute(TermMatch match, TermCase termCase = TermCase.Inherit) : base(match, termCase) { } } }
using System; namespace Atata { [AttributeUsage(AttributeTargets.Assembly)] public class VerifyTitleSettingsAttribute : TermSettingsAttribute { public VerifyTitleSettingsAttribute(TermCase termCase = TermCase.Inherit) : base(termCase) { } public VerifyTitleSettingsAttribute(TermMatch match, TermCase termCase = TermCase.Inherit) : base(match, termCase) { } } }
apache-2.0
C#
5f44fa77bae42b3c84506a9a6ab20455da708ae9
Add JsonIgnore to MonitorState ISessionControllers
tgstation/tgstation-server,tgstation/tgstation-server-tools,tgstation/tgstation-server,Cyberboss/tgstation-server,Cyberboss/tgstation-server
src/Tgstation.Server.Host/Components/Watchdog/MonitorState.cs
src/Tgstation.Server.Host/Components/Watchdog/MonitorState.cs
using Newtonsoft.Json; namespace Tgstation.Server.Host.Components.Watchdog { /// <summary> /// The (absolute) state of the <see cref="Watchdog"/> /// </summary> sealed class MonitorState { /// <summary> /// If the inactive server is being rebooted /// </summary> public bool RebootingInactiveServer { get; set; } /// <summary> /// If the inactive server has a .dmb and needs to be swapped in /// </summary> public bool InactiveServerHasStagedDmb { get; set; } /// <summary> /// If the inactive server is in an unrecoverable state /// </summary> public bool InactiveServerCritFail { get; set; } /// <summary> /// The next <see cref="MonitorAction"/> to take in <see cref="Watchdog.MonitorLifetimes(System.Threading.CancellationToken)"/> /// </summary> public MonitorAction NextAction { get; set; } /// <summary> /// The active <see cref="ISessionController"/> /// </summary> [JsonIgnore] public ISessionController ActiveServer { get; set; } /// <summary> /// The inactive <see cref="ISessionController"/> /// </summary> [JsonIgnore] public ISessionController InactiveServer { get; set; } } }
namespace Tgstation.Server.Host.Components.Watchdog { sealed class MonitorState { public bool RebootingInactiveServer { get; set; } public bool InactiveServerHasStagedDmb { get; set; } public bool InactiveServerCritFail { get; set; } public MonitorAction NextAction { get; set; } public ISessionController ActiveServer { get; set; } public ISessionController InactiveServer { get; set; } } }
agpl-3.0
C#
b624d87a59b028c8682523aeabfd03a0b82c011b
make sure related links datatype value type is set to JSON
qizhiyu/Umbraco-CMS,Scott-Herbert/Umbraco-CMS,umbraco/Umbraco-CMS,kasperhhk/Umbraco-CMS,gavinfaux/Umbraco-CMS,WebCentrum/Umbraco-CMS,JeffreyPerplex/Umbraco-CMS,rasmusfjord/Umbraco-CMS,rajendra1809/Umbraco-CMS,kgiszewski/Umbraco-CMS,Spijkerboer/Umbraco-CMS,engern/Umbraco-CMS,robertjf/Umbraco-CMS,Phosworks/Umbraco-CMS,m0wo/Umbraco-CMS,kasperhhk/Umbraco-CMS,Spijkerboer/Umbraco-CMS,Phosworks/Umbraco-CMS,arknu/Umbraco-CMS,christopherbauer/Umbraco-CMS,tcmorris/Umbraco-CMS,abjerner/Umbraco-CMS,nvisage-gf/Umbraco-CMS,neilgaietto/Umbraco-CMS,romanlytvyn/Umbraco-CMS,umbraco/Umbraco-CMS,lingxyd/Umbraco-CMS,corsjune/Umbraco-CMS,ordepdev/Umbraco-CMS,dawoe/Umbraco-CMS,rasmusfjord/Umbraco-CMS,Door3Dev/HRI-Umbraco,sargin48/Umbraco-CMS,Pyuuma/Umbraco-CMS,mstodd/Umbraco-CMS,markoliver288/Umbraco-CMS,DaveGreasley/Umbraco-CMS,Nicholas-Westby/Umbraco-CMS,lars-erik/Umbraco-CMS,markoliver288/Umbraco-CMS,TimoPerplex/Umbraco-CMS,Phosworks/Umbraco-CMS,kgiszewski/Umbraco-CMS,rasmuseeg/Umbraco-CMS,gkonings/Umbraco-CMS,marcemarc/Umbraco-CMS,ordepdev/Umbraco-CMS,Tronhus/Umbraco-CMS,marcemarc/Umbraco-CMS,AzarinSergey/Umbraco-CMS,base33/Umbraco-CMS,Pyuuma/Umbraco-CMS,Tronhus/Umbraco-CMS,romanlytvyn/Umbraco-CMS,sargin48/Umbraco-CMS,PeteDuncanson/Umbraco-CMS,madsoulswe/Umbraco-CMS,bjarnef/Umbraco-CMS,zidad/Umbraco-CMS,JimBobSquarePants/Umbraco-CMS,countrywide/Umbraco-CMS,TimoPerplex/Umbraco-CMS,sargin48/Umbraco-CMS,timothyleerussell/Umbraco-CMS,m0wo/Umbraco-CMS,VDBBjorn/Umbraco-CMS,umbraco/Umbraco-CMS,DaveGreasley/Umbraco-CMS,neilgaietto/Umbraco-CMS,countrywide/Umbraco-CMS,engern/Umbraco-CMS,countrywide/Umbraco-CMS,YsqEvilmax/Umbraco-CMS,gregoriusxu/Umbraco-CMS,yannisgu/Umbraco-CMS,NikRimington/Umbraco-CMS,dawoe/Umbraco-CMS,lars-erik/Umbraco-CMS,mittonp/Umbraco-CMS,countrywide/Umbraco-CMS,tompipe/Umbraco-CMS,mstodd/Umbraco-CMS,WebCentrum/Umbraco-CMS,tcmorris/Umbraco-CMS,rasmusfjord/Umbraco-CMS,lars-erik/Umbraco-CMS,romanlytvyn/Umbraco-CMS,mittonp/Umbraco-CMS,mstodd/Umbraco-CMS,zidad/Umbraco-CMS,abryukhov/Umbraco-CMS,KevinJump/Umbraco-CMS,rajendra1809/Umbraco-CMS,christopherbauer/Umbraco-CMS,Khamull/Umbraco-CMS,Khamull/Umbraco-CMS,gregoriusxu/Umbraco-CMS,arvaris/HRI-Umbraco,abjerner/Umbraco-CMS,nul800sebastiaan/Umbraco-CMS,mattbrailsford/Umbraco-CMS,kasperhhk/Umbraco-CMS,KevinJump/Umbraco-CMS,leekelleher/Umbraco-CMS,Phosworks/Umbraco-CMS,nvisage-gf/Umbraco-CMS,timothyleerussell/Umbraco-CMS,VDBBjorn/Umbraco-CMS,countrywide/Umbraco-CMS,aadfPT/Umbraco-CMS,JimBobSquarePants/Umbraco-CMS,yannisgu/Umbraco-CMS,ehornbostel/Umbraco-CMS,sargin48/Umbraco-CMS,mittonp/Umbraco-CMS,AzarinSergey/Umbraco-CMS,aadfPT/Umbraco-CMS,gkonings/Umbraco-CMS,gavinfaux/Umbraco-CMS,YsqEvilmax/Umbraco-CMS,abryukhov/Umbraco-CMS,yannisgu/Umbraco-CMS,marcemarc/Umbraco-CMS,rasmuseeg/Umbraco-CMS,gavinfaux/Umbraco-CMS,yannisgu/Umbraco-CMS,Door3Dev/HRI-Umbraco,tompipe/Umbraco-CMS,DaveGreasley/Umbraco-CMS,rustyswayne/Umbraco-CMS,tcmorris/Umbraco-CMS,JimBobSquarePants/Umbraco-CMS,Khamull/Umbraco-CMS,bjarnef/Umbraco-CMS,rustyswayne/Umbraco-CMS,rasmusfjord/Umbraco-CMS,Spijkerboer/Umbraco-CMS,Tronhus/Umbraco-CMS,mittonp/Umbraco-CMS,DaveGreasley/Umbraco-CMS,KevinJump/Umbraco-CMS,KevinJump/Umbraco-CMS,ehornbostel/Umbraco-CMS,umbraco/Umbraco-CMS,rasmuseeg/Umbraco-CMS,zidad/Umbraco-CMS,lingxyd/Umbraco-CMS,nul800sebastiaan/Umbraco-CMS,Nicholas-Westby/Umbraco-CMS,AzarinSergey/Umbraco-CMS,gregoriusxu/Umbraco-CMS,gkonings/Umbraco-CMS,Door3Dev/HRI-Umbraco,kgiszewski/Umbraco-CMS,leekelleher/Umbraco-CMS,timothyleerussell/Umbraco-CMS,arvaris/HRI-Umbraco,sargin48/Umbraco-CMS,bjarnef/Umbraco-CMS,JimBobSquarePants/Umbraco-CMS,dawoe/Umbraco-CMS,Khamull/Umbraco-CMS,aaronpowell/Umbraco-CMS,lingxyd/Umbraco-CMS,Khamull/Umbraco-CMS,lingxyd/Umbraco-CMS,mstodd/Umbraco-CMS,jchurchley/Umbraco-CMS,madsoulswe/Umbraco-CMS,qizhiyu/Umbraco-CMS,nvisage-gf/Umbraco-CMS,arknu/Umbraco-CMS,marcemarc/Umbraco-CMS,nvisage-gf/Umbraco-CMS,mattbrailsford/Umbraco-CMS,lingxyd/Umbraco-CMS,TimoPerplex/Umbraco-CMS,TimoPerplex/Umbraco-CMS,rustyswayne/Umbraco-CMS,WebCentrum/Umbraco-CMS,Pyuuma/Umbraco-CMS,iahdevelop/Umbraco-CMS,dawoe/Umbraco-CMS,qizhiyu/Umbraco-CMS,nul800sebastiaan/Umbraco-CMS,rajendra1809/Umbraco-CMS,arvaris/HRI-Umbraco,ordepdev/Umbraco-CMS,markoliver288/Umbraco-CMS,Door3Dev/HRI-Umbraco,hfloyd/Umbraco-CMS,ehornbostel/Umbraco-CMS,AzarinSergey/Umbraco-CMS,corsjune/Umbraco-CMS,qizhiyu/Umbraco-CMS,romanlytvyn/Umbraco-CMS,lars-erik/Umbraco-CMS,Nicholas-Westby/Umbraco-CMS,christopherbauer/Umbraco-CMS,timothyleerussell/Umbraco-CMS,ehornbostel/Umbraco-CMS,aadfPT/Umbraco-CMS,aaronpowell/Umbraco-CMS,DaveGreasley/Umbraco-CMS,rajendra1809/Umbraco-CMS,neilgaietto/Umbraco-CMS,AzarinSergey/Umbraco-CMS,rasmusfjord/Umbraco-CMS,iahdevelop/Umbraco-CMS,mittonp/Umbraco-CMS,abryukhov/Umbraco-CMS,neilgaietto/Umbraco-CMS,robertjf/Umbraco-CMS,corsjune/Umbraco-CMS,VDBBjorn/Umbraco-CMS,rajendra1809/Umbraco-CMS,ehornbostel/Umbraco-CMS,YsqEvilmax/Umbraco-CMS,m0wo/Umbraco-CMS,christopherbauer/Umbraco-CMS,NikRimington/Umbraco-CMS,bjarnef/Umbraco-CMS,Scott-Herbert/Umbraco-CMS,JimBobSquarePants/Umbraco-CMS,leekelleher/Umbraco-CMS,Pyuuma/Umbraco-CMS,NikRimington/Umbraco-CMS,nvisage-gf/Umbraco-CMS,jchurchley/Umbraco-CMS,hfloyd/Umbraco-CMS,yannisgu/Umbraco-CMS,engern/Umbraco-CMS,Tronhus/Umbraco-CMS,ordepdev/Umbraco-CMS,Scott-Herbert/Umbraco-CMS,VDBBjorn/Umbraco-CMS,gregoriusxu/Umbraco-CMS,Nicholas-Westby/Umbraco-CMS,abjerner/Umbraco-CMS,kasperhhk/Umbraco-CMS,KevinJump/Umbraco-CMS,tcmorris/Umbraco-CMS,gavinfaux/Umbraco-CMS,madsoulswe/Umbraco-CMS,gregoriusxu/Umbraco-CMS,neilgaietto/Umbraco-CMS,romanlytvyn/Umbraco-CMS,corsjune/Umbraco-CMS,Scott-Herbert/Umbraco-CMS,iahdevelop/Umbraco-CMS,leekelleher/Umbraco-CMS,arvaris/HRI-Umbraco,YsqEvilmax/Umbraco-CMS,Scott-Herbert/Umbraco-CMS,zidad/Umbraco-CMS,Nicholas-Westby/Umbraco-CMS,tcmorris/Umbraco-CMS,marcemarc/Umbraco-CMS,base33/Umbraco-CMS,mattbrailsford/Umbraco-CMS,markoliver288/Umbraco-CMS,robertjf/Umbraco-CMS,lars-erik/Umbraco-CMS,markoliver288/Umbraco-CMS,robertjf/Umbraco-CMS,abjerner/Umbraco-CMS,engern/Umbraco-CMS,arknu/Umbraco-CMS,leekelleher/Umbraco-CMS,Door3Dev/HRI-Umbraco,Spijkerboer/Umbraco-CMS,gkonings/Umbraco-CMS,christopherbauer/Umbraco-CMS,rustyswayne/Umbraco-CMS,ordepdev/Umbraco-CMS,PeteDuncanson/Umbraco-CMS,Spijkerboer/Umbraco-CMS,timothyleerussell/Umbraco-CMS,robertjf/Umbraco-CMS,rustyswayne/Umbraco-CMS,qizhiyu/Umbraco-CMS,zidad/Umbraco-CMS,markoliver288/Umbraco-CMS,arknu/Umbraco-CMS,PeteDuncanson/Umbraco-CMS,JeffreyPerplex/Umbraco-CMS,gavinfaux/Umbraco-CMS,Phosworks/Umbraco-CMS,iahdevelop/Umbraco-CMS,VDBBjorn/Umbraco-CMS,m0wo/Umbraco-CMS,tcmorris/Umbraco-CMS,mattbrailsford/Umbraco-CMS,hfloyd/Umbraco-CMS,TimoPerplex/Umbraco-CMS,corsjune/Umbraco-CMS,base33/Umbraco-CMS,abryukhov/Umbraco-CMS,m0wo/Umbraco-CMS,gkonings/Umbraco-CMS,iahdevelop/Umbraco-CMS,Tronhus/Umbraco-CMS,dawoe/Umbraco-CMS,engern/Umbraco-CMS,mstodd/Umbraco-CMS,Pyuuma/Umbraco-CMS,JeffreyPerplex/Umbraco-CMS,kasperhhk/Umbraco-CMS,hfloyd/Umbraco-CMS,hfloyd/Umbraco-CMS,tompipe/Umbraco-CMS,YsqEvilmax/Umbraco-CMS,jchurchley/Umbraco-CMS,aaronpowell/Umbraco-CMS
src/Umbraco.Web/PropertyEditors/RelatedLinksPropertyEditor.cs
src/Umbraco.Web/PropertyEditors/RelatedLinksPropertyEditor.cs
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Umbraco.Core; using Umbraco.Core.PropertyEditors; namespace Umbraco.Web.PropertyEditors { [PropertyEditor(Constants.PropertyEditors.RelatedLinksAlias, "Related links", "relatedlinks", ValueType ="JSON")] public class RelatedLinksPropertyEditor : PropertyEditor { } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Umbraco.Core; using Umbraco.Core.PropertyEditors; namespace Umbraco.Web.PropertyEditors { [PropertyEditor(Constants.PropertyEditors.RelatedLinksAlias, "Related links", "relatedlinks")] public class RelatedLinksPropertyEditor : PropertyEditor { } }
mit
C#
acb9871c43ac63685cbadeb96b051b25a0e65424
Fix DTE.ItemOperations.Navigate
mrward/monodevelop-nuget-extensions,mrward/monodevelop-nuget-extensions
src/MonoDevelop.PackageManagement.Extensions/MonoDevelop.PackageManagement.EnvDTE/ItemOperationsMessageHandler.cs
src/MonoDevelop.PackageManagement.Extensions/MonoDevelop.PackageManagement.EnvDTE/ItemOperationsMessageHandler.cs
// // ItemOperationsMessageHandler.cs // // Author: // Matt Ward <matt.ward@microsoft.com> // // Copyright (c) 2019 Microsoft // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; using MonoDevelop.Core; using MonoDevelop.Ide; using MonoDevelop.PackageManagement.PowerShell.Protocol; using Newtonsoft.Json.Linq; using StreamJsonRpc; namespace MonoDevelop.PackageManagement.EnvDTE { class ItemOperationsMessageHandler { [JsonRpcMethod (Methods.ItemOperationsNavigateName)] public void OnNavigate (JToken arg) { try { var navigateMessage = arg.ToObject<ItemOperationsNavigateParams> (); DesktopService.ShowUrl (navigateMessage.Url); } catch (Exception ex) { LoggingService.LogError ("OnNavigate error: {0}", ex); } } [JsonRpcMethod (Methods.ItemOperationsOpenFileName)] public void OnOpenFile (JToken arg) { try { var message = arg.ToObject<ItemOperationsOpenFileParams> (); Runtime.RunInMainThread (() => { OpenFile (new FilePath (message.FileName)); }).Ignore (); } catch (Exception ex) { LoggingService.LogError ("OnNavigate error: {0}", ex); } } void OpenFile (FilePath filePath) { IdeApp.Workbench.OpenDocument (filePath, null, true).Ignore (); } } }
// // ItemOperationsMessageHandler.cs // // Author: // Matt Ward <matt.ward@microsoft.com> // // Copyright (c) 2019 Microsoft // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; using MonoDevelop.Core; using MonoDevelop.Ide; using MonoDevelop.PackageManagement.PowerShell.Protocol; using Newtonsoft.Json.Linq; using StreamJsonRpc; namespace MonoDevelop.PackageManagement.EnvDTE { class ItemOperationsMessageHandler { [JsonRpcMethod (Methods.ItemOperationsNavigateName)] public void OnNavigate (JToken arg) { try { var navigateMessage = arg.ToObject<ItemOperationsNavigateParams> (); DesktopService.OpenFile (navigateMessage.Url); } catch (Exception ex) { LoggingService.LogError ("OnNavigate error: {0}", ex); } } [JsonRpcMethod (Methods.ItemOperationsOpenFileName)] public void OnOpenFile (JToken arg) { try { var message = arg.ToObject<ItemOperationsOpenFileParams> (); Runtime.RunInMainThread (() => { OpenFile (new FilePath (message.FileName)); }).Ignore (); } catch (Exception ex) { LoggingService.LogError ("OnNavigate error: {0}", ex); } } void OpenFile (FilePath filePath) { IdeApp.Workbench.OpenDocument (filePath, null, true).Ignore (); } } }
mit
C#
eb99b387495856b7f618c6d757b0a09ac6c94b1a
Fix - Corretto nome variabile
vvfosprojects/sovvf,vvfosprojects/sovvf,vvfosprojects/sovvf,vvfosprojects/sovvf,vvfosprojects/sovvf
src/backend/SO115App.FakePersistance.ExternalAPI/Servizi/DistaccamentoUtentiComuni/GetDistaccamentoByCodiceSede.cs
src/backend/SO115App.FakePersistance.ExternalAPI/Servizi/DistaccamentoUtentiComuni/GetDistaccamentoByCodiceSede.cs
using Microsoft.Extensions.Configuration; using Newtonsoft.Json; using SO115App.API.Models.Classi.Condivise; using SO115App.ExternalAPI.Fake.Classi.DistaccamentiUtenteComune; using SO115App.ExternalAPI.Fake.Classi.Utility; using SO115App.Models.Classi.Condivise; using SO115App.Models.Servizi.Infrastruttura.SistemiEsterni.Distaccamenti; using SO115App.Models.Servizi.Infrastruttura.SistemiEsterni.IdentityManagement; using System; using System.Net.Http; using System.Threading.Tasks; namespace SO115App.ExternalAPI.Fake.Servizi.DistaccamentoUtentiComuni { /// <summary> /// la classe che recupera il distaccamento dal servizio Utente Comune /// </summary> public class GetDistaccamentoByCodiceSede : IGetDistaccamentoByCodiceSedeUC, IGetDistaccamentoByCodiceSede { private readonly HttpClient _client; private readonly IConfiguration _configuration; private readonly MapDistaccamentoSuDistaccamentoUC _mapper; /// <summary> /// il costruttore della classe /// </summary> /// <param name="client"></param> /// <param name="configuration"></param> public GetDistaccamentoByCodiceSede(HttpClient client, IConfiguration configuration, MapDistaccamentoSuDistaccamentoUC mapper) { _client = client; _configuration = configuration; _mapper = mapper; } /// <summary> /// metodo della classe che restituisce un Distaccamento /// </summary> /// <param name="codiceSede"></param> /// <returns>un task contenente il distaccamento</returns> public async Task<Distaccamento> Get(string codiceSede) { _client.DefaultRequestHeaders.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("test"); var response = await _client.GetAsync($"{_configuration.GetSection("UrlExternalApi").GetSection("InfoSedeApiUtenteComune").Value}/GetInfoSede?codSede={codiceSede}").ConfigureAwait(false); response.EnsureSuccessStatusCode(); using HttpContent content = response.Content; string data = await content.ReadAsStringAsync().ConfigureAwait(false); var distaccametoUC = JsonConvert.DeserializeObject<DistaccamentoUC>(data); return _mapper.Map(distaccametoUC); } Sede IGetDistaccamentoByCodiceSede.Get(string codiceSede) { throw new NotImplementedException(); } } }
using Microsoft.Extensions.Configuration; using Newtonsoft.Json; using SO115App.API.Models.Classi.Condivise; using SO115App.ExternalAPI.Fake.Classi.DistaccamentiUtenteComune; using SO115App.ExternalAPI.Fake.Classi.Utility; using SO115App.Models.Classi.Condivise; using SO115App.Models.Servizi.Infrastruttura.SistemiEsterni.Distaccamenti; using SO115App.Models.Servizi.Infrastruttura.SistemiEsterni.IdentityManagement; using System; using System.Net.Http; using System.Threading.Tasks; namespace SO115App.ExternalAPI.Fake.Servizi.DistaccamentoUtentiComuni { /// <summary> /// la classe che recupera il distaccamento dal servizio Utente Comune /// </summary> public class GetDistaccamentoByCodiceSede : IGetDistaccamentoByCodiceSedeUC, IGetDistaccamentoByCodiceSede { private readonly HttpClient _client; private readonly IConfiguration _configuration; private readonly MapDistaccamentoSuDistaccamentoUC _mapper; /// <summary> /// il costruttore della classe /// </summary> /// <param name="client"></param> /// <param name="configuration"></param> public GetDistaccamentoByCodiceSede(HttpClient client, IConfiguration configuration, MapDistaccamentoSuDistaccamentoUC mapper) { _client = client; _configuration = configuration; _mapper = mapper; } /// <summary> /// metodo della classe che restituisce un Distaccamento /// </summary> /// <param name="codiceSede"></param> /// <returns>un task contenente il distaccamento</returns> public async Task<Distaccamento> Get(string codiceSede) { _client.DefaultRequestHeaders.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("test"); var response = await _client.GetAsync($"{_configuration.GetSection("UrlExternalApi").GetSection("InfoSedeApiUtenteComune").Value}/GetInfoSede?codSede={codiceSede}").ConfigureAwait(false); response.EnsureSuccessStatusCode(); using HttpContent content = response.Content; string data = await content.ReadAsStringAsync().ConfigureAwait(false); var personaleUC = JsonConvert.DeserializeObject<DistaccamentoUC>(data); return _mapper.Map(personaleUC); } Sede IGetDistaccamentoByCodiceSede.Get(string codiceSede) { throw new NotImplementedException(); } } }
agpl-3.0
C#
9fbc53e49447637e3d5d0b7b376d7973c47cea0e
adjust access modifier
Team-Captain-Marvel-2016/Team-Captain-Marvel-2016-Project,Team-Captain-Marvel-2016/TeamWorkSkeletonSample,Team-Captain-Marvel-2016/Team-Captain-Marvel-2016-Project,Team-Captain-Marvel-2016/TeamWorkSkeletonSample
TeamWorkSkeleton/FootballPlayerAssembly/FootballPlayerFactoryClasses/NeptunianFootballPlayerConstructingMethodss.cs
TeamWorkSkeleton/FootballPlayerAssembly/FootballPlayerFactoryClasses/NeptunianFootballPlayerConstructingMethodss.cs
using FootballPlayerAssembly.FootballPlayerAbstractClass; using FootballPlayerAssembly.SpeciesNameGenerators; namespace FootballPlayerAssembly.FootballPlayerFactoryClasses { public static partial class FootballPlayerFactory { private static FootballPlayer CreateNeptunianAttacker(FootballPlayer baseStats) { var newPlayerName = NeptuneNameGenerator.GenerateName(); var newPlayer = new RolesClasses.NeptunianFootballPlayer.FootballPlayerFactory.NeptunianAttacker(); return newPlayer; } private static FootballPlayer CreateNeptunianDefender(FootballPlayer baseStats) { var newPlayerName = NeptuneNameGenerator.GenerateName(); var newPlayer = new RolesClasses.NeptunianFootballPlayer.FootballPlayerFactory.NeptunianDefender(); return newPlayer; } private static FootballPlayer CreateNeptunianMidfielder(FootballPlayer baseStats) { var newPlayerName = NeptuneNameGenerator.GenerateName(); var newPlayer = new RolesClasses.NeptunianFootballPlayer.FootballPlayerFactory.NeptunianMidfielder(); return newPlayer; } private static FootballPlayer CreateNeptunianGoalkeeper(FootballPlayer baseStats) { var newPlayerName = NeptuneNameGenerator.GenerateName(); var newPlayer = new RolesClasses.NeptunianFootballPlayer.FootballPlayerFactory.NeptunianGoalkeeper(); return newPlayer; } } }
using FootballPlayerAssembly.FootballPlayerAbstractClass; using FootballPlayerAssembly.SpeciesNameGenerators; namespace FootballPlayerAssembly.FootballPlayerFactoryClasses { public static partial class FootballPlayerFactory { internal static FootballPlayer CreateNeptunianAttacker(FootballPlayer baseStats) { var newPlayerName = NeptuneNameGenerator.GenerateName(); var newPlayer = new RolesClasses.NeptunianFootballPlayer.FootballPlayerFactory.NeptunianAttacker(); return newPlayer; } internal static FootballPlayer CreateNeptunianDefender(FootballPlayer baseStats) { var newPlayerName = NeptuneNameGenerator.GenerateName(); var newPlayer = new RolesClasses.NeptunianFootballPlayer.FootballPlayerFactory.NeptunianDefender(); return newPlayer; } internal static FootballPlayer CreateNeptunianMidfielder(FootballPlayer baseStats) { var newPlayerName = NeptuneNameGenerator.GenerateName(); var newPlayer = new RolesClasses.NeptunianFootballPlayer.FootballPlayerFactory.NeptunianMidfielder(); return newPlayer; } internal static FootballPlayer CreateNeptunianGoalkeeper(FootballPlayer baseStats) { var newPlayerName = NeptuneNameGenerator.GenerateName(); var newPlayer = new RolesClasses.NeptunianFootballPlayer.FootballPlayerFactory.NeptunianGoalkeeper(); return newPlayer; } } }
mit
C#
e52f6cf1ac322c4d898c4abbda62e0cf2eeefe44
Fix find vessels landed at
gavazquez/LunaMultiPlayer,DaggerES/LunaMultiPlayer,gavazquez/LunaMultiPlayer,gavazquez/LunaMultiPlayer
Client/Harmony/ShipConstruction_FindVesselsLandedAt.cs
Client/Harmony/ShipConstruction_FindVesselsLandedAt.cs
using Harmony; using LunaClient.Systems.Lock; using LunaCommon.Enums; using System.Collections.Generic; // ReSharper disable All namespace LunaClient.Harmony { /// <summary> /// This harmony patch is intended to override the "FindVesselsLandedAt" that sometimes is called to check if there are vessels in a launch site /// We just remove the other controlled vessels from that check and set them correctly /// </summary> [HarmonyPatch(typeof(ShipConstruction))] [HarmonyPatch("FindVesselsLandedAt")] [HarmonyPatch(new[] { typeof(FlightState), typeof(string) })] public class ShipConstruction_FindVesselsLandedAt { private static readonly List<ProtoVessel> ProtoVesselsToRemove = new List<ProtoVessel>(); [HarmonyPostfix] private static void PostfixFindVesselsLandedAt(List<ProtoVessel> __result) { if (MainSystem.NetworkState < ClientState.Connected) return; ProtoVesselsToRemove.Clear(); foreach (var pv in __result) { if (LockSystem.LockQuery.ControlLockExists(pv.vesselID)) ProtoVesselsToRemove.Add(pv); } foreach (var pv in ProtoVesselsToRemove) { __result.Remove(pv); } } } }
using Harmony; using LunaClient.Systems.Lock; using LunaCommon.Enums; using System.Collections.Generic; // ReSharper disable All namespace LunaClient.Harmony { /// <summary> /// This harmony patch is intended to override the "FindVesselsLandedAt" that sometimes is called to check if there are vessels in a launch site /// We just remove the other controlled vessels from that check and set them correctly /// </summary> [HarmonyPatch(typeof(ShipConstruction))] [HarmonyPatch("FindVesselsLandedAt")] [HarmonyPatch(new[] { typeof(FlightState), typeof(string) })] public class ShipConstruction_FindVesselsLandedAt { private static readonly List<ProtoVessel> ProtoVesselsToRemove = new List<ProtoVessel>(); [HarmonyPostfix] private static void PostfixFindVesselsLandedAt(List<ProtoVessel> __result) { if (MainSystem.NetworkState < ClientState.Connected) return; ProtoVesselsToRemove.Clear(); foreach (var pv in __result) { if (!LockSystem.LockQuery.ControlLockExists(pv.vesselID)) ProtoVesselsToRemove.Add(pv); } foreach (var pv in ProtoVesselsToRemove) { __result.Remove(pv); } } } }
mit
C#
36acb2a61e5274001db3082c6176d7f5a70bd8e5
Check latest version in Unity Settings panel
vedi/unity3d-levelup,vedi/unity3d-levelup,vedi/unity3d-levelup,vedi/unity3d-levelup,vedi/unity3d-levelup
Soomla/Assets/Plugins/Soomla/Levelup/Config/LevelUpSettings.cs
Soomla/Assets/Plugins/Soomla/Levelup/Config/LevelUpSettings.cs
/// Copyright (C) 2012-2014 Soomla Inc. /// /// Licensed under the Apache License, Version 2.0 (the "License"); /// you may not use this file except in compliance with the License. /// You may obtain a copy of the License at /// /// http://www.apache.org/licenses/LICENSE-2.0 /// /// Unless required by applicable law or agreed to in writing, software /// distributed under the License is distributed on an "AS IS" BASIS, /// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. /// See the License for the specific language governing permissions and /// limitations under the License. using UnityEngine; using System.IO; using System; using System.Collections.Generic; using System.Linq; #if UNITY_EDITOR using UnityEditor; #endif namespace Soomla.Levelup { #if UNITY_EDITOR [InitializeOnLoad] #endif /// <summary> /// This class holds the levelup's configurations. /// </summary> public class LevelUpSettings : ISoomlaSettings { #if UNITY_EDITOR static LevelUpSettings instance = new LevelUpSettings(); static LevelUpSettings() { SoomlaEditorScript.addSettings(instance); } // BuildTargetGroup[] supportedPlatforms = { BuildTargetGroup.Android, BuildTargetGroup.iPhone, // BuildTargetGroup.WebPlayer, BuildTargetGroup.Standalone}; GUIContent profileVersion = new GUIContent("LevelUp Version [?]", "The SOOMLA LevelUp version. "); private LevelUpSettings() { } public void OnEnable() { // Generating AndroidManifest.xml // ManifestTools.GenerateManifest(); } public void OnModuleGUI() { // AndroidGUI(); // EditorGUILayout.Space(); // IOSGUI(); } public void OnInfoGUI() { SoomlaEditorScript.SelectableLabelField(profileVersion, "1.0.17"); SoomlaEditorScript.LatestVersionField ("unity3d-levelup", "1.0.17"); EditorGUILayout.Space(); } public void OnSoomlaGUI() { } #endif /** LevelUp Specific Variables **/ } }
/// Copyright (C) 2012-2014 Soomla Inc. /// /// Licensed under the Apache License, Version 2.0 (the "License"); /// you may not use this file except in compliance with the License. /// You may obtain a copy of the License at /// /// http://www.apache.org/licenses/LICENSE-2.0 /// /// Unless required by applicable law or agreed to in writing, software /// distributed under the License is distributed on an "AS IS" BASIS, /// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. /// See the License for the specific language governing permissions and /// limitations under the License. using UnityEngine; using System.IO; using System; using System.Collections.Generic; using System.Linq; #if UNITY_EDITOR using UnityEditor; #endif namespace Soomla.Levelup { #if UNITY_EDITOR [InitializeOnLoad] #endif /// <summary> /// This class holds the levelup's configurations. /// </summary> public class LevelUpSettings : ISoomlaSettings { #if UNITY_EDITOR static LevelUpSettings instance = new LevelUpSettings(); static LevelUpSettings() { SoomlaEditorScript.addSettings(instance); } // BuildTargetGroup[] supportedPlatforms = { BuildTargetGroup.Android, BuildTargetGroup.iPhone, // BuildTargetGroup.WebPlayer, BuildTargetGroup.Standalone}; GUIContent profileVersion = new GUIContent("LevelUp Version [?]", "The SOOMLA LevelUp version. "); GUIContent profileBuildVersion = new GUIContent("LevelUp Build [?]", "The SOOMLA LevelUp build."); private LevelUpSettings() { } public void OnEnable() { // Generating AndroidManifest.xml // ManifestTools.GenerateManifest(); } public void OnModuleGUI() { // AndroidGUI(); // EditorGUILayout.Space(); // IOSGUI(); } public void OnInfoGUI() { SoomlaEditorScript.SelectableLabelField(profileVersion, "1.0.17"); SoomlaEditorScript.SelectableLabelField(profileBuildVersion, "1"); EditorGUILayout.Space(); } public void OnSoomlaGUI() { } #endif /** LevelUp Specific Variables **/ } }
apache-2.0
C#
74142c0586d6164c3937792d37bc68e051d3fcd9
IMPROVE 24 Check latest version in Unity Settings panel
vedi/unity3d-levelup,vedi/unity3d-levelup,vedi/unity3d-levelup,vedi/unity3d-levelup,vedi/unity3d-levelup
Soomla/Assets/Plugins/Soomla/Levelup/Config/LevelUpSettings.cs
Soomla/Assets/Plugins/Soomla/Levelup/Config/LevelUpSettings.cs
/// Copyright (C) 2012-2014 Soomla Inc. /// /// Licensed under the Apache License, Version 2.0 (the "License"); /// you may not use this file except in compliance with the License. /// You may obtain a copy of the License at /// /// http://www.apache.org/licenses/LICENSE-2.0 /// /// Unless required by applicable law or agreed to in writing, software /// distributed under the License is distributed on an "AS IS" BASIS, /// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. /// See the License for the specific language governing permissions and /// limitations under the License. using UnityEngine; using System.IO; using System; using System.Collections.Generic; using System.Linq; #if UNITY_EDITOR using UnityEditor; #endif namespace Soomla.Levelup { #if UNITY_EDITOR [InitializeOnLoad] #endif /// <summary> /// This class holds the levelup's configurations. /// </summary> public class LevelUpSettings : ISoomlaSettings { #if UNITY_EDITOR static LevelUpSettings instance = new LevelUpSettings(); static LevelUpSettings() { SoomlaEditorScript.addSettings(instance); } // BuildTargetGroup[] supportedPlatforms = { BuildTargetGroup.Android, BuildTargetGroup.iPhone, // BuildTargetGroup.WebPlayer, BuildTargetGroup.Standalone}; GUIContent profileVersion = new GUIContent("LevelUp Version [?]", "The SOOMLA LevelUp version. "); private LevelUpSettings() { } public void OnEnable() { // Generating AndroidManifest.xml // ManifestTools.GenerateManifest(); } public void OnModuleGUI() { // AndroidGUI(); // EditorGUILayout.Space(); // IOSGUI(); } public void OnInfoGUI() { SoomlaEditorScript.SelectableLabelField(profileVersion, "1.0.17"); SoomlaEditorScript.LatestVersionField ("unity3d-levelup", "1.0.17", "New LevelUp version available!", "http://library.soom.la/fetch/unity3d-levelup/latest?cf=unity"); EditorGUILayout.Space(); } public void OnSoomlaGUI() { } #endif /** LevelUp Specific Variables **/ } }
/// Copyright (C) 2012-2014 Soomla Inc. /// /// Licensed under the Apache License, Version 2.0 (the "License"); /// you may not use this file except in compliance with the License. /// You may obtain a copy of the License at /// /// http://www.apache.org/licenses/LICENSE-2.0 /// /// Unless required by applicable law or agreed to in writing, software /// distributed under the License is distributed on an "AS IS" BASIS, /// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. /// See the License for the specific language governing permissions and /// limitations under the License. using UnityEngine; using System.IO; using System; using System.Collections.Generic; using System.Linq; #if UNITY_EDITOR using UnityEditor; #endif namespace Soomla.Levelup { #if UNITY_EDITOR [InitializeOnLoad] #endif /// <summary> /// This class holds the levelup's configurations. /// </summary> public class LevelUpSettings : ISoomlaSettings { #if UNITY_EDITOR static LevelUpSettings instance = new LevelUpSettings(); static LevelUpSettings() { SoomlaEditorScript.addSettings(instance); } // BuildTargetGroup[] supportedPlatforms = { BuildTargetGroup.Android, BuildTargetGroup.iPhone, // BuildTargetGroup.WebPlayer, BuildTargetGroup.Standalone}; GUIContent profileVersion = new GUIContent("LevelUp Version [?]", "The SOOMLA LevelUp version. "); private LevelUpSettings() { } public void OnEnable() { // Generating AndroidManifest.xml // ManifestTools.GenerateManifest(); } public void OnModuleGUI() { // AndroidGUI(); // EditorGUILayout.Space(); // IOSGUI(); } public void OnInfoGUI() { SoomlaEditorScript.SelectableLabelField(profileVersion, "1.0.17"); SoomlaEditorScript.LatestVersionField ("unity3d-levelup", "1.0.17"); EditorGUILayout.Space(); } public void OnSoomlaGUI() { } #endif /** LevelUp Specific Variables **/ } }
apache-2.0
C#
32d17766cc030933be924611575fe1620f13e23c
add compression
davidbetz/nalarium
Core/Nalarium/IO/Compression.cs
Core/Nalarium/IO/Compression.cs
#region Copyright //+ Jampad Technology, Inc. 2007-2013 Pro 3.0 - Core Module //+ Copyright © Jampad Technology, Inc. 2008-2010 #endregion using System.IO; using System.IO.Compression; using System.Text; namespace Nalarium.IO { /// <summary> /// Compresses and decompresses. /// </summary> public static class Compression { public static byte[] Compress(string input) { return Compress(Encoding.UTF8.GetBytes(input)); } public static byte[] Compress(byte[] input) { using (var memoryStream = new MemoryStream()) using (var gzipStream = new GZipStream(memoryStream, CompressionMode.Compress)) { gzipStream.Write(input, 0, input.Length); gzipStream.Close(); return memoryStream.ToArray(); } } public static byte[] Decompress(byte[] input) { using (var memory = new MemoryStream()) using (var stream = new GZipStream(new MemoryStream(input), CompressionMode.Decompress)) { const int size = 4096; byte[] buffer = new byte[size]; int count; do { count = stream.Read(buffer, 0, size); if (count > 0) { memory.Write(buffer, 0, count); } } while (count > 0); return memory.ToArray(); } } public static string DecompressToString(byte[] input) { using (var memoryStream = new MemoryStream(input)) using (var gzipStream = new GZipStream(memoryStream, CompressionMode.Decompress)) using (var reader = new StreamReader(gzipStream)) { return reader.ReadToEnd(); } } } }
#region Copyright //+ Jampad Technology, Inc. 2007-2013 Pro 3.0 - Core Module //+ Copyright © Jampad Technology, Inc. 2008-2010 #endregion using System.IO; using System.IO.Compression; using System.Text; namespace Nalarium.IO { /// <summary> /// Compresses and decompresses. /// </summary> public static class Compression { public static byte[] Compress(string input) { return Compress(Encoding.UTF8.GetBytes(input)); } public static byte[] Compress(byte[] input) { using (var memoryStream = new MemoryStream()) using (var gzipStream = new GZipStream(memoryStream, CompressionLevel.Optimal, true)) { gzipStream.Write(input, 0, input.Length); return memoryStream.ToArray(); } } public static byte[] Decompress(byte[] input) { using (var stream = new GZipStream(new MemoryStream(input), CompressionMode.Decompress)) { const int size = 4096; byte[] buffer = new byte[size]; using (MemoryStream memory = new MemoryStream()) { int count = 0; do { count = stream.Read(buffer, 0, size); if (count > 0) { memory.Write(buffer, 0, count); } } while (count > 0); return memory.ToArray(); } } } public static string DecompressToString(byte[] input) { return Encoding.UTF8.GetString(Decompress(input)); } } }
bsd-3-clause
C#
774f48e37cb9237d472b05e8e8515f561b8e62b7
Remove throttle in Pin lock check.
nopara73/HiddenWallet,nopara73/HiddenWallet,nopara73/HiddenWallet,nopara73/HiddenWallet
WalletWasabi.Gui/Controls/LockScreen/PinLockScreenViewModel.cs
WalletWasabi.Gui/Controls/LockScreen/PinLockScreenViewModel.cs
using WalletWasabi.Gui.ViewModels; using WalletWasabi.Helpers; using System; using System.Reactive; using ReactiveUI; using System.Reactive.Disposables; using System.Reactive.Linq; namespace WalletWasabi.Gui.Controls.LockScreen { public class PinLockScreenViewModel : ViewModelBase, ILockScreenViewModel { private LockScreenViewModel _parentVM; private CompositeDisposable Disposables { get; } public ReactiveCommand<string, Unit> KeyPadCommand { get; } private ObservableAsPropertyHelper<bool> _isLocked; public bool IsLocked => _isLocked?.Value ?? false; private string _pinInput; public string PinInput { get => _pinInput; set => this.RaiseAndSetIfChanged(ref _pinInput, value); } private bool _warningMessageVisible; public bool WarningMessageVisible { get => _warningMessageVisible; set => this.RaiseAndSetIfChanged(ref _warningMessageVisible, value); } public PinLockScreenViewModel(LockScreenViewModel lockScreenViewModel) { _parentVM = Guard.NotNull(nameof(lockScreenViewModel), lockScreenViewModel); Disposables = new CompositeDisposable(); KeyPadCommand = ReactiveCommand.Create<string>((arg) => { PinInput += arg; }); this.WhenAnyValue(x => x.PinInput) .ObserveOn(RxApp.MainThreadScheduler) .Select(Guard.Correct) .Where(x => x != string.Empty) .Do(x => WarningMessageVisible = false) .DistinctUntilChanged() .Subscribe(CheckPIN) .DisposeWith(Disposables); _isLocked = _parentVM.WhenAnyValue(x => x.IsLocked) .ObserveOn(RxApp.MainThreadScheduler) .ToProperty(this, x => x.IsLocked) .DisposeWith(Disposables); } private void CheckPIN(string input) { if (_parentVM.PINHash == HashHelpers.GenerateSha256Hash(input)) { _parentVM.IsLocked = false; PinInput = string.Empty; } else { WarningMessageVisible = true; } } public void Dispose() { Disposables?.Dispose(); } } }
using WalletWasabi.Gui.ViewModels; using WalletWasabi.Helpers; using System; using System.Reactive; using ReactiveUI; using System.Reactive.Disposables; using System.Reactive.Linq; namespace WalletWasabi.Gui.Controls.LockScreen { public class PinLockScreenViewModel : ViewModelBase, ILockScreenViewModel { private LockScreenViewModel _parentVM; private CompositeDisposable Disposables { get; } public ReactiveCommand<string, Unit> KeyPadCommand { get; } private ObservableAsPropertyHelper<bool> _isLocked; public bool IsLocked => _isLocked?.Value ?? false; private string _pinInput; public string PinInput { get => _pinInput; set => this.RaiseAndSetIfChanged(ref _pinInput, value); } private bool _warningMessageVisible; public bool WarningMessageVisible { get => _warningMessageVisible; set => this.RaiseAndSetIfChanged(ref _warningMessageVisible, value); } public PinLockScreenViewModel(LockScreenViewModel lockScreenViewModel) { _parentVM = Guard.NotNull(nameof(lockScreenViewModel), lockScreenViewModel); Disposables = new CompositeDisposable(); KeyPadCommand = ReactiveCommand.Create<string>((arg) => { PinInput += arg; }); this.WhenAnyValue(x => x.PinInput) .ObserveOn(RxApp.MainThreadScheduler) .Throttle(TimeSpan.FromSeconds(0.5)) .Select(Guard.Correct) .Where(x => x != string.Empty) .Do(x => WarningMessageVisible = false) .DistinctUntilChanged() .Subscribe(CheckPIN) .DisposeWith(Disposables); _isLocked = _parentVM.WhenAnyValue(x => x.IsLocked) .ObserveOn(RxApp.MainThreadScheduler) .ToProperty(this, x => x.IsLocked) .DisposeWith(Disposables); } private void CheckPIN(string input) { if (_parentVM.PINHash == HashHelpers.GenerateSha256Hash(input)) { _parentVM.IsLocked = false; PinInput = string.Empty; } else { WarningMessageVisible = true; } } public void Dispose() { Disposables?.Dispose(); } } }
mit
C#
bd8fa2a63648cd22f87b078a00d5cfe0f2cb3e7e
Fix type fast => no validation
nopara73/HiddenWallet,nopara73/HiddenWallet,nopara73/HiddenWallet,nopara73/HiddenWallet
WalletWasabi.Gui/Controls/LockScreen/PinLockScreenViewModel.cs
WalletWasabi.Gui/Controls/LockScreen/PinLockScreenViewModel.cs
using WalletWasabi.Gui.ViewModels; using WalletWasabi.Helpers; using System; using System.Reactive; using ReactiveUI; using System.Reactive.Disposables; using System.Reactive.Linq; namespace WalletWasabi.Gui.Controls.LockScreen { public class PinLockScreenViewModel : ViewModelBase, ILockScreenViewModel { private LockScreenViewModel _parentVM; private CompositeDisposable Disposables { get; } public ReactiveCommand<string, Unit> KeyPadCommand { get; } private ObservableAsPropertyHelper<bool> _isLocked; public bool IsLocked => _isLocked?.Value ?? false; private string _pinInput; public string PinInput { get => _pinInput; set => this.RaiseAndSetIfChanged(ref _pinInput, value); } private bool _warningMessageVisible; public bool WarningMessageVisible { get => _warningMessageVisible; set => this.RaiseAndSetIfChanged(ref _warningMessageVisible, value); } public PinLockScreenViewModel(LockScreenViewModel lockScreenViewModel) { _parentVM = Guard.NotNull(nameof(lockScreenViewModel), lockScreenViewModel); Disposables = new CompositeDisposable(); KeyPadCommand = ReactiveCommand.Create<string>((arg) => { if (arg == "BACK") { if (PinInput.Length > 0) { PinInput = PinInput.Substring(0, PinInput.Length - 1); WarningMessageVisible = false; } } else if (arg == "CLEAR") { PinInput = string.Empty; WarningMessageVisible = false; } else { PinInput += arg; } }); this.WhenAnyValue(x => x.PinInput) .Throttle(TimeSpan.FromSeconds(0.5)) .Select(Guard.Correct) .Where(x => x != string.Empty) .ObserveOn(RxApp.MainThreadScheduler) .Do(x => WarningMessageVisible = false) .Subscribe(CheckPin) .DisposeWith(Disposables); _isLocked = _parentVM.WhenAnyValue(x => x.IsLocked) .ObserveOn(RxApp.MainThreadScheduler) .ToProperty(this, x => x.IsLocked) .DisposeWith(Disposables); } private void CheckPin(string input) { if (_parentVM.PinHash == HashHelpers.GenerateSha256Hash(input)) { _parentVM.IsLocked = false; PinInput = string.Empty; } else { WarningMessageVisible = true; } } public void Dispose() { Disposables?.Dispose(); } } }
using WalletWasabi.Gui.ViewModels; using WalletWasabi.Helpers; using System; using System.Reactive; using ReactiveUI; using System.Reactive.Disposables; using System.Reactive.Linq; namespace WalletWasabi.Gui.Controls.LockScreen { public class PinLockScreenViewModel : ViewModelBase, ILockScreenViewModel { private LockScreenViewModel _parentVM; private CompositeDisposable Disposables { get; } public ReactiveCommand<string, Unit> KeyPadCommand { get; } private ObservableAsPropertyHelper<bool> _isLocked; public bool IsLocked => _isLocked?.Value ?? false; private string _pinInput; public string PinInput { get => _pinInput; set => this.RaiseAndSetIfChanged(ref _pinInput, value); } private bool _warningMessageVisible; public bool WarningMessageVisible { get => _warningMessageVisible; set => this.RaiseAndSetIfChanged(ref _warningMessageVisible, value); } public PinLockScreenViewModel(LockScreenViewModel lockScreenViewModel) { _parentVM = Guard.NotNull(nameof(lockScreenViewModel), lockScreenViewModel); Disposables = new CompositeDisposable(); KeyPadCommand = ReactiveCommand.Create<string>((arg) => { if (arg == "BACK") { if (PinInput.Length > 0) { PinInput = PinInput.Substring(0, PinInput.Length - 1); WarningMessageVisible = false; } } else if (arg == "CLEAR") { PinInput = string.Empty; WarningMessageVisible = false; } else { PinInput += arg; } }); this.WhenAnyValue(x => x.PinInput) .Throttle(TimeSpan.FromSeconds(0.5)) .Select(Guard.Correct) .Where(x => x != string.Empty) .ObserveOn(RxApp.MainThreadScheduler) .Do(x => WarningMessageVisible = false) .DistinctUntilChanged() .Subscribe(CheckPin) .DisposeWith(Disposables); _isLocked = _parentVM.WhenAnyValue(x => x.IsLocked) .ObserveOn(RxApp.MainThreadScheduler) .ToProperty(this, x => x.IsLocked) .DisposeWith(Disposables); } private void CheckPin(string input) { if (_parentVM.PinHash == HashHelpers.GenerateSha256Hash(input)) { _parentVM.IsLocked = false; PinInput = string.Empty; } else { WarningMessageVisible = true; } } public void Dispose() { Disposables?.Dispose(); } } }
mit
C#
1ec6be087fb3cccded34477f1386ca1d72492ab1
Mark IsDirty property as internal
wieslawsoltes/Draw2D,wieslawsoltes/Draw2D,wieslawsoltes/Draw2D
src/Draw2D.Core/ObservableObject.cs
src/Draw2D.Core/ObservableObject.cs
// Copyright (c) Wiesław Šoltés. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. using System.ComponentModel; using System.Runtime.CompilerServices; namespace Draw2D.Core { public abstract class ObservableObject : INotifyPropertyChanged { internal bool IsDirty { get; set; } public event PropertyChangedEventHandler PropertyChanged; public void Notify([CallerMemberName] string propertyName = null) { PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); } public bool Update<T>(ref T field, T value, [CallerMemberName] string propertyName = null) { if (!Equals(field, value)) { field = value; IsDirty = true; Notify(propertyName); return true; } return false; } } }
// Copyright (c) Wiesław Šoltés. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. using System.ComponentModel; using System.Runtime.CompilerServices; namespace Draw2D.Core { public abstract class ObservableObject : INotifyPropertyChanged { public bool IsDirty { get; set; } public event PropertyChangedEventHandler PropertyChanged; public void Notify([CallerMemberName] string propertyName = null) { PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); } public bool Update<T>(ref T field, T value, [CallerMemberName] string propertyName = null) { if (!Equals(field, value)) { field = value; IsDirty = true; Notify(propertyName); return true; } return false; } } }
mit
C#
d1f27c5dbcffb72bebbb573470281dc57b4c3818
Update src/NUnitFramework/framework/Internal/Extensions/IPropertyBagDataExtensions.cs
nunit/nunit,nunit/nunit
src/NUnitFramework/framework/Internal/Extensions/IPropertyBagDataExtensions.cs
src/NUnitFramework/framework/Internal/Extensions/IPropertyBagDataExtensions.cs
// Copyright (c) Charlie Poole, Rob Prouse and Contributors. MIT License - see LICENSE.txt #nullable enable using System; using NUnit.Framework.Interfaces; namespace NUnit.Framework.Internal.Extensions { /// <summary> /// Extensions to <see cref="IPropertyBag"/>. /// </summary> internal static class IPropertyBagDataExtensions { /// <summary> /// Adds the skip reason to tests that are ignored until a specific date. /// </summary> /// <param name="properties">The test properties to add the skip reason to</param> /// <param name="untilDate">The date that the test is being ignored until</param> /// <param name="reason">The reason the test is being ignored until that date</param> internal static void AddIgnoreUntilReason(this IPropertyBag properties, DateTimeOffset untilDate, string reason) { string skipReason = $"Ignoring until {untilDate:u}. {reason}"; properties.Set(PropertyNames.SkipReason, skipReason); } } }
// Copyright (c) Charlie Poole, Rob Prouse and Contributors. MIT License - see LICENSE.txt #nullable enable using System; using NUnit.Framework.Interfaces; namespace NUnit.Framework.Internal.Extensions { /// <summary> /// Extensions to <see cref="IPropertyBag"/>. /// </summary> internal static class IPropertyBagDataExtensions { /// <summary> /// Adds the skip reason to tests that are ignored until a specific date. /// </summary> /// <param name="properties">The test properties to add the skip reason to</param> /// <param name="untilDate">The date that the test is being ignored until</param> /// <param name="reason">The reason the test is being ignored until that date</param> internal static void AddIgnoreUntilReason(this IPropertyBag properties, DateTimeOffset untilDate, string reason) { string skipReason = $"Ignoring until {untilDate.ToString("u")}. {reason}"; properties.Set(PropertyNames.SkipReason, skipReason); } } }
mit
C#
5ce022f24c6388ab8f5462ffa1d775ea306fe390
Fix build
tomgilder/dserv,tomgilder/dserv
src/Server/Dserv.Server/IHandler.cs
src/Server/Dserv.Server/IHandler.cs
using System.Net; using System.Threading.Tasks; namespace Dserv.Server { public interface IHandler { bool CanHandle(HttpListenerRequest request); Task HandleAsync(HttpListenerContext context); } }
using System.Net; using System.Threading.Tasks; namespace Dserv.Server { public interface IHandler { //bool CanHandle(HttpListenerRequest request); //Task HandleAsync(HttpListenerContext context); } }
mit
C#
2395370c2c9fbbac925f0953729d394a0ec8d4fc
bump version, add github link
eth0up/R6GameServicePatcher
Properties/AssemblyInfo.cs
Properties/AssemblyInfo.cs
using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("R6GameService_Patcher")] [assembly: AssemblyDescription("https://github.com/eth0up/R6GameServicePatcher")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("eth0up")] [assembly: AssemblyProduct("R6GameService_Patcher")] [assembly: AssemblyCopyright("Copyright © 2017")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("1169eb42-8eeb-47a8-9650-119001eac9e3")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.1.0.0")] [assembly: AssemblyFileVersion("1.1.0.0")]
using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("R6GameService_Patcher")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("R6GameService_Patcher")] [assembly: AssemblyCopyright("Copyright © 2016")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("1169eb42-8eeb-47a8-9650-119001eac9e3")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]
mit
C#
92d3a58bac7f9f0c0dd02094f055f02b06b53977
Add basic methods to distinguish between an empty and a non-empty value.
PenguinF/sandra-three
Eutherion/Shared/Utils/Maybe.cs
Eutherion/Shared/Utils/Maybe.cs
#region License /********************************************************************************* * Maybe.cs * * Copyright (c) 2004-2019 Henk Nicolai * * 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 namespace Eutherion.Utils { /// <summary> /// Represents an optional value. /// </summary> /// <typeparam name="T"> /// The type of the optional value. /// </typeparam> public abstract class Maybe<T> { private sealed class NothingValue : Maybe<T> { public override bool IsNothing => true; public override bool IsJust(out T value) { value = default; return false; } } private sealed class JustValue : Maybe<T> { public readonly T Value; public JustValue(T value) => Value = value; public override bool IsNothing => false; public override bool IsJust(out T value) { value = Value; return true; } } /// <summary> /// Represents the <see cref="Maybe{T}"/> without a value. /// </summary> public static readonly Maybe<T> Nothing = new NothingValue(); /// <summary> /// Creates a <see cref="Maybe{T}"/> instance which contains a value. /// </summary> /// <param name="value"> /// The value to wrap. /// </param> /// <returns> /// The <see cref="Maybe{T}"/> which contains the value. /// </returns> public static Maybe<T> Just(T value) => new JustValue(value); public static implicit operator Maybe<T>(T value) => new JustValue(value); private Maybe() { } /// <summary> /// Returns if this <see cref="Maybe{T}"/> is empty, i.e. does not contain a value. /// </summary> public abstract bool IsNothing { get; } /// <summary> /// Returns if this <see cref="Maybe{T}"/> contains a value, and if it does, returns it. /// </summary> /// <param name="value"> /// The value contained in this <see cref="Maybe{T}"/>, or a default value if empty. /// </param> /// <returns> /// Whether or not this <see cref="Maybe{T}"/> contains a value. /// </returns> public abstract bool IsJust(out T value); } }
#region License /********************************************************************************* * Maybe.cs * * Copyright (c) 2004-2019 Henk Nicolai * * 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 namespace Eutherion.Utils { }
apache-2.0
C#
2a8413aae59779a6581e5309a907f10270492298
Update version to 1.9.0.0
davispuh/gear-emu,gatuno1/gear-emu-branch-old,davispuh/gear-emu,gatuno1/gear-emu-branch-old,davispuh/gear-emu,gatuno1/gear-emu-branch-old,davispuh/gear-emu
Gear/Properties/AssemblyInfo.cs
Gear/Properties/AssemblyInfo.cs
/* -------------------------------------------------------------------------------- * Gear: Parallax Inc. Propeller Debugger * Copyright 2007 - Robert Vandiver * -------------------------------------------------------------------------------- * AssemblyInfo.cs * Run-time settings for gear * -------------------------------------------------------------------------------- * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * -------------------------------------------------------------------------------- */ 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("Gear")] [assembly: AssemblyDescription( "Developers: Robert Vandiver.\r\n" + "\r\n" + "Thanks to everyone on the forums for being " + "so helpful with providing me with information\r\n" + "\r\n" + "As this is a pre-release, there are bound to be bugs\r\n" + "Please do not send me reports, and I'm still in the testing " + "phase, and most everything you will tell me I already know. " + "The interpreted core is mostly untested. Use at your own risk.\r\n" + "\r\n" + "Contributed code: \r\n" + "Windows Forms Collapsible Splitter Control for .Net\r\n" + "(c)Copyright 2002-2003 NJF (furty74@yahoo.com). All rights reserved." )] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("sublab research")] [assembly: AssemblyProduct("Gear: Parallax Propeller Emulator")] [assembly: AssemblyCopyright("Copyright © sublab research 2007")] [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("59a0b77c-72ca-4835-955a-dba571ba3b42")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // [assembly: AssemblyVersion("1.9.0.0")] [assembly: AssemblyFileVersion("1.9.0.0")]
/* -------------------------------------------------------------------------------- * Gear: Parallax Inc. Propeller Debugger * Copyright 2007 - Robert Vandiver * -------------------------------------------------------------------------------- * AssemblyInfo.cs * Run-time settings for gear * -------------------------------------------------------------------------------- * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * -------------------------------------------------------------------------------- */ 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("Gear")] [assembly: AssemblyDescription( "Developers: Robert Vandiver.\r\n" + "\r\n" + "Thanks to everyone on the forums for being " + "so helpful with providing me with information\r\n" + "\r\n" + "As this is a pre-release, there are bound to be bugs\r\n" + "Please do not send me reports, and I'm still in the testing " + "phase, and most everything you will tell me I already know. " + "The interpreted core is mostly untested. Use at your own risk.\r\n" + "\r\n" + "Contributed code: \r\n" + "Windows Forms Collapsible Splitter Control for .Net\r\n" + "(c)Copyright 2002-2003 NJF (furty74@yahoo.com). All rights reserved." )] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("sublab research")] [assembly: AssemblyProduct("Gear: Parallax Propeller Emulator")] [assembly: AssemblyCopyright("Copyright © sublab research 2007")] [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("59a0b77c-72ca-4835-955a-dba571ba3b42")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // [assembly: AssemblyVersion("1.8.0.0")] [assembly: AssemblyFileVersion("1.8.0.0")]
lgpl-2.1
C#
031f6260e69a80d4be87d94791191a9b504c3a19
bump ver
AntonyCorbett/OnlyT,AntonyCorbett/OnlyT
SolutionInfo.cs
SolutionInfo.cs
using System.Reflection; [assembly: AssemblyCompany("SoundBox")] [assembly: AssemblyProduct("OnlyT")] [assembly: AssemblyCopyright("Copyright © 2019 Antony Corbett")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] [assembly: AssemblyVersion("1.2.0.5")]
using System.Reflection; [assembly: AssemblyCompany("SoundBox")] [assembly: AssemblyProduct("OnlyT")] [assembly: AssemblyCopyright("Copyright © 2019 Antony Corbett")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] [assembly: AssemblyVersion("1.2.0.4")]
mit
C#
0090f5af27faafdb6abf6d74691b8b100a33dd33
Remove unused usings
eriawan/roslyn,AlekseyTs/roslyn,jasonmalinowski/roslyn,dotnet/roslyn,nguerrera/roslyn,physhi/roslyn,panopticoncentral/roslyn,genlu/roslyn,swaroop-sridhar/roslyn,KevinRansom/roslyn,gafter/roslyn,panopticoncentral/roslyn,stephentoub/roslyn,gafter/roslyn,AmadeusW/roslyn,panopticoncentral/roslyn,jmarolf/roslyn,KirillOsenkov/roslyn,AlekseyTs/roslyn,AmadeusW/roslyn,shyamnamboodiripad/roslyn,wvdd007/roslyn,MichalStrehovsky/roslyn,bartdesmet/roslyn,tmat/roslyn,nguerrera/roslyn,mgoertz-msft/roslyn,stephentoub/roslyn,mavasani/roslyn,shyamnamboodiripad/roslyn,diryboy/roslyn,agocke/roslyn,sharwell/roslyn,MichalStrehovsky/roslyn,physhi/roslyn,agocke/roslyn,MichalStrehovsky/roslyn,jasonmalinowski/roslyn,aelij/roslyn,bartdesmet/roslyn,jmarolf/roslyn,shyamnamboodiripad/roslyn,tmat/roslyn,brettfo/roslyn,tmat/roslyn,diryboy/roslyn,heejaechang/roslyn,mavasani/roslyn,tannergooding/roslyn,dotnet/roslyn,reaction1989/roslyn,AlekseyTs/roslyn,nguerrera/roslyn,davkean/roslyn,tannergooding/roslyn,reaction1989/roslyn,bartdesmet/roslyn,tannergooding/roslyn,weltkante/roslyn,ErikSchierboom/roslyn,genlu/roslyn,mgoertz-msft/roslyn,dotnet/roslyn,swaroop-sridhar/roslyn,brettfo/roslyn,CyrusNajmabadi/roslyn,CyrusNajmabadi/roslyn,KevinRansom/roslyn,abock/roslyn,genlu/roslyn,wvdd007/roslyn,KirillOsenkov/roslyn,CyrusNajmabadi/roslyn,physhi/roslyn,mavasani/roslyn,agocke/roslyn,brettfo/roslyn,weltkante/roslyn,heejaechang/roslyn,AmadeusW/roslyn,abock/roslyn,jasonmalinowski/roslyn,weltkante/roslyn,diryboy/roslyn,heejaechang/roslyn,aelij/roslyn,KevinRansom/roslyn,swaroop-sridhar/roslyn,mgoertz-msft/roslyn,davkean/roslyn,eriawan/roslyn,aelij/roslyn,reaction1989/roslyn,ErikSchierboom/roslyn,stephentoub/roslyn,sharwell/roslyn,sharwell/roslyn,KirillOsenkov/roslyn,wvdd007/roslyn,abock/roslyn,gafter/roslyn,eriawan/roslyn,ErikSchierboom/roslyn,jmarolf/roslyn,davkean/roslyn
src/VisualStudio/Core/Def/Implementation/ProjectSystem/VisualStudioWorkspaceImpl.RenameDocumentUndoUnit.cs
src/VisualStudio/Core/Def/Implementation/ProjectSystem/VisualStudioWorkspaceImpl.RenameDocumentUndoUnit.cs
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; using System.Linq; using Microsoft.VisualStudio.OLE.Interop; namespace Microsoft.VisualStudio.LanguageServices.Implementation.ProjectSystem { internal partial class VisualStudioWorkspaceImpl { private class RenameDocumentUndoUnit : IOleUndoUnit { private readonly VisualStudioWorkspaceImpl _workspace; private readonly string _fromName; private readonly string _toName; private readonly string _filePath; public RenameDocumentUndoUnit(VisualStudioWorkspaceImpl workspace, string fromName, string toName, string filePath) { _workspace = workspace; _fromName = fromName; _toName = toName; _filePath = filePath; } public void Do(IOleUndoManager pUndoManager) { // FirstOrDefault is okay because that's how the rename would have been // done in the forward direction as well. var documentId = _workspace.CurrentSolution.GetDocumentIdsWithFilePath(_filePath).FirstOrDefault(); if (documentId != null) { var updatedSolution = _workspace.CurrentSolution.WithDocumentName(documentId, _toName); _workspace.TryApplyChanges(updatedSolution); } } public void GetDescription(out string pBstr) { pBstr = $"Rename '{_fromName}' to '{_toName}'"; } public void GetUnitType(out Guid pClsid, out int plID) { throw new NotImplementedException(); } public void OnNextAdd() { } } } }
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; using System.Collections.Generic; using System.Linq; using Microsoft.CodeAnalysis; using Microsoft.VisualStudio.OLE.Interop; namespace Microsoft.VisualStudio.LanguageServices.Implementation.ProjectSystem { internal partial class VisualStudioWorkspaceImpl { private class RenameDocumentUndoUnit : IOleUndoUnit { private readonly VisualStudioWorkspaceImpl _workspace; private readonly string _fromName; private readonly string _toName; private readonly string _filePath; public RenameDocumentUndoUnit(VisualStudioWorkspaceImpl workspace, string fromName, string toName, string filePath) { _workspace = workspace; _fromName = fromName; _toName = toName; _filePath = filePath; } public void Do(IOleUndoManager pUndoManager) { // FirstOrDefault is okay because that's how the rename would have been // done in the forward direction as well. var documentId = _workspace.CurrentSolution.GetDocumentIdsWithFilePath(_filePath).FirstOrDefault(); if (documentId != null) { var updatedSolution = _workspace.CurrentSolution.WithDocumentName(documentId, _toName); _workspace.TryApplyChanges(updatedSolution); } } public void GetDescription(out string pBstr) { pBstr = $"Rename '{_fromName}' to '{_toName}'"; } public void GetUnitType(out Guid pClsid, out int plID) { throw new NotImplementedException(); } public void OnNextAdd() { } } } }
mit
C#
a9f8b9597c1375e9ab239d85139c69aed405925a
remove debug code
EdiWang/UWP-CharacterMap,EdiWang/UWP-CharacterMap,EdiWang/UWP-CharacterMap
CharacterMap/CharacterMap/Core/AlphaKeyGroup.cs
CharacterMap/CharacterMap/Core/AlphaKeyGroup.cs
using System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using Windows.Globalization.Collation; namespace CharacterMap.Core { public class AlphaKeyGroup<T> : List<T> { const string GlobeGroupKey = "?"; public string Key { get; private set; } //public List<T> this { get; private set; } public AlphaKeyGroup(string key) { Key = key; } private static List<AlphaKeyGroup<T>> CreateDefaultGroups(CharacterGroupings slg) { return (from cg in slg where cg.Label != string.Empty select cg.Label == "..." ? new AlphaKeyGroup<T>(GlobeGroupKey) : new AlphaKeyGroup<T>(cg.Label)) .ToList(); } public static List<AlphaKeyGroup<T>> CreateGroups(IEnumerable<T> items, Func<T, string> keySelector) { CharacterGroupings slg = new CharacterGroupings(); List<AlphaKeyGroup<T>> list = CreateDefaultGroups(slg); foreach (T item in items) { int index = 0; string label = slg.Lookup(keySelector(item)); index = list.FindIndex(alphagroupkey => (alphagroupkey.Key.Equals(label, StringComparison.CurrentCulture))); if (index > -1 && index < list.Count) list[index].Add(item); } return list; } } }
using System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using Windows.Globalization.Collation; namespace CharacterMap.Core { public class AlphaKeyGroup<T> : List<T> { const string GlobeGroupKey = "?"; public string Key { get; private set; } //public List<T> this { get; private set; } public AlphaKeyGroup(string key) { Key = key; } private static List<AlphaKeyGroup<T>> CreateDefaultGroups(CharacterGroupings slg) { return (from cg in slg where cg.Label != string.Empty select cg.Label == "..." ? new AlphaKeyGroup<T>(GlobeGroupKey) : new AlphaKeyGroup<T>(cg.Label)) .ToList(); } public static List<AlphaKeyGroup<T>> CreateGroups(IEnumerable<T> items, Func<T, string> keySelector) { CharacterGroupings slg = new CharacterGroupings(); List<AlphaKeyGroup<T>> list = CreateDefaultGroups(slg); foreach (T item in items) { int index = 0; string label = slg.Lookup(keySelector(item)); index = list.FindIndex(alphagroupkey => (alphagroupkey.Key.Equals(label, StringComparison.CurrentCulture))); if (index > -1 && index < list.Count) list[index].Add(item); Debug.WriteLine($"Added {(item as InstalledFont).Name} to {list[index].Key}(index {index})."); } return list; } } }
mit
C#
34e040ecf99a6aa899772c9804adbf7d6d145e52
Fix panama duplicate entry
tinohager/Nager.Date,tinohager/Nager.Date,tinohager/Nager.Date
Src/Nager.Date/PublicHolidays/PanamaProvider.cs
Src/Nager.Date/PublicHolidays/PanamaProvider.cs
using Nager.Date.Model; using System.Collections.Generic; using System.Linq; namespace Nager.Date.PublicHolidays { public class PanamaProvider : CatholicBaseProvider { public override IEnumerable<PublicHoliday> Get(int year) { //Panama //https://en.wikipedia.org/wiki/Public_holidays_in_Panama var countryCode = CountryCode.PA; var easterSunday = base.EasterSunday(year); var items = new List<PublicHoliday>(); items.Add(new PublicHoliday(year, 1, 1, "New Year's Day", "New Year's Day", countryCode)); items.Add(new PublicHoliday(year, 1, 9, "Martyr's Day", "Martyr's Day", countryCode)); items.Add(new PublicHoliday(easterSunday.AddDays(-48), "Carnival", "Carnival", countryCode)); items.Add(new PublicHoliday(easterSunday.AddDays(-47), "Carnival", "Carnival", countryCode)); items.Add(new PublicHoliday(easterSunday.AddDays(-2), "Good Friday", "Good Friday", countryCode)); items.Add(new PublicHoliday(year, 5, 1, "Labour Day", "Labour Day", countryCode)); //presidential inauguration (not enough informations) items.Add(new PublicHoliday(year, 11, 3, "Separation Day", "Separation Day", countryCode)); items.Add(new PublicHoliday(year, 11, 4, "Flag Day", "Flag Day", countryCode)); items.Add(new PublicHoliday(year, 11, 5, "Colón Day", "Colon Day", countryCode)); items.Add(new PublicHoliday(year, 11, 10, "Shout in Villa de los Santos", "Shout in Villa de los Santos", countryCode)); items.Add(new PublicHoliday(year, 11, 28, "Independence Day", "Independence Day", countryCode)); items.Add(new PublicHoliday(year, 12, 8, "Mothers' Day", "Mothers' Day", countryCode)); items.Add(new PublicHoliday(year, 12, 25, "Christmas Day", "Christmas Day", countryCode)); return items.OrderBy(o => o.Date); } } }
using Nager.Date.Model; using System.Collections.Generic; using System.Linq; namespace Nager.Date.PublicHolidays { public class PanamaProvider : CatholicBaseProvider { public override IEnumerable<PublicHoliday> Get(int year) { //Panama //https://en.wikipedia.org/wiki/Public_holidays_in_Panama var countryCode = CountryCode.PA; var easterSunday = base.EasterSunday(year); var items = new List<PublicHoliday>(); items.Add(new PublicHoliday(year, 1, 1, "New Year's Day", "New Year's Day", countryCode)); items.Add(new PublicHoliday(year, 1, 9, "Martyr's Day", "Martyr's Day", countryCode)); items.Add(new PublicHoliday(year, 1, 9, "Martyr's Day", "Martyr's Day", countryCode)); items.Add(new PublicHoliday(easterSunday.AddDays(-48), "Carnival", "Carnival", countryCode)); items.Add(new PublicHoliday(easterSunday.AddDays(-47), "Carnival", "Carnival", countryCode)); items.Add(new PublicHoliday(easterSunday.AddDays(-2), "Good Friday", "Good Friday", countryCode)); items.Add(new PublicHoliday(year, 5, 1, "Labour Day", "Labour Day", countryCode)); //presidential inauguration (not enough informations) items.Add(new PublicHoliday(year, 11, 3, "Separation Day", "Separation Day", countryCode)); items.Add(new PublicHoliday(year, 11, 4, "Flag Day", "Flag Day", countryCode)); items.Add(new PublicHoliday(year, 11, 5, "Colón Day", "Colon Day", countryCode)); items.Add(new PublicHoliday(year, 11, 10, "Shout in Villa de los Santos", "Shout in Villa de los Santos", countryCode)); items.Add(new PublicHoliday(year, 11, 28, "Independence Day", "Independence Day", countryCode)); items.Add(new PublicHoliday(year, 12, 8, "Mothers' Day", "Mothers' Day", countryCode)); items.Add(new PublicHoliday(year, 12, 25, "Christmas Day", "Christmas Day", countryCode)); return items.OrderBy(o => o.Date); } } }
mit
C#
a22912756784bae8b94d209ccabc30e908f765fa
Change back to use the default database name.
lukecahill/NutritionTracker
food_tracker/TrackerContext.cs
food_tracker/TrackerContext.cs
using System.Data.Entity; namespace food_tracker { public class TrackerContext : DbContext { public TrackerContext() : base() { Configuration.LazyLoadingEnabled = false; this.Database.Log = s => System.Diagnostics.Debug.WriteLine(s); } public DbSet<WholeDay> Days { get; set; } public DbSet<NutritionItem> Nutrition { get; set; } } }
using System.Data.Entity; namespace food_tracker { public class TrackerContext : DbContext { public TrackerContext() : base("name=NutritionTrackerContext") { Configuration.LazyLoadingEnabled = false; this.Database.Log = s => System.Diagnostics.Debug.WriteLine(s); } public DbSet<WholeDay> Days { get; set; } public DbSet<NutritionItem> Nutrition { get; set; } } }
mit
C#
09b3b25798211fdabc200a8e754474879495e4f5
rename method
DDReaper/MixedRealityToolkit-Unity,killerantz/HoloToolkit-Unity,killerantz/HoloToolkit-Unity,killerantz/HoloToolkit-Unity,killerantz/HoloToolkit-Unity
Assets/MixedRealityToolkit.Providers/WindowsMixedReality/Editor/ConfigurationChecker/WindowsMixedRealityConfigurationChecker.cs
Assets/MixedRealityToolkit.Providers/WindowsMixedReality/Editor/ConfigurationChecker/WindowsMixedRealityConfigurationChecker.cs
// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See LICENSE in the project root for license information. using Microsoft.MixedReality.Toolkit.Utilities.Editor; using System.IO; using UnityEditor; namespace Microsoft.MixedReality.Toolkit.WindowsMixedReality { /// <summary> /// Class to perform checks for configuration checks for the Windows Mixed Reality provider. /// </summary> [InitializeOnLoad] public static class WindowsMixedRealityConfigurationChecker { static WindowsMixedRealityConfigurationChecker() { EnsureDotNetWinRTDefine(); } /// <summary> /// Ensures that the appropriate symbolic constant is defined based on the presence of the DotNetWinRT binary. /// </summary> private static void EnsureDotNetWinRTDefine() { const string fileName = "Microsoft.Windows.MixedReality.DotNetWinRT.dll"; string[] defintions = { "DOTNETWINRT_PRESENT" }; FileInfo[] files = FileUtilities.FindFilesInAssets(fileName); if (files.Length > 0) { ScriptingUtilities.AppendScriptingDefinitions(BuildTargetGroup.WSA, defintions); } else { ScriptingUtilities.RemoveScriptingDefinitions(BuildTargetGroup.WSA, defintions); } } } }
// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See LICENSE in the project root for license information. using Microsoft.MixedReality.Toolkit.Utilities.Editor; using System.IO; using UnityEditor; namespace Microsoft.MixedReality.Toolkit.WindowsMixedReality { /// <summary> /// Class to perform checks for configuration checks for the Windows Mixed Reality provider. /// </summary> [InitializeOnLoad] public static class WindowsMixedRealityConfigurationChecker { static WindowsMixedRealityConfigurationChecker() { EnsureDotNetWinRT(); } /// <summary> /// Ensures that the appropriate value is defined based on the presence of the DotNetWinRT binary. /// </summary> private static void EnsureDotNetWinRT() { const string fileName = "Microsoft.Windows.MixedReality.DotNetWinRT.dll"; string[] defintions = { "DOTNETWINRT_PRESENT" }; FileInfo[] files = FileUtilities.FindFilesInAssets(fileName); if (files.Length > 0) { ScriptingUtilities.AppendScriptingDefinitions(BuildTargetGroup.WSA, defintions); } else { ScriptingUtilities.RemoveScriptingDefinitions(BuildTargetGroup.WSA, defintions); } } } }
mit
C#
f768e62d40278b4c22e13ce916a84c71ea63926a
add custom content serializer extension to CapBuilder
dotnetcore/CAP,dotnetcore/CAP,dotnetcore/CAP,ouraspnet/cap
src/DotNetCore.CAP/CAP.Builder.cs
src/DotNetCore.CAP/CAP.Builder.cs
using System; using DotNetCore.CAP.Abstractions; using Microsoft.Extensions.DependencyInjection; namespace DotNetCore.CAP { /// <summary> /// Used to verify cap service was called on a ServiceCollection /// </summary> public class CapMarkerService { } /// <summary> /// Used to verify cap database storage extension was added on a ServiceCollection /// </summary> public class CapDatabaseStorageMarkerService { } /// <summary> /// Used to verify cap message queue extension was added on a ServiceCollection /// </summary> public class CapMessageQueueMakerService { } /// <summary> /// Allows fine grained configuration of CAP services. /// </summary> public sealed class CapBuilder { public CapBuilder(IServiceCollection services) { Services = services; } /// <summary> /// Gets the <see cref="IServiceCollection" /> where MVC services are configured. /// </summary> public IServiceCollection Services { get; } /// <summary> /// Add an <see cref="ICapPublisher" />. /// </summary> /// <typeparam name="T">The type of the service.</typeparam> public CapBuilder AddProducerService<T>() where T : class, ICapPublisher { return AddScoped(typeof(ICapPublisher), typeof(T)); } /// <summary> /// Add a custom content serializer /// </summary> /// <typeparam name="T">The type of the service.</typeparam> public CapBuilder AddContentSerializer<T>() where T : class, IContentSerializer { return AddSingleton(typeof(IContentSerializer), typeof(T)); } /// <summary> /// Adds a scoped service of the type specified in serviceType with an implementation /// </summary> private CapBuilder AddScoped(Type serviceType, Type concreteType) { Services.AddScoped(serviceType, concreteType); return this; } /// <summary> /// Adds a singleton service of the type specified in serviceType with an implementation /// </summary> private CapBuilder AddSingleton(Type serviceType, Type concreteType) { Services.AddSingleton(serviceType, concreteType); return this; } } }
using System; using Microsoft.Extensions.DependencyInjection; namespace DotNetCore.CAP { /// <summary> /// Used to verify cap service was called on a ServiceCollection /// </summary> public class CapMarkerService { } /// <summary> /// Used to verify cap database storage extension was added on a ServiceCollection /// </summary> public class CapDatabaseStorageMarkerService { } /// <summary> /// Used to verify cap message queue extension was added on a ServiceCollection /// </summary> public class CapMessageQueueMakerService { } /// <summary> /// Allows fine grained configuration of CAP services. /// </summary> public class CapBuilder { public CapBuilder(IServiceCollection services) { Services = services; } /// <summary> /// Gets the <see cref="IServiceCollection" /> where MVC services are configured. /// </summary> public IServiceCollection Services { get; } /// <summary> /// Adds a scoped service of the type specified in serviceType with an implementation /// </summary> private CapBuilder AddScoped(Type serviceType, Type concreteType) { Services.AddScoped(serviceType, concreteType); return this; } /// <summary> /// Add an <see cref="ICapPublisher" />. /// </summary> /// <typeparam name="T">The type of the service.</typeparam> public virtual CapBuilder AddProducerService<T>() where T : class, ICapPublisher { return AddScoped(typeof(ICapPublisher), typeof(T)); } } }
mit
C#
c66064872a18d1bd75cdcdde80fa4242f5054978
Fix `DrawableHit` test scene not showing rim hits correctly
ppy/osu,peppy/osu,peppy/osu,ppy/osu,ppy/osu,peppy/osu
osu.Game.Rulesets.Taiko.Tests/Skinning/TestSceneDrawableHit.cs
osu.Game.Rulesets.Taiko.Tests/Skinning/TestSceneDrawableHit.cs
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. #nullable disable using NUnit.Framework; using osu.Framework.Graphics; using osu.Game.Beatmaps; using osu.Game.Beatmaps.ControlPoints; using osu.Game.Rulesets.Taiko.Objects; using osu.Game.Rulesets.Taiko.Objects.Drawables; namespace osu.Game.Rulesets.Taiko.Tests.Skinning { [TestFixture] public class TestSceneDrawableHit : TaikoSkinnableTestScene { [Test] public void TestHits() { AddStep("Centre hit", () => SetContents(_ => new DrawableHit(createHitAtCurrentTime()) { Anchor = Anchor.Centre, Origin = Anchor.Centre, })); AddStep("Centre hit (strong)", () => SetContents(_ => new DrawableHit(createHitAtCurrentTime(true)) { Anchor = Anchor.Centre, Origin = Anchor.Centre, })); AddStep("Rim hit", () => SetContents(_ => new DrawableHit(createHitAtCurrentTime(rim: true)) { Anchor = Anchor.Centre, Origin = Anchor.Centre, })); AddStep("Rim hit (strong)", () => SetContents(_ => new DrawableHit(createHitAtCurrentTime(true, true)) { Anchor = Anchor.Centre, Origin = Anchor.Centre, })); } private Hit createHitAtCurrentTime(bool strong = false, bool rim = false) { var hit = new Hit { Type = rim ? HitType.Rim : HitType.Centre, IsStrong = strong, StartTime = Time.Current + 3000, }; hit.ApplyDefaults(new ControlPointInfo(), new BeatmapDifficulty()); return hit; } } }
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. #nullable disable using NUnit.Framework; using osu.Framework.Graphics; using osu.Game.Beatmaps; using osu.Game.Beatmaps.ControlPoints; using osu.Game.Rulesets.Taiko.Objects; using osu.Game.Rulesets.Taiko.Objects.Drawables; namespace osu.Game.Rulesets.Taiko.Tests.Skinning { [TestFixture] public class TestSceneDrawableHit : TaikoSkinnableTestScene { [Test] public void TestHits() { AddStep("Centre hit", () => SetContents(_ => new DrawableHit(createHitAtCurrentTime()) { Anchor = Anchor.Centre, Origin = Anchor.Centre, })); AddStep("Centre hit (strong)", () => SetContents(_ => new DrawableHit(createHitAtCurrentTime(true)) { Anchor = Anchor.Centre, Origin = Anchor.Centre, })); AddStep("Rim hit", () => SetContents(_ => new DrawableHit(createHitAtCurrentTime()) { Anchor = Anchor.Centre, Origin = Anchor.Centre, })); AddStep("Rim hit (strong)", () => SetContents(_ => new DrawableHit(createHitAtCurrentTime(true)) { Anchor = Anchor.Centre, Origin = Anchor.Centre, })); } private Hit createHitAtCurrentTime(bool strong = false) { var hit = new Hit { IsStrong = strong, StartTime = Time.Current + 3000, }; hit.ApplyDefaults(new ControlPointInfo(), new BeatmapDifficulty()); return hit; } } }
mit
C#
0805b65e0e9af48a8276d529f73773b634de4bda
Update NUnitTest1.cs
informedcitizenry/6502.Net
NUnitTest6502.Net/NUnitTest1.cs
NUnitTest6502.Net/NUnitTest1.cs
using Asm6502.Net; using NUnit.Framework; using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace UnitTest6502.Net { [TestFixture] public class GeneralTest { [Test] public void TestStringBuilderExtensions() { StringBuilder sb = new StringBuilder(" hello "); Assert.AreEqual(" hello ", sb.ToString()); sb.TrimStart(); Assert.AreEqual("hello ", sb.ToString()); sb.TrimEnd(); Assert.AreEqual("hello", sb.ToString()); sb = new StringBuilder(" hello "); sb.Trim(); Assert.AreEqual("hello", sb.ToString()); sb.Length = 10; sb.Replace('\0', ' '); Assert.AreEqual("hello ", sb.ToString()); } [Test] public void TestcaseSensitivity() { StringComparison ignore = StringComparison.CurrentCultureIgnoreCase; StringComparer ignoreC = StringComparer.CurrentCultureIgnoreCase; StringComparison casesensitive = StringComparison.CurrentCulture; StringComparer casesensitiveC = StringComparer.CurrentCulture; System.Collections.Generic.HashSet<string> ignoreHash = new System.Collections.Generic.HashSet<string>(ignoreC); System.Collections.Generic.HashSet<string> csHash = new System.Collections.Generic.HashSet<string>(casesensitiveC); string lstring = "bob"; string Mstring = "Bob"; ignoreHash.Add(lstring); csHash.Add(Mstring); Assert.IsTrue(ignoreHash.Contains(lstring.ToUpper())); // BOB Assert.IsTrue(csHash.Contains(Mstring)); Assert.IsFalse(csHash.Contains(Mstring.ToUpper())); // BOB Assert.IsTrue(lstring.Equals(Mstring, ignore)); Assert.IsFalse(Mstring.Equals(lstring, casesensitive)); } } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using NUnit.Framework; using Asm6502.Net; namespace UnitTest6502.Net { [TestFixture] public class GeneralTest { [Test] public void TestStringBuilderExtensions() { StringBuilder sb = new StringBuilder(" hello "); Assert.AreEqual(" hello ", sb.ToString()); sb.TrimStart(); Assert.AreEqual("hello ", sb.ToString()); sb.TrimEnd(); Assert.AreEqual("hello", sb.ToString()); sb = new StringBuilder(" hello "); sb.Trim(); Assert.AreEqual("hello", sb.ToString()); sb.Length = 10; sb.Replace('\0', ' '); Assert.AreEqual("hello ", sb.ToString()); } [Test] public void TestcaseSensitivity() { StringComparison ignore = StringComparison.CurrentCultureIgnoreCase; StringComparer ignoreC = StringComparer.CurrentCultureIgnoreCase; StringComparison casesensitive = StringComparison.CurrentCulture; StringComparer casesensitiveC = StringComparer.CurrentCulture; System.Collections.Generic.HashSet<string> ignoreHash = new System.Collections.Generic.HashSet<string>(ignoreC); System.Collections.Generic.HashSet<string> csHash = new System.Collections.Generic.HashSet<string>(casesensitiveC); string lstring = "bob"; string Mstring = "Bob"; ignoreHash.Add(lstring); csHash.Add(Mstring); Assert.IsTrue(ignoreHash.Contains(lstring.ToUpper())); // BOB Assert.IsTrue(csHash.Contains(Mstring)); Assert.IsFalse(csHash.Contains(Mstring.ToUpper())); // BOB Assert.IsTrue(lstring.Equals(Mstring, ignore)); Assert.IsFalse(Mstring.Equals(lstring, casesensitive)); } } }
mit
C#
5419b461450cda52197197034c1286695bf86939
Fix NSUrlConnection:SendSynchronousRequest binding
beni55/maccore,mono/maccore,cwensley/maccore,jorik041/maccore
src/Foundation/NSUrlConnection.cs
src/Foundation/NSUrlConnection.cs
// // NSUrlConnection.cs: // Author: // Miguel de Icaza // using System; using System.Reflection; using System.Collections; using System.Runtime.InteropServices; using MonoMac.ObjCRuntime; namespace MonoMac.Foundation { public partial class NSUrlConnection { static Selector selSendSynchronousRequestReturningResponseError = new Selector ("sendSynchronousRequest:returningResponse:error:"); unsafe static NSData SendSynchronousRequest (NSUrlRequest request, out NSUrlResponse response, out NSError error) { IntPtr responseStorage = IntPtr.Zero; IntPtr errorStorage = IntPtr.Zero; void *resp = &responseStorage; void *errp = &errorStorage; IntPtr rhandle = (IntPtr) resp; IntPtr ehandle = (IntPtr) errp; var res = Messaging.IntPtr_objc_msgSend_IntPtr_IntPtr_IntPtr ( class_ptr, selSendSynchronousRequestReturningResponseError.Handle, request.Handle, rhandle, ehandle); if (responseStorage != IntPtr.Zero) response = (NSUrlResponse) Runtime.GetNSObject (responseStorage); else response = null; if (errorStorage != IntPtr.Zero) error = (NSUrlResponse) Runtime.GetNSObject (errorStorage); else error = null; return (NSData) Runtime.GetNSObject (res); } } }
// // NSUrlConnection.cs: // Author: // Miguel de Icaza // using System; using System.Reflection; using System.Collections; using System.Runtime.InteropServices; using MonoMac.ObjCRuntime; namespace MonoMac.Foundation { public partial class NSUrlConnection { static Selector selSendSynchronousRequestReturningResponseError = new Selector ("sendSynchronousRequest:returningResponse:error:"); unsafe static NSData SendSynchronousRequest (NSUrlRequest request, out NSUrlResponse response, NSError error) { IntPtr storage = IntPtr.Zero; void *p = &storage; IntPtr handle = (IntPtr) p; var res = Messaging.IntPtr_objc_msgSend_IntPtr_IntPtr_IntPtr ( class_ptr, selSendSynchronousRequestReturningResponseError.Handle, request.Handle, handle, error != null ? error.Handle : IntPtr.Zero); if (storage != IntPtr.Zero) response = (NSUrlResponse) Runtime.GetNSObject (storage); else response = null; return (NSData) Runtime.GetNSObject (res); } } }
apache-2.0
C#
2e5a292f440eef4a9f3b27061060a79f0df368d9
Add extra parameter in connection API
stankovski/azure-powershell,haocs/azure-powershell,arcadiahlyy/azure-powershell,atpham256/azure-powershell,jtlibing/azure-powershell,arcadiahlyy/azure-powershell,rohmano/azure-powershell,AzureAutomationTeam/azure-powershell,jtlibing/azure-powershell,naveedaz/azure-powershell,shuagarw/azure-powershell,AzureRT/azure-powershell,dulems/azure-powershell,nemanja88/azure-powershell,akurmi/azure-powershell,nemanja88/azure-powershell,hungmai-msft/azure-powershell,alfantp/azure-powershell,yoavrubin/azure-powershell,CamSoper/azure-powershell,stankovski/azure-powershell,AzureRT/azure-powershell,hovsepm/azure-powershell,stankovski/azure-powershell,TaraMeyer/azure-powershell,hungmai-msft/azure-powershell,Matt-Westphal/azure-powershell,krkhan/azure-powershell,yoavrubin/azure-powershell,krkhan/azure-powershell,yantang-msft/azure-powershell,ClogenyTechnologies/azure-powershell,dulems/azure-powershell,alfantp/azure-powershell,arcadiahlyy/azure-powershell,jtlibing/azure-powershell,atpham256/azure-powershell,pankajsn/azure-powershell,arcadiahlyy/azure-powershell,arcadiahlyy/azure-powershell,dulems/azure-powershell,jtlibing/azure-powershell,atpham256/azure-powershell,zhencui/azure-powershell,rohmano/azure-powershell,haocs/azure-powershell,stankovski/azure-powershell,seanbamsft/azure-powershell,devigned/azure-powershell,yantang-msft/azure-powershell,haocs/azure-powershell,Matt-Westphal/azure-powershell,zhencui/azure-powershell,Matt-Westphal/azure-powershell,akurmi/azure-powershell,yoavrubin/azure-powershell,rohmano/azure-powershell,jtlibing/azure-powershell,hungmai-msft/azure-powershell,hungmai-msft/azure-powershell,yoavrubin/azure-powershell,shuagarw/azure-powershell,hungmai-msft/azure-powershell,krkhan/azure-powershell,pankajsn/azure-powershell,Matt-Westphal/azure-powershell,yantang-msft/azure-powershell,CamSoper/azure-powershell,shuagarw/azure-powershell,krkhan/azure-powershell,ClogenyTechnologies/azure-powershell,stankovski/azure-powershell,seanbamsft/azure-powershell,AzureAutomationTeam/azure-powershell,juvchan/azure-powershell,devigned/azure-powershell,rohmano/azure-powershell,krkhan/azure-powershell,akurmi/azure-powershell,AzureAutomationTeam/azure-powershell,alfantp/azure-powershell,juvchan/azure-powershell,naveedaz/azure-powershell,TaraMeyer/azure-powershell,nemanja88/azure-powershell,haocs/azure-powershell,pankajsn/azure-powershell,alfantp/azure-powershell,ankurchoubeymsft/azure-powershell,juvchan/azure-powershell,zhencui/azure-powershell,seanbamsft/azure-powershell,nemanja88/azure-powershell,dulems/azure-powershell,TaraMeyer/azure-powershell,AzureAutomationTeam/azure-powershell,yantang-msft/azure-powershell,ankurchoubeymsft/azure-powershell,yantang-msft/azure-powershell,yantang-msft/azure-powershell,krkhan/azure-powershell,alfantp/azure-powershell,CamSoper/azure-powershell,haocs/azure-powershell,Matt-Westphal/azure-powershell,devigned/azure-powershell,TaraMeyer/azure-powershell,juvchan/azure-powershell,naveedaz/azure-powershell,AzureAutomationTeam/azure-powershell,naveedaz/azure-powershell,zhencui/azure-powershell,atpham256/azure-powershell,hovsepm/azure-powershell,seanbamsft/azure-powershell,atpham256/azure-powershell,hungmai-msft/azure-powershell,AzureRT/azure-powershell,CamSoper/azure-powershell,hovsepm/azure-powershell,hovsepm/azure-powershell,pankajsn/azure-powershell,zhencui/azure-powershell,ClogenyTechnologies/azure-powershell,AzureRT/azure-powershell,shuagarw/azure-powershell,seanbamsft/azure-powershell,AzureRT/azure-powershell,juvchan/azure-powershell,devigned/azure-powershell,ankurchoubeymsft/azure-powershell,ClogenyTechnologies/azure-powershell,zhencui/azure-powershell,atpham256/azure-powershell,seanbamsft/azure-powershell,devigned/azure-powershell,dulems/azure-powershell,naveedaz/azure-powershell,rohmano/azure-powershell,nemanja88/azure-powershell,naveedaz/azure-powershell,akurmi/azure-powershell,devigned/azure-powershell,yoavrubin/azure-powershell,CamSoper/azure-powershell,shuagarw/azure-powershell,ClogenyTechnologies/azure-powershell,AzureAutomationTeam/azure-powershell,akurmi/azure-powershell,ankurchoubeymsft/azure-powershell,pankajsn/azure-powershell,TaraMeyer/azure-powershell,hovsepm/azure-powershell,pankajsn/azure-powershell,ankurchoubeymsft/azure-powershell,AzureRT/azure-powershell,rohmano/azure-powershell
src/ResourceManager/Network/Commands.Network/Models/PSVirtualNetworkGatewayConnection.cs
src/ResourceManager/Network/Commands.Network/Models/PSVirtualNetworkGatewayConnection.cs
// ---------------------------------------------------------------------------------- // // Copyright Microsoft Corporation // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // http://www.apache.org/licenses/LICENSE-2.0 // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // ---------------------------------------------------------------------------------- namespace Microsoft.Azure.Commands.Network.Models { using Newtonsoft.Json; public class PSVirtualNetworkGatewayConnection : PSTopLevelResource { public string AuthorizationKey { get; set; } public PSVirtualNetworkGateway VirtualNetworkGateway1 { get; set; } public PSVirtualNetworkGateway VirtualNetworkGateway2 { get; set; } public PSLocalNetworkGateway LocalNetworkGateway2 { get; set; } public PSResourceId Peer { get; set; } public string ConnectionType { get; set; } public int RoutingWeight { get; set; } public string SharedKey { get; set; } public string ConnectionStatus { get; set; } public ulong EgressBytesTransferred { get; set; } public ulong IngressBytesTransferred { get; set; } public string ProvisioningState { get; set; } [JsonIgnore] public string VirtualNetworkGateway1Text { get { return JsonConvert.SerializeObject(VirtualNetworkGateway1.Id, Formatting.Indented, new JsonSerializerSettings() { NullValueHandling = NullValueHandling.Ignore }); } } [JsonIgnore] public string VirtualNetworkGateway2Text { get { return JsonConvert.SerializeObject(VirtualNetworkGateway2.Id, Formatting.Indented, new JsonSerializerSettings() { NullValueHandling = NullValueHandling.Ignore }); } } [JsonIgnore] public string LocalNetworkGateway2Text { get { return JsonConvert.SerializeObject(LocalNetworkGateway2.Id, Formatting.Indented, new JsonSerializerSettings() { NullValueHandling = NullValueHandling.Ignore }); } } [JsonIgnore] public string PeerText { get { return JsonConvert.SerializeObject(Peer.Id, Formatting.Indented, new JsonSerializerSettings() { NullValueHandling = NullValueHandling.Ignore }); } } } }
// ---------------------------------------------------------------------------------- // // Copyright Microsoft Corporation // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // http://www.apache.org/licenses/LICENSE-2.0 // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // ---------------------------------------------------------------------------------- namespace Microsoft.Azure.Commands.Network.Models { using Newtonsoft.Json; public class PSVirtualNetworkGatewayConnection : PSTopLevelResource { public string AuthorizationKey { get; set; } public PSVirtualNetworkGateway VirtualNetworkGateway1 { get; set; } public PSVirtualNetworkGateway VirtualNetworkGateway2 { get; set; } public PSLocalNetworkGateway LocalNetworkGateway2 { get; set; } public PSResourceId Peer { get; set; } public string ConnectionType { get; set; } public int RoutingWeight { get; set; } public string SharedKey { get; set; } public string ConnectionStatus { get; set; } public ulong EgressBytesTransferred { get; set; } public ulong IngressBytesTransferred { get; set; } [JsonIgnore] public string VirtualNetworkGateway1Text { get { return JsonConvert.SerializeObject(VirtualNetworkGateway1.Id, Formatting.Indented, new JsonSerializerSettings() { NullValueHandling = NullValueHandling.Ignore }); } } [JsonIgnore] public string VirtualNetworkGateway2Text { get { return JsonConvert.SerializeObject(VirtualNetworkGateway2.Id, Formatting.Indented, new JsonSerializerSettings() { NullValueHandling = NullValueHandling.Ignore }); } } [JsonIgnore] public string LocalNetworkGateway2Text { get { return JsonConvert.SerializeObject(LocalNetworkGateway2.Id, Formatting.Indented, new JsonSerializerSettings() { NullValueHandling = NullValueHandling.Ignore }); } } [JsonIgnore] public string PeerText { get { return JsonConvert.SerializeObject(Peer.Id, Formatting.Indented, new JsonSerializerSettings() { NullValueHandling = NullValueHandling.Ignore }); } } } }
apache-2.0
C#
4b0c09b69c46526cadae4fd60a3a8e27ba8283d4
Add async enumerator for Task collection
KodamaSakuno/Sakuno.Base
src/Sakuno.Base/TaskExtensions.cs
src/Sakuno.Base/TaskExtensions.cs
using System.Collections.Generic; using System.ComponentModel; using System.Linq; using System.Runtime.CompilerServices; using System.Threading.Tasks; namespace Sakuno { [EditorBrowsable(EditorBrowsableState.Never)] public static class TaskExtensions { #pragma warning disable IDE0060 [MethodImpl(MethodImplOptions.AggressiveInlining)] public static void Forget(this Task task) { } #pragma warning restore IDE0060 [MethodImpl(MethodImplOptions.AggressiveInlining)] public static void WaitAndUnwarp(this Task task) => task.GetAwaiter().GetResult(); [MethodImpl(MethodImplOptions.AggressiveInlining)] public static T WaitAndUnwarp<T>(this Task<T> task) => task.GetAwaiter().GetResult(); [MethodImpl(MethodImplOptions.AggressiveInlining)] public static void WaitAll(this Task[] tasks) => Task.WaitAll(tasks); [MethodImpl(MethodImplOptions.AggressiveInlining)] public static int WaitAny(this Task[] tasks) => Task.WaitAny(tasks); [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Task WhenAll(this IEnumerable<Task> tasks) => Task.WhenAll(tasks); [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Task<T[]> WhenAll<T>(this IEnumerable<Task<T>> tasks) => Task.WhenAll(tasks); [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Task<Task> WhenAny(this IEnumerable<Task> tasks) => Task.WhenAny(tasks); [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Task<Task<T>> WhenAny<T>(this IEnumerable<Task<T>> tasks) => Task.WhenAny(tasks); #if NETSTANDARD2_1 public static async IAsyncEnumerable<T> AsAsyncEnumeable<T>(this IEnumerable<Task<T>> tasks) { foreach (var task in tasks.ToArray()) yield return await task; } #endif } }
using System.Collections.Generic; using System.ComponentModel; using System.Runtime.CompilerServices; using System.Threading.Tasks; namespace Sakuno { [EditorBrowsable(EditorBrowsableState.Never)] public static class TaskExtensions { #pragma warning disable IDE0060 [MethodImpl(MethodImplOptions.AggressiveInlining)] public static void Forget(this Task task) { } #pragma warning restore IDE0060 [MethodImpl(MethodImplOptions.AggressiveInlining)] public static void WaitAndUnwarp(this Task task) => task.GetAwaiter().GetResult(); [MethodImpl(MethodImplOptions.AggressiveInlining)] public static T WaitAndUnwarp<T>(this Task<T> task) => task.GetAwaiter().GetResult(); [MethodImpl(MethodImplOptions.AggressiveInlining)] public static void WaitAll(this Task[] tasks) => Task.WaitAll(tasks); [MethodImpl(MethodImplOptions.AggressiveInlining)] public static int WaitAny(this Task[] tasks) => Task.WaitAny(tasks); [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Task WhenAll(this IEnumerable<Task> tasks) => Task.WhenAll(tasks); [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Task<T[]> WhenAll<T>(this IEnumerable<Task<T>> tasks) => Task.WhenAll(tasks); [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Task<Task> WhenAny(this IEnumerable<Task> tasks) => Task.WhenAny(tasks); [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Task<Task<T>> WhenAny<T>(this IEnumerable<Task<T>> tasks) => Task.WhenAny(tasks); } }
mit
C#
16af37474f59acebad35de77099910f68ea36c17
Update tests re: process builder, etc.
brendanjbaker/Bakery
test/Bakery.Processes.Tests/Bakery/Processes/SystemDiagnosticsProcessTests.cs
test/Bakery.Processes.Tests/Bakery/Processes/SystemDiagnosticsProcessTests.cs
namespace Bakery.Processes { using System; using System.Text; using System.Threading.Tasks; using Xunit; public class SystemDiagnosticsProcessTests { [Fact] public async Task EchoWithCombinedOutput() { var process = await new ProcessFactory().RunAsync(builder => { return builder .WithProgram("echo") .WithArguments("a", "b", "c") .WithEnvironment() .WithCombinedOutput() .Build(); }); var stringBuilder = new StringBuilder(); while (true) { var output = await process.TryReadAsync(TimeSpan.FromSeconds(1)); if (output == null) break; stringBuilder.Append(output.Text); } var totalOutput = stringBuilder.ToString(); Assert.Equal("a b c", totalOutput); } } }
namespace Bakery.Processes { using Specification.Builder; using System; using System.Text; using System.Threading.Tasks; using Xunit; public class SystemDiagnosticsProcessTests { [Fact] public async Task EchoWithCombinedOutput() { var processSpecification = ProcessSpecificationBuilder.Create() .WithProgram(@"echo") .WithArguments("a", "b", "c") .WithEnvironment() .WithCombinedOutput() .Build(); var processFactory = new ProcessFactory(); var process = processFactory.Start(processSpecification); var stringBuilder = new StringBuilder(); await process.WaitForExit(TimeSpan.FromSeconds(5)); while (true) { var output = await process.TryReadAsync(TimeSpan.FromSeconds(1)); if (output == null) break; stringBuilder.Append(output.Text); } var totalOutput = stringBuilder.ToString(); Assert.Equal("a b c", totalOutput); } } }
mit
C#
bb118a68765f2b1b35704fefaa1e592355c7f3c5
improve AdditionalPluginsInstaller so that updated plugin is immeditely loaded
JetBrains/resharper-unity,JetBrains/resharper-unity,JetBrains/resharper-unity
unity/JetBrains.Rider.Unity.Editor/EditorPlugin/AdditionalPluginsInstaller.cs
unity/JetBrains.Rider.Unity.Editor/EditorPlugin/AdditionalPluginsInstaller.cs
using System; using System.Diagnostics; using System.IO; using System.Reflection; using JetBrains.Util.Logging; using UnityEditor; namespace JetBrains.Rider.Unity.Editor { public static class AdditionalPluginsInstaller { private static readonly ILog ourLogger = Log.GetLog("AdditionalPluginsInstaller"); private static readonly string ourTarget = ExecutingAssemblyPath; public static void UpdateSelf(string fullPluginPath) { if (string.IsNullOrEmpty(fullPluginPath)) return; if (!PluginEntryPoint.IsLoadedFromAssets()) { ourLogger.Verbose($"Plugin was not loaded from Assets."); return; } ourLogger.Verbose($"UnityUtils.UnityVersion: {UnityUtils.UnityVersion}"); if (UnityUtils.UnityVersion >= new Version(5, 6)) { var fullPluginFileInfo = new FileInfo(fullPluginPath); if (!fullPluginFileInfo.Exists) { ourLogger.Verbose($"Plugin {fullPluginPath} doesn't exist."); return; } ourLogger.Verbose($"ourTarget: {ourTarget}"); if (File.Exists(ourTarget)) { var targetVersionInfo = FileVersionInfo.GetVersionInfo(ourTarget); var originVersionInfo = FileVersionInfo.GetVersionInfo(fullPluginFileInfo.FullName); ourLogger.Verbose($"{targetVersionInfo.FileVersion} {originVersionInfo.FileVersion} {targetVersionInfo.InternalName} {originVersionInfo.InternalName}"); if (targetVersionInfo.FileVersion != originVersionInfo.FileVersion || targetVersionInfo.InternalName != originVersionInfo.InternalName) { ourLogger.Verbose($"Coping ${fullPluginFileInfo} -> ${ourTarget}."); File.Delete(ourTarget); File.Delete(ourTarget+".meta"); fullPluginFileInfo.CopyTo(ourTarget, true); AssetDatabase.Refresh(); return; } } ourLogger.Verbose($"Plugin {ourTarget} was not updated by {fullPluginPath}."); } } private static string ExecutingAssemblyPath { get { var codeBase = Assembly.GetExecutingAssembly().CodeBase; var uri = new UriBuilder(codeBase); var path = Uri.UnescapeDataString(uri.Path); return path; } } } }
using System; using System.Diagnostics; using System.IO; using System.Reflection; using JetBrains.Util.Logging; namespace JetBrains.Rider.Unity.Editor { public static class AdditionalPluginsInstaller { private static readonly ILog ourLogger = Log.GetLog("AdditionalPluginsInstaller"); private static readonly string ourTarget = ExecutingAssemblyPath; public static void UpdateSelf(string fullPluginPath) { if (string.IsNullOrEmpty(fullPluginPath)) return; if (!PluginEntryPoint.IsLoadedFromAssets()) { ourLogger.Verbose($"Plugin was not loaded from Assets."); return; } ourLogger.Verbose($"UnityUtils.UnityVersion: {UnityUtils.UnityVersion}"); if (UnityUtils.UnityVersion >= new Version(5, 6)) { var fullPluginFileInfo = new FileInfo(fullPluginPath); if (!fullPluginFileInfo.Exists) { ourLogger.Verbose($"Plugin {fullPluginPath} doesn't exist."); return; } ourLogger.Verbose($"ourTarget: {ourTarget}"); if (File.Exists(ourTarget)) { var targetVersionInfo = FileVersionInfo.GetVersionInfo(ourTarget); var originVersionInfo = FileVersionInfo.GetVersionInfo(fullPluginFileInfo.FullName); ourLogger.Verbose($"{targetVersionInfo.FileVersion} {originVersionInfo.FileVersion} {targetVersionInfo.InternalName} {originVersionInfo.InternalName}"); if (targetVersionInfo.FileVersion != originVersionInfo.FileVersion || targetVersionInfo.InternalName != originVersionInfo.InternalName) { ourLogger.Verbose($"Coping ${fullPluginFileInfo} -> ${ourTarget}."); fullPluginFileInfo.CopyTo(ourTarget, true); return; } } ourLogger.Verbose($"Plugin {ourTarget} was not updated by {fullPluginPath}."); } } private static string ExecutingAssemblyPath { get { var codeBase = Assembly.GetExecutingAssembly().CodeBase; var uri = new UriBuilder(codeBase); var path = Uri.UnescapeDataString(uri.Path); return path; } } } }
apache-2.0
C#
dcba622771f1229e1cee05ee4581b2330de1d1fb
Use RecordedTest in template live tests (#19064)
ayeletshpigelman/azure-sdk-for-net,AsrOneSdk/azure-sdk-for-net,AsrOneSdk/azure-sdk-for-net,jackmagic313/azure-sdk-for-net,jackmagic313/azure-sdk-for-net,AsrOneSdk/azure-sdk-for-net,ayeletshpigelman/azure-sdk-for-net,ayeletshpigelman/azure-sdk-for-net,jackmagic313/azure-sdk-for-net,jackmagic313/azure-sdk-for-net,jackmagic313/azure-sdk-for-net,ayeletshpigelman/azure-sdk-for-net,AsrOneSdk/azure-sdk-for-net
sdk/template/Azure.Template/tests/MiniSecretClientLiveTests.cs
sdk/template/Azure.Template/tests/MiniSecretClientLiveTests.cs
// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. using System; using System.Threading.Tasks; using Azure.Core.TestFramework; using NUnit.Framework; namespace Azure.Template.Tests { public class MiniSecretClientLiveTests: RecordedTestBase<MiniSecretClientTestEnvironment> { public MiniSecretClientLiveTests(bool isAsync) : base(isAsync) { } private MiniSecretClient CreateClient() { return InstrumentClient(new MiniSecretClient( new Uri(TestEnvironment.KeyVaultUri), TestEnvironment.Credential, InstrumentClientOptions(new MiniSecretClientOptions()) )); } [RecordedTest] public async Task CanGetSecret() { var client = CreateClient(); var secret = await client.GetSecretAsync("TestSecret"); Assert.AreEqual("Very secret value", secret.Value.Value); } } }
// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. using System; using System.Threading.Tasks; using Azure.Core.TestFramework; using NUnit.Framework; namespace Azure.Template.Tests { public class MiniSecretClientLiveTests: RecordedTestBase<MiniSecretClientTestEnvironment> { public MiniSecretClientLiveTests(bool isAsync) : base(isAsync) { } private MiniSecretClient CreateClient() { return InstrumentClient(new MiniSecretClient( new Uri(TestEnvironment.KeyVaultUri), TestEnvironment.Credential, InstrumentClientOptions(new MiniSecretClientOptions()) )); } [Test] public async Task CanGetSecret() { var client = CreateClient(); var secret = await client.GetSecretAsync("TestSecret"); Assert.AreEqual("Very secret value", secret.Value.Value); } } }
mit
C#
51f36a6c3534fb08859b9cffb4456dc6ed9764a4
Change namespace
fredrikstrandin/IdentityServer4.MongoDB
src/Core.MongoDB/Extensions/IdentityServerBuilderExtensions.cs
src/Core.MongoDB/Extensions/IdentityServerBuilderExtensions.cs
using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using IdentityServer4.Core.Services; using IdentityServer4.Core.Services.MongoDB; using IdentityServer4.Core.Validation; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection.Extensions; namespace Microsoft.Extensions.DependencyInjection { public static class IdentityServerBuilderExtensions { public static IIdentityServerBuilder AddMongoDBUsers(this IIdentityServerBuilder builder) { builder.Services.AddTransient<IProfileService, MongoDBProfileService>(); builder.Services.AddTransient<IResourceOwnerPasswordValidator, MongoDBResourceOwnerPasswordValidator>(); return builder; } public static IIdentityServerBuilder AddMongoDBClients(this IIdentityServerBuilder builder) { builder.Services.AddTransient<IClientStore, MongoDBClientStore>(); builder.Services.AddTransient<ICorsPolicyService, MongoDBCorsPolicyService>(); return builder; } public static IIdentityServerBuilder AddMongoDBScopes(this IIdentityServerBuilder builder) { builder.Services.AddTransient<IScopeStore, MongoDBScopeStore>(); return builder; } public static IServiceCollection AddMongoDBTransientStores(this IServiceCollection services) { services.TryAddSingleton<IAuthorizationCodeStore, MongoDBAuthorizationCodeStore>(); services.TryAddSingleton<IRefreshTokenStore, MongoDBRefreshTokenStore>(); services.TryAddSingleton<ITokenHandleStore, MongoDBTokenHandleStore>(); services.TryAddSingleton<IConsentStore, MongoDBConsentStore>(); return services; } } }
using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using IdentityServer4.Core.Services; using IdentityServer4.Core.Services.MongoDB; using IdentityServer4.Core.Validation; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection.Extensions; namespace Core.MongoDB.Extensions { public static class IdentityServerBuilderExtensions { public static IIdentityServerBuilder AddMongoDBUsers(this IIdentityServerBuilder builder) { builder.Services.AddTransient<IProfileService, MongoDBProfileService>(); builder.Services.AddTransient<IResourceOwnerPasswordValidator, MongoDBResourceOwnerPasswordValidator>(); return builder; } public static IIdentityServerBuilder AddMongoDBClients(this IIdentityServerBuilder builder) { builder.Services.AddTransient<IClientStore, MongoDBClientStore>(); builder.Services.AddTransient<ICorsPolicyService, MongoDBCorsPolicyService>(); return builder; } public static IIdentityServerBuilder AddMongoDBScopes(this IIdentityServerBuilder builder) { builder.Services.AddTransient<IScopeStore, MongoDBScopeStore>(); return builder; } public static IServiceCollection AddMongoDBTransientStores(this IServiceCollection services) { services.TryAddSingleton<IAuthorizationCodeStore, MongoDBAuthorizationCodeStore>(); services.TryAddSingleton<IRefreshTokenStore, MongoDBRefreshTokenStore>(); services.TryAddSingleton<ITokenHandleStore, MongoDBTokenHandleStore>(); services.TryAddSingleton<IConsentStore, MongoDBConsentStore>(); return services; } } }
apache-2.0
C#
ffef81475f26d06167e2b07360f6bfe0cc6574bf
Fix SqlServer
tgstation/tgstation-server,tgstation/tgstation-server,tgstation/tgstation-server-tools
src/Tgstation.Server.Host/Database/SqlServerDatabaseContext.cs
src/Tgstation.Server.Host/Database/SqlServerDatabaseContext.cs
using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; using System; using Tgstation.Server.Host.Configuration; namespace Tgstation.Server.Host.Database { /// <summary> /// <see cref="DatabaseContext{TParentContext}"/> for Sqlserver /// </summary> sealed class SqlServerDatabaseContext : DatabaseContext<SqlServerDatabaseContext> { /// <summary> /// Construct a <see cref="SqlServerDatabaseContext"/> /// </summary> /// <param name="dbContextOptions">The <see cref="DbContextOptions{TContext}"/> for the <see cref="DatabaseContext{TParentContext}"/></param> /// <param name="databaseConfiguration">The <see cref="IOptions{TOptions}"/> of <see cref="DatabaseConfiguration"/> for the <see cref="DatabaseContext{TParentContext}"/></param> /// <param name="databaseSeeder">The <see cref="IDatabaseSeeder"/> for the <see cref="DatabaseContext{TParentContext}"/></param> /// <param name="logger">The <see cref="ILogger"/> for the <see cref="DatabaseContext{TParentContext}"/></param> public SqlServerDatabaseContext(DbContextOptions<SqlServerDatabaseContext> dbContextOptions, IOptions<DatabaseConfiguration> databaseConfiguration, IDatabaseSeeder databaseSeeder, ILogger<SqlServerDatabaseContext> logger) : base(dbContextOptions, databaseConfiguration, databaseSeeder, logger) { } /// <inheritdoc /> protected override void OnConfiguring(DbContextOptionsBuilder options) { base.OnConfiguring(options); options.UseSqlServer(DatabaseConfiguration.ConnectionString); } /// <inheritdoc /> protected override void ValidateDatabaseType() { if (DatabaseType != DatabaseType.SqlServer) throw new InvalidOperationException("Invalid DatabaseType for SqlServerDatabaseContext!"); } } }
using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; using System; using Tgstation.Server.Host.Configuration; namespace Tgstation.Server.Host.Database { /// <summary> /// <see cref="DatabaseContext{TParentContext}"/> for Sqlserver /// </summary> sealed class SqlServerDatabaseContext : DatabaseContext<SqlServerDatabaseContext> { /// <summary> /// Construct a <see cref="SqlServerDatabaseContext"/> /// </summary> /// <param name="dbContextOptions">The <see cref="DbContextOptions{TContext}"/> for the <see cref="DatabaseContext{TParentContext}"/></param> /// <param name="databaseConfiguration">The <see cref="IOptions{TOptions}"/> of <see cref="DatabaseConfiguration"/> for the <see cref="DatabaseContext{TParentContext}"/></param> /// <param name="databaseSeeder">The <see cref="IDatabaseSeeder"/> for the <see cref="DatabaseContext{TParentContext}"/></param> /// <param name="logger">The <see cref="ILogger"/> for the <see cref="DatabaseContext{TParentContext}"/></param> public SqlServerDatabaseContext(DbContextOptions<SqlServerDatabaseContext> dbContextOptions, IOptions<DatabaseConfiguration> databaseConfiguration, IDatabaseSeeder databaseSeeder, ILogger<SqlServerDatabaseContext> logger) : base(dbContextOptions, databaseConfiguration, databaseSeeder, logger) { } /// <inheritdoc /> protected override void OnConfiguring(DbContextOptionsBuilder options) { base.OnConfiguring(options); options.UseSqlServer(DatabaseConfiguration.ConnectionString); } /// <inheritdoc /> protected override void ValidateDatabaseType() { if (DatabaseType != DatabaseType.Sqlite) throw new InvalidOperationException("Invalid DatabaseType for SqlServerDatabaseContext!"); } } }
agpl-3.0
C#
1ce8b42c062f4ec6dca59111f24c66ee2e672856
prepare for minor release update
AzureAD/microsoft-authentication-library-for-dotnet,AzureAD/azure-activedirectory-library-for-dotnet,AzureAD/microsoft-authentication-library-for-dotnet,AzureAD/microsoft-authentication-library-for-dotnet,AzureAD/microsoft-authentication-library-for-dotnet
src/ADAL.Common/CommonAssemblyInfo.cs
src/ADAL.Common/CommonAssemblyInfo.cs
//------------------------------------------------------------------------------ // // Copyright (c) Microsoft Corporation. // All rights reserved. // // This code is licensed under the MIT License. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files(the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and / or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions : // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. // //------------------------------------------------------------------------------ using System; using System.Reflection; [assembly: AssemblyProduct("Active Directory Authentication Library")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCulture("")] [assembly: AssemblyCompany("Microsoft Corporation")] [assembly: AssemblyCopyright("Copyright (c) Microsoft Corporation. All rights reserved.")] [assembly: AssemblyTrademark("")] [assembly: AssemblyMetadata("Serviceable", "True")] [assembly: AssemblyFileVersion("3.15.0.0")] // On official build, attribute AssemblyInformationalVersionAttribute is added as well // with its value equal to the hash of the last commit to the git branch. // e.g.: [assembly: AssemblyInformationalVersionAttribute("4392c9835a38c27516fc0cd7bad7bccdcaeab161")] [assembly: CLSCompliant(false)]
//------------------------------------------------------------------------------ // // Copyright (c) Microsoft Corporation. // All rights reserved. // // This code is licensed under the MIT License. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files(the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and / or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions : // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. // //------------------------------------------------------------------------------ using System; using System.Reflection; [assembly: AssemblyProduct("Active Directory Authentication Library")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCulture("")] [assembly: AssemblyCompany("Microsoft Corporation")] [assembly: AssemblyCopyright("Copyright (c) Microsoft Corporation. All rights reserved.")] [assembly: AssemblyTrademark("")] [assembly: AssemblyMetadata("Serviceable", "True")] [assembly: AssemblyFileVersion("3.14.2.0")] // On official build, attribute AssemblyInformationalVersionAttribute is added as well // with its value equal to the hash of the last commit to the git branch. // e.g.: [assembly: AssemblyInformationalVersionAttribute("4392c9835a38c27516fc0cd7bad7bccdcaeab161")] [assembly: CLSCompliant(false)]
mit
C#
7776b911593bd2b58e817b679824f666c769290e
Refresh token constant
Autodesk-Forge/forge-api-dotnet-client,Autodesk-Forge/forge-api-dotnet-client
src/Autodesk.Forge/Model/Constants.cs
src/Autodesk.Forge/Model/Constants.cs
/* * Forge SDK * * The Forge Platform contains an expanding collection of web service components that can be used with Autodesk cloud-based products or your own technologies. Take advantage of Autodesk’s expertise in design and engineering. * * OpenAPI spec version: 0.1.0 * Contact: forge.help@autodesk.com * Generated by: https://github.com/swagger-api/swagger-codegen.git * * 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. */ #pragma warning disable 1591 using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Linq; using RestSharp; using System.ComponentModel; using System.Reflection; namespace Autodesk.Forge { public class oAuthConstants { public const string CLIENT_CREDENTIALS ="client_credentials" ; public const string CODE ="code" ; public const string AUTHORIZATION_CODE ="authorization_code" ; public const string REFRESH_TOKEN = "refresh_token" ; } } #pragma warning restore 1591
/* * Forge SDK * * The Forge Platform contains an expanding collection of web service components that can be used with Autodesk cloud-based products or your own technologies. Take advantage of Autodesk’s expertise in design and engineering. * * OpenAPI spec version: 0.1.0 * Contact: forge.help@autodesk.com * Generated by: https://github.com/swagger-api/swagger-codegen.git * * 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. */ #pragma warning disable 1591 using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Linq; using RestSharp; using System.ComponentModel; using System.Reflection; namespace Autodesk.Forge { public class oAuthConstants { public const string CLIENT_CREDENTIALS ="client_credentials" ; public const string CODE ="code" ; public const string AUTHORIZATION_CODE ="authorization_code" ; } } #pragma warning restore 1591
apache-2.0
C#
8cdb1c68ad25280e359e07d0ff68db3bfce4ce5a
Add invariant IFormatterProvider to avoid issues based on user local
michael-wolfenden/cake,vlesierse/cake,phrusher/cake,cake-build/cake,gep13/cake,Julien-Mialon/cake,UnbelievablyRitchie/cake,Sam13/cake,robgha01/cake,robgha01/cake,thomaslevesque/cake,mholo65/cake,cake-build/cake,Julien-Mialon/cake,patriksvensson/cake,RehanSaeed/cake,ferventcoder/cake,RehanSaeed/cake,devlead/cake,patriksvensson/cake,mholo65/cake,andycmaj/cake,SharpeRAD/Cake,RichiCoder1/cake,Sam13/cake,devlead/cake,adamhathcock/cake,phrusher/cake,adamhathcock/cake,thomaslevesque/cake,daveaglick/cake,andycmaj/cake,RichiCoder1/cake,vlesierse/cake,DixonD-git/cake,michael-wolfenden/cake,ferventcoder/cake,UnbelievablyRitchie/cake,phenixdotnet/cake,phenixdotnet/cake,SharpeRAD/Cake,gep13/cake,daveaglick/cake
src/Cake/Arguments/VerbosityParser.cs
src/Cake/Arguments/VerbosityParser.cs
using System; using System.Collections.Generic; using System.Globalization; using Cake.Core.Diagnostics; namespace Cake.Arguments { /// <summary> /// Responsible for parsing <see cref="Verbosity"/>. /// </summary> internal sealed class VerbosityParser { private readonly Dictionary<string, Verbosity> _lookup; /// <summary> /// Initializes a new instance of the <see cref="VerbosityParser"/> class. /// </summary> public VerbosityParser() { _lookup = new Dictionary<string, Verbosity>(StringComparer.OrdinalIgnoreCase) { { "q", Verbosity.Quiet }, { "quiet", Verbosity.Quiet }, { "m", Verbosity.Minimal }, { "minimal", Verbosity.Minimal }, { "n", Verbosity.Normal }, { "normal", Verbosity.Normal }, { "v", Verbosity.Verbose }, { "verbose", Verbosity.Verbose }, { "d", Verbosity.Diagnostic }, { "diagnostic", Verbosity.Diagnostic } }; } /// <summary> /// Parses the provided string to a <see cref="Verbosity"/>. /// </summary> /// <param name="value">The string to parse.</param> /// <returns>The verbosity.</returns> public Verbosity Parse(string value) { Verbosity verbosity; if (_lookup.TryGetValue(value, out verbosity)) { return verbosity; } const string format = "The value '{0}' is not a valid verbosity."; var message = string.Format(CultureInfo.InvariantCulture, format, value); throw new InvalidOperationException(message); } } }
using System; using System.Collections.Generic; using Cake.Core.Diagnostics; namespace Cake.Arguments { /// <summary> /// Responsible for parsing <see cref="Verbosity"/>. /// </summary> internal sealed class VerbosityParser { private readonly Dictionary<string, Verbosity> _lookup; /// <summary> /// Initializes a new instance of the <see cref="VerbosityParser"/> class. /// </summary> public VerbosityParser() { _lookup = new Dictionary<string, Verbosity>(StringComparer.OrdinalIgnoreCase) { { "q", Verbosity.Quiet }, { "quiet", Verbosity.Quiet }, { "m", Verbosity.Minimal }, { "minimal", Verbosity.Minimal }, { "n", Verbosity.Normal }, { "normal", Verbosity.Normal }, { "v", Verbosity.Verbose }, { "verbose", Verbosity.Verbose }, { "d", Verbosity.Diagnostic }, { "diagnostic", Verbosity.Diagnostic } }; } /// <summary> /// Parses the provided string to a <see cref="Verbosity"/>. /// </summary> /// <param name="value">The string to parse.</param> /// <returns>The verbosity.</returns> public Verbosity Parse(string value) { Verbosity verbosity; if (_lookup.TryGetValue(value, out verbosity)) { return verbosity; } const string format = "The value '{0}' is not a valid verbosity."; var message = string.Format(format, value ?? string.Empty); throw new InvalidOperationException(message); } } }
mit
C#
ba95bf6748457ea1cb63f7ae9bc436df1539b362
add missing fields
FacturAPI/facturapi-net
facturapi-net/Models/Invoice.cs
facturapi-net/Models/Invoice.cs
using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Facturapi { public class Invoice { public string Id { get; set; } public DateTime CreatedAt { get; set; } public bool Livemode { get; set; } public string Status { get; set; } public Customer Customer { get; set; } public Decimal Total { get; set; } public string Uuid { get; set; } public long FolioNumber { get; set; } public string Series { get; set; } public string PaymentForm { get; set; } public List<InvoiceItem> Items { get; set; } public static Task<SearchResult<Invoice>> ListAsync(Dictionary<string, object> query = null) { return new Wrapper().ListInvoices(query); } public static Task<Invoice> CreateAsync(Dictionary<string, object> data) { return new Wrapper().CreateInvoice(data); } public static Task<Invoice> RetrieveAsync(string id) { return new Wrapper().RetrieveInvoice(id); } public static Task<Invoice> CancelAsync(string id) { return new Wrapper().CancelInvoice(id); } public static Task SendByEmailAsync(string id) { return new Wrapper().SendInvoiceByEmail(id); } public static Task<Stream> DownloadXmlAsync(string id) { return new Wrapper().DownloadInvoice(id, "xml"); } public static Task<Stream> DownloadPdfAsync(string id) { return new Wrapper().DownloadInvoice(id, "pdf"); } public static Task<Stream> DownloadZipAsync(string id) { return new Wrapper().DownloadInvoice(id, "zip"); } } }
using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Facturapi { public class Invoice { public string Id { get; set; } public DateTime CreatedAt { get; set; } public bool Livemode { get; set; } public Customer Customer { get; set; } public List<InvoiceItem> Items { get; set; } public string PaymentForm { get; set; } public static Task<SearchResult<Invoice>> ListAsync(Dictionary<string, object> query = null) { return new Wrapper().ListInvoices(query); } public static Task<Invoice> CreateAsync(Dictionary<string, object> data) { return new Wrapper().CreateInvoice(data); } public static Task<Invoice> RetrieveAsync(string id) { return new Wrapper().RetrieveInvoice(id); } public static Task<Invoice> CancelAsync(string id) { return new Wrapper().CancelInvoice(id); } public static Task SendByEmailAsync(string id) { return new Wrapper().SendInvoiceByEmail(id); } public static Task<Stream> DownloadXmlAsync(string id) { return new Wrapper().DownloadInvoice(id, "xml"); } public static Task<Stream> DownloadPdfAsync(string id) { return new Wrapper().DownloadInvoice(id, "pdf"); } public static Task<Stream> DownloadZipAsync(string id) { return new Wrapper().DownloadInvoice(id, "zip"); } } }
mit
C#