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
0582d464e7359f40b5db5561f48a3f3c24321719
Refactor code.
LykkeCity/CompetitionPlatform,LykkeCity/CompetitionPlatform,LykkeCity/CompetitionPlatform
src/CompetitionPlatform/Views/Home/Index.cshtml
src/CompetitionPlatform/Views/Home/Index.cshtml
@using CompetitionPlatform.Models @model CompetitionPlatform.Models.ProjectViewModels.ProjectListIndexViewModel @{ ViewData["Title"] = "Home Page"; } <div class="row projects-filter-buttons"> <div class="col-md-12"> <button type="button" class="btn btn-primary btn-sm">All Projects</button> <button type="button" class="btn btn-info btn-sm">My Projects</button> <button type="button" class="btn btn-info btn-sm">Following</button> </div> </div> <div class="row col-md-12"> <div class="row col-md-3 project-filter"> <select id="projectStatusFilter" name="projectStatusFilter" class="form-control" value="Create"> <option value="">Status : All</option> @foreach (var status in Enum.GetValues(typeof(Status))) { <option value=@status>@status</option> } </select> </div> <div class="row col-md-3"> <select id="projectCategoryFilter" name="projectCategoryFilter" class="form-control" value="Create"> <option value="">Category: All</option> <option value="Finance">Finance</option> <option value="Technology">Technology</option> <option value="Bitcoin">Bitcoin</option> <option value="Mobile">Mobile</option> </select> </div> </div> <div id="projectListResults"> @await Html.PartialAsync("ProjectListPartial", Model) </div>
@using CompetitionPlatform.Models @model CompetitionPlatform.Models.ProjectViewModels.ProjectListIndexViewModel @{ ViewData["Title"] = "Home Page"; } <div class="row projects-filter-buttons"> <div class="col-md-12"> <button type="button" class="btn btn-primary btn-sm">All Projects</button> <button type="button" class="btn btn-info btn-sm">My Projects</button> <button type="button" class="btn btn-info btn-sm">Following</button> </div> </div> <div class="row col-md-12"> <div class="row col-md-3 project-filter"> <select id="projectStatusFilter" name="projectStatusFilter" class="form-control" value="Create"> <option value="">Status : All</option> @foreach (var status in Status.GetValues(typeof(Status))) { <option value=@status>@status</option> } </select> </div> <div class="row col-md-3"> <select id="projectCategoryFilter" name="projectCategoryFilter" class="form-control" value="Create"> <option value="">Category: All</option> <option value="Finance">Finance</option> <option value="Technology">Technology</option> <option value="Bitcoin">Bitcoin</option> <option value="Mobile">Mobile</option> </select> </div> </div> <div id="projectListResults"> @await Html.PartialAsync("ProjectListPartial", Model) </div>
mit
C#
7179494179079dfe8f936cf33181c63a296b4409
Remove Patient Portal Link from the Layout page
EhrgoHealth/CS6440,EhrgoHealth/CS6440
src/EhrgoHealth.Web/Views/Shared/_Layout.cshtml
src/EhrgoHealth.Web/Views/Shared/_Layout.cshtml
<!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>@ViewBag.Title - My ASP.NET Application</title> @Styles.Render("~/Content/css") @Scripts.Render("~/bundles/modernizr") </head> <body> <div class="navbar navbar-inverse navbar-fixed-top"> <div class="container"> <div class="navbar-header"> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse"> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> @Html.ActionLink("Ehrgo Health", "Index", "Home", new { area = "" }, new { @class = "navbar-brand" }) </div> <div class="navbar-collapse collapse"> <ul class="nav navbar-nav"> <li>@Html.ActionLink("Home", "Index", "Home")</li> <li>@Html.ActionLink("About", "About", "Home")</li> <li>@Html.ActionLink("Contact", "Contact", "Home")</li> </ul> @Html.Partial("_LoginPartial") </div> </div> </div> <div class="container body-content"> @RenderBody() <hr /> <footer> <p>&copy; @DateTime.Now.Year - Ehrgo Health</p> </footer> </div> @Scripts.Render("~/bundles/jquery") @Scripts.Render("~/bundles/bootstrap") @RenderSection("scripts", required: false) </body> </html>
<!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>@ViewBag.Title - My ASP.NET Application</title> @Styles.Render("~/Content/css") @Scripts.Render("~/bundles/modernizr") </head> <body> <div class="navbar navbar-inverse navbar-fixed-top"> <div class="container"> <div class="navbar-header"> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse"> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> @Html.ActionLink("Ehrgo Health", "Index", "Home", new { area = "" }, new { @class = "navbar-brand" }) </div> <div class="navbar-collapse collapse"> <ul class="nav navbar-nav"> <li>@Html.ActionLink("Home", "Index", "Home")</li> <li>@Html.ActionLink("About", "About", "Home")</li> <li>@Html.ActionLink("Contact", "Contact", "Home")</li> <li>@Html.ActionLink("Patient", "Index", "Home", new { area = "Patient" }, null)</li> </ul> @Html.Partial("_LoginPartial") </div> </div> </div> <div class="container body-content"> @RenderBody() <hr /> <footer> <p>&copy; @DateTime.Now.Year - Ehrgo Health</p> </footer> </div> @Scripts.Render("~/bundles/jquery") @Scripts.Render("~/bundles/bootstrap") @RenderSection("scripts", required: false) </body> </html>
mit
C#
c1f148b302a81e743b75452ebea12b184c896f1f
Update Client.cs
pmpu/serverhouse,pmpu/serverhouse,pmpu/serverhouse,pmpu/serverhouse
test_tasks/code/3_chat/Client/Assets/Client.cs
test_tasks/code/3_chat/Client/Assets/Client.cs
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Net.Sockets; using System.Net; using System.Threading; class Client { static TcpClient client;//т.к статический, то в одном приложении не может быть два чата static bool IsRunClient; public Client(int Port, string connectIp) { IsRunClient = true; client = new TcpClient(); client.Connect(IPAddress.Parse(connectIp), Port);//соединяемся с сервером } public void Work() { Thread clientListener = new Thread(Reader); clientListener.Start(); } public void SendMessage(string message) { message.Trim(); byte[] Buffer = Encoding.Default.GetBytes((message).ToCharArray());/*was ASCII, stay Default*/ client.GetStream().Write(Buffer, 0, Buffer.Length); Chat.message.Add(message); } static void Reader() { while (IsRunClient) { NetworkStream NS = client.GetStream(); List<byte> Buffer = new List<byte>(); while (NS.DataAvailable) { int ReadByte = NS.ReadByte(); if (ReadByte > -1) { Buffer.Add((byte)ReadByte); } } if (Buffer.Count > 0) Chat.message.Add(Encoding.Default.GetString(Buffer.ToArray()));/*was ASCII, stay Default*/ } } public void Destruct() { IsRunClient = false; if (client != null) client.Close(); } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Net.Sockets; using System.Net; using System.Threading; class Client { static TcpClient client;//т.к статический, то в одном приложении не может быть два чата static bool IsRunClient; public Client(int Port, string connectIp) { IsRunClient = true; client = new TcpClient(); client.Connect(IPAddress.Parse(connectIp), Port);//соединяемся с сервером } public void Work() { Thread clientListener = new Thread(Reader); clientListener.Start(); } public void SendMessage(string message) { message.Trim(); byte[] Buffer = Encoding.ASCII.GetBytes((message).ToCharArray()); client.GetStream().Write(Buffer, 0, Buffer.Length); Chat.message.Add(message); } static void Reader() { while (IsRunClient) { NetworkStream NS = client.GetStream(); List<byte> Buffer = new List<byte>(); while (NS.DataAvailable) { int ReadByte = NS.ReadByte(); if (ReadByte > -1) { Buffer.Add((byte)ReadByte); } } if (Buffer.Count > 0) Chat.message.Add(Encoding.ASCII.GetString(Buffer.ToArray())); } } public void Destruct() { IsRunClient = false; if (client != null) client.Close(); } }
mit
C#
83dc931e3854a7e1814a308cf8afe37c5abd5691
Update XML comment document.
jyuch/ReflectionToStringBuilder
src/ReflectionToStringBuilder/ToStringConfig.cs
src/ReflectionToStringBuilder/ToStringConfig.cs
// Copyright (c) 2015 jyuch // Released under the MIT license // https://github.com/jyuch/ReflectionToStringBuilder/blob/master/LICENSE using System; using System.Collections.Generic; using System.Linq.Expressions; using System.Reflection; namespace Jyuch.ReflectionToStringBuilder { /// <summary> /// Represent configuration of generate string-format. /// </summary> /// <typeparam name="T">The type of object generate a string-format.</typeparam> public sealed class ToStringConfig<T> { private HashSet<MemberInfo> _ignoreMember = new HashSet<MemberInfo>(); /// <summary> /// Specify mode of ignoring member. Default is <see cref="IgnoreMemberMode.None"/>. /// </summary> public IgnoreMemberMode IgnoreMode { get; set; } = IgnoreMemberMode.None; /// <summary> /// Specify output target member. Default is <see cref="TargetType.Property"/>. /// </summary> public TargetType OutputTarget { get; set; } = TargetType.Property; /// <summary> /// Specify whether to expand IEnumerable member. Default is <code>false</code>. /// </summary> public bool ExpandIEnumerable { get; set; } = false; /// <summary> /// Specify member of ignoring when generate string-format. /// </summary> /// <param name="expression">The member of ignoring.</param> public void SetIgnoreMember(Expression<Func<T, object>> expression) { _ignoreMember.Add(ReflectionHelper.GetMember(expression)); } internal HashSet<MemberInfo> IgnoreMember { get { return _ignoreMember; } } } internal class DefaultConfig<T> { internal static readonly ToStringConfig<T> Value = new ToStringConfig<T>(); } }
// Copyright (c) 2015 jyuch // Released under the MIT license // https://github.com/jyuch/ReflectionToStringBuilder/blob/master/LICENSE using System; using System.Collections.Generic; using System.Linq.Expressions; using System.Reflection; namespace Jyuch.ReflectionToStringBuilder { /// <summary> /// Represent configuration of generate string-format. /// </summary> /// <typeparam name="T">The type of object generate a string-format.</typeparam> public sealed class ToStringConfig<T> { private HashSet<MemberInfo> _ignoreMember = new HashSet<MemberInfo>(); /// <summary> /// Specify mode of ignoring member. Default is <see cref="IgnoreMemberMode.None"/>. /// </summary> public IgnoreMemberMode IgnoreMode { get; set; } = IgnoreMemberMode.None; /// <summary> /// Specify output target member. Default is <see cref="TargetType.Property"/>. /// </summary> public TargetType OutputTarget { get; set; } = TargetType.Property; public bool ExpandIEnumerable { get; set; } = false; /// <summary> /// Specify member of ignoring when generate string-format. /// </summary> /// <param name="expression">The member of ignoring.</param> public void SetIgnoreMember(Expression<Func<T, object>> expression) { _ignoreMember.Add(ReflectionHelper.GetMember(expression)); } internal HashSet<MemberInfo> IgnoreMember { get { return _ignoreMember; } } } internal class DefaultConfig<T> { internal static readonly ToStringConfig<T> Value = new ToStringConfig<T>(); } }
mit
C#
99d28cbe130b36ba01b5a36e4c19a885591e83a8
Update About.cshtml
PomeloFoundation/YuukoBlog,PomeloFoundation/YuukoBlog
src/YuukoBlog/Views/Default/Shared/About.cshtml
src/YuukoBlog/Views/Default/Shared/About.cshtml
@if (Model != null && Model.GetType() != typeof(Post)) { <div class="sidebar-module sidebar-about"> <h3>ABOUT</h3> <div class="sidebar-body"> <div class="face"><img src="@ViewBag.AvatarUrl"></div> <p style="text-align: center"><a href="@ViewBag.AboutUrl">@ViewBag.Site</a></p> </div> </div> }
@if (Model != null && Model.GetType() != typeof(Post)) { <div class="sidebar-module sidebar-about"> <h3>ABOUT</h3> <div class="sidebar-body"> <div class="face"><img src="@ViewBag.AvatarUrl"></div> <p style="text-align: center"><a href="@ViewBag.AboutUrl">@ViewBag.Site</a></p> <div class="sidebar-certifications"> <div> <a target="_blank" href="https://mvp.microsoft.com/zh-cn/PublicProfile/5001885" yuuko-static><img src="~/assets/Default/images/mvp.png" alt="微软最有价值专家" class="mvp" /></a> </div> <div> <img src="~/assets/Default/images/mcsd.png" alt="微软认证解决方案开发专家" class="mvp" /> </div> <div> <img src="~/assets/Default/images/accd.png" alt="Adobe认证网络设计师" class="mvp" /> </div> </div> </div> </div> }
mit
C#
2ff2a62cdd2a782c1255f71750c7d0e081a26f1c
Implement RunspaceConfiguration.Scripts
ForNeVeR/Pash,Jaykul/Pash,Jaykul/Pash,Jaykul/Pash,WimObiwan/Pash,sburnicki/Pash,mrward/Pash,ForNeVeR/Pash,mrward/Pash,sburnicki/Pash,WimObiwan/Pash,WimObiwan/Pash,Jaykul/Pash,sillvan/Pash,sburnicki/Pash,mrward/Pash,sburnicki/Pash,WimObiwan/Pash,sillvan/Pash,sillvan/Pash,mrward/Pash,ForNeVeR/Pash,sillvan/Pash,ForNeVeR/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; private RunspaceConfigurationEntryCollection<ScriptConfigurationEntry> scripts; 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 { if (this.scripts == null) { this.scripts = new RunspaceConfigurationEntryCollection<ScriptConfigurationEntry> (); } return this.scripts; } } 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; 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 (); } } }
bsd-3-clause
C#
cac1b5b7ed9aced289a490d40379b81cf9f8fa00
Fix sample
NRules/NRules,StanleyGoldman/NRules,StanleyGoldman/NRules,prashanthr/NRules
samples/SimpleRulesTest/SimpleRulesTest/Program.cs
samples/SimpleRulesTest/SimpleRulesTest/Program.cs
using NRules; using NRules.Fluent; namespace SimpleRulesTest { internal class Program { private static void Main(string[] args) { var dwelling = new Dwelling {Address = "1 Main Street, New York, NY", Type = DwellingTypes.SingleHouse}; var dwelling2 = new Dwelling {Address = "2 Main Street, New York, NY", Type = DwellingTypes.SingleHouse}; var policy1 = new Policy {Name = "Silver", PolicyType = PolicyTypes.Home, Price = 1200, Dwelling = dwelling}; var policy2 = new Policy {Name = "Gold", PolicyType = PolicyTypes.Home, Price = 2300, Dwelling = dwelling2}; var customer1 = new Customer {Name = "John Do", Age = 22, Sex = SexTypes.Male, Policy = policy1}; var customer2 = new Customer {Name = "Emily Brown", Age = 32, Sex = SexTypes.Female, Policy = policy2}; var repository = new RuleRepository(); repository.Load("Test", x => x.From(typeof (Program).Assembly)); var ruleSets = repository.GetRuleSets(); IRuleCompiler compiler = new RuleCompiler(); ISessionFactory factory = compiler.Compile(ruleSets); ISession session = factory.CreateSession(); session.Insert(policy1); session.Insert(policy2); session.Insert(customer1); session.Insert(customer2); session.Insert(dwelling); session.Insert(dwelling2); customer1.Age = 10; session.Update(customer1); session.Retract(customer2); session.Fire(); session.Insert(customer2); session.Fire(); customer1.Age = 30; session.Update(customer1); session.Fire(); } } }
using NRules; using NRules.Fluent; namespace SimpleRulesTest { internal class Program { private static void Main(string[] args) { var dwelling = new Dwelling {Address = "1 Main Street, New York, NY", Type = DwellingTypes.SingleHouse}; var dwelling2 = new Dwelling {Address = "2 Main Street, New York, NY", Type = DwellingTypes.SingleHouse}; var policy1 = new Policy {Name = "Silver", PolicyType = PolicyTypes.Home, Price = 1200, Dwelling = dwelling}; var policy2 = new Policy {Name = "Gold", PolicyType = PolicyTypes.Home, Price = 2300, Dwelling = dwelling2}; var customer1 = new Customer {Name = "John Do", Age = 22, Sex = SexTypes.Male, Policy = policy1}; var customer2 = new Customer {Name = "Emily Brown", Age = 32, Sex = SexTypes.Female, Policy = policy2}; var repository = new RuleRepository(); repository.AddFromAssembly(typeof (Program).Assembly); ISessionFactory factory = repository.Compile(); ISession session = factory.CreateSession(); session.Insert(policy1); session.Insert(policy2); session.Insert(customer1); session.Insert(customer2); session.Insert(dwelling); session.Insert(dwelling2); customer1.Age = 10; session.Update(customer1); session.Retract(customer2); session.Fire(); session.Insert(customer2); session.Fire(); customer1.Age = 30; session.Update(customer1); session.Fire(); } } }
mit
C#
3dadf62f7e2fba9717f12def9c1efdbdbe02fa6a
Update lab
tamasflamich/effort
Main/Source/lab/Effort.Lab.EF6/Form_NotMapped.cs
Main/Source/lab/Effort.Lab.EF6/Form_NotMapped.cs
using System; using System.Collections.Concurrent; using System.Collections.Generic; using System.ComponentModel; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; using System.Data; using System.Data.Common; using System.Data.Entity; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; using NMemory.StoredProcedures; namespace Effort.Lab.EF6 { public partial class Form_NotMapped : Form { public Form_NotMapped() { InitializeComponent(); var connection = Effort.DbConnectionFactory.CreateTransient(); // CLEAN using (var context = new EntityContext(connection)) { context.EntitySimples.RemoveRange(context.EntitySimples); context.SaveChanges(); } // SEED using (var context = new EntityContext(connection)) { context.EntitySimples.Add(new EntitySimple { ColumnInt = 1 }); context.EntitySimples.Add(new EntitySimple { ColumnInt = 2 }); context.EntitySimples.Add(new EntitySimple { ColumnInt = 3 }); context.SaveChanges(); } // TEST using (var context = new EntityContext(connection)) { var list = context.EntitySimples.ToList(); list.ForEach(x => x.LastModified = DateTime.Now); list.ForEach(x => x.ColumnInt = 35); context.SaveChanges(); } using (var context = new EntityContext(connection)) { var list = context.EntitySimples.ToList(); } } public class EntityContext : DbContext { public EntityContext(DbConnection connection) : base(connection, true) { } public DbSet<EntitySimple> EntitySimples { get; set; } protected override void OnModelCreating(DbModelBuilder modelBuilder) { base.OnModelCreating(modelBuilder); } } public class EntitySimple { public int ID { get; set; } public int ColumnInt { get; set; } [DatabaseGenerated(DatabaseGeneratedOption.Computed)] public DateTime LastModified { get; set; } [DatabaseGenerated(DatabaseGeneratedOption.Computed)] public int Computed { get; set; } [DatabaseGenerated(DatabaseGeneratedOption.Computed)] public string UserId { get; set; } } } }
using System; using System.Collections.Concurrent; using System.Collections.Generic; using System.ComponentModel; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; using System.Data; using System.Data.Common; using System.Data.Entity; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; using NMemory.StoredProcedures; namespace Effort.Lab.EF6 { public partial class Form_NotMapped : Form { public Form_NotMapped() { InitializeComponent(); var connection = Effort.DbConnectionFactory.CreateTransient(); // CLEAN using (var context = new EntityContext(connection)) { context.EntitySimples.RemoveRange(context.EntitySimples); context.SaveChanges(); } // SEED using (var context = new EntityContext(connection)) { context.EntitySimples.Add(new EntitySimple { ColumnInt = 1, Computed = int.MaxValue }); context.EntitySimples.Add(new EntitySimple { ColumnInt = 2, LastModified = DateTime.Now }); context.EntitySimples.Add(new EntitySimple { ColumnInt = 3 }); context.SaveChanges(); } // TEST using (var context = new EntityContext(connection)) { var list = context.EntitySimples.ToList(); list.ForEach(x => x.LastModified = DateTime.Now); list.ForEach(x => x.ColumnInt = 35); context.SaveChanges(); } using (var context = new EntityContext(connection)) { var list = context.EntitySimples.ToList(); } } public class EntityContext : DbContext { public EntityContext(DbConnection connection) : base(connection, true) { } public DbSet<EntitySimple> EntitySimples { get; set; } protected override void OnModelCreating(DbModelBuilder modelBuilder) { base.OnModelCreating(modelBuilder); } } public class EntitySimple { public int ID { get; set; } public int ColumnInt { get; set; } [Column, DatabaseGenerated(DatabaseGeneratedOption.Computed)] public DateTime? LastModified { get; set; } [DatabaseGenerated(DatabaseGeneratedOption.Computed)] public int Computed { get; set; } } } }
mit
C#
b2f31cec5484fea0f8abaa445bd8cbd03adeb96d
Update QuadraticBezierDrawNode.cs
wieslawsoltes/Core2D,wieslawsoltes/Core2D,wieslawsoltes/Core2D,wieslawsoltes/Core2D
src/Core2D/Modules/Renderer/SkiaSharp/Nodes/QuadraticBezierDrawNode.cs
src/Core2D/Modules/Renderer/SkiaSharp/Nodes/QuadraticBezierDrawNode.cs
#nullable enable using Core2D.Model.Renderer; using Core2D.Model.Renderer.Nodes; using Core2D.ViewModels.Shapes; using Core2D.ViewModels.Style; using SkiaSharp; namespace Core2D.Modules.Renderer.SkiaSharp.Nodes; internal class QuadraticBezierDrawNode : DrawNode, IQuadraticBezierDrawNode { public QuadraticBezierShapeViewModel QuadraticBezier { get; set; } public SKPath? Geometry { get; set; } public QuadraticBezierDrawNode(QuadraticBezierShapeViewModel quadraticBezier, ShapeStyleViewModel? style) { Style = style; QuadraticBezier = quadraticBezier; UpdateGeometry(); } public sealed override void UpdateGeometry() { ScaleThickness = QuadraticBezier.State.HasFlag(ShapeStateFlags.Thickness); ScaleSize = QuadraticBezier.State.HasFlag(ShapeStateFlags.Size); Geometry = PathGeometryConverter.ToSKPath(QuadraticBezier); if (Geometry is { }) { Center = new SKPoint(Geometry.Bounds.MidX, Geometry.Bounds.MidY); } else { Center = SKPoint.Empty; } } public override void OnDraw(object? dc, double zoom) { if (dc is not SKCanvas canvas) { return; } if (QuadraticBezier.IsFilled) { canvas.DrawPath(Geometry, Fill); } if (QuadraticBezier.IsStroked) { canvas.DrawPath(Geometry, Stroke); } } }
#nullable enable using Core2D.Model.Renderer; using Core2D.Model.Renderer.Nodes; using Core2D.ViewModels.Shapes; using Core2D.ViewModels.Style; using SkiaSharp; namespace Core2D.Modules.Renderer.SkiaSharp.Nodes; internal class QuadraticBezierDrawNode : DrawNode, IQuadraticBezierDrawNode { public QuadraticBezierShapeViewModel QuadraticBezier { get; set; } public SKPath? Geometry { get; set; } public QuadraticBezierDrawNode(QuadraticBezierShapeViewModel quadraticBezier, ShapeStyleViewModel? style) { Style = style; QuadraticBezier = quadraticBezier; UpdateGeometry(); } public sealed override void UpdateGeometry() { ScaleThickness = QuadraticBezier.State.HasFlag(ShapeStateFlags.Thickness); ScaleSize = QuadraticBezier.State.HasFlag(ShapeStateFlags.Size); Geometry = PathGeometryConverter.ToSKPath(QuadraticBezier); Center = new SKPoint(Geometry.Bounds.MidX, Geometry.Bounds.MidY); } public override void OnDraw(object? dc, double zoom) { if (dc is not SKCanvas canvas) { return; } if (QuadraticBezier.IsFilled) { canvas.DrawPath(Geometry, Fill); } if (QuadraticBezier.IsStroked) { canvas.DrawPath(Geometry, Stroke); } } }
mit
C#
05ff447d7da7fdf46a6b994e1797a8aaea525c14
Fix service collection extensions: New overload having lambda for options, return void and added doc comments.
aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore
src/Microsoft.AspNetCore.Routing/DependencyInjection/RoutingServiceCollectionExtensions.cs
src/Microsoft.AspNetCore.Routing/DependencyInjection/RoutingServiceCollectionExtensions.cs
// Copyright (c) .NET Foundation. 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.Text.Encodings.Web; using Microsoft.AspNetCore.Routing; using Microsoft.AspNetCore.Routing.Internal; using Microsoft.Extensions.DependencyInjection.Extensions; using Microsoft.Extensions.ObjectPool; namespace Microsoft.Extensions.DependencyInjection { /// <summary> /// Contains extension methods to <see cref="IServiceCollection"/>. /// </summary> public static class RoutingServiceCollectionExtensions { /// <summary> /// Adds services required for routing requests. /// </summary> /// <param name="services">The <see cref="IServiceCollection"/> to add the services to.</param> public static void AddRouting(this IServiceCollection services) { if (services == null) { throw new ArgumentNullException(nameof(services)); } services.TryAddTransient<IInlineConstraintResolver, DefaultInlineConstraintResolver>(); services.TryAddSingleton(UrlEncoder.Default); services.TryAddSingleton<ObjectPoolProvider>(new DefaultObjectPoolProvider()); services.TryAddSingleton<ObjectPool<UriBuildingContext>>(s => { var provider = s.GetRequiredService<ObjectPoolProvider>(); var encoder = s.GetRequiredService<UrlEncoder>(); return provider.Create<UriBuildingContext>(new UriBuilderContextPooledObjectPolicy(encoder)); }); services.TryAddSingleton(typeof(RoutingMarkerService)); } /// <summary> /// Adds services required for routing requests. /// </summary> /// <param name="services">The <see cref="IServiceCollection"/> to add the services to.</param> /// <param name="configureOptions">The routing options to configure the middleware with.</param> public static void AddRouting( this IServiceCollection services, Action<RouteOptions> configureOptions) { if (services == null) { throw new ArgumentNullException(nameof(services)); } if (configureOptions == null) { throw new ArgumentNullException(nameof(configureOptions)); } services.Configure(configureOptions); services.AddRouting(); } } }
// Copyright (c) .NET Foundation. 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.Text.Encodings.Web; using Microsoft.AspNetCore.Routing; using Microsoft.AspNetCore.Routing.Internal; using Microsoft.Extensions.DependencyInjection.Extensions; using Microsoft.Extensions.ObjectPool; namespace Microsoft.Extensions.DependencyInjection { /// <summary> /// Contains extension methods to <see cref="IServiceCollection"/>. /// </summary> public static class RoutingServiceCollectionExtensions { public static IServiceCollection AddRouting(this IServiceCollection services) { return AddRouting(services, configureOptions: null); } public static IServiceCollection AddRouting( this IServiceCollection services, Action<RouteOptions> configureOptions) { services.TryAddTransient<IInlineConstraintResolver, DefaultInlineConstraintResolver>(); services.TryAddSingleton(UrlEncoder.Default); services.TryAddSingleton<ObjectPoolProvider>(new DefaultObjectPoolProvider()); services.TryAddSingleton<ObjectPool<UriBuildingContext>>(s => { var provider = s.GetRequiredService<ObjectPoolProvider>(); var encoder = s.GetRequiredService<UrlEncoder>(); return provider.Create<UriBuildingContext>(new UriBuilderContextPooledObjectPolicy(encoder)); }); services.TryAddSingleton(typeof(RoutingMarkerService)); if (configureOptions != null) { services.Configure(configureOptions); } return services; } } }
apache-2.0
C#
9632d27eb76bfc2b6e46b0b30cbeb21f0c42182a
Update BaseCommitmentOrchestrator.cs
SkillsFundingAgency/das-providerapprenticeshipsservice,SkillsFundingAgency/das-providerapprenticeshipsservice,SkillsFundingAgency/das-providerapprenticeshipsservice
src/SFA.DAS.ProviderApprenticeshipsService.Web/Orchestrators/BaseCommitmentOrchestrator.cs
src/SFA.DAS.ProviderApprenticeshipsService.Web/Orchestrators/BaseCommitmentOrchestrator.cs
using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using MediatR; using SFA.DAS.HashingService; using SFA.DAS.ProviderApprenticeshipsService.Application.Exceptions; using SFA.DAS.ProviderApprenticeshipsService.Domain.Interfaces; using SFA.DAS.ProviderApprenticeshipsService.Domain.Models.ApprenticeshipCourse; namespace SFA.DAS.ProviderApprenticeshipsService.Web.Orchestrators { public class BaseCommitmentOrchestrator { protected readonly IMediator Mediator; protected readonly IHashingService HashingService; protected readonly IProviderCommitmentsLogger Logger; public BaseCommitmentOrchestrator(IMediator mediator, IHashingService hashingService, IProviderCommitmentsLogger logger) { // we keep null checks here, as this is a base class Mediator = mediator ?? throw new ArgumentNullException(nameof(mediator)); HashingService = hashingService ?? throw new ArgumentNullException(nameof(hashingService)); Logger = logger ?? throw new ArgumentNullException(nameof(logger)); } } }
using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using MediatR; using SFA.DAS.Commitments.Api.Types; using SFA.DAS.Commitments.Api.Types.Commitment; using SFA.DAS.Commitments.Api.Types.Commitment.Types; using SFA.DAS.Commitments.Api.Types.TrainingProgramme; using SFA.DAS.HashingService; using SFA.DAS.ProviderApprenticeshipsService.Application.Exceptions; using SFA.DAS.ProviderApprenticeshipsService.Domain.Interfaces; using SFA.DAS.ProviderApprenticeshipsService.Domain.Models.ApprenticeshipCourse; namespace SFA.DAS.ProviderApprenticeshipsService.Web.Orchestrators { public class BaseCommitmentOrchestrator { protected readonly IMediator Mediator; protected readonly IHashingService HashingService; protected readonly IProviderCommitmentsLogger Logger; public BaseCommitmentOrchestrator(IMediator mediator, IHashingService hashingService, IProviderCommitmentsLogger logger) { // we keep null checks here, as this is a base class Mediator = mediator ?? throw new ArgumentNullException(nameof(mediator)); HashingService = hashingService ?? throw new ArgumentNullException(nameof(hashingService)); Logger = logger ?? throw new ArgumentNullException(nameof(logger)); } } }
mit
C#
f268f6b5c664f740edf57c8d297a65732dd7b90d
Add InitializeCustomTypes
quails4Eva/NSwag,quails4Eva/NSwag,NSwag/NSwag,NSwag/NSwag,quails4Eva/NSwag,quails4Eva/NSwag,NSwag/NSwag,RSuter/NSwag,RSuter/NSwag,RSuter/NSwag,RSuter/NSwag,NSwag/NSwag,RSuter/NSwag
src/NSwag.Commands/Commands/CodeGeneration/CodeGeneratorCommandBase.cs
src/NSwag.Commands/Commands/CodeGeneration/CodeGeneratorCommandBase.cs
//----------------------------------------------------------------------- // <copyright file="CodeGeneratorCommandBase.cs" company="NSwag"> // Copyright (c) Rico Suter. All rights reserved. // </copyright> // <license>https://github.com/NSwag/NSwag/blob/master/LICENSE.md</license> // <author>Rico Suter, mail@rsuter.com</author> //----------------------------------------------------------------------- using NConsole; using Newtonsoft.Json; using NJsonSchema; using NJsonSchema.CodeGeneration; using NSwag.CodeGeneration; namespace NSwag.Commands.CodeGeneration { public abstract class CodeGeneratorCommandBase<TSettings> : InputOutputCommandBase where TSettings : ClientGeneratorBaseSettings { protected CodeGeneratorCommandBase(TSettings settings) { Settings = settings; } [JsonIgnore] public TSettings Settings { get; } [Argument(Name = "TemplateDirectory", IsRequired = false, Description = "The Liquid template directory (experimental).")] public string TemplateDirectory { get { return Settings.CodeGeneratorSettings.TemplateDirectory; } set { Settings.CodeGeneratorSettings.TemplateDirectory = value; } } [Argument(Name = "TypeNameGenerator", IsRequired = false, Description = "The custom ITypeNameGenerator implementation type in the form 'assemblyName:fullTypeName' or 'fullTypeName').")] public string TypeNameGeneratorType { get; set; } [Argument(Name = "PropertyNameGeneratorType", IsRequired = false, Description = "The custom IPropertyNameGenerator implementation type in the form 'assemblyName:fullTypeName' or 'fullTypeName').")] public string PropertyNameGeneratorType { get; set; } [Argument(Name = "EnumNameGeneratorType", IsRequired = false, Description = "The custom IEnumNameGenerator implementation type in the form 'assemblyName:fullTypeName' or 'fullTypeName').")] public string EnumNameGeneratorType { get; set; } // TODO: Use InitializeCustomTypes method public void InitializeCustomTypes(AssemblyLoader.AssemblyLoader assemblyLoader) { if (!string.IsNullOrEmpty(TypeNameGeneratorType)) Settings.CodeGeneratorSettings.TypeNameGenerator = (ITypeNameGenerator)assemblyLoader.CreateInstance(TypeNameGeneratorType); if (!string.IsNullOrEmpty(PropertyNameGeneratorType)) Settings.CodeGeneratorSettings.PropertyNameGenerator = (IPropertyNameGenerator)assemblyLoader.CreateInstance(PropertyNameGeneratorType); if (!string.IsNullOrEmpty(EnumNameGeneratorType)) Settings.CodeGeneratorSettings.EnumNameGenerator = (IEnumNameGenerator)assemblyLoader.CreateInstance(EnumNameGeneratorType); } } }
//----------------------------------------------------------------------- // <copyright file="CodeGeneratorCommandBase.cs" company="NSwag"> // Copyright (c) Rico Suter. All rights reserved. // </copyright> // <license>https://github.com/NSwag/NSwag/blob/master/LICENSE.md</license> // <author>Rico Suter, mail@rsuter.com</author> //----------------------------------------------------------------------- using NConsole; using Newtonsoft.Json; using NSwag.CodeGeneration; namespace NSwag.Commands.CodeGeneration { public abstract class CodeGeneratorCommandBase<TSettings> : InputOutputCommandBase where TSettings : ClientGeneratorBaseSettings { protected CodeGeneratorCommandBase(TSettings settings) { Settings = settings; } [JsonIgnore] public TSettings Settings { get; } [Argument(Name = "TemplateDirectory", IsRequired = false, Description = "The Liquid template directory (experimental).")] public string TemplateDirectory { get { return Settings.CodeGeneratorSettings.TemplateDirectory; } set { Settings.CodeGeneratorSettings.TemplateDirectory = value; } } } }
mit
C#
d6eed272172abb83bf79c8a1cf80b3c0abf5e520
teste c
Thiago-Caramelo/patchsearch
Program.cs
Program.cs
using System; using System.Collections.Generic; using System.IO; using System.Text; namespace PatchSearch { // teste teste class Program { static void Main(string[] args) { if (args == null || args.Length == 0) { return; } // obter todos os arquivos da pasta string[] files = Directory.GetFiles(Directory.GetCurrentDirectory()); foreach (var item in files) //teste { using (StreamReader reader = new StreamReader(item)) { string fileContent = reader.ReadToEnd(); int qt = 0;//teste 7 foreach (var term in args) { if (fileContent.Contains(term)) { qt++; } } if (qt == args.Length) { Console.WriteLine(Path.GetFileName(item)); } } } } } } //teste c
using System; using System.Collections.Generic; using System.IO; using System.Text; namespace PatchSearch { // teste teste class Program { static void Main(string[] args) { if (args == null || args.Length == 0) { return; } // obter todos os arquivos da pasta string[] files = Directory.GetFiles(Directory.GetCurrentDirectory()); foreach (var item in files) //teste { using (StreamReader reader = new StreamReader(item)) { string fileContent = reader.ReadToEnd(); int qt = 0;//teste 7 foreach (var term in args) { if (fileContent.Contains(term)) { qt++; } } if (qt == args.Length) { Console.WriteLine(Path.GetFileName(item)); } } } } } }
mit
C#
88af7a93cb8a471649f323282fbc46e0bca7115b
fix Items mapping
williamverdolini/CQRS-ES-Todos,williamverdolini/CQRS-ES-Todos,williamverdolini/CQRS-ES-Todos
Todo.QueryStack/Mappers/NotifierMapperProfile.cs
Todo.QueryStack/Mappers/NotifierMapperProfile.cs
using AutoMapper; using Todo.QueryStack.Model; namespace Todo.QueryStack.Mappers { class NotifierMapperProfile : Profile { protected override void Configure() { CreateMap<ToDoList, NotifiedToDoList>() .ForMember(dest => dest.Items, opt => opt.Ignore()); CreateMap<ToDoItem, NotifiedToDoItem>(); } } }
using AutoMapper; using Todo.QueryStack.Model; namespace Todo.QueryStack.Mappers { class NotifierMapperProfile : Profile { protected override void Configure() { CreateMap<ToDoList, NotifiedToDoList>(); CreateMap<ToDoItem, NotifiedToDoItem>(); } } }
mit
C#
84a8dfed80b96351ac12178c9a355f003672008d
remove whitespace
aloisdg/algo
Algo/FisherYates/Program.cs
Algo/FisherYates/Program.cs
using System; using System.Collections.Generic; using System.Linq; namespace FisherYates { class Program { static void Main() { var nums = Enumerable.Range(0, 10); var numsShuffled = nums.Shuffle<int>(); foreach (var item in numsShuffled) Console.Write("{0} ", item); Console.WriteLine(); var list = new List<string> { "fisher", "yates", "havel", "hakimi" }; var listShuffled = list.Shuffle<string>(); foreach (var item in listShuffled) Console.Write("{0} ", item); Console.ReadLine(); } } }
using System; using System.Collections.Generic; namespace FisherYates { class Program { static void Main(string[] args) { var nums = Enumerable.Range(0, 10); var numsShuffled = nums.Shuffle<int>(); foreach (var item in numsShuffled) Console.Write("{0} ", item); Console.WriteLine(); var list = new List<string> { "fisher", "yates", "havel", "hakimi" }; var listShuffled = list.Shuffle<string>(); foreach (var item in listShuffled) Console.Write("{0} ", item); Console.ReadLine(); } } }
bsd-3-clause
C#
bb034d24f9e3e8d42875522cccc6b066d3f17cec
remove pre-release designation.
ume05rw/Xb.File.Tree
Xb.Net.SmbTree.STD1.3/Properties/AssemblyInfo.cs
Xb.Net.SmbTree.STD1.3/Properties/AssemblyInfo.cs
using System.Resources; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // アセンブリに関する一般情報は以下の属性セットをとおして制御されます。 // アセンブリに関連付けられている情報を変更するには、 // これらの属性値を変更してください。 [assembly: AssemblyTitle("Xb.Net.SmbTree")] [assembly: AssemblyDescription("Ready to Xamarin & .NET Core, SMB Shared Folder Access Library. based on Xb.File.Tree. SMB depend on SharpCifs.Std.")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Do-Be's")] [assembly: AssemblyProduct("Xb.Net.SmbTree")] [assembly: AssemblyCopyright("Copyright Do-Be's(C) 2016")] [assembly: AssemblyTrademark("Do-Be's")] [assembly: AssemblyCulture("")] [assembly: NeutralResourcesLanguage("ja")] // アセンブリのバージョン情報は次の 4 つの値で構成されています: // // メジャー バージョン // マイナー バージョン // ビルド番号 // リビジョン // // すべての値を指定するか、下のように '*' を使ってビルドおよびリビジョン番号を // 既定値にすることができます: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]
using System.Resources; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // アセンブリに関する一般情報は以下の属性セットをとおして制御されます。 // アセンブリに関連付けられている情報を変更するには、 // これらの属性値を変更してください。 [assembly: AssemblyTitle("Xb.Net.SmbTree")] [assembly: AssemblyDescription("Ready to Xamarin & .NET Core, SMB Shared Folder Access Library. based on Xb.File.Tree. SMB depend on SharpCifs.Std.")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Do-Be's")] [assembly: AssemblyProduct("Xb.Net.SmbTree")] [assembly: AssemblyCopyright("Copyright Do-Be's(C) 2016")] [assembly: AssemblyTrademark("Do-Be's")] [assembly: AssemblyCulture("")] [assembly: NeutralResourcesLanguage("ja")] // アセンブリのバージョン情報は次の 4 つの値で構成されています: // // メジャー バージョン // マイナー バージョン // ビルド番号 // リビジョン // // すべての値を指定するか、下のように '*' を使ってビルドおよびリビジョン番号を // 既定値にすることができます: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("0.4.0.0")] [assembly: AssemblyFileVersion("0.4.0.0")]
lgpl-2.1
C#
e39dce5d4c4d3f862a22cf5a39233507d6c391c4
Fix typo from copy-pasted build template
FiniteReality/Discord.Addons.EmojiTools,foxbot/Discord.Addons.EmojiTools,foxbot/Discord.Addons.EmojiTools,FiniteReality/Discord.Addons.EmojiTools
build.cake
build.cake
#addin nuget:?package=NuGet.Core&version=2.12.0 #addin "Cake.ExtendedNuGet" var MyGetKey = EnvironmentVariable("MYGET_KEY"); string BuildNumber = EnvironmentVariable("TRAVIS_BUILD_NUMBER"); Task("Restore") .Does(() => { var settings = new DotNetCoreRestoreSettings { Sources = new[] { "https://www.myget.org/F/discord-net/api/v2", "https://www.nuget.org/api/v2" } }; DotNetCoreRestore(settings); }); Task("CodeGen") .Does(() => { using (var process = StartAndReturnProcess("python3", new ProcessSettings { Arguments = "generator.py" })) { process.WaitForExit(); var code = process.GetExitCode(); if (code != 0) { throw new Exception(string.Format("Code Generation script failed! Exited {0}", code)); } } }); Task("Build") .Does(() => { var suffix = BuildNumber.PadLeft(5,'0'); var settings = new DotNetCorePackSettings { Configuration = "Release", OutputDirectory = "./artifacts/", VersionSuffix = suffix }; DotNetCorePack("./src/Discord.Addons.EmojiTools/", settings); }); Task("Test") .Does(() => { DotNetCoreTest("./test/"); }); Task("Deploy") .Does(() => { var settings = new NuGetPushSettings { Source = "https://www.myget.org/F/discord-net/api/v2/package", ApiKey = MyGetKey }; var packages = GetFiles("./artifacts/*.nupkg"); NuGetPush(packages, settings); }); Task("Default") .IsDependentOn("Restore") .IsDependentOn("CodeGen") .IsDependentOn("Build") .IsDependentOn("Test") .IsDependentOn("Deploy") .Does(() => { Information("Build Succeeded"); }); RunTarget("Default");
#addin nuget:?package=NuGet.Core&version=2.12.0 #addin "Cake.ExtendedNuGet" var MyGetKey = EnvironmentVariable("MYGET_KEY"); string BuildNumber = EnvironmentVariable("TRAVIS_BUILD_NUMBER"); Task("Restore") .Does(() => { var settings = new DotNetCoreRestoreSettings { Sources = new[] { "https://www.myget.org/F/discord-net/api/v2", "https://www.nuget.org/api/v2" } }; DotNetCoreRestore(settings); }); Task("CodeGen") .Does(() => { using (var process = StartAndReturnProcess("python3", new ProcessSettings { Arguments = "generator.py" })) { process.WaitForExit(); var code = process.GetExitCode(); if (code != 0) { throw new Exception(string.Format("Code Generation script failed! Exited {0}", code)); } } }); Task("Build") .Does(() => { var suffix = BuildNumber.PadLeft(5,'0'); var settings = new DotNetCorePackSettings { Configuration = "Release", OutputDirectory = "./artifacts/", VersionSuffix = suffix }; DotNetCorePack("./src/Discord.Addons.InteractiveCommands/", settings); }); Task("Test") .Does(() => { DotNetCoreTest("./test/"); }); Task("Deploy") .Does(() => { var settings = new NuGetPushSettings { Source = "https://www.myget.org/F/discord-net/api/v2/package", ApiKey = MyGetKey }; var packages = GetFiles("./artifacts/*.nupkg"); NuGetPush(packages, settings); }); Task("Default") .IsDependentOn("Restore") .IsDependentOn("CodeGen") .IsDependentOn("Build") .IsDependentOn("Test") .IsDependentOn("Deploy") .Does(() => { Information("Build Succeeded"); }); RunTarget("Default");
isc
C#
f62825fa1ebb57d189157102cbc5d0a470004256
Simplify build script
jamesmontemagno/MediaPlugin,jamesmontemagno/MediaPlugin
build.cake
build.cake
var TARGET = Argument ("target", Argument ("t", "Default")); var VERSION = EnvironmentVariable ("APPVEYOR_BUILD_VERSION") ?? Argument("version", "0.0.9999"); var CONFIG = Argument("configuration", EnvironmentVariable ("CONFIGURATION") ?? "Release"); var SLN = "./src/Media.sln"; Task("Libraries").Does(()=> { NuGetRestore (SLN); MSBuild (SLN, c => c.Configuration = CONFIG); }); Task ("NuGet") .IsDependentOn ("Libraries") .Does (() => { if(!DirectoryExists("./Build/nuget/")) CreateDirectory("./Build/nuget"); NuGetPack ("./nuget/Plugin.nuspec", new NuGetPackSettings { Version = VERSION, OutputDirectory = "./Build/nuget/", BasePath = "./" }); }); //Build the component, which build samples, nugets, and libraries Task ("Default").IsDependentOn("NuGet"); Task ("Clean").Does (() => { CleanDirectory ("./component/tools/"); CleanDirectories ("./Build/"); CleanDirectories ("./**/bin"); CleanDirectories ("./**/obj"); }); RunTarget (TARGET);
#addin nuget:?package=Cake.XCode&version=2.0.13 #addin nuget:?package=Cake.Xamarin.Build&version=2.0.18 #addin nuget:?package=Cake.Xamarin&version=1.3.0.15 #addin nuget:?package=Cake.FileHelpers&version=1.0.4 #addin nuget:?package=Cake.Yaml&version=1.0.3 #addin nuget:?package=Cake.Json&version=1.0.2 var TARGET = Argument ("target", Argument ("t", "Default")); var version = EnvironmentVariable ("APPVEYOR_BUILD_VERSION") ?? Argument("version", "0.0.9999"); var libraries = new Dictionary<string, string> { { "./src/Media.sln", "Any" }, }; var BuildAction = new Action<Dictionary<string, string>> (solutions => { foreach (var sln in solutions) { // If the platform is Any build regardless // If the platform is Win and we are running on windows build // If the platform is Mac and we are running on Mac, build if ((sln.Value == "Any") || (sln.Value == "Win" && IsRunningOnWindows ()) || (sln.Value == "Mac" && IsRunningOnUnix ())) { // Bit of a hack to use nuget3 to restore packages for project.json if (IsRunningOnWindows ()) { Information ("RunningOn: {0}", "Windows"); NuGetRestore (sln.Key, new NuGetRestoreSettings { ToolPath = "./tools/nuget3.exe" }); // Windows Phone / Universal projects require not using the amd64 msbuild MSBuild (sln.Key, c => { c.Configuration = "Release"; c.MSBuildPlatform = Cake.Common.Tools.MSBuild.MSBuildPlatform.x86; }); } else { // Mac is easy ;) NuGetRestore (sln.Key); DotNetBuild (sln.Key, c => c.Configuration = "Release"); } } } }); Task("Libraries").Does(()=> { BuildAction(libraries); }); Task ("NuGet") .IsDependentOn ("Libraries") .Does (() => { if(!DirectoryExists("./Build/nuget/")) CreateDirectory("./Build/nuget"); NuGetPack ("./nuget/Plugin.nuspec", new NuGetPackSettings { Version = version, Verbosity = NuGetVerbosity.Detailed, OutputDirectory = "./Build/nuget/", BasePath = "./", ToolPath = "./tools/nuget3.exe" }); }); //Build the component, which build samples, nugets, and libraries Task ("Default").IsDependentOn("NuGet"); Task ("Clean").Does (() => { CleanDirectory ("./component/tools/"); CleanDirectories ("./Build/"); CleanDirectories ("./**/bin"); CleanDirectories ("./**/obj"); }); RunTarget (TARGET);
mit
C#
c4e85a25a140fa0c4955d7887099ccb69260902f
update formatting
designsbyjuan/UnityLib
LookDownCanvas.cs
LookDownCanvas.cs
using UnityEngine; using UnityEngine.EventSystems; using System.Collections; using VRStandardAssets.Utils; public class LookDownCanvas : MonoBehaviour { private CanvasGroup canvasGroup; private UIFader uiFader; private CardboardMain main; public float UIDistance = 300f; public float UIHeight = -400f; public float UIRotation = 65f; // Use this for initialization void Start () { uiFader = GetComponent<UIFader>(); canvasGroup = GetComponent<CanvasGroup>(); main = FindObjectOfType<CardboardMain>(); } // Update is called once per frame void Update() { // checks if canvas should follow player StartCoroutine(FollowPlayer()); } IEnumerator FollowPlayer() { // check if lookdowncanvas is visible if (canvasGroup.alpha <= 0) // canvas is not visible, so it should follow the player { Quaternion offsetRot = Quaternion.AngleAxis(UIRotation, Vector3.right); Quaternion playerLookRot = Quaternion.LookRotation(main.ProjectedVector(), Vector3.up); // set canvas to player look rotation transform.rotation = playerLookRot * offsetRot; // set canvas to player position transform.position = main.transform.position; // set distance from player transform.position += main.ProjectedVector() * UIDistance; // set height from ground transform.position += Vector3.up * UIHeight; } yield return null; } public void ShowCanvas() { StartCoroutine(uiFader.FadeIn()); canvasGroup.interactable = true; } public void HideCanvas() { StartCoroutine(uiFader.FadeOut()); canvasGroup.interactable = false; } }
using UnityEngine; using UnityEngine.EventSystems; using System.Collections; using VRStandardAssets.Utils; public class LookDownCanvas : MonoBehaviour { private CanvasGroup canvasGroup; private UIFader uiFader; private CardboardMain main; public float UIDistance = 300f; public float UIHeight = -400f; public float UIRotation = 65f; // Use this for initialization void Start () { uiFader = GetComponent<UIFader>(); canvasGroup = GetComponent<CanvasGroup>(); main = FindObjectOfType<CardboardMain>(); } // Update is called once per frame void Update() { // checks if canvas should follow player StartCoroutine(FollowPlayer()); } IEnumerator FollowPlayer() { // check if lookdowncanvas is visible if (canvasGroup.alpha <= 0) // canvas is not visible, so it should follow the player { Quaternion offsetRot = Quaternion.AngleAxis(UIRotation, Vector3.right); Quaternion playerLookRot = Quaternion.LookRotation(main.ProjectedVector(), Vector3.up); // set canvas to player look rotation transform.rotation = playerLookRot * offsetRot; // set canvas to player position transform.position = main.transform.position; // set distance from player transform.position += main.ProjectedVector() * UIDistance; // set height from ground transform.position += Vector3.up * UIHeight; } yield return null; } public void ShowCanvas() { StartCoroutine(uiFader.FadeIn()); canvasGroup.interactable = true; } public void HideCanvas() { StartCoroutine(uiFader.FadeOut()); canvasGroup.interactable = false; } }
mit
C#
397971c6313eff22d645c07d782547a4e7683a2e
Change FrameDataBundle.Frames into an IList
ppy/osu,ppy/osu,peppy/osu,NeoAdonis/osu,peppy/osu,NeoAdonis/osu,ppy/osu,peppy/osu,NeoAdonis/osu
osu.Game/Online/Spectator/FrameDataBundle.cs
osu.Game/Online/Spectator/FrameDataBundle.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; using System.Collections.Generic; using MessagePack; using Newtonsoft.Json; using osu.Game.Replays.Legacy; using osu.Game.Scoring; namespace osu.Game.Online.Spectator { [Serializable] [MessagePackObject] public class FrameDataBundle { [Key(0)] public FrameHeader Header { get; set; } [Key(1)] public IList<LegacyReplayFrame> Frames { get; set; } public FrameDataBundle(ScoreInfo score, IList<LegacyReplayFrame> frames) { Frames = frames; Header = new FrameHeader(score); } [JsonConstructor] public FrameDataBundle(FrameHeader header, IList<LegacyReplayFrame> frames) { Header = header; Frames = frames; } } }
// 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; using System.Collections.Generic; using MessagePack; using Newtonsoft.Json; using osu.Game.Replays.Legacy; using osu.Game.Scoring; namespace osu.Game.Online.Spectator { [Serializable] [MessagePackObject] public class FrameDataBundle { [Key(0)] public FrameHeader Header { get; set; } [Key(1)] public IEnumerable<LegacyReplayFrame> Frames { get; set; } public FrameDataBundle(ScoreInfo score, IEnumerable<LegacyReplayFrame> frames) { Frames = frames; Header = new FrameHeader(score); } [JsonConstructor] public FrameDataBundle(FrameHeader header, IEnumerable<LegacyReplayFrame> frames) { Header = header; Frames = frames; } } }
mit
C#
8c89354b36638a36def5a25ea70e6f96ac738c96
Remove extra whitespace
DrabWeb/osu,naoey/osu,NeoAdonis/osu,NeoAdonis/osu,naoey/osu,smoogipoo/osu,2yangk23/osu,ZLima12/osu,peppy/osu,UselessToucan/osu,Frontear/osuKyzer,EVAST9919/osu,smoogipoo/osu,ppy/osu,DrabWeb/osu,UselessToucan/osu,UselessToucan/osu,DrabWeb/osu,ppy/osu,peppy/osu,peppy/osu,johnneijzen/osu,Nabile-Rahmani/osu,2yangk23/osu,johnneijzen/osu,peppy/osu-new,ZLima12/osu,ppy/osu,naoey/osu,smoogipoo/osu,NeoAdonis/osu,smoogipooo/osu,EVAST9919/osu
osu.Game/Overlays/BeatmapSet/HeaderButton.cs
osu.Game/Overlays/BeatmapSet/HeaderButton.cs
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>. // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Graphics; using osu.Game.Graphics; using osu.Game.Graphics.UserInterface; using osu.Framework.Allocation; namespace osu.Game.Overlays.BeatmapSet { public class HeaderButton : TriangleButton { public HeaderButton() { Height = 0; RelativeSizeAxes = Axes.Y; } [BackgroundDependencyLoader] private void load() { BackgroundColour = OsuColour.FromHex(@"094c5f"); Triangles.ColourLight = OsuColour.FromHex(@"0f7c9b"); Triangles.ColourDark = OsuColour.FromHex(@"094c5f"); Triangles.TriangleScale = 1.5f; } } }
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>. // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Graphics; using osu.Game.Graphics; using osu.Game.Graphics.UserInterface; using osu.Framework.Allocation; namespace osu.Game.Overlays.BeatmapSet { public class HeaderButton : TriangleButton { public HeaderButton() { Height = 0; RelativeSizeAxes = Axes.Y; } [BackgroundDependencyLoader] private void load() { BackgroundColour = OsuColour.FromHex(@"094c5f"); Triangles.ColourLight = OsuColour.FromHex(@"0f7c9b"); Triangles.ColourDark = OsuColour.FromHex(@"094c5f"); Triangles.TriangleScale = 1.5f; } } }
mit
C#
4caae55d8e8357abddcfe1a1c0b2317f571f75a5
Disable failed tests for issue 19341. (#19395)
rubo/corefx,jlin177/corefx,yizhang82/corefx,JosephTremoulet/corefx,billwert/corefx,YoupHulsebos/corefx,DnlHarvey/corefx,krytarowski/corefx,wtgodbe/corefx,elijah6/corefx,richlander/corefx,mmitche/corefx,krytarowski/corefx,zhenlan/corefx,nbarbettini/corefx,parjong/corefx,shimingsg/corefx,stone-li/corefx,tijoytom/corefx,richlander/corefx,yizhang82/corefx,ericstj/corefx,Ermiar/corefx,rjxby/corefx,wtgodbe/corefx,parjong/corefx,stephenmichaelf/corefx,Jiayili1/corefx,ravimeda/corefx,DnlHarvey/corefx,yizhang82/corefx,JosephTremoulet/corefx,MaggieTsang/corefx,gkhanna79/corefx,the-dwyer/corefx,YoupHulsebos/corefx,weltkante/corefx,stephenmichaelf/corefx,krk/corefx,gkhanna79/corefx,fgreinacher/corefx,stephenmichaelf/corefx,twsouthwick/corefx,zhenlan/corefx,jlin177/corefx,mmitche/corefx,ptoonen/corefx,YoupHulsebos/corefx,dhoehna/corefx,parjong/corefx,JosephTremoulet/corefx,axelheer/corefx,the-dwyer/corefx,rjxby/corefx,mazong1123/corefx,rjxby/corefx,billwert/corefx,elijah6/corefx,nchikanov/corefx,Ermiar/corefx,cydhaselton/corefx,ericstj/corefx,rjxby/corefx,parjong/corefx,nchikanov/corefx,nchikanov/corefx,yizhang82/corefx,seanshpark/corefx,JosephTremoulet/corefx,MaggieTsang/corefx,richlander/corefx,ptoonen/corefx,ViktorHofer/corefx,ViktorHofer/corefx,rubo/corefx,elijah6/corefx,yizhang82/corefx,dhoehna/corefx,MaggieTsang/corefx,cydhaselton/corefx,ravimeda/corefx,rubo/corefx,ptoonen/corefx,stone-li/corefx,ptoonen/corefx,dhoehna/corefx,stephenmichaelf/corefx,nbarbettini/corefx,krk/corefx,zhenlan/corefx,DnlHarvey/corefx,nbarbettini/corefx,billwert/corefx,stone-li/corefx,BrennanConroy/corefx,gkhanna79/corefx,weltkante/corefx,billwert/corefx,seanshpark/corefx,rjxby/corefx,the-dwyer/corefx,mazong1123/corefx,fgreinacher/corefx,ericstj/corefx,krk/corefx,krytarowski/corefx,nchikanov/corefx,DnlHarvey/corefx,yizhang82/corefx,gkhanna79/corefx,rjxby/corefx,dotnet-bot/corefx,seanshpark/corefx,zhenlan/corefx,weltkante/corefx,krytarowski/corefx,dotnet-bot/corefx,alexperovich/corefx,richlander/corefx,mazong1123/corefx,richlander/corefx,Jiayili1/corefx,wtgodbe/corefx,billwert/corefx,the-dwyer/corefx,krk/corefx,ericstj/corefx,tijoytom/corefx,wtgodbe/corefx,parjong/corefx,nchikanov/corefx,ViktorHofer/corefx,cydhaselton/corefx,JosephTremoulet/corefx,elijah6/corefx,nbarbettini/corefx,shimingsg/corefx,mmitche/corefx,richlander/corefx,axelheer/corefx,YoupHulsebos/corefx,shimingsg/corefx,fgreinacher/corefx,YoupHulsebos/corefx,Ermiar/corefx,tijoytom/corefx,tijoytom/corefx,BrennanConroy/corefx,krytarowski/corefx,Jiayili1/corefx,twsouthwick/corefx,jlin177/corefx,the-dwyer/corefx,axelheer/corefx,cydhaselton/corefx,zhenlan/corefx,wtgodbe/corefx,seanshpark/corefx,ViktorHofer/corefx,seanshpark/corefx,DnlHarvey/corefx,stephenmichaelf/corefx,MaggieTsang/corefx,YoupHulsebos/corefx,stone-li/corefx,dotnet-bot/corefx,richlander/corefx,ViktorHofer/corefx,shimingsg/corefx,axelheer/corefx,ericstj/corefx,ericstj/corefx,jlin177/corefx,krk/corefx,cydhaselton/corefx,Jiayili1/corefx,cydhaselton/corefx,twsouthwick/corefx,mazong1123/corefx,axelheer/corefx,yizhang82/corefx,elijah6/corefx,Ermiar/corefx,krytarowski/corefx,the-dwyer/corefx,alexperovich/corefx,alexperovich/corefx,ravimeda/corefx,billwert/corefx,billwert/corefx,rjxby/corefx,stephenmichaelf/corefx,ViktorHofer/corefx,elijah6/corefx,mmitche/corefx,krk/corefx,dhoehna/corefx,dhoehna/corefx,dotnet-bot/corefx,jlin177/corefx,ptoonen/corefx,dotnet-bot/corefx,mazong1123/corefx,parjong/corefx,MaggieTsang/corefx,alexperovich/corefx,twsouthwick/corefx,Jiayili1/corefx,gkhanna79/corefx,weltkante/corefx,stone-li/corefx,JosephTremoulet/corefx,Jiayili1/corefx,weltkante/corefx,jlin177/corefx,stone-li/corefx,ptoonen/corefx,zhenlan/corefx,tijoytom/corefx,axelheer/corefx,weltkante/corefx,fgreinacher/corefx,stephenmichaelf/corefx,BrennanConroy/corefx,wtgodbe/corefx,rubo/corefx,YoupHulsebos/corefx,stone-li/corefx,mazong1123/corefx,ericstj/corefx,parjong/corefx,alexperovich/corefx,shimingsg/corefx,Jiayili1/corefx,nbarbettini/corefx,dhoehna/corefx,mmitche/corefx,MaggieTsang/corefx,gkhanna79/corefx,the-dwyer/corefx,seanshpark/corefx,ravimeda/corefx,shimingsg/corefx,rubo/corefx,seanshpark/corefx,twsouthwick/corefx,mazong1123/corefx,DnlHarvey/corefx,nchikanov/corefx,Ermiar/corefx,ravimeda/corefx,ptoonen/corefx,alexperovich/corefx,DnlHarvey/corefx,dotnet-bot/corefx,tijoytom/corefx,Ermiar/corefx,wtgodbe/corefx,cydhaselton/corefx,nbarbettini/corefx,MaggieTsang/corefx,gkhanna79/corefx,dotnet-bot/corefx,shimingsg/corefx,twsouthwick/corefx,krytarowski/corefx,twsouthwick/corefx,weltkante/corefx,elijah6/corefx,dhoehna/corefx,mmitche/corefx,tijoytom/corefx,ravimeda/corefx,nchikanov/corefx,alexperovich/corefx,nbarbettini/corefx,ViktorHofer/corefx,ravimeda/corefx,krk/corefx,JosephTremoulet/corefx,mmitche/corefx,zhenlan/corefx,Ermiar/corefx,jlin177/corefx
src/System.Configuration.ConfigurationManager/tests/System/Configuration/UriSectionTests.cs
src/System.Configuration.ConfigurationManager/tests/System/Configuration/UriSectionTests.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.Configuration; using Xunit; namespace System.ConfigurationTests { public class UriSectionTests { public static string UriSectionConfiguration = @"<?xml version='1.0' encoding='utf-8' ?> <configuration> <configSections> <section name='uri' type='System.Configuration.UriSection, System' /> </configSections> <uri> <idn enabled='All' /> <iriParsing enabled='true' /> <schemeSettings> <add name='ftp' genericUriParserOptions='DontCompressPath' /> </schemeSettings> </uri> </configuration>"; [Fact] [SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework, "dotnet/corefx #19341")] public void UriSectionIdnIriParsing() { using (var temp = new TempConfig(UriSectionConfiguration)) { var config = ConfigurationManager.OpenExeConfiguration(temp.ExePath); UriSection uriSection = (UriSection)config.GetSection("uri"); Assert.Equal(UriIdnScope.All, uriSection.Idn.Enabled); Assert.Equal(true, uriSection.IriParsing.Enabled); } } [Fact] [SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework, "dotnet/corefx #19341")] public void UriSectionSchemeSettings() { using (var temp = new TempConfig(UriSectionConfiguration)) { var config = ConfigurationManager.OpenExeConfiguration(temp.ExePath); UriSection uriSection = (UriSection)config.GetSection("uri"); Assert.Equal(1, uriSection.SchemeSettings.Count); SchemeSettingElement schemeSettingElement = uriSection.SchemeSettings[0]; Assert.Equal("ftp", schemeSettingElement.Name); Assert.Equal(GenericUriParserOptions.DontCompressPath, schemeSettingElement.GenericUriParserOptions); } } } }
// 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.Configuration; using Xunit; namespace System.ConfigurationTests { public class UriSectionTests { public static string UriSectionConfiguration = @"<?xml version='1.0' encoding='utf-8' ?> <configuration> <configSections> <section name='uri' type='System.Configuration.UriSection, System' /> </configSections> <uri> <idn enabled='All' /> <iriParsing enabled='true' /> <schemeSettings> <add name='ftp' genericUriParserOptions='DontCompressPath' /> </schemeSettings> </uri> </configuration>"; [Fact] public void UriSectionIdnIriParsing() { using (var temp = new TempConfig(UriSectionConfiguration)) { var config = ConfigurationManager.OpenExeConfiguration(temp.ExePath); UriSection uriSection = (UriSection)config.GetSection("uri"); Assert.Equal(UriIdnScope.All, uriSection.Idn.Enabled); Assert.Equal(true, uriSection.IriParsing.Enabled); } } [Fact] public void UriSectionSchemeSettings() { using (var temp = new TempConfig(UriSectionConfiguration)) { var config = ConfigurationManager.OpenExeConfiguration(temp.ExePath); UriSection uriSection = (UriSection)config.GetSection("uri"); Assert.Equal(1, uriSection.SchemeSettings.Count); SchemeSettingElement schemeSettingElement = uriSection.SchemeSettings[0]; Assert.Equal("ftp", schemeSettingElement.Name); Assert.Equal(GenericUriParserOptions.DontCompressPath, schemeSettingElement.GenericUriParserOptions); } } } }
mit
C#
d546cc0abbb4f37555263b3634481e7ceca66aff
Update AssemblyInfo.cs
EnableSoftware/DelimitedDataParser
src/DelimitedDataParser/Properties/AssemblyInfo.cs
src/DelimitedDataParser/Properties/AssemblyInfo.cs
using System; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; [assembly: AssemblyTitle("Delimited Data Parser")] [assembly: AssemblyProduct("Delimited Data Parser")] [assembly: AssemblyDescription("C# library for parsing and exporting tabular data in delimited format (e.g. CSV).")] [assembly: AssemblyCompany("Enable · enable.com")] [assembly: AssemblyCopyright("Copyright © 2017")] [assembly: ComVisible(false)] [assembly: CLSCompliant(true)] [assembly: InternalsVisibleTo("DelimitedDataParser.Test")] [assembly: AssemblyVersion("4.0.*")]
using System; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; [assembly: AssemblyTitle("Delimited Data Parser")] [assembly: AssemblyProduct("Delimited Data Parser")] [assembly: ComVisible(false)] [assembly: CLSCompliant(true)] [assembly: InternalsVisibleTo("DelimitedDataParser.Test")] [assembly: AssemblyVersion("4.0.*")]
mit
C#
f82a7999141cee0b53bf36944b8b2ba8312e2037
Update bot builder history to 3.0.5
yakumo/BotBuilder,msft-shahins/BotBuilder,stevengum97/BotBuilder,yakumo/BotBuilder,yakumo/BotBuilder,stevengum97/BotBuilder,msft-shahins/BotBuilder,msft-shahins/BotBuilder,stevengum97/BotBuilder,msft-shahins/BotBuilder,yakumo/BotBuilder,stevengum97/BotBuilder
CSharp/Library/Microsoft.Bot.Builder.History/Properties/AssemblyInfo.cs
CSharp/Library/Microsoft.Bot.Builder.History/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.Builder.History")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("Microsoft.Bot.Builder.History")] [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("d2834d71-d7a2-451b-9a61-1488af049526")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("3.0.5.0")] [assembly: AssemblyFileVersion("3.0.5.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("Microsoft.Bot.Builder.History")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("Microsoft.Bot.Builder.History")] [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("d2834d71-d7a2-451b-9a61-1488af049526")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("3.0.4.0")] [assembly: AssemblyFileVersion("3.0.4.0")]
mit
C#
32bb7596aec333564657c1dff48c6e4a224c33b8
Correct grammar error in comment.
thenerdery/UmbracoVault,thenerdery/UmbracoVault,thenerdery/UmbracoVault
UmbracoVault/Collections/TypeAliasSet.cs
UmbracoVault/Collections/TypeAliasSet.cs
using System; using System.Collections.Generic; using System.Globalization; using Umbraco.Core; using UmbracoVault.Comparers; using UmbracoVault.Extensions; namespace UmbracoVault.Collections { public class TypeAliasSet : ReadOnlySet<string> { private TypeAliasSet() : base(new HashSet<string>(new InvariantCultureCamelCaseStringComparer())) { } public static TypeAliasSet GetAliasesForUmbracoEntityType<T>() { return GetAliasesForUmbracoEntityType(typeof(T)); } public static TypeAliasSet GetAliasesForUmbracoEntityType(Type type) { var set = new TypeAliasSet(); var attributes = type.GetUmbracoEntityAttributes(); foreach (var attribute in attributes) { var alias = attribute.Alias; if (string.IsNullOrWhiteSpace(alias)) { // account for doc type models using naming convention of [DocumentTypeAlias]ViewModel alias = type.Name.TrimEnd("ViewModel"); } set.BackingSet.Add(alias.ToCamelCase(CultureInfo.InvariantCulture)); } return set; } } }
using System; using System.Collections.Generic; using System.Globalization; using Umbraco.Core; using UmbracoVault.Comparers; using UmbracoVault.Extensions; namespace UmbracoVault.Collections { public class TypeAliasSet : ReadOnlySet<string> { private TypeAliasSet() : base(new HashSet<string>(new InvariantCultureCamelCaseStringComparer())) { } public static TypeAliasSet GetAliasesForUmbracoEntityType<T>() { return GetAliasesForUmbracoEntityType(typeof(T)); } public static TypeAliasSet GetAliasesForUmbracoEntityType(Type type) { var set = new TypeAliasSet(); var attributes = type.GetUmbracoEntityAttributes(); foreach (var attribute in attributes) { var alias = attribute.Alias; if (string.IsNullOrWhiteSpace(alias)) { // account for doc type models use naming convention of [DocumentTypeAlias]ViewModel alias = type.Name.TrimEnd("ViewModel"); } set.BackingSet.Add(alias.ToCamelCase(CultureInfo.InvariantCulture)); } return set; } } }
apache-2.0
C#
ff78430ed481550aa744295b960afa6d67391b69
Move null check into FEATURE_THREAD_THREADPOOL section.
sshnet/SSH.NET,Bloomcredit/SSH.NET,miniter/SSH.NET
src/Renci.SshNet/Abstractions/ThreadAbstraction.cs
src/Renci.SshNet/Abstractions/ThreadAbstraction.cs
using System; namespace Renci.SshNet.Abstractions { internal static class ThreadAbstraction { /// <summary> /// Suspends the current thread for the specified number of milliseconds. /// </summary> /// <param name="millisecondsTimeout">The number of milliseconds for which the thread is suspended.</param> public static void Sleep(int millisecondsTimeout) { #if FEATURE_THREAD_SLEEP System.Threading.Thread.Sleep(millisecondsTimeout); #elif FEATURE_THREAD_TAP System.Threading.Tasks.Task.Delay(millisecondsTimeout).Wait(); #else #error Suspend of the current thread is not implemented. #endif } public static void ExecuteThreadLongRunning(Action action) { #if FEATURE_THREAD_TAP var taskCreationOptions = System.Threading.Tasks.TaskCreationOptions.LongRunning; System.Threading.Tasks.Task.Factory.StartNew(action, taskCreationOptions); #else var thread = new System.Threading.Thread(() => action()); thread.Start(); #endif } /// <summary> /// Executes the specified action in a separate thread. /// </summary> /// <param name="action">The action to execute.</param> public static void ExecuteThread(Action action) { #if FEATURE_THREAD_THREADPOOL if (action == null) throw new ArgumentNullException("action"); System.Threading.ThreadPool.QueueUserWorkItem(o => action()); #elif FEATURE_THREAD_TAP System.Threading.Tasks.Task.Run(action); #else #error Execution of action in a separate thread is not implemented. #endif } } }
using System; namespace Renci.SshNet.Abstractions { internal static class ThreadAbstraction { /// <summary> /// Suspends the current thread for the specified number of milliseconds. /// </summary> /// <param name="millisecondsTimeout">The number of milliseconds for which the thread is suspended.</param> public static void Sleep(int millisecondsTimeout) { #if FEATURE_THREAD_SLEEP System.Threading.Thread.Sleep(millisecondsTimeout); #elif FEATURE_THREAD_TAP System.Threading.Tasks.Task.Delay(millisecondsTimeout).Wait(); #else #error Suspend of the current thread is not implemented. #endif } public static void ExecuteThreadLongRunning(Action action) { #if FEATURE_THREAD_TAP var taskCreationOptions = System.Threading.Tasks.TaskCreationOptions.LongRunning; System.Threading.Tasks.Task.Factory.StartNew(action, taskCreationOptions); #else var thread = new System.Threading.Thread(() => action()); thread.Start(); #endif } /// <summary> /// Executes the specified action in a separate thread. /// </summary> /// <param name="action">The action to execute.</param> public static void ExecuteThread(Action action) { if (action == null) throw new ArgumentNullException("action"); #if FEATURE_THREAD_THREADPOOL System.Threading.ThreadPool.QueueUserWorkItem(o => action()); #elif FEATURE_THREAD_TAP System.Threading.Tasks.Task.Run(action); #else #error Execution of action in a separate thread is not implemented. #endif } } }
mit
C#
8d0d92fd3c3f2f15024feaf0dbf0bad9033649f0
Allow $ as import root
azarkevich/VssSvnConverter
VssSvnConverter/ext/VssItemExtensions.cs
VssSvnConverter/ext/VssItemExtensions.cs
using System; using SourceSafeTypeLib; namespace vsslib { public static class VssItemExtensions { /// <summary> /// If VSS conatins $/Project1 but requested $/project1, then case will not be fixed and $/project1 will be retuned. /// This methor return case to normal -> $/Project1 /// </summary> /// <param name="item">Item for normalize</param> /// <returns>Normalized item</returns> public static IVSSItem Normalize(this IVSSItem item, IVSSDatabase db) { IVSSItem current = db.VSSItem["$/"]; if (item.Spec.Replace('\\', '/').TrimEnd("/".ToCharArray()) == "$") return current; foreach (var pathPart in item.Spec.Replace('\\', '/').TrimStart("$/".ToCharArray()).TrimEnd('/').Split('/')) { IVSSItem next = null; foreach (IVSSItem child in current.Items) { var parts = child.Spec.TrimEnd('/').Split('/'); var lastPart = parts[parts.Length - 1]; if(String.Compare(pathPart, lastPart, StringComparison.OrdinalIgnoreCase) == 0) { next = child; break; } } if(next == null) throw new ApplicationException("Can't normalize: " + item.Spec); current = next; } return current; } } }
using System; using SourceSafeTypeLib; namespace vsslib { public static class VssItemExtensions { /// <summary> /// If VSS conatins $/Project1 but requested $/project1, then case will not be fixed and $/project1 will be retuned. /// This methor return case to normal -> $/Project1 /// </summary> /// <param name="item">Item for normalize</param> /// <returns>Normalized item</returns> public static IVSSItem Normalize(this IVSSItem item, IVSSDatabase db) { IVSSItem current = db.VSSItem["$/"]; foreach (var pathPart in item.Spec.Replace('\\', '/').TrimStart("$/".ToCharArray()).TrimEnd('/').Split('/')) { IVSSItem next = null; foreach (IVSSItem child in current.Items) { var parts = child.Spec.TrimEnd('/').Split('/'); var lastPart = parts[parts.Length - 1]; if(String.Compare(pathPart, lastPart, StringComparison.OrdinalIgnoreCase) == 0) { next = child; break; } } if(next == null) throw new ApplicationException("Can't normalize: " + item.Spec); current = next; } return current; } } }
mit
C#
9f2fb488d67c56b4a09b687725e97ed1612a8673
Remove old implementation
kappa7194/otp
Albireo.Otp.Library/Base32.cs
Albireo.Otp.Library/Base32.cs
namespace Albireo.Otp.Library { using System; internal static class Base32 { internal static byte[] ToBytes(string input) { throw new NotImplementedException(); } internal static string ToString(byte[] input) { throw new NotImplementedException(); } } }
namespace Albireo.Otp.Library { using System; using System.Diagnostics.Contracts; using System.Linq; internal static class Base32 { internal static byte[] ToBytes(string input) { Contract.Requires<ArgumentNullException>(input != null); Contract.Ensures(Contract.Result<byte[]>() != null); if (input.Length == 0) return new byte[0]; input = input.TrimEnd('='); var byteCount = input.Length * 5 / 8; var result = new byte[byteCount]; byte currentByte = 0, bitsRemaining = 8; var arrayIndex = 0; foreach (var value in input.Select(CharToValue)) { int mask; if (bitsRemaining > 5) { mask = value << (bitsRemaining - 5); currentByte = (byte) (currentByte | mask); bitsRemaining -= 5; } else { mask = value >> (5 - bitsRemaining); currentByte = (byte) (currentByte | mask); result[arrayIndex++] = currentByte; unchecked { currentByte = (byte) (value << (3 + bitsRemaining)); } bitsRemaining += 3; } } if (arrayIndex != byteCount) result[arrayIndex] = currentByte; return result; } internal static string ToString(byte[] input) { Contract.Requires<ArgumentNullException>(input != null); Contract.Ensures(Contract.Result<string>() != null); if (input.Length == 0) return string.Empty; var charCount = (int) Math.Ceiling(input.Length / 5d) * 8; var result = new char[charCount]; byte nextChar = 0, bitsRemaining = 5; var arrayIndex = 0; foreach (var b in input) { nextChar = (byte) (nextChar | (b >> (8 - bitsRemaining))); result[arrayIndex++] = ValueToChar(nextChar); if (bitsRemaining < 4) { nextChar = (byte) ((b >> (3 - bitsRemaining)) & 31); result[arrayIndex++] = ValueToChar(nextChar); bitsRemaining += 5; } bitsRemaining -= 3; nextChar = (byte) ((b << bitsRemaining) & 31); } if (arrayIndex == charCount) return new string(result); result[arrayIndex++] = ValueToChar(nextChar); while (arrayIndex != charCount) result[arrayIndex++] = '='; return new string(result); } private static int CharToValue(char c) { var value = (int) c; if (value < 91 && value > 64) return value - 65; if (value < 56 && value > 49) return value - 24; if (value < 123 && value > 96) return value - 97; throw new ArgumentException("Character is not a Base32 character.", "c"); } private static char ValueToChar(byte b) { if (b < 26) return (char) (b + 65); if (b < 32) return (char) (b + 24); throw new ArgumentException("Byte is not a value Base32 value.", "b"); } } }
mit
C#
d9421a8c9fb740d81d1fc28da7d371d3dca01db8
Fix #2107 by removing some remaining T4MVC gunk
ScottShingler/NuGetGallery,ScottShingler/NuGetGallery,mtian/SiteExtensionGallery,projectkudu/SiteExtensionGallery,skbkontur/NuGetGallery,skbkontur/NuGetGallery,skbkontur/NuGetGallery,ScottShingler/NuGetGallery,grenade/NuGetGallery_download-count-patch,mtian/SiteExtensionGallery,grenade/NuGetGallery_download-count-patch,projectkudu/SiteExtensionGallery,grenade/NuGetGallery_download-count-patch,projectkudu/SiteExtensionGallery,mtian/SiteExtensionGallery
src/NuGetGallery/Views/CuratedPackages/CreateCuratedPackageForm.cshtml
src/NuGetGallery/Views/CuratedPackages/CreateCuratedPackageForm.cshtml
@model CreateCuratedPackageRequest @{ Layout = "~/Views/Shared/TwoColumnLayout.cshtml"; } @section SideColumn { <p><strong>Note: </strong>Packages might also be automatically included in your curated feed based on pre-defined rules. This form is to manually include a package in the curated feed, which will override any pre-defined rules.</p> } <h1 class="page-heading">Include Package in <i>@ViewBag.CuratedFeedName</i></h1> @using (Html.BeginForm("CuratedPackages", "CuratedPackages", new { curatedFeedName = ViewBag.CuratedFeedName })) { <fieldset class="form"> @Html.AntiForgeryToken() @Html.ValidationSummary(true) @Html.EditorForModel() <input type="submit" value="Add" title="Add" /> </fieldset> }
@model CreateCuratedPackageRequest @{ Layout = "~/Views/Shared/TwoColumnLayout.cshtml"; } @section SideColumn { <p><strong>Note: </strong>Packages might also be automatically included in your curated feed based on pre-defined rules. This form is to manually include a package in the curated feed, which will override any pre-defined rules.</p> } <h1 class="page-heading">Include Package in <i>@ViewBag.CuratedFeedName</i></h1> @using (Html.BeginForm("CuratedPackages", CuratedPackagesController.ControllerName, new { curatedFeedName = ViewBag.CuratedFeedName })) { <fieldset class="form"> @Html.AntiForgeryToken() @Html.ValidationSummary(true) @Html.EditorForModel() <input type="submit" value="Add" title="Add" /> </fieldset> }
apache-2.0
C#
482b74201030b6555333d1408ce87f8d4a230278
Add description to assembly.
Bitmapped/UmbIntranetRestrict,Bitmapped/UmbIntranetRestrict,Bitmapped/UmbIntranetRestrict
src/UmbIntranetRestrict/Properties/AssemblyInfo.cs
src/UmbIntranetRestrict/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("UmbHttpStatusCode")] [assembly: AssemblyDescription("Event handler plugin for Umbraco that allows users to specify as page properties HTTP Status Codes to be returned.")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Brian M. Powell")] [assembly: AssemblyProduct("UmbHttpStatusCode")] [assembly: AssemblyCopyright("Copyright 2016, Brian M. Powell")] [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("743ed641-efbf-40fb-8011-509d13258ecb")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("2.1.1.0")] [assembly: AssemblyFileVersion("2.1.1.0")]
using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("UmbHttpStatusCode")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Brian M. Powell")] [assembly: AssemblyProduct("UmbHttpStatusCode")] [assembly: AssemblyCopyright("Copyright 2016, Brian M. Powell")] [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("743ed641-efbf-40fb-8011-509d13258ecb")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("2.1.1.0")] [assembly: AssemblyFileVersion("2.1.1.0")]
mit
C#
b571978e930fc0050145d5e919b450dc1e6aecf9
Update ConsoleWriterActor.cs
abogushevsky/akka-bootcamp,xxelka/akka-bootcamp,matovich/akka-bootcamp,DevEnable/akka-bootcamp,nerubseran/akka-bootcamp,BredStik/akka-bootcamp,mmisztal1980/akka-bootcamp,sjpence/akka-bootcamp,billyxing/akka-bootcamp,HenrikHagberg/akka-bootcamp,ng-martin/akka-bootcamp,Aaronontheweb/akka-bootcamp,robinwyss/akka-bootcamp,vermluh/akka-bootcamp,mungobungo/akka-bootcamp,petabridge/akka-bootcamp,vermluh/akka-bootcamp,bobbychopra/akka-bootcamp,earaya/akka-bootcamp,billyxing/akka-bootcamp,jessetechie/akka-bootcamp,bartschotten/akka-bootcamp,eeevans/akka-bootcamp,ralphwillgoss/akka-bootcamp,stickmanblue/akka-bootcamp,alinesjr/akka-bootcamp,TomKearney/akka-bootcamp,ralphwillgoss/akka-bootcamp,mungobungo/akka-bootcamp-translation-ru,stickmanblue/akka-bootcamp,SaberZA/akka-bootcamp,pahunt-1978/akka-bootcamp,skotzko/akka-bootcamp,mungobungo/akka-bootcamp-translation-ru,matneyx/akka-bootcamp,TimMurphy/akka-bootcamp,albertodall/akka-bootcamp,matneyx/akka-bootcamp,EthanSteiner/akka-bootcamp,nerubseran/akka-bootcamp,GeorgeFocas/akka-bootcamp,silentnull/akka-bootcamp,mungobungo/akka-bootcamp,EDOlsson/akka-bootcamp,bartschotten/akka-bootcamp,featuresnap/akka-bootcamp,featuresnap/akka-bootcamp,jeffdoolittle/akka-bootcamp,borgrodrick/akka-bootcamp,TomKearney/akka-bootcamp,mhdubose/akka-bootcamp,abogushevsky/akka-bootcamp,alinesjr/akka-bootcamp,soalexmn/akka-bootcamp,vdefeo/akka-bootcamp,wshirey/akka-bootcamp,eeevans/akka-bootcamp,borgrodrick/akka-bootcamp,vdefeo/akka-bootcamp,xxelka/akka-bootcamp,pavelsvintsov/akka-bootcamp,robinwyss/akka-bootcamp,LastManStanding/akka-bootcamp,albertodall/akka-bootcamp,EDOlsson/akka-bootcamp,bobbychopra/akka-bootcamp,jessetechie/akka-bootcamp,jcox86/akka-bootcamp,pahunt-1978/akka-bootcamp,cortas/akka-bootcamp,krro83/akka-bootcamp,TimMurphy/akka-bootcamp,DevEnable/akka-bootcamp,mhdubose/akka-bootcamp,kolbasik/akka-bootcamp,SaberZA/akka-bootcamp,cortas/akka-bootcamp,ng-martin/akka-bootcamp,soalexmn/akka-bootcamp,krro83/akka-bootcamp,ITHedgeHog/akka-bootcamp,jeffdoolittle/akka-bootcamp,skotzko/akka-bootcamp,pavelsvintsov/akka-bootcamp,GeorgeFocas/akka-bootcamp,matovich/akka-bootcamp,EthanSteiner/akka-bootcamp,StephenBeacom77/akka-bootcamp,LastManStanding/akka-bootcamp,wshirey/akka-bootcamp,HenrikHagberg/akka-bootcamp,pavsh/akka-bootcamp,jcox86/akka-bootcamp,BredStik/akka-bootcamp,ITHedgeHog/akka-bootcamp,earaya/akka-bootcamp,sjpence/akka-bootcamp,Aaronontheweb/akka-bootcamp,kolbasik/akka-bootcamp,StephenBeacom77/akka-bootcamp,arcaartem/akka-bootcamp,petabridge/akka-bootcamp,silentnull/akka-bootcamp,arcaartem/akka-bootcamp,pavsh/akka-bootcamp
src/Unit-1/lesson1/Completed/ConsoleWriterActor.cs
src/Unit-1/lesson1/Completed/ConsoleWriterActor.cs
using System; using Akka.Actor; namespace WinTail { /// <summary> /// Actor responsible for serializing message writes to the console. /// (write one message at a time, champ :) /// </summary> class ConsoleWriterActor : UntypedActor { protected override void OnReceive(object message) { var msg = message as string; // make sure we got a message if (string.IsNullOrEmpty(msg)) { Console.ForegroundColor = ConsoleColor.DarkYellow; Console.WriteLine("Please provide an input.\n"); Console.ResetColor(); return; } // if message has even # characters, display in red; else, green var even = msg.Length % 2 == 0; var color = even ? ConsoleColor.Red : ConsoleColor.Green; var alert = even ? "Your string had an even # of characters.\n" : "Your string had an odd # of characters.\n"; Console.ForegroundColor = color; Console.WriteLine(alert); Console.ResetColor(); } } }
using System; using Akka.Actor; namespace WinTail { /// <summary> /// Actor responsible for serializing message writes to the console. /// (write one message at a time, champ :) /// </summary> class ConsoleWriterActor : UntypedActor { protected override void OnReceive(object message) { var msg = message as string; // make sure we got a message if (string.IsNullOrEmpty(msg)) { Console.ForegroundColor = ConsoleColor.DarkYellow; Console.WriteLine("Please provide an input.\n"); return; } // if message has even # characters, display in red; else, green var even = msg.Length % 2 == 0; var color = even ? ConsoleColor.Red : ConsoleColor.Green; var alert = even ? "Your string had an even # of characters.\n" : "Your string had an odd # of characters.\n"; Console.ForegroundColor = color; Console.WriteLine(alert); Console.ResetColor(); } } }
apache-2.0
C#
f5b460a9cd7a44fbc26726fc6c7228c9952dab30
Remove public length property
mstrother/BmpListener
BmpListener/Bgp/Capability.cs
BmpListener/Bgp/Capability.cs
using System; using Newtonsoft.Json; namespace BmpListener.Bgp { public abstract class Capability { private byte CapabilityLength; public enum CapabilityCode : byte { Multiprotocol = 1, RouteRefresh = 2, //TODO capability code 4 GracefulRestart = 64, FourOctetAs = 65, AddPath = 69, EnhancedRouteRefresh = 70, CiscoRouteRefresh = 128 //TODO capability code 129 } protected Capability(CapabilityCode capability, ArraySegment<byte> data) { CapabilityType = capability; CapabilityLength = (byte) data.Count; } public CapabilityCode CapabilityType { get; } public static Capability GetCapability(CapabilityCode capabilityCode, ArraySegment<byte> data) { switch (capabilityCode) { case CapabilityCode.Multiprotocol: return new CapabilityMultiProtocol(capabilityCode, data); case CapabilityCode.RouteRefresh: return new CapabilityRouteRefresh(capabilityCode, data); case CapabilityCode.GracefulRestart: return new CapabilityGracefulRestart(capabilityCode, data); case CapabilityCode.FourOctetAs: return new CapabilityFourOctetAsNumber(capabilityCode, data); case CapabilityCode.AddPath: return new CapabilityAddPath(capabilityCode, data); case CapabilityCode.EnhancedRouteRefresh: return new CapabilityEnhancedRouteRefresh(capabilityCode, data); case CapabilityCode.CiscoRouteRefresh: return new CapabilityCiscoRouteRefresh(capabilityCode, data); default: return new CapabilityCiscoRouteRefresh(capabilityCode, data); } } } }
using System; using Newtonsoft.Json; namespace BmpListener.Bgp { public abstract class Capability { public enum CapabilityCode : byte { Multiprotocol = 1, RouteRefresh = 2, //TODO capability code 4 GracefulRestart = 64, FourOctetAs = 65, AddPath = 69, EnhancedRouteRefresh = 70, CiscoRouteRefresh = 128 //TODO capability code 129 } protected Capability(CapabilityCode capability, ArraySegment<byte> data) { CapabilityType = capability; CapabilityLength = (byte) data.Count; } public CapabilityCode CapabilityType { get; } [JsonIgnore] public byte CapabilityLength { get; } public static Capability GetCapability(CapabilityCode capabilityCode, ArraySegment<byte> data) { switch (capabilityCode) { case CapabilityCode.Multiprotocol: return new CapabilityMultiProtocol(capabilityCode, data); case CapabilityCode.RouteRefresh: return new CapabilityRouteRefresh(capabilityCode, data); case CapabilityCode.GracefulRestart: return new CapabilityGracefulRestart(capabilityCode, data); case CapabilityCode.FourOctetAs: return new CapabilityFourOctetAsNumber(capabilityCode, data); case CapabilityCode.AddPath: return new CapabilityAddPath(capabilityCode, data); case CapabilityCode.EnhancedRouteRefresh: return new CapabilityEnhancedRouteRefresh(capabilityCode, data); case CapabilityCode.CiscoRouteRefresh: return new CapabilityCiscoRouteRefresh(capabilityCode, data); default: return new CapabilityCiscoRouteRefresh(capabilityCode, data); } } } }
mit
C#
53817cce14929b6d425497291fd2695a773bcc15
update homepage
alimon808/contoso-university,alimon808/contoso-university,alimon808/contoso-university
ContosoUniversity.Web/Views/Home/Index.cshtml
ContosoUniversity.Web/Views/Home/Index.cshtml
@{ ViewData["Title"] = "Home Page"; } <div class="jumbotron"> <h1>Contoso University</h1> </div> <div class="row"> <div class="col-md-4"> <p> Contoso University is a place for learning AspNetCore and related technologies. This demo application is an amalgamation of smaller demo applications found in tutorials at <a href="https://docs.microsoft.com/en-us/aspnet/core/">AspNetCore docs</a>. The tutorials are great at demonstrating isolated concepts, but issues surfaces when applying these concepts/techniques in a larger context. The purpose of this demo application is to apply concepts/techniques learned from those tutorial into a single domain (i.e. university). </p> </div> <div class="col-md-4"> <h2>Build it from scratch</h2> <p> You can build the initial application by following the steps in a series of tutorials. </p> <p> <a class="btn btn-default" href="https://docs.asp.net/en/latest/data/ef-mvc/intro.html"> Seee the tutorial &raquo; </a> </p> </div> <div class="col-md-4"> <h2>Download it</h2> <p>You can download the completed project from Github.</p> <p> <a class="btn btn-default" href="https://github.com/alimon808/contoso-university"> See project source code &raquo; </a> </p> </div> </div>
@{ ViewData["Title"] = "Home Page"; } <div class="jumbotron"> <h1>Contoso University</h1> </div> <div class="row"> <div class="col-md-4"> <p> Contoso University is a sample application that demonstrates how to use Entity Framework Core in an ASP.Net Core MVC web application. </p> </div> <div class="col-md-4"> <h2>Build it from scratch</h2> <p> You can build the application by following the steps in a series of tutorials. </p> <p> <a class="btn btn-default" href="https://docs.asp.net/en/latest/data/ef-mvc/intro.html"> Seee the tutorial &raquo; </a> </p> </div> <div class="col-md-4"> <h2>Download it</h2> <p>You can download the completed project from Github.</p> <p> <a class="btn btn-default" href="https://github.com/aspnet/docs/tree/master/aspnetcore/data/ef-mvc/intro/samples/cu-final"> See project source code &raquo; </a> </p> </div> </div>
mit
C#
26db85d24d4da39cd3cec280d952fea1d967c959
add missing ToastrOptions
WasimAhmad/Serenity,rolembergfilho/Serenity,volkanceylan/Serenity,rolembergfilho/Serenity,rolembergfilho/Serenity,WasimAhmad/Serenity,WasimAhmad/Serenity,volkanceylan/Serenity,dfaruque/Serenity,rolembergfilho/Serenity,dfaruque/Serenity,WasimAhmad/Serenity,dfaruque/Serenity,volkanceylan/Serenity,dfaruque/Serenity,WasimAhmad/Serenity,dfaruque/Serenity,volkanceylan/Serenity,volkanceylan/Serenity,rolembergfilho/Serenity
Serenity.Script.Imports/Toastr/ToastrOptions.cs
Serenity.Script.Imports/Toastr/ToastrOptions.cs
using System; using System.Runtime.CompilerServices; namespace Serenity { /// <summary> /// Options for the jQuery toastr plugin /// </summary> [Imported, Serializable] public class ToastrOptions { public object Target { get; set; } public string ContainerId { get; set; } public string PositionClass { get; set; } public int TimeOut { get; set; } public int ShowDuration { get; set; } public int HideDuration { get; set; } public int ExtendedTimeOut { get; set; } public bool ProgressBar { get; set; } public bool CloseButton { get; set; } } }
using System; using System.Runtime.CompilerServices; namespace Serenity { /// <summary> /// Options for the jQuery toastr plugin /// </summary> [Imported, Serializable] public class ToastrOptions { public object Target { get; set; } public string ContainerId { get; set; } public string PositionClass { get; set; } public int TimeOut { get; set; } public int ShowDuration { get; set; } public int HideDuration { get; set; } public int ExtendedTimeOut { get; set; } } }
mit
C#
3262f6c864c8c958e1a13ac48f3b011b843ed70a
bump version
raml-org/raml-dotnet-parser,raml-org/raml-dotnet-parser
source/RAML.Parser/Properties/AssemblyInfo.cs
source/RAML.Parser/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("RAML.Parser")] [assembly: AssemblyDescription("RAML and OAS (swagger) parser for .Net")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("MuleSoft")] [assembly: AssemblyProduct("RAML.Parser")] [assembly: AssemblyCopyright("Copyright © 2018")] [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("af24976e-d021-4aa5-b7d7-1de6574cd6f6")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("2.0.0")] [assembly: AssemblyFileVersion("2.0.0")]
using System.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("RAML.Parser")] [assembly: AssemblyDescription("RAML and OAS (swagger) parser for .Net")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("MuleSoft")] [assembly: AssemblyProduct("RAML.Parser")] [assembly: AssemblyCopyright("Copyright © 2018")] [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("af24976e-d021-4aa5-b7d7-1de6574cd6f6")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("0.9.8")] [assembly: AssemblyFileVersion("0.9.8")]
apache-2.0
C#
a8f4baeba52cc2d09bde2a178561e2be74642510
Use json in WCF REST response.
tlaothong/lab-swp-ws-kiatnakin,tlaothong/lab-swp-ws-kiatnakin,tlaothong/lab-swp-ws-kiatnakin
LabWsKiatnakin/DemoWcfRest/DemoService.svc.cs
LabWsKiatnakin/DemoWcfRest/DemoService.svc.cs
using System; using System.Collections.Generic; using System.Linq; using System.Runtime.Serialization; using System.ServiceModel; using System.ServiceModel.Activation; using System.ServiceModel.Web; using System.Text; namespace DemoWcfRest { [ServiceContract(Namespace = "")] [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)] public class DemoService { // To use HTTP GET, add [WebGet] attribute. (Default ResponseFormat is WebMessageFormat.Json) // To create an operation that returns XML, // add [WebGet(ResponseFormat=WebMessageFormat.Xml)], // and include the following line in the operation body: // WebOperationContext.Current.OutgoingResponse.ContentType = "text/xml"; [OperationContract] [WebGet(UriTemplate = "hi/{name}", ResponseFormat = WebMessageFormat.Json)] public string Hello(string name) { return string.Format("Hello, {0}", name); } // Add more operations here and mark them with [OperationContract] [OperationContract] [WebInvoke(Method = "POST")] public void PostSample(string postBody) { // DO NOTHING } } }
using System; using System.Collections.Generic; using System.Linq; using System.Runtime.Serialization; using System.ServiceModel; using System.ServiceModel.Activation; using System.ServiceModel.Web; using System.Text; namespace DemoWcfRest { [ServiceContract(Namespace = "")] [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)] public class DemoService { // To use HTTP GET, add [WebGet] attribute. (Default ResponseFormat is WebMessageFormat.Json) // To create an operation that returns XML, // add [WebGet(ResponseFormat=WebMessageFormat.Xml)], // and include the following line in the operation body: // WebOperationContext.Current.OutgoingResponse.ContentType = "text/xml"; [OperationContract] [WebGet(UriTemplate = "hi/{name}")] public string Hello(string name) { return string.Format("Hello, {0}", name); } // Add more operations here and mark them with [OperationContract] [OperationContract] [WebInvoke(Method = "POST")] public void PostSample(string postBody) { // DO NOTHING } } }
mit
C#
eb89ecd86653290be0089f71fbd6d65575b80c47
put x-ms-routing-name in cookie when calling auth provider
projectkudu/SimpleWAWS,projectkudu/TryAppService,davidebbo/SimpleWAWS,projectkudu/SimpleWAWS,projectkudu/SimpleWAWS,projectkudu/TryAppService,projectkudu/SimpleWAWS,projectkudu/TryAppService,fashaikh/SimpleWAWS,davidebbo/SimpleWAWS,projectkudu/TryAppService,fashaikh/SimpleWAWS,fashaikh/SimpleWAWS,davidebbo/SimpleWAWS,fashaikh/SimpleWAWS,davidebbo/SimpleWAWS
SimpleWAWS/Authentication/GoogleAuthProvider.cs
SimpleWAWS/Authentication/GoogleAuthProvider.cs
using System; using System.Collections.Generic; using System.Configuration; using System.Globalization; using System.Linq; using System.Net; using System.Text; using System.Web; namespace SimpleWAWS.Authentication { public class GoogleAuthProvider : BaseOpenIdConnectAuthProvider { public override string GetLoginUrl(HttpContextBase context) { var culture = CultureInfo.CurrentCulture.Name.ToLowerInvariant(); var builder = new StringBuilder(); builder.Append("https://accounts.google.com/o/oauth2/auth"); builder.Append("?response_type=id_token"); var slot = String.Empty; if (context.Request.QueryString["x-ms-routing-name"] != null) // slot = $"?x-ms-routing-name={context.Request.QueryString["x-ms-routing-name"]}"; context.Response.Cookies.Add(new HttpCookie("x-ms-routing-name", context.Request.QueryString["x-ms-routing-name"])); builder.AppendFormat("&redirect_uri={0}", WebUtility.UrlEncode(string.Format(CultureInfo.InvariantCulture, "https://{0}/Login{1}", context.Request.Headers["HOST"], slot))); builder.AppendFormat("&client_id={0}", AuthSettings.GoogleAppId); builder.AppendFormat("&scope={0}", "email"); if (context.IsFunctionsPortalRequest()) { builder.AppendFormat("&state={0}", WebUtility.UrlEncode(string.Format(CultureInfo.InvariantCulture, "{0}{1}", context.Request.Headers["Referer"], context.Request.Url.Query) )); } else builder.AppendFormat("&state={0}", WebUtility.UrlEncode(context.IsAjaxRequest()? string.Format(CultureInfo.InvariantCulture, "/{0}{1}", culture, context.Request.Url.Query) : context.Request.Url.PathAndQuery)); return builder.ToString(); } protected override string GetValidAudiance() { return AuthSettings.GoogleAppId; } public override string GetIssuerName(string altSecId) { return "Google"; } } }
using System; using System.Collections.Generic; using System.Configuration; using System.Globalization; using System.Linq; using System.Net; using System.Text; using System.Web; namespace SimpleWAWS.Authentication { public class GoogleAuthProvider : BaseOpenIdConnectAuthProvider { public override string GetLoginUrl(HttpContextBase context) { var culture = CultureInfo.CurrentCulture.Name.ToLowerInvariant(); var builder = new StringBuilder(); builder.Append("https://accounts.google.com/o/oauth2/auth"); builder.Append("?response_type=id_token"); var slot = String.Empty; if (context.Request.QueryString["x-ms-routing-name"] != null) slot = $"?x-ms-routing-name={context.Request.QueryString["x-ms-routing-name"]}"; builder.AppendFormat("&redirect_uri={0}", WebUtility.UrlEncode(string.Format(CultureInfo.InvariantCulture, "https://{0}/Login{1}", context.Request.Headers["HOST"], slot))); builder.AppendFormat("&client_id={0}", AuthSettings.GoogleAppId); builder.AppendFormat("&scope={0}", "email"); if (context.IsFunctionsPortalRequest()) { builder.AppendFormat("&state={0}", WebUtility.UrlEncode(string.Format(CultureInfo.InvariantCulture, "{0}{1}", context.Request.Headers["Referer"], context.Request.Url.Query) )); } else builder.AppendFormat("&state={0}", WebUtility.UrlEncode(context.IsAjaxRequest()? string.Format(CultureInfo.InvariantCulture, "/{0}{1}", culture, context.Request.Url.Query) : context.Request.Url.PathAndQuery)); return builder.ToString(); } protected override string GetValidAudiance() { return AuthSettings.GoogleAppId; } public override string GetIssuerName(string altSecId) { return "Google"; } } }
apache-2.0
C#
448bed012392bf085346aa45e269deb92ef000ca
Fix test namespace
RadicalFx/Radical.Windows
src/Radical.Windows.Tests/API/APIApprovals.cs
src/Radical.Windows.Tests/API/APIApprovals.cs
using ApprovalTests; using ApprovalTests.Reporters; using Microsoft.VisualStudio.TestTools.UnitTesting; using PublicApiGenerator; using System; using System.Linq; using System.Runtime.CompilerServices; namespace Radical.Windows.Tests.API { [TestClass] public class APIApprovals { [TestMethod] [TestCategory("APIApprovals")] [MethodImpl(MethodImplOptions.NoInlining)] [UseReporter(typeof(DiffReporter))] public void Approve_API() { ApiGeneratorOptions options = null; var type = Type.GetType("XamlGeneratedNamespace.GeneratedInternalTypeHelper, Radical.Windows"); if (type != null) { var typesToInclude = typeof(VisualTreeCrawler).Assembly .GetExportedTypes() .Except(new Type[] { type }) .ToArray(); options = new ApiGeneratorOptions() { IncludeTypes = typesToInclude }; } var publicApi = ApiGenerator.GeneratePublicApi(typeof(VisualTreeCrawler).Assembly, options: options); Approvals.Verify(publicApi); } } }
using ApprovalTests; using ApprovalTests.Reporters; using Microsoft.VisualStudio.TestTools.UnitTesting; using PublicApiGenerator; using Radical.Windows; using System; using System.Linq; using System.Runtime.CompilerServices; namespace Radical.Tests.API { [TestClass] public class APIApprovals { [TestMethod] [TestCategory("APIApprovals")] [MethodImpl(MethodImplOptions.NoInlining)] [UseReporter(typeof(DiffReporter))] public void Approve_API() { ApiGeneratorOptions options = null; var type = Type.GetType("XamlGeneratedNamespace.GeneratedInternalTypeHelper, Radical.Windows"); if (type != null) { var typesToInclude = typeof(VisualTreeCrawler).Assembly .GetExportedTypes() .Except(new Type[] { type }) .ToArray(); options = new ApiGeneratorOptions() { IncludeTypes = typesToInclude }; } var publicApi = ApiGenerator.GeneratePublicApi(typeof(VisualTreeCrawler).Assembly, options: options); Approvals.Verify(publicApi); } } }
mit
C#
b0e2933cf7fe58ed924b6e18a9066beec5245394
Add function to get background color
emoacht/Monitorian
Source/Monitorian.Supplement/UIInformation.cs
Source/Monitorian.Supplement/UIInformation.cs
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Media; using Microsoft.Win32; using Windows.UI.ViewManagement; namespace Monitorian.Supplement { /// <summary> /// A wrapper class of <see cref="Windows.UI.ViewManagement.UISettings"/> /// </summary> /// <remarks> /// <see cref="Windows.UI.ViewManagement.UISettings"/> is available /// on Windows 10 (version 10.0.10240.0) or newer. /// </remarks> public class UIInformation { private static UISettings _uiSettings; /// <summary> /// Gets the system accent color. /// </summary> /// <returns></returns> public static Color GetAccentColor() => GetUIColor(UIColorType.Accent); /// <summary> /// Gets the system background color. /// </summary> /// <returns></returns> public static Color GetBackgroundColor() => GetUIColor(UIColorType.Background); private static Color GetUIColor(UIColorType colorType) { var value = (_uiSettings ?? new UISettings()).GetColorValue(colorType); return Color.FromArgb(value.A, value.R, value.G, value.B); } /// <summary> /// Determines whether light theme is used by the system. /// </summary> /// <returns>True if light theme is used</returns> public static bool IsLightThemeUsed() { const string keyName = @"Software\Microsoft\Windows\CurrentVersion\Themes\Personalize"; // HKCU const string valueName = "SystemUsesLightTheme"; using var key = Registry.CurrentUser.OpenSubKey(keyName); return (key?.GetValue(valueName) is int value) && (value == 1); } private static readonly object _lock = new object(); /// <summary> /// Occurs when colors have changed. /// </summary> public static event EventHandler ColorsChanged { add { lock (_lock) { _colorsChanged += value; if (_uiSettings is null) { _uiSettings = new UISettings(); _uiSettings.ColorValuesChanged += OnColorValuesChanged; } } } remove { lock (_lock) { _colorsChanged -= value; if (_colorsChanged is not null) return; if (_uiSettings is not null) { _uiSettings.ColorValuesChanged -= OnColorValuesChanged; _uiSettings = null; } } } } private static event EventHandler _colorsChanged; private static void OnColorValuesChanged(UISettings sender, object args) { _colorsChanged?.Invoke(sender, EventArgs.Empty); } } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Media; using Windows.UI.ViewManagement; namespace Monitorian.Supplement { /// <summary> /// A wrapper class of <see cref="Windows.UI.ViewManagement.UISettings"/> /// </summary> /// <remarks> /// <see cref="Windows.UI.ViewManagement.UISettings"/> is available /// on Windows 10 (version 10.0.10240.0) or newer. /// </remarks> public class UIInformation { /// <summary> /// Gets accent color. /// </summary> /// <returns></returns> public static Color GetAccentColor() { var value = (_uiSettings ?? new UISettings()).GetColorValue(UIColorType.Accent); return Color.FromArgb(value.A, value.R, value.G, value.B); } private static UISettings _uiSettings; private static readonly object _lock = new object(); /// <summary> /// Occurs when colors have changed. /// </summary> public static event EventHandler ColorsChanged { add { lock (_lock) { _colorsChanged += value; if (_uiSettings is null) { _uiSettings = new UISettings(); _uiSettings.ColorValuesChanged += OnColorValuesChanged; } } } remove { lock (_lock) { _colorsChanged -= value; if (_colorsChanged is not null) return; if (_uiSettings is not null) { _uiSettings.ColorValuesChanged -= OnColorValuesChanged; _uiSettings = null; } } } } private static event EventHandler _colorsChanged; private static void OnColorValuesChanged(UISettings sender, object args) { _colorsChanged?.Invoke(sender, EventArgs.Empty); } } }
mit
C#
1f2cef1a4585e28e4bc5fb555c8cd2ce359b4cc8
Update ICurrentCommandStore.cs
tiksn/TIKSN-Framework
TIKSN.Core/PowerShell/ICurrentCommandStore.cs
TIKSN.Core/PowerShell/ICurrentCommandStore.cs
namespace TIKSN.PowerShell { public interface ICurrentCommandStore { void SetCurrentCommand(CommandBase command); } }
namespace TIKSN.PowerShell { public interface ICurrentCommandStore { void SetCurrentCommand(CommandBase command); } }
mit
C#
d1ba9e025205fd9f4bc0f2e9f868a93f41be0ddd
Test disable of logging
jherby2k/AudioWorks
AudioWorks/tests/AudioWorks.Common.Tests/AudioEncodingExceptionTests.cs
AudioWorks/tests/AudioWorks.Common.Tests/AudioEncodingExceptionTests.cs
/* Copyright 2018 Jeremy Herbison This file is part of AudioWorks. AudioWorks is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. AudioWorks 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 Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with AudioWorks. If not, see <https://www.gnu.org/licenses/>. */ using AudioWorks.TestUtilities; using Xunit; using Xunit.Abstractions; namespace AudioWorks.Common.Tests { public sealed class AudioEncodingExceptionTests { [Fact(DisplayName = "AudioEncodingException is an AudioException")] public void IsAudioException() => Assert.IsAssignableFrom<AudioException>(new AudioEncodingException()); } }
/* Copyright 2018 Jeremy Herbison This file is part of AudioWorks. AudioWorks is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. AudioWorks 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 Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with AudioWorks. If not, see <https://www.gnu.org/licenses/>. */ using AudioWorks.TestUtilities; using Xunit; using Xunit.Abstractions; namespace AudioWorks.Common.Tests { public sealed class AudioEncodingExceptionTests { public AudioEncodingExceptionTests(ITestOutputHelper outputHelper) => LoggerManager.AddSingletonProvider(() => new XunitLoggerProvider()).OutputHelper = outputHelper; [Fact(DisplayName = "AudioEncodingException is an AudioException")] public void IsAudioException() => Assert.IsAssignableFrom<AudioException>(new AudioEncodingException()); } }
agpl-3.0
C#
7b1311a55c9a2d4173ac3f3c472007f87668a827
Fix copy/paste error in comments.
punker76/taglib-sharp,Clancey/taglib-sharp,hwahrmann/taglib-sharp,archrival/taglib-sharp,archrival/taglib-sharp,CamargoR/taglib-sharp,hwahrmann/taglib-sharp,Clancey/taglib-sharp,CamargoR/taglib-sharp,Clancey/taglib-sharp,mono/taglib-sharp,punker76/taglib-sharp
src/TagLib/Cr2/Codec.cs
src/TagLib/Cr2/Codec.cs
// // Codec.cs: // // Author: // Mike Gemuende (mike@gemuende.be) // // Copyright (C) 2010 Mike Gemuende // // This library is free software; you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License version // 2.1 as published by the Free Software Foundation. // // This library is distributed in the hope that it will be useful, but // WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 // USA // using System; namespace TagLib.Cr2 { /// <summary> /// A Canon RAW photo codec. Contains basic photo details. /// </summary> public class Codec : Image.Codec { /// <summary> /// Gets a text description of the media represented by the /// current instance. /// </summary> /// <value> /// A <see cref="string" /> object containing a description /// of the media represented by the current instance. /// </value> public override string Description { get { return "Canon Raw File"; } } /// <summary> /// Constructs a new <see cref="Codec" /> with the given width /// and height. /// </summary> /// <param name="width"> /// The width of the photo. /// </param> /// <param name="height"> /// The height of the photo. /// </param> /// <returns> /// A new <see cref="Codec" /> instance. /// </returns> public Codec (int width, int height) : base (width, height) {} } }
// // Codec.cs: // // Author: // Mike Gemuende (mike@gemuende.be) // // Copyright (C) 2010 Mike Gemuende // // This library is free software; you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License version // 2.1 as published by the Free Software Foundation. // // This library is distributed in the hope that it will be useful, but // WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 // USA // using System; namespace TagLib.Cr2 { /// <summary> /// A Png photo codec. Contains basic photo details. /// </summary> public class Codec : Image.Codec { /// <summary> /// Gets a text description of the media represented by the /// current instance. /// </summary> /// <value> /// A <see cref="string" /> object containing a description /// of the media represented by the current instance. /// </value> public override string Description { get { return "Canon Raw File"; } } /// <summary> /// Constructs a new <see cref="Codec" /> with the given width /// and height. /// </summary> /// <param name="width"> /// The width of the photo. /// </param> /// <param name="height"> /// The height of the photo. /// </param> /// <returns> /// A new <see cref="Codec" /> instance. /// </returns> public Codec (int width, int height) : base (width, height) {} } }
lgpl-2.1
C#
39990724988d99157d99aa2af85a9386ae719fde
Update "Configuration"
DRFP/Personal-Library
_Build/PersonalLibrary/Library/Configuration.cs
_Build/PersonalLibrary/Library/Configuration.cs
using Google.Apis.Books.v1; using Google.Apis.Services; namespace Library { public class Configuration { public const string applicationName = "PersonalLibrary"; public const string apiKey = "AIzaSyCeOsGdlQrvY5KpiHlJAA9m5Fn_ANhcR0I"; public const string databaseName = "PersonalLibrary.db"; } }
namespace Library { public class Configuration { public const string DatabaseName = "PersonalLibrary.db"; } }
mit
C#
6abb8d3745a03be8798c77a9b572b227009feba9
Change default popup title text
danielchalmers/SteamAccountSwitcher
SteamAccountSwitcher/Popup.cs
SteamAccountSwitcher/Popup.cs
#region using System.Windows; #endregion namespace SteamAccountSwitcher { internal class Popup { public static MessageBoxResult Show(string text, MessageBoxButton btn = MessageBoxButton.OK, MessageBoxImage img = MessageBoxImage.Information, MessageBoxResult defaultbtn = MessageBoxResult.OK) { return MessageBox.Show(text, "Steam Account Switcher", btn, img, defaultbtn); } } }
#region using System.Windows; #endregion namespace SteamAccountSwitcher { internal class Popup { public static MessageBoxResult Show(string text, MessageBoxButton btn = MessageBoxButton.OK, MessageBoxImage img = MessageBoxImage.Information, MessageBoxResult defaultbtn = MessageBoxResult.OK) { return MessageBox.Show(text, "SteamAccountSwitcher", btn, img, defaultbtn); } } }
mit
C#
73a87eb9de4115cd9ef3da780774c1c1abc33985
fix issue where code blowing up when capacity, etc. are null
crdschurch/crds-signin-checkin,crdschurch/crds-signin-checkin,crdschurch/crds-signin-checkin,crdschurch/crds-signin-checkin
SignInCheckIn/MinistryPlatform.Translation/Models/DTO/MpEventRoomDto.cs
SignInCheckIn/MinistryPlatform.Translation/Models/DTO/MpEventRoomDto.cs
using MinistryPlatform.Translation.Models.Attributes; using Newtonsoft.Json; namespace MinistryPlatform.Translation.Models.DTO { [MpRestApiTable(Name = "Event_Rooms")] public class MpEventRoomDto { [JsonProperty(PropertyName = "Event_Room_ID", NullValueHandling = NullValueHandling.Ignore)] public int? EventRoomId { get; set; } [JsonProperty(PropertyName = "Room_ID")] public int RoomId { get; set; } [JsonProperty(PropertyName = "Event_ID")] public int EventId { get; set; } [JsonProperty(PropertyName = "Room_Name")] public string RoomName { get; set; } [JsonProperty(PropertyName = "Room_Number")] public string RoomNumber { get; set; } [JsonProperty(PropertyName = "Allow_Checkin")] public bool AllowSignIn { get; set; } [JsonProperty(PropertyName = "Volunteers")] public int? Volunteers { get; set; } [JsonProperty(PropertyName = "Capacity")] public int? Capacity { get; set; } [JsonProperty(PropertyName = "Signed_In")] public int? SignedIn { get; set; } [JsonProperty(PropertyName = "Checked_In")] public int? CheckedIn { get; set; } [JsonProperty(PropertyName = "Label")] public string Label { get; set; } [JsonProperty(PropertyName = "Hidden")] public bool Hidden { get; set; } = false; } }
using MinistryPlatform.Translation.Models.Attributes; using Newtonsoft.Json; namespace MinistryPlatform.Translation.Models.DTO { [MpRestApiTable(Name = "Event_Rooms")] public class MpEventRoomDto { [JsonProperty(PropertyName = "Event_Room_ID", NullValueHandling = NullValueHandling.Ignore)] public int? EventRoomId { get; set; } [JsonProperty(PropertyName = "Room_ID")] public int RoomId { get; set; } [JsonProperty(PropertyName = "Event_ID")] public int EventId { get; set; } [JsonProperty(PropertyName = "Room_Name")] public string RoomName { get; set; } [JsonProperty(PropertyName = "Room_Number")] public string RoomNumber { get; set; } [JsonProperty(PropertyName = "Allow_Checkin")] public bool AllowSignIn { get; set; } [JsonProperty(PropertyName = "Volunteers")] public int Volunteers { get; set; } [JsonProperty(PropertyName = "Capacity")] public int Capacity { get; set; } [JsonProperty(PropertyName = "Signed_In")] public int SignedIn { get; set; } [JsonProperty(PropertyName = "Checked_In")] public int CheckedIn { get; set; } [JsonProperty(PropertyName = "Label")] public string Label { get; set; } [JsonProperty(PropertyName = "Hidden")] public bool Hidden { get; set; } = false; } }
bsd-2-clause
C#
47fd66c0c300c4fa1e6a9338c487485ec677a4c7
Add OnboardingService tests
zmira/abremir.AllMyBricks
abremir.AllMyBricks.Onboarding.Tests/Services/OnboardingServiceTests.cs
abremir.AllMyBricks.Onboarding.Tests/Services/OnboardingServiceTests.cs
using abremir.AllMyBricks.Device.Interfaces; using abremir.AllMyBricks.Onboarding.Interfaces; using abremir.AllMyBricks.Onboarding.Services; using FluentAssertions; using Microsoft.VisualStudio.TestTools.UnitTesting; using NSubstitute; namespace abremir.AllMyBricks.Onboarding.Tests.Services { [TestClass] public class OnboardingServiceTests { private ISecureStorageService _secureStorageService; private IApiKeyService _apiKeyService; private IRegistrationService _registrationService; [ClassInitialize] #pragma warning disable RCS1163 // Unused parameter. #pragma warning disable RECS0154 // Parameter is never used public static void ClassInitialize(TestContext testContext) #pragma warning restore RECS0154 // Parameter is never used #pragma warning restore RCS1163 // Unused parameter. { } [TestInitialize] public void Initialize() { _secureStorageService = Substitute.For<ISecureStorageService>(); _apiKeyService = Substitute.For<IApiKeyService>(); _registrationService = Substitute.For<IRegistrationService>(); } [TestMethod] public void GetBricksetApiKey_ApiKeyExistsStored_ReturnsApiKeyAndSaveBricksetApiKeyNotInvoked() { _secureStorageService .GetBricksetApiKey() .Returns("API KEY"); var onboardingService = CreateTarget(); var result = onboardingService.GetBricksetApiKey(); result.Should().NotBeNullOrWhiteSpace(); _secureStorageService.DidNotReceive().SaveBricksetApiKey(Arg.Any<string>()); } [TestMethod] public void GetBricksetApiKey_ApiKeyNotStoredButIdentificationStored_ReturnsApiKeyAndSaveDeviceIdentificationNotInvoked() { _secureStorageService .GetBricksetApiKey() .Returns(string.Empty); _secureStorageService .DeviceIdentificationCreated .Returns(true); _secureStorageService .GetDeviceIdentification() .Returns(new Core.Models.Identification()); _apiKeyService .GetBricksetApiKey(Arg.Any<Core.Models.Identification>()) .Returns("API KEY"); var onboardingService = CreateTarget(); var result = onboardingService.GetBricksetApiKey(); result.Should().NotBeNullOrWhiteSpace(); _apiKeyService.Received().GetBricksetApiKey(Arg.Any<Core.Models.Identification>()); _secureStorageService.DidNotReceive().SaveDeviceIdentification(Arg.Any<Core.Models.Identification>()); } [TestMethod] public void GetBricksetApiKey_ApiKeyAndIdentificationNotStored_ReturnsApiKeyAndSaveDeviceIdentificationInvoked() { _secureStorageService .GetBricksetApiKey() .Returns(string.Empty); _secureStorageService .DeviceIdentificationCreated .Returns(false); _registrationService .Register(Arg.Any<Core.Models.Identification>()) .Returns(new Core.Models.Identification()); _apiKeyService .GetBricksetApiKey(Arg.Any<Core.Models.Identification>()) .Returns("API KEY"); var onboardingService = CreateTarget(); var result = onboardingService.GetBricksetApiKey(); result.Should().NotBeNullOrWhiteSpace(); _apiKeyService.Received().GetBricksetApiKey(Arg.Any<Core.Models.Identification>()); _secureStorageService.Received().SaveDeviceIdentification(Arg.Any<Core.Models.Identification>()); } private OnboardingService CreateTarget() { var deviceInformationService = Substitute.For<IDeviceInformationService>(); return new OnboardingService(_secureStorageService, _registrationService, _apiKeyService, deviceInformationService); } } }
using FluentAssertions; using Microsoft.VisualStudio.TestTools.UnitTesting; using NSubstitute; namespace abremir.AllMyBricks.Onboarding.Tests.Services { [TestClass] public class OnboardingServiceTests { [ClassInitialize] #pragma warning disable RCS1163 // Unused parameter. #pragma warning disable RECS0154 // Parameter is never used public static void ClassInitialize(TestContext testContext) #pragma warning restore RECS0154 // Parameter is never used #pragma warning restore RCS1163 // Unused parameter. { } } }
mit
C#
8bb135b7726e0db8931238e4cf02ec5a7440e4d1
Add two helper functions to YGOClient
IceYGO/ygosharp,Zayelion/ygosharp
YGOSharp.Network/YGOClient.cs
YGOSharp.Network/YGOClient.cs
using System.IO; using YGOSharp.Network.Enums; namespace YGOSharp.Network { public class YGOClient : BinaryClient { public YGOClient() : base(new NetworkClient()) { } public YGOClient(NetworkClient client) : base(client) { } public void Send(BinaryWriter writer) { Send(((MemoryStream)writer.BaseStream).ToArray()); } public void Send(CtosMessage message) { using (BinaryWriter writer = new BinaryWriter(new MemoryStream())) { writer.Write((byte)message); Send(writer); } } public void Send(CtosMessage message, int value) { using (BinaryWriter writer = new BinaryWriter(new MemoryStream())) { writer.Write((byte)message); writer.Write(value); Send(writer); } } } }
using System.IO; namespace YGOSharp.Network { public class YGOClient : BinaryClient { public YGOClient() : base(new NetworkClient()) { } public YGOClient(NetworkClient client) : base(client) { } public void Send(BinaryWriter writer) { Send(((MemoryStream)writer.BaseStream).ToArray()); } } }
mit
C#
4016fe1e19695637ea0a954b63ec633fcff2d5b4
Adjust profile ruleset selector to new design
peppy/osu,ppy/osu,ppy/osu,peppy/osu,NeoAdonis/osu,NeoAdonis/osu,NeoAdonis/osu,ppy/osu,peppy/osu
osu.Game/Overlays/Profile/Header/Components/ProfileRulesetTabItem.cs
osu.Game/Overlays/Profile/Header/Components/ProfileRulesetTabItem.cs
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. using osu.Framework.Graphics; using osu.Framework.Graphics.Sprites; using osu.Game.Rulesets; using osuTK; using osuTK.Graphics; namespace osu.Game.Overlays.Profile.Header.Components { public class ProfileRulesetTabItem : OverlayRulesetTabItem { private bool isDefault; public bool IsDefault { get => isDefault; set { if (isDefault == value) return; isDefault = value; icon.Alpha = isDefault ? 1 : 0; } } protected override Color4 AccentColour { get => base.AccentColour; set { base.AccentColour = value; icon.FadeColour(value, 120, Easing.OutQuint); } } private readonly SpriteIcon icon; public ProfileRulesetTabItem(RulesetInfo value) : base(value) { Add(icon = new SpriteIcon { Origin = Anchor.Centre, Anchor = Anchor.Centre, Alpha = 0, Icon = FontAwesome.Solid.Star, Size = new Vector2(12), }); } } }
// 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.Sprites; using osu.Game.Rulesets; using osuTK; using osuTK.Graphics; namespace osu.Game.Overlays.Profile.Header.Components { public class ProfileRulesetTabItem : OverlayRulesetTabItem { private bool isDefault; public bool IsDefault { get => isDefault; set { if (isDefault == value) return; isDefault = value; icon.FadeTo(isDefault ? 1 : 0, 200, Easing.OutQuint); } } protected override Color4 AccentColour { get => base.AccentColour; set { base.AccentColour = value; icon.FadeColour(value, 120, Easing.OutQuint); } } private readonly SpriteIcon icon; public ProfileRulesetTabItem(RulesetInfo value) : base(value) { Add(icon = new SpriteIcon { Origin = Anchor.Centre, Anchor = Anchor.Centre, Alpha = 0, AlwaysPresent = true, Icon = FontAwesome.Solid.Star, Size = new Vector2(12), }); } } }
mit
C#
eee2191491f549dc29227892104fdbc34e4e50a8
Update OrderSaga.cs
eclaus/docs.particular.net,WojcikMike/docs.particular.net,pedroreys/docs.particular.net,pashute/docs.particular.net,yuxuac/docs.particular.net
samples/saga/ravendb-custom-sagafinder/Version_5/Sample/OrderSaga.cs
samples/saga/ravendb-custom-sagafinder/Version_5/Sample/OrderSaga.cs
using NServiceBus; using NServiceBus.Logging; using NServiceBus.Saga; using System; #region TheSagaRavenDB public class OrderSaga : Saga<OrderSagaData>, IAmStartedByMessages<StartOrder>, IHandleMessages<PaymentTransactionCompleted>, IHandleMessages<CompleteOrder> { static ILog logger = LogManager.GetLogger(typeof(OrderSaga)); protected override void ConfigureHowToFindSaga(SagaPropertyMapper<OrderSagaData> mapper) { //NOP } public void Handle(StartOrder message) { Data.OrderId = message.OrderId; Data.PaymentTransactionId = Guid.NewGuid().ToString(); logger.InfoFormat("Saga with OrderId {0} received StartOrder with OrderId {1}", Data.OrderId, message.OrderId); Bus.SendLocal(new IssuePaymentRequest { PaymentTransactionId = Data.PaymentTransactionId }); } public void Handle(PaymentTransactionCompleted message) { logger.InfoFormat("Transaction with Id {0} completed for order id {1}", Data.PaymentTransactionId, Data.OrderId); Bus.SendLocal(new CompleteOrder { OrderId = Data.OrderId }); } public void Handle(CompleteOrder message) { logger.InfoFormat("Saga with OrderId {0} received CompleteOrder with OrderId {1}", Data.OrderId, message.OrderId); MarkAsComplete(); } } #endregion
using NServiceBus; using NServiceBus.Logging; using NServiceBus.Saga; using System; #region TheSagaRavenDB public class OrderSaga : Saga<OrderSagaData>, IAmStartedByMessages<StartOrder>, IHandleMessages<PaymentTransactionCompleted>, IHandleMessages<CompleteOrder> { static ILog logger = LogManager.GetLogger(typeof(OrderSaga)); protected override void ConfigureHowToFindSaga(SagaPropertyMapper<OrderSagaData> mapper) { //NOP } public void Handle(StartOrder message) { Data.OrderId = message.OrderId; Data.PaymentTransactionId = Guid.NewGuid().ToString(); logger.InfoFormat("Saga with OrderId {0} received StartOrder with OrderId {1}", Data.OrderId, message.OrderId); Bus.SendLocal(new IssuePaymentRequest { PaymentTransactionId = Data.PaymentTransactionId }); } public void Handle(PaymentTransactionCompleted message) { logger.InfoFormat("Transaction with Id {0} completed for order id {1}", Data.PaymentTransactionId, Data.OrderId); Bus.SendLocal(new CompleteOrder { OrderId = Data.OrderId }); } public void Handle(CompleteOrder message) { logger.InfoFormat("Saga with OrderId {0} received CompleteOrder with OrderId {1}", Data.OrderId, message.OrderId); MarkAsComplete(); } } #endregion
apache-2.0
C#
364fee11ddf8b55ec68a36527a80120ed275e584
Return exit values through wrapper.
icedream/citizenmp-server-updater
src/wrapper/Program.cs
src/wrapper/Program.cs
using System; using System.IO; using System.Reflection; // ReSharper disable once CheckNamespace internal static class Program { private static int Main(string[] args) { // Mono's XBuild uses assembly redirects to make sure it uses .NET 4.5 target binaries. // We emulate it using our own assembly redirector. AppDomain.CurrentDomain.AssemblyLoad += (sender, e) => { var assemblyName = e.LoadedAssembly.GetName(); Console.WriteLine("Assembly load: {0}", assemblyName); }; var mainAsm = Assembly.Load("citizenmp_server_updater"); mainAsm.GetType("Costura.AssemblyLoader") .GetMethod("Attach") .Invoke(null, null); return (int) mainAsm.GetType("CitizenMP.Server.Installer.Program") .GetMethod("Main", BindingFlags.NonPublic | BindingFlags.Static) .Invoke(null, new object[] {args}); } }
using System.Linq; using System.Reflection; // ReSharper disable once CheckNamespace internal class Program { private static void Main(string[] args) { var mainAsm = Assembly.Load("citizenmp_server_updater"); mainAsm.GetType("Costura.AssemblyLoader") .GetMethod("Attach") .Invoke(null, null); mainAsm.GetType("CitizenMP.Server.Installer.Program") .GetMethod("Main", BindingFlags.NonPublic | BindingFlags.Static) .Invoke(null, new object[] {args}); } }
mit
C#
201898d95d92df7c0e8e9f0ccd7808fb262ea4c8
Add action that can handle server_x=1
Endlessages/EndlessAges.LauncherService
src/EndlessAges.LauncherService/Controllers/ContentManagerController.cs
src/EndlessAges.LauncherService/Controllers/ContentManagerController.cs
using System; using System.Collections.Generic; using System.Linq; using System.Net; using System.Threading.Tasks; using Microsoft.AspNetCore.Mvc; namespace EndlessAges.LauncherService.Controllers { /// <summary> /// Emulated controller ContentManager.aspx from the Endless Ages backend. /// </summary> [Route("ContentManager.aspx")] public class ContentManagerController : Controller { //ContentManager.aspx?installer_patcher=ENDLESS [HttpGet] public IActionResult GetPatchingInfo([FromQuery]string installer_patcher) { //If no valid parameter was provided in the query then return an error code //This should only happen if someone is spoofing //422 (Unprocessable Entity) if (string.IsNullOrWhiteSpace(installer_patcher)) return StatusCode(422); //TODO: What exactly should the backend return? EACentral returns a broken url return Content($"{@"http://game1.endlessagesonline./ENDLESSINSTALL.cab"}\n{@"ENDLESSINSTALL.cab"}"); } //ContentManager.aspx?gameapp=1 [HttpGet] public IActionResult GetGameApplicationUrl([FromQuery]int gameapp) { //If no valid parameter was provided in the query then return an error code //This should only happen if someone is spoofing //422 (Unprocessable Entity) if (gameapp < 0) return StatusCode(422); //TODO: Implement server and IP mysql tables //TODO: It points to an endpoint http://game1.endlessagesonline.com/AXEngineApp.cab but what is it for? return Content(@"http://game1.endlessagesonline.com/AXEngineApp.cab"); } //server_x=1 [HttpGet] public IActionResult GetServerInformation([FromQuery]int server_x) { //If no valid parameter was provided in the query then return an error code //This should only happen if someone is spoofing //422 (Unprocessable Entity) if (server_x < 0) return StatusCode(422); //TODO: Implement server and IP mysql tables //TODO: I can only guess what is going on here //It appears it sends Aixen IIA, the server IP for some reason and ENDLESS //This could be the gameserver IP and the gameserver APP name? A Hello might be required //with the app name? I can only guess at this time. return Content("Aixen IIA 96.82.227.146 ENDLESS"); } } }
using System; using System.Collections.Generic; using System.Linq; using System.Net; using System.Threading.Tasks; using Microsoft.AspNetCore.Mvc; namespace EndlessAges.LauncherService.Controllers { /// <summary> /// Emulated controller ContentManager.aspx from the Endless Ages backend. /// </summary> [Route("ContentManager.aspx")] public class ContentManagerController : Controller { //ContentManager.aspx?installer_patcher=ENDLESS [HttpGet] public IActionResult GetPatchingInfo([FromQuery]string installer_patcher) { //If no valid parameter was provided in the query then return an error code //This should only happen if someone is spoofing //422 (Unprocessable Entity) if (string.IsNullOrWhiteSpace(installer_patcher)) return StatusCode(422); //TODO: What exactly should the backend return? EACentral returns a broken url return Content($"{@"http://game1.endlessagesonline./ENDLESSINSTALL.cab"}\n{@"ENDLESSINSTALL.cab"}"); } //ContentManager.aspx?gameapp=1 [HttpGet] public IActionResult GetGameApplicationUrl([FromQuery]int gameapp) { //If no valid parameter was provided in the query then return an error code //This should only happen if someone is spoofing //422 (Unprocessable Entity) if (gameapp < 0) return StatusCode(422); //TODO: It points to an endpoint http://game1.endlessagesonline.com/AXEngineApp.cab but what is it for? return Content(@"http://game1.endlessagesonline.com/AXEngineApp.cab"); } } }
mit
C#
7775a79bffc738b5191a05e73173d100f47c2c0d
Add new file userAuth.cpl/Droid/InitBroadcast.cs
ArcanaMagus/userAuth.cpl,ArcanaMagus/userAuth.cpl,ArcanaMagus/userAuth.cpl,ArcanaMagus/userAuth.cpl
userAuth.cpl/Droid/InitBroadcast.cs
userAuth.cpl/Droid/InitBroadcast.cs
using System; using System.Collections.Generic; using System.Linq; using System.Text; using Android.App; using Android.Content; using Android.OS; using Android.Runtime; using Android.Views; using Android.Widget; namespace userAuth.cpl.Droid { [BroadcastReceiver] public class InitBroadcast : BroadcastReceiver { public override void OnReceive (Context context, Intent intent) { Toast.MakeText (context, "Received intent!", ToastLength.Short).Show (); } } } [Import InitBroadcast] from InitBroadcast private dynamic extern InfinReciever { public override void OnBroadcast(Context context, Intent intent) { } }
 using System; using System.Collections.Generic; using System.Linq; using System.Text; using Android.App; using Android.Content; using Android.OS; using Android.Runtime; using Android.Views; using Android.Widget; namespace userAuth.cpl.Droid { [BroadcastReceiver] public class InitBroadcast : BroadcastReceiver { public override void OnReceive (Context context, Intent intent) { Toast.MakeText (context, "Received intent!", ToastLength.Short).Show (); } } } [Import InitBroadcast] from InitBroadcast private dynamic extern InfinReciever { public override void OnBroadcast(Context context, Intent intent) { } }
mit
C#
478159200f4098a756a10388d59d16e08551c44c
fix execFlags attribute in config
pchalamet/cassandra-sharp,yonglehou/cassandra-sharp,cj525/cassandra-sharp,zjpxl217/cassandra-sharp,pchalamet/cassandra-sharp,yonglehou/cassandra-sharp,cj525/cassandra-sharp
CassandraSharp.Interfaces/Config/TransportConfig.cs
CassandraSharp.Interfaces/Config/TransportConfig.cs
// cassandra-sharp - high performance .NET driver for Apache Cassandra // Copyright (c) 2011-2013 Pierre Chalamet // // 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 CassandraSharp.Config { using System.Xml.Serialization; public class TransportConfig { [XmlAttribute("keepAlive")] public bool KeepAlive; [XmlAttribute("keepAliveTime")] public int KeepAliveTime; public TransportConfig() { Type = "Default"; Port = 9042; Recoverable = true; CqlVersion = "3.0.0"; DefaultConsistencyLevel = ConsistencyLevel.QUORUM; DefaultExecutionFlags = ExecutionFlags.None; KeepAlive = true; } [XmlAttribute("port")] public int Port { get; set; } [XmlAttribute("type")] public string Type { get; set; } [XmlAttribute("rcvTimeout")] public int ReceiveTimeout { get; set; } [XmlAttribute("sndTimeout")] public int SendTimeout { get; set; } [XmlAttribute("recoverable")] public bool Recoverable { get; set; } [XmlAttribute("user")] public string User { get; set; } [XmlAttribute("password")] public string Password { get; set; } [XmlAttribute("cqlver")] public string CqlVersion { get; set; } [XmlAttribute("cl")] public ConsistencyLevel DefaultConsistencyLevel { get; set; } [XmlAttribute("execFlags")] public ExecutionFlags DefaultExecutionFlags { get; set; } } }
// cassandra-sharp - high performance .NET driver for Apache Cassandra // Copyright (c) 2011-2013 Pierre Chalamet // // 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 CassandraSharp.Config { using System.Xml.Serialization; public class TransportConfig { [XmlAttribute("keepAlive")] public bool KeepAlive; [XmlAttribute("keepAliveTime")] public int KeepAliveTime; public TransportConfig() { Type = "Default"; Port = 9042; Recoverable = true; CqlVersion = "3.0.0"; DefaultConsistencyLevel = ConsistencyLevel.QUORUM; DefaultExecutionFlags = ExecutionFlags.None; KeepAlive = true; } [XmlAttribute("port")] public int Port { get; set; } [XmlAttribute("type")] public string Type { get; set; } [XmlAttribute("rcvTimeout")] public int ReceiveTimeout { get; set; } [XmlAttribute("sndTimeout")] public int SendTimeout { get; set; } [XmlAttribute("recoverable")] public bool Recoverable { get; set; } [XmlAttribute("user")] public string User { get; set; } [XmlAttribute("password")] public string Password { get; set; } [XmlAttribute("cqlver")] public string CqlVersion { get; set; } [XmlAttribute("cl")] public ConsistencyLevel DefaultConsistencyLevel { get; set; } [XmlAttribute] public ExecutionFlags DefaultExecutionFlags { get; set; } } }
apache-2.0
C#
3a190331e3856c8b6a4402974c21934f53540ba8
Update test
sakapon/KLibrary-Labs
CoreLab/UnitTest/Mathematics/FrequencyFilterTest.cs
CoreLab/UnitTest/Mathematics/FrequencyFilterTest.cs
using KLibrary.Labs.Mathematics; using KLibrary.Labs.Reactive; using Microsoft.VisualStudio.TestTools.UnitTesting; using System; using System.Reactive.Linq; using System.Threading; namespace UnitTest.Mathematics { [TestClass] public class FrequencyFilterTest { [TestMethod] public void ctor_1() { var filter = new FrequencyFilter(25); var meter = new FrequencyMeter(); Observable2.Interval(TimeSpan.FromMilliseconds(20)) .Where(_ => filter.CheckLap()) .Do(_ => meter.RecordLap()) .Subscribe(Console.WriteLine); Thread.Sleep(3000); Assert.IsTrue(meter.Frequency > 24); Assert.IsTrue(meter.Frequency <= 25); } [TestMethod] public void ctor_2() { var filter = new FrequencyFilter(25); Observable2.Interval(TimeSpan.FromMilliseconds(20)) .Do(_ => filter.CheckLap()) .Select(_ => filter.ArrangedFrequency) .Subscribe(Console.WriteLine); Thread.Sleep(3000); } } }
using KLibrary.Labs.Mathematics; using KLibrary.Labs.Reactive; using Microsoft.VisualStudio.TestTools.UnitTesting; using System; using System.Reactive.Linq; using System.Threading; namespace UnitTest.Mathematics { [TestClass] public class FrequencyFilterTest { [TestMethod] public void ctor_1() { var filter = new FrequencyFilter(25); Observable2.Interval(TimeSpan.FromMilliseconds(20)) .Where(_ => filter.CheckLap()) .Subscribe(Console.WriteLine); Thread.Sleep(3000); } [TestMethod] public void ctor_2() { var filter = new FrequencyFilter(25); Observable2.Interval(TimeSpan.FromMilliseconds(20)) .Do(_ => filter.CheckLap()) .Select(_ => filter.ArrangedFrequency) .Subscribe(Console.WriteLine); Thread.Sleep(3000); } } }
mit
C#
faa9581c1b1fea7f348f30d4c2dc87c0bd65aa88
Handle indenting better.
DartVS/DartVS,DartVS/DartVS,modulexcite/DartVS,DartVS/DartVS,modulexcite/DartVS,modulexcite/DartVS
DanTup.DartVS.Vsix/Providers/SmartIndentProvider.cs
DanTup.DartVS.Vsix/Providers/SmartIndentProvider.cs
using System.ComponentModel.Composition; using System.Linq; using Microsoft.VisualStudio.Text; using Microsoft.VisualStudio.Text.Editor; using Microsoft.VisualStudio.Utilities; namespace DanTup.DartVS.Providers { [Export(typeof(ISmartIndentProvider))] [ContentType(DartContentTypeDefinition.DartContentType)] class SmartIndentProvider : ISmartIndentProvider { public ISmartIndent CreateSmartIndent(ITextView textView) { var tabSize = textView.Options.Parent.IsOptionDefined("Tabs/TabSize", true) ? textView.Options.Parent.GetOptionValue<int>("Tabs/TabSize") : 2; return textView.Properties.GetOrCreateSingletonProperty(() => new SmartIndent(tabSize)); } } class SmartIndent : ISmartIndent { int tabSize; public SmartIndent(int tabSize) { this.tabSize = tabSize; } public int? GetDesiredIndentation(ITextSnapshotLine line) { // If we're on the first line, we can't really do anything clever. if (line.LineNumber == 0) return 0; var snapshot = line.Snapshot; // Walk up previous lines trying to find the first non-blank one. var previousNonBlankLine = snapshot.GetLineFromLineNumber(line.LineNumber - 1); while (previousNonBlankLine.LineNumber >= 1 && previousNonBlankLine.GetText().Trim().Length == 0) previousNonBlankLine = snapshot.GetLineFromLineNumber(previousNonBlankLine.LineNumber - 1); // If we didn't find an actual non-blank line, we can't really do anything clever. if (previousNonBlankLine.GetText().Trim() == "") return 0; var previousLineText = previousNonBlankLine.GetText(); var previousLineIndent = previousLineText.Replace("\t", new string(' ', tabSize)).TakeWhile(char.IsWhiteSpace).Count(); // If we started a block on the previous line; then add indent. if (previousLineText.TrimEnd().EndsWith("{")) return previousLineIndent + tabSize; else return previousLineIndent; } public void Dispose() { } } }
using System.Linq; using Microsoft.VisualStudio.Text; using Microsoft.VisualStudio.Text.Editor; using Microsoft.VisualStudio.Utilities; namespace DanTup.DartVS.Providers { // TODO: Currently this breaks when VS converts 4 spaces to 1 tab. To fix, we really need to // know if VS is going to covert x spaces to tabs (and then count a tab as that many characters) // However; we really also need to be able to register Dart as a language and set it to default to // 2 spaces (no tabs); so we can fix this all up toegther if I ever figure out how to do it. // TODO: Remove this export when it's ready to use. //[Export(typeof(ISmartIndentProvider))] [ContentType(DartContentTypeDefinition.DartContentType)] class SmartIndentProvider : ISmartIndentProvider { public ISmartIndent CreateSmartIndent(ITextView textView) { return textView.Properties.GetOrCreateSingletonProperty(() => new SmartIndent()); } } class SmartIndent : ISmartIndent { public int? GetDesiredIndentation(ITextSnapshotLine line) { // If we're on the first line, we can't really do anything clever. if (line.LineNumber == 0) return 0; var snapshot = line.Snapshot; // Walk up previous lines trying to find the first non-blank one. var previousNonBlankLine = snapshot.GetLineFromLineNumber(line.LineNumber - 1); while (previousNonBlankLine.LineNumber >= 1 && previousNonBlankLine.GetText().Trim().Length == 0) previousNonBlankLine = snapshot.GetLineFromLineNumber(previousNonBlankLine.LineNumber - 1); // If we didn't find an actual non-blank line, we can't really do anything clever. if (previousNonBlankLine.GetText().Trim() == "") return 0; var previousLineText = previousNonBlankLine.GetText(); var thisLineText = line.GetText(); var previousLineIndent = previousLineText.TakeWhile(char.IsWhiteSpace).Count(); if (previousLineText.TrimEnd().EndsWith("{")) return previousLineIndent + 2; else if (thisLineText.TrimStart().StartsWith("}") && previousLineIndent >= 2) return previousLineIndent - 2; else return previousLineIndent; } public void Dispose() { } } }
mit
C#
acbcddc9077796c4534b0c4e274bd63f5dc7926a
Correct cake error
kingstonrichard/kingstonrichard.github.io,kingstonrichard/kingstonrichard.github.io
build.cake
build.cake
#tool "nuget:?package=Wyam&version=2.2.7" #addin "nuget:?package=Cake.Wyam&version=2.2.7" var target = Argument("target", "Build"); Task("Build") .Does(() => { Wyam(); }); Task("Preview") .Does(() => { Wyam(new WyamSettings { Preview = true, Watch = true }); }); Task("Deploy") .IsDependentOn("Build") .Does(() => { StartProcess("git", "push origin master"); StartProcess("git", "remote add public https://github.com/kingstonrichard/kingstonrichard.github.io"); StartProcess("git", "subtree split --prefix output -b public"); StartProcess("git", "checkout public"); StartProcess("git", "push -f public public:master"); StartProcess("git", "checkout master"); StartProcess("git", "branch -D public"); StartProcess("git", "remote remove public"); }); RunTarget(target);
#tool "nuget:?package=Wyam&version=2.2.7" #addin "nuget:?package=Cake.Wyam&version=2.2.7" var target = Argument("target", "Build"); Task("Build") .Does(() => { Wyam(); }); Task("Preview") .Does(() => { Wyam(new WyamSettings { Preview = true, Watch = true }); }); Task("Deploy") .IsDependentOn("Build") .Does(() => { StartProcess("git", "push origin master"); StartProcess("git", "remote add public https://github.com/kingstonrichard/kingstonrichard.github.io"); StartProcess("git", "subtree split --prefix output -b output"); StartProcess("git", "checkout public"); StartProcess("git", "push -f public public:master"); StartProcess("git", "checkout master"); StartProcess("git", "branch -D public"); StartProcess("git", "remote remove public"); }); RunTarget(target);
mit
C#
634183360b3f613bf5c827f3db9632e68f214511
Remove default version suffix
ErwinSteffens/DotNetAirbrake,ErwinSteffens/DotNetAirbrake
build.cake
build.cake
var versionSuffix = Argument("version-suffix", ""); var target = Argument("target", "Default"); var configuration = Argument("configuration", "Release"); Task("Clean") .Does(() => { CleanDirectories("./src/**/bin"); CleanDirectories("./src/**/obj"); }); Task("Restore") .IsDependentOn("Clean") .Does(() => { DotNetCoreRestore(); }); Task("Build") .IsDependentOn("Restore") .Does(() => { DotNetCoreBuild("./src/DotNetAirBrake", new DotNetCoreBuildSettings { Configuration = configuration, VersionSuffix = versionSuffix }); }); Task("Test") .IsDependentOn("Build") .Does(() => { // TODO }); Task("Pack") .IsDependentOn("Restore") .Does(() => { var settings = new DotNetCorePackSettings { Configuration = "Release", OutputDirectory = "./output/", VersionSuffix = versionSuffix }; DotNetCorePack("./src/DotNetAirBrake", settings); }); Task("Default") .IsDependentOn("Test"); RunTarget(target);
var versionSuffix = Argument("version-suffix", "test"); var target = Argument("target", "Default"); var configuration = Argument("configuration", "Release"); Task("Clean") .Does(() => { CleanDirectories("./src/**/bin"); CleanDirectories("./src/**/obj"); }); Task("Restore") .IsDependentOn("Clean") .Does(() => { DotNetCoreRestore(); }); Task("Build") .IsDependentOn("Restore") .Does(() => { DotNetCoreBuild("./src/DotNetAirBrake", new DotNetCoreBuildSettings { Configuration = configuration, VersionSuffix = versionSuffix }); }); Task("Test") .IsDependentOn("Build") .Does(() => { // TODO }); Task("Pack") .IsDependentOn("Restore") .Does(() => { var settings = new DotNetCorePackSettings { Configuration = "Release", OutputDirectory = "./output/", VersionSuffix = versionSuffix }; DotNetCorePack("./src/DotNetAirBrake", settings); }); Task("Default") .IsDependentOn("Test"); RunTarget(target);
mit
C#
a6e0f152d2c4a67b2eb63bcd21b63a292779a612
set up a randomizer to create a random array with 20 values, wrote logic to display values in the array at each pass of the sort
brlittle86/data-structures
RadixSortAlgorithm/RadixSortAlgorithm/Program.cs
RadixSortAlgorithm/RadixSortAlgorithm/Program.cs
using System; namespace RadixSortAlgorithm { class Program { static void Main(string[] args) { const int valueCount = 20; int[] randomArray = new int[valueCount]; Random rnd = new Random(); for (int i = 0; i < valueCount; i++) { randomArray[i] = rnd.Next(1, 1000); } Console.WriteLine($"Initial array: {String.Join(" ", randomArray)}"); RadixSort(randomArray); Console.Read(); } public static void RadixSort(int[] array) { int max = Int32.MinValue; for (int i = 0; i < array.Length; i++) { max = Math.Max(max, array[i]); } int p = 1; int pass = 1; while (max / p > 0) { array = CountSort(array, array.Length, p); Console.WriteLine($"After pass {pass} : {String.Join(" ", array)}"); pass++; p *= 10; } } public static int[] CountSort(int[] array, int max, int p) { int[] output = new int[max]; int[] count = new int[10]; for (int i = 0; i < max; i++) { count[(array[i] / p) % 10]++; } for (int i = 1; i < 10; i++) { count[i] += count[i - 1]; } for (int i = max - 1; i >= 0; i--) { output[count[(array[i] / p) % 10] - 1] = array[i]; count[(array[i] / p) % 10]--; } return output; } } }
using System; namespace RadixSortAlgorithm { class Program { static void Main(string[] args) { Console.WriteLine("Hello World!"); } public static void RadixSort(int[] array) { int max = Int32.MinValue; for (int i = 0; i < array.Length; i++) { max = Math.Max(max, array[i]); } int p = 1; int pass = 1; while (max / p > 0) { array = CountSort(array, array.Length, p); Console.WriteLine(String.Join(" ", array)); pass++; p *= 10; } } public static int[] CountSort(int[] array, int max, int p) { int[] output = new int[max]; int[] count = new int[10]; for (int i = 0; i < max; i++) { count[i] += count[i - 1]; } for (int i = max - 1; i >= 0; i--) { output[count[(array[i] / p) % 10] - 1] = array[i]; count[(array[i] / p) % 10]--; } return output; } } }
mit
C#
a06004c3702d0615feda82da0140aae3db2cbf01
handle case where no arguments are passed
Arke64/ArkeOS
ArkeOS.Tools.Assembler/Program.cs
ArkeOS.Tools.Assembler/Program.cs
using System; using System.IO; namespace ArkeOS.Tools.Assembler { public static class Program { public static void Main(string[] args) { if (args.Length < 1) { Console.WriteLine("Need at least one argument: the file to assemble"); return; } var input = args[0]; if (!File.Exists(input)) { Console.WriteLine("The specified file cannot be found."); return; } File.WriteAllBytes(Path.ChangeExtension(input, "bin"), new Assembler().Assemble(Path.GetDirectoryName(input), File.ReadAllLines(input))); } } }
using System; using System.IO; namespace ArkeOS.Tools.Assembler { public static class Program { public static void Main(string[] args) { var input = args[0]; if (!File.Exists(input)) { Console.WriteLine("The specified file cannot be found."); return; } File.WriteAllBytes(Path.ChangeExtension(input, "bin"), new Assembler().Assemble(Path.GetDirectoryName(input), File.ReadAllLines(input))); } } }
mit
C#
e0c0e52853c00188285d1be678d783f2b0622bb6
Define standard layout
12joan/hangman
hangman.cs
hangman.cs
using System; using System.IO; namespace Hangman { public class Hangman { public static void Main(string[] args) { // char key = Console.ReadKey(true).KeyChar; // var game = new Game("HANG THE MAN"); // bool wasCorrect = game.GuessLetter(key); // Console.WriteLine(wasCorrect.ToString()); // var output = game.ShownWord(); // Console.WriteLine(output); string titleText = File.ReadAllText("title.txt"); Cell[] title = { new Cell(titleText, Cell.CentreAlign) }; Cell[] word = { new Cell("_E__O _O___", Cell.CentreAlign) }; Cell[] stats = { new Cell("Incorrect letters:\n A B I U"), new Cell("Lives remaining:\n 11/15", Cell.RightAlign) }; Cell[] status = { new Cell("Press any letter to guess!", Cell.CentreAlign) }; Row[] rows = { new Row(title), new Row(word), new Row(stats), new Row(status) }; var table = new Table( Math.Min(81, Console.WindowWidth), 2, rows ); var output = table.Draw(); Console.WriteLine(output); } } }
using System; namespace Hangman { public class Hangman { public static void Main(string[] args) { // char key = Console.ReadKey(true).KeyChar; // var game = new Game("HANG THE MAN"); // bool wasCorrect = game.GuessLetter(key); // Console.WriteLine(wasCorrect.ToString()); // var output = game.ShownWord(); // Console.WriteLine(output); Cell[] cells = { new Cell("This\nis\na"), new Cell("Row", Cell.RightAlign) }; Row[] rows = { new Row(cells), new Row(cells) }; var table = new Table( Math.Min(80, Console.WindowWidth), 2, rows ); var output = table.Draw(); Console.WriteLine(output); } } }
unlicense
C#
6459327c88306ad06b98347c6994de1da7301998
format remove options code
gaochundong/Knifer
Gimela.Toolkit.CommandLines.Remove/RemoveOptions.cs
Gimela.Toolkit.CommandLines.Remove/RemoveOptions.cs
using System.Collections.Generic; using System.Collections.ObjectModel; using System.Diagnostics.CodeAnalysis; using System.Globalization; namespace Gimela.Toolkit.CommandLines.Remove { internal static class RemoveOptions { public static readonly ReadOnlyCollection<string> DirectoryOptions; public static readonly ReadOnlyCollection<string> RecursiveOptions; public static readonly ReadOnlyCollection<string> HelpOptions; public static readonly ReadOnlyCollection<string> VersionOptions; public static readonly IDictionary<RemoveOptionType, ICollection<string>> Options; [SuppressMessage("Microsoft.Performance", "CA1810:InitializeReferenceTypeStaticFieldsInline")] static RemoveOptions() { DirectoryOptions = new ReadOnlyCollection<string>(new string[] { "d", "D", "directory" }); RecursiveOptions = new ReadOnlyCollection<string>(new string[] { "r", "R", "recursive" }); HelpOptions = new ReadOnlyCollection<string>(new string[] { "h", "help" }); VersionOptions = new ReadOnlyCollection<string>(new string[] { "v", "version" }); Options = new Dictionary<RemoveOptionType, ICollection<string>>(); Options.Add(RemoveOptionType.Directory, DirectoryOptions); Options.Add(RemoveOptionType.Recursive, RecursiveOptions); Options.Add(RemoveOptionType.Help, HelpOptions); Options.Add(RemoveOptionType.Version, VersionOptions); } public static List<string> GetSingleOptions() { List<string> singleOptionList = new List<string>(); singleOptionList.AddRange(RemoveOptions.HelpOptions); singleOptionList.AddRange(RemoveOptions.VersionOptions); return singleOptionList; } #region Usage public const string Version = @"Remove v1.0"; public static readonly string Usage = string.Format(CultureInfo.CurrentCulture, @" NAME rm - remove files SYNOPSIS rm [OPTION]... FILE... DESCRIPTION Remove the FILE(s). OPTIONS -d, -D, --directory=DIRECTORY {0}{0}Specify a directory, a path name of a starting point {0}{0}in the directory hierarchy. -r, -R, --recursive {0}{0}Remove the contents of directories recursively. -h, --help {0}{0}Display this help and exit. -v, --version {0}{0}Output version information and exit. EXAMPLES rm myfile.txt Remove the file myfile.txt without prompting the user. AUTHOR Written by Chundong Gao. REPORTING BUGS Report bugs to <gaochundong@gmail.com>. COPYRIGHT Copyright (C) 2011-2012 Chundong Gao. All Rights Reserved. ", @" "); #endregion public static RemoveOptionType GetOptionType(string option) { RemoveOptionType optionType = RemoveOptionType.None; foreach (var pair in Options) { foreach (var item in pair.Value) { if (item == option) { optionType = pair.Key; break; } } } return optionType; } } }
using System.Collections.Generic; using System.Collections.ObjectModel; using System.Diagnostics.CodeAnalysis; using System.Globalization; namespace Gimela.Toolkit.CommandLines.Remove { internal static class RemoveOptions { public static readonly ReadOnlyCollection<string> DirectoryOptions; public static readonly ReadOnlyCollection<string> RecursiveOptions; public static readonly ReadOnlyCollection<string> HelpOptions; public static readonly ReadOnlyCollection<string> VersionOptions; public static readonly IDictionary<RemoveOptionType, ICollection<string>> Options; [SuppressMessage("Microsoft.Performance", "CA1810:InitializeReferenceTypeStaticFieldsInline")] static RemoveOptions() { DirectoryOptions = new ReadOnlyCollection<string>(new string[] { "d", "D", "directory" }); RecursiveOptions = new ReadOnlyCollection<string>(new string[] { "r", "R", "recursive" }); HelpOptions = new ReadOnlyCollection<string>(new string[] { "h", "help" }); VersionOptions = new ReadOnlyCollection<string>(new string[] { "v", "version" }); Options = new Dictionary<RemoveOptionType, ICollection<string>>(); Options.Add(RemoveOptionType.Directory, DirectoryOptions); Options.Add(RemoveOptionType.Recursive, RecursiveOptions); Options.Add(RemoveOptionType.Help, HelpOptions); Options.Add(RemoveOptionType.Version, VersionOptions); } public static List<string> GetSingleOptions() { List<string> singleOptionList = new List<string>(); singleOptionList.AddRange(RemoveOptions.HelpOptions); singleOptionList.AddRange(RemoveOptions.VersionOptions); return singleOptionList; } #region Usage public const string Version = @"Remove v1.0"; public static readonly string Usage = string.Format(CultureInfo.CurrentCulture, @" NAME rm - remove files SYNOPSIS rm [OPTION]... FILE... DESCRIPTION Remove the FILE(s). OPTIONS -d, -D, --directory=DIRECTORY {0}{0}Specify a directory, a path name of a starting point {0}{0}in the directory hierarchy. -r, -R, --recursive {0}{0}Remove the contents of directories recursively. -h, --help {0}{0}Display this help and exit. -v, --version {0}{0}Output version information and exit. EXAMPLES rm myfile.txt Remove the file myfile.txt without prompting the user. AUTHOR Written by Chundong Gao. REPORTING BUGS Report bugs to <gaochundong@gmail.com>. COPYRIGHT Copyright (C) 2011-2012 Chundong Gao. All Rights Reserved. ", @" "); #endregion public static RemoveOptionType GetOptionType(string option) { RemoveOptionType optionType = RemoveOptionType.None; foreach (var pair in Options) { foreach (var item in pair.Value) { if (item == option) { optionType = pair.Key; break; } } } return optionType; } } }
mit
C#
8deb5cd0d8c1738075cb93e4b7d3927e975dfeac
Update AssemblyInfo.cs
WSDOT-GIS/WSDOT-Traveler-Info-DotNet-Client
Client/Properties/AssemblyInfo.cs
Client/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("Client")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("WSDOT")] [assembly: AssemblyProduct("Client")] [assembly: AssemblyCopyright("Copyright © WSDOT 2014")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("b83a9609-b90e-42d4-b842-f6e59aaee76a")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]
using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("Client")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Microsoft")] [assembly: AssemblyProduct("Client")] [assembly: AssemblyCopyright("Copyright © Microsoft 2014")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("b83a9609-b90e-42d4-b842-f6e59aaee76a")] // 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")]
unlicense
C#
2b11e95a6c89182d04f19fc54a94c6705e5fffa2
Mark fields in DeviceInfo as public API
WolfspiritM/Colore,CoraleStudios/Colore
Corale.Colore/Razer/DeviceInfo.cs
Corale.Colore/Razer/DeviceInfo.cs
// --------------------------------------------------------------------------------------- // <copyright file="DeviceInfo.cs" company="Corale"> // Copyright © 2015 by Adam Hellberg and Brandon Scott. // // Permission is hereby granted, free of charge, to any person obtaining a copy of // this software and associated documentation files (the "Software"), to deal in // the Software without restriction, including without limitation the rights to // use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies // of the Software, and to permit persons to whom the Software is furnished to do // so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in all // copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // // "Razer" is a trademark of Razer USA Ltd. // </copyright> // --------------------------------------------------------------------------------------- namespace Corale.Colore.Razer { using System.Runtime.InteropServices; using Corale.Colore.Annotations; /// <summary> /// Information about a device. /// </summary> [StructLayout(LayoutKind.Sequential)] public struct DeviceInfo { /// <summary> /// The type of device this is. /// </summary> [PublicAPI] public readonly DeviceType Type; /// <summary> /// Whether this device is connected. /// </summary> [PublicAPI] public readonly bool Connected; } }
// --------------------------------------------------------------------------------------- // <copyright file="DeviceInfo.cs" company="Corale"> // Copyright © 2015 by Adam Hellberg and Brandon Scott. // // Permission is hereby granted, free of charge, to any person obtaining a copy of // this software and associated documentation files (the "Software"), to deal in // the Software without restriction, including without limitation the rights to // use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies // of the Software, and to permit persons to whom the Software is furnished to do // so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in all // copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // // "Razer" is a trademark of Razer USA Ltd. // </copyright> // --------------------------------------------------------------------------------------- namespace Corale.Colore.Razer { using System.Runtime.InteropServices; /// <summary> /// Information about a device. /// </summary> [StructLayout(LayoutKind.Sequential)] public struct DeviceInfo { /// <summary> /// The type of device this is. /// </summary> public readonly DeviceType Type; /// <summary> /// Whether this device is connected. /// </summary> public readonly bool Connected; } }
mit
C#
5bc9f84fc96b410852a484bcea56ae7778799216
Update AzureStorageBase.cs
tiksn/TIKSN-Framework
TIKSN.Core/Data/AzureStorage/AzureStorageBase.cs
TIKSN.Core/Data/AzureStorage/AzureStorageBase.cs
using Microsoft.Azure.Storage; using Microsoft.Extensions.Configuration; namespace TIKSN.Data.AzureStorage { public abstract class AzureStorageBase { private readonly IConfigurationRoot _configuration; private readonly string _connectionStringKey; protected AzureStorageBase(IConfigurationRoot configuration, string connectionStringKey) { this._configuration = configuration; this._connectionStringKey = connectionStringKey; } protected CloudStorageAccount GetCloudStorageAccount() => CloudStorageAccount.Parse(this._configuration.GetConnectionString(this._connectionStringKey)); } }
using Microsoft.Azure.Storage; using Microsoft.Extensions.Configuration; namespace TIKSN.Data.AzureStorage { public abstract class AzureStorageBase { private readonly IConfigurationRoot _configuration; private readonly string _connectionStringKey; protected AzureStorageBase(IConfigurationRoot configuration, string connectionStringKey) { _configuration = configuration; _connectionStringKey = connectionStringKey; } protected CloudStorageAccount GetCloudStorageAccount() { return CloudStorageAccount.Parse(_configuration.GetConnectionString(_connectionStringKey)); } } }
mit
C#
b2a47e621672e7a51957d34f93527f730c742403
Add uniqiue identifier when adding customer user program source
qianlifeng/Wox,qianlifeng/Wox,Wox-launcher/Wox,qianlifeng/Wox,Wox-launcher/Wox
Plugins/Wox.Plugin.Program/AddProgramSource.xaml.cs
Plugins/Wox.Plugin.Program/AddProgramSource.xaml.cs
using System.Windows; using System.Windows.Forms; using Wox.Plugin.Program.Programs; namespace Wox.Plugin.Program { /// <summary> /// Interaction logic for AddProgramSource.xaml /// </summary> public partial class AddProgramSource { private PluginInitContext _context; private Settings.ProgramSource _editing; private Settings _settings; public AddProgramSource(PluginInitContext context, Settings settings) { InitializeComponent(); _context = context; _settings = settings; Directory.Focus(); } public AddProgramSource(Settings.ProgramSource edit, Settings settings) { _editing = edit; _settings = settings; InitializeComponent(); Directory.Text = _editing.Location; } private void BrowseButton_Click(object sender, RoutedEventArgs e) { var dialog = new FolderBrowserDialog(); DialogResult result = dialog.ShowDialog(); if (result == System.Windows.Forms.DialogResult.OK) { Directory.Text = dialog.SelectedPath; } } private void ButtonAdd_OnClick(object sender, RoutedEventArgs e) { string s = Directory.Text; if (!System.IO.Directory.Exists(s)) { System.Windows.MessageBox.Show(_context.API.GetTranslation("wox_plugin_program_invalid_path")); return; } if (_editing == null) { var source = new Settings.ProgramSource { Location = Directory.Text, UniqueIdentifier = Directory.Text }; _settings.ProgramSources.Insert(0, source); } else { _editing.Location = Directory.Text; } DialogResult = true; Close(); } } }
using System.Windows; using System.Windows.Forms; using Wox.Plugin.Program.Programs; namespace Wox.Plugin.Program { /// <summary> /// Interaction logic for AddProgramSource.xaml /// </summary> public partial class AddProgramSource { private PluginInitContext _context; private Settings.ProgramSource _editing; private Settings _settings; public AddProgramSource(PluginInitContext context, Settings settings) { InitializeComponent(); _context = context; _settings = settings; Directory.Focus(); } public AddProgramSource(Settings.ProgramSource edit, Settings settings) { _editing = edit; _settings = settings; InitializeComponent(); Directory.Text = _editing.Location; } private void BrowseButton_Click(object sender, RoutedEventArgs e) { var dialog = new FolderBrowserDialog(); DialogResult result = dialog.ShowDialog(); if (result == System.Windows.Forms.DialogResult.OK) { Directory.Text = dialog.SelectedPath; } } private void ButtonAdd_OnClick(object sender, RoutedEventArgs e) { string s = Directory.Text; if (!System.IO.Directory.Exists(s)) { System.Windows.MessageBox.Show(_context.API.GetTranslation("wox_plugin_program_invalid_path")); return; } if (_editing == null) { var source = new Settings.ProgramSource { Location = Directory.Text, }; _settings.ProgramSources.Insert(0, source); } else { _editing.Location = Directory.Text; } DialogResult = true; Close(); } } }
mit
C#
a3b4c8caacbf21f72da18f9e0152e710ee13346f
fix since bug in RetrieveParams;
ceee/PocketSharp
PocketSharp/Models/Parameters/RetrieveParameters.cs
PocketSharp/Models/Parameters/RetrieveParameters.cs
using RestSharp; using System; using System.Collections.Generic; using System.Reflection; using System.Runtime.Serialization; namespace PocketSharp.Models { public class RetrieveParameters : ParameterBase { public StateEnum? State { get; set; } public bool? Favorite { get; set; } public string Tag { get; set; } public ContentTypeEnum? ContentType { get; set; } public SortEnum? Sort { get; set; } public DetailTypeEnum? DetailType { get; set; } public string Search { get; set; } public string Domain { get; set; } public DateTime? Since { get; set; } public int? Count { get; set; } public int? Offset { get; set; } public List<Parameter> Convert() { List<Parameter> parameters = new List<Parameter>(); if (State != null) parameters.Add(CreateParam("state", State.ToString())); if (Favorite != null) parameters.Add(CreateParam("favorite", (bool)Favorite ? "1" : "0")); if (Tag != null) parameters.Add(CreateParam("tag", Tag)); if (ContentType != null) parameters.Add(CreateParam("contentType", ContentType.ToString())); if (Sort != null) parameters.Add(CreateParam("sort", Sort.ToString())); if (DetailType != null) parameters.Add(CreateParam("detailType", DetailType.ToString())); if (Search != null) parameters.Add(CreateParam("search", Search)); if (Domain != null) parameters.Add(CreateParam("domain", Domain)); if (Since != null) parameters.Add(CreateParam("since", (int)((DateTime)Since - new DateTime(1970, 1, 1)).TotalSeconds)); if (Count != null) parameters.Add(CreateParam("count", Count)); if (Offset != null) parameters.Add(CreateParam("offset", Offset)); return parameters; } } public enum StateEnum { unread, archive, all } public enum SortEnum { newest, oldest, title, site } public enum ContentTypeEnum { article, video, image } public enum DetailTypeEnum { simple, complete } }
using RestSharp; using System; using System.Collections.Generic; using System.Reflection; using System.Runtime.Serialization; namespace PocketSharp.Models { public class RetrieveParameters : ParameterBase { public StateEnum? State { get; set; } public bool? Favorite { get; set; } public string Tag { get; set; } public ContentTypeEnum? ContentType { get; set; } public SortEnum? Sort { get; set; } public DetailTypeEnum? DetailType { get; set; } public string Search { get; set; } public string Domain { get; set; } public DateTime Since { get; set; } public int? Count { get; set; } public int? Offset { get; set; } public List<Parameter> Convert() { List<Parameter> parameters = new List<Parameter>(); if (State != null) parameters.Add(CreateParam("state", State.ToString())); if (Favorite != null) parameters.Add(CreateParam("favorite", (bool)Favorite ? "1" : "0")); if (Tag != null) parameters.Add(CreateParam("tag", Tag)); if (ContentType != null) parameters.Add(CreateParam("contentType", ContentType.ToString())); if (Sort != null) parameters.Add(CreateParam("sort", Sort.ToString())); if (DetailType != null) parameters.Add(CreateParam("detailType", DetailType.ToString())); if (Search != null) parameters.Add(CreateParam("search", Search)); if (Domain != null) parameters.Add(CreateParam("domain", Domain)); if (Since != null) parameters.Add(CreateParam("since", (int)(Since - new DateTime(1970, 1, 1)).TotalSeconds)); if (Count != null) parameters.Add(CreateParam("count", Count)); if (Offset != null) parameters.Add(CreateParam("offset", Offset)); return parameters; } } public enum StateEnum { unread, archive, all } public enum SortEnum { newest, oldest, title, site } public enum ContentTypeEnum { article, video, image } public enum DetailTypeEnum { simple, complete } }
mit
C#
75807be7a41e09c12b9c99e03fd5813e2aa4e3ab
add heap statistic for future implementation
lookuper/LiveProcessInspector
LiveProcessInspector/LiveProcessInspector/Screens/ClrRuntimeViewModel.cs
LiveProcessInspector/LiveProcessInspector/Screens/ClrRuntimeViewModel.cs
using Caliburn.Micro; using Microsoft.Diagnostics.Runtime; using System; using System.Collections.Generic; using System.ComponentModel.Composition; using System.Linq; using System.Text; using System.Threading.Tasks; namespace LiveProcessInspector.Screens { [Export(typeof(ClrRuntimeViewModel))] public class ClrRuntimeViewModel : PropertyChangedBase { private readonly ClrRuntime _runtime; private readonly ClrHeap _heap; public ClrRuntimeViewModel(ClrRuntime runtime) { _runtime = runtime; _heap = _runtime.GetHeap(); //foreach (var obj in _heap.EnumerateObjects()) //{ // clr //} //var t = (from obj in _heap.EnumerateObjects() // let type = _heap.GetObjectType(obj) // let size = type.GetSize(obj) // select new // { // Object = obj, // Size = size, // Name = type.Name // }).ToList(); //var i = 5; } public bool IsServerGC { get { return _runtime.ServerGC; } } public int PointerSize { get { return _runtime.PointerSize; } } public int HeadCount { get { return _runtime.HeapCount; } } public IEnumerable<ClrAppDomain> AppDomains { get { return _runtime.AppDomains; } } public IList<ClrThread> Threads { get { return _runtime.Threads; } } public ClrThreadPool ThreadPool { get { return _runtime.GetThreadPool(); } } public bool CanWalkHelp { get { return _heap.CanWalkHeap; } } private ClrThread _selectedThread = null; public ClrThread SelectedThread { get { return _selectedThread; } set { _selectedThread = value; NotifyOfPropertyChange(() => SelectedThread); } } public Object HeapObjects { get { if (!CanWalkHelp) return null; var heapObjects = (from obj in _heap.EnumerateObjects() let type = _heap.GetObjectType(obj) let size = type.GetSize(obj) select new { ObjectId = obj, Size = size, Name = type.Name }).ToList(); // add heap statistic //var stats = from o in _heap.EnumerateObjects() // let t = _heap.GetObjectType(o) // group o by t into g // let size = g.Sum(o => (uint)g.Key.GetSize(o)) // orderby size // select new // { // Name = g.Key.Name, // Size = size, // Count = g.Count() // }; return heapObjects; } } } }
using Caliburn.Micro; using Microsoft.Diagnostics.Runtime; using System; using System.Collections.Generic; using System.ComponentModel.Composition; using System.Linq; using System.Text; using System.Threading.Tasks; namespace LiveProcessInspector.Screens { [Export(typeof(ClrRuntimeViewModel))] public class ClrRuntimeViewModel : PropertyChangedBase { private readonly ClrRuntime _runtime; private readonly ClrHeap _heap; public ClrRuntimeViewModel(ClrRuntime runtime) { _runtime = runtime; _heap = _runtime.GetHeap(); //foreach (var obj in _heap.EnumerateObjects()) //{ // clr //} //var t = (from obj in _heap.EnumerateObjects() // let type = _heap.GetObjectType(obj) // let size = type.GetSize(obj) // select new // { // Object = obj, // Size = size, // Name = type.Name // }).ToList(); //var i = 5; } public bool IsServerGC { get { return _runtime.ServerGC; } } public int PointerSize { get { return _runtime.PointerSize; } } public int HeadCount { get { return _runtime.HeapCount; } } public IEnumerable<ClrAppDomain> AppDomains { get { return _runtime.AppDomains; } } public IList<ClrThread> Threads { get { return _runtime.Threads; } } public ClrThreadPool ThreadPool { get { return _runtime.GetThreadPool(); } } public bool CanWalkHelp { get { return _heap.CanWalkHeap; } } private ClrThread _selectedThread = null; public ClrThread SelectedThread { get { return _selectedThread; } set { _selectedThread = value; NotifyOfPropertyChange(() => SelectedThread); } } public Object HeapObjects { get { if (!CanWalkHelp) return null; var heapObjects = (from obj in _heap.EnumerateObjects() let type = _heap.GetObjectType(obj) let size = type.GetSize(obj) select new { ObjectId = obj, Size = size, Name = type.Name }).ToList(); return heapObjects; } } } }
mit
C#
85342f8276b32aa5358dc82bbcf1c2512817b79c
Remove Obselete Validation in the 'CloneViewModel'
tommcclean/PortalCMS,tommcclean/PortalCMS,tommcclean/PortalCMS
Portal.CMS.Web/Areas/PageBuilder/ViewModels/Section/CloneViewModel.cs
Portal.CMS.Web/Areas/PageBuilder/ViewModels/Section/CloneViewModel.cs
using Portal.CMS.Entities.Entities; using System.Collections.Generic; using System.ComponentModel; using System.ComponentModel.DataAnnotations; using System.Linq; using System.Web.Mvc; namespace Portal.CMS.Web.Areas.PageBuilder.ViewModels.Section { public class CloneViewModel { [DisplayName("Page")] public int PageId { get; set; } public int PageAssociationId { get; set; } internal List<Page> PageList { get; set; } public IEnumerable<SelectListItem> PageListOptions => PageList.Select(x => new SelectListItem { Value = x.PageId.ToString(), Text = x.PageName }); } }
using Portal.CMS.Entities.Entities; using System.Collections.Generic; using System.ComponentModel; using System.ComponentModel.DataAnnotations; using System.Linq; using System.Web.Mvc; namespace Portal.CMS.Web.Areas.PageBuilder.ViewModels.Section { public class CloneViewModel { [Required] [DisplayName("Page")] public int PageId { get; set; } public int PageAssociationId { get; set; } internal List<Page> PageList { get; set; } public IEnumerable<SelectListItem> PageListOptions => PageList.Select(x => new SelectListItem { Value = x.PageId.ToString(), Text = x.PageName }); } }
mit
C#
d970e0515104c4c8beba10764766b19d09a1993e
Add dispose method.
RockFramework/Rock.Messaging,peteraritchie/Rock.Messaging,bfriesen/Rock.Messaging
Rock.Messaging.IntegrationTests/MQ/ExampleMessagingScenarioFactory.cs
Rock.Messaging.IntegrationTests/MQ/ExampleMessagingScenarioFactory.cs
using System; namespace Rock.Messaging { public class ExampleMessagingScenarioFactory : IMessagingScenarioFactory { private readonly int _intData; public ExampleMessagingScenarioFactory() : this(0) { } public ExampleMessagingScenarioFactory(int intData = 0) { _intData = intData; } public int IntData { get { return _intData; } } public ISender CreateQueueProducer(string name) { throw new NotImplementedException(); } public IReceiver CreateQueueConsumer(string name) { throw new NotImplementedException(); } public ISender CreateTopicPublisher(string name) { throw new NotImplementedException(); } public IReceiver CreateTopicSubscriber(string name) { throw new NotImplementedException(); } void IDisposable.Dispose() { } } }
using System; namespace Rock.Messaging { public class ExampleMessagingScenarioFactory : IMessagingScenarioFactory { private readonly int _intData; public ExampleMessagingScenarioFactory() : this(0) { } public ExampleMessagingScenarioFactory(int intData = 0) { _intData = intData; } public int IntData { get { return _intData; } } public ISender CreateQueueProducer(string name) { throw new NotImplementedException(); } public IReceiver CreateQueueConsumer(string name) { throw new NotImplementedException(); } public ISender CreateTopicPublisher(string name) { throw new NotImplementedException(); } public IReceiver CreateTopicSubscriber(string name) { throw new NotImplementedException(); } } }
mit
C#
899dcd7f1d347df226ba02a9e45f2ff9ba03fa72
Solve build related issue
Promact/trappist,Promact/trappist,Promact/trappist,Promact/trappist,Promact/trappist
Trappist/src/Promact.Trappist.Core/Controllers/QuestionsController.cs
Trappist/src/Promact.Trappist.Core/Controllers/QuestionsController.cs
using Microsoft.AspNetCore.Mvc; using Promact.Trappist.DomainModel.Models.Question; using Promact.Trappist.Repository.Questions; using System; namespace Promact.Trappist.Core.Controllers { [Route("api")] public class QuestionsController : Controller { private readonly IQuestionRepository _questionsRepository; public QuestionsController(IQuestionRepository questionsRepository) { _questionsRepository = questionsRepository; } /// <summary> /// Add single multiple answer question into model /// </summary> /// <param name="singleMultipleAnswerQuestion"></param> /// <param name="singleMultipleAnswerQuestionOption"></param> /// <returns></returns> [Route("single-multiple-question")] [HttpPost] public IActionResult AddSingleMultipleAnswerQuestion(SingleMultipleAnswerQuestion singleMultipleAnswerQuestion, SingleMultipleAnswerQuestionOption singleMultipleAnswerQuestionOption) { _questionsRepository.AddSingleMultipleAnswerQuestion(singleMultipleAnswerQuestion, singleMultipleAnswerQuestionOption); return Ok(); } } }
using Microsoft.AspNetCore.Mvc; using Promact.Trappist.DomainModel.Models.Question; using Promact.Trappist.Repository.Questions; using System; namespace Promact.Trappist.Core.Controllers { [Route("api")] public class QuestionsController : Controller { private readonly IQuestionRepository _questionsRepository; public QuestionsController(IQuestionRepository questionsRepository) { _questionsRepository = questionsRepository; } [Route("single-multiple-question")] [HttpPost] /// <summary> /// Add single multiple answer question into model /// </summary> /// <param name="singleMultipleAnswerQuestion"></param> public IActionResult AddSingleMultipleAnswerQuestion(SingleMultipleAnswerQuestion singleMultipleAnswerQuestion, SingleMultipleAnswerQuestionOption singleMultipleAnswerQuestionOption) { _questionsRepository.AddSingleMultipleAnswerQuestion(singleMultipleAnswerQuestion, singleMultipleAnswerQuestionOption); return Ok(); } } }
mit
C#
e9f9d21604d8596bc29362859d7e057b773dc2a6
Fix zero size parent container in visual tests
ppy/osu-framework,ZLima12/osu-framework,ppy/osu-framework,ppy/osu-framework,EVAST9919/osu-framework,peppy/osu-framework,EVAST9919/osu-framework,smoogipooo/osu-framework,peppy/osu-framework,ZLima12/osu-framework,smoogipooo/osu-framework,EVAST9919/osu-framework,EVAST9919/osu-framework,peppy/osu-framework
osu.Framework.Tests/VisualTestGame.cs
osu.Framework.Tests/VisualTestGame.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.Cursor; using osu.Framework.Graphics.Containers; using osu.Framework.Platform; using osu.Framework.Testing; namespace osu.Framework.Tests { internal class VisualTestGame : TestGame { [BackgroundDependencyLoader] private void load() { Child = new SafeAreaSnappingContainer { RelativeSizeAxes = Axes.Both, SafeEdges = Edges.Left | Edges.Top | Edges.Right, Child = new DrawSizePreservingFillContainer { Children = new Drawable[] { new TestBrowser(), new CursorContainer(), }, } }; } public override void SetHost(GameHost host) { base.SetHost(host); host.Window.CursorState |= CursorState.Hidden; } } }
// 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.Cursor; using osu.Framework.Graphics.Containers; using osu.Framework.Platform; using osu.Framework.Testing; namespace osu.Framework.Tests { internal class VisualTestGame : TestGame { [BackgroundDependencyLoader] private void load() { Child = new SafeAreaSnappingContainer { SafeEdges = Edges.Left | Edges.Top | Edges.Right, Child = new DrawSizePreservingFillContainer { Children = new Drawable[] { new TestBrowser(), new CursorContainer(), }, } }; } public override void SetHost(GameHost host) { base.SetHost(host); host.Window.CursorState |= CursorState.Hidden; } } }
mit
C#
410463d14bb5e5130e6d2a5a5d07c86b6716f03d
Add test case for open generics
jquintus/spikes,jquintus/spikes,jquintus/spikes,jquintus/spikes
ConsoleApps/FunWithSpikes/FunWithNinject/Conventions/ConventionsTests.cs
ConsoleApps/FunWithSpikes/FunWithNinject/Conventions/ConventionsTests.cs
using Ninject; using Ninject.Extensions.Conventions; using NUnit.Framework; namespace FunWithNinject.Conventions { [TestFixture] public class ConventionsTests { [Test] public void Bind_OneClassWithMultipleInterfaces_BindsOneInstanceToAll() { // Assemble using (var kernel = new StandardKernel()) { kernel.Bind(k => k.FromThisAssembly() .SelectAllClasses() .InNamespaceOf<ConventionsTests>() .BindAllInterfaces() .Configure(b => b.InSingletonScope())); // Act var face1 = kernel.Get<IFace1>(); var face2 = kernel.Get<IFace2>(); // Assemble Assert.AreSame(face1, face2); } } [Test] public void Bind_ResolveGenericType_Works() { // Assemble using (var kernel = new StandardKernel()) { kernel.Bind(k => k.FromThisAssembly() .SelectAllClasses() .InNamespaceOf<ConventionsTests>() .BindAllInterfaces() .Configure(b => b.InSingletonScope())); kernel.Bind<int>().ToConstant(27); kernel.Bind<string>().ToConstant("twenty seven"); // Act var generic = kernel.Get<IGeneric<int, string>>(); // Assemble Assert.AreEqual(27, generic.FirstProp); Assert.AreEqual("twenty seven", generic.SecondProp); } } #region Helper Classes/Interfaces public interface IFace1 { } public interface IFace2 { } public interface IGeneric<T1, T2> { T1 FirstProp { get; set; } T2 SecondProp { get; set; } } public class AllFaces : IFace1, IFace2 { } public class Generic<T1, T2> : IGeneric<T1, T2> { public Generic(T1 first, T2 second) { FirstProp = first; SecondProp = second; } public T1 FirstProp { get; set; } public T2 SecondProp { get; set; } } #endregion Helper Classes/Interfaces } }
using Ninject; using NUnit.Framework; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Ninject.Extensions.Conventions; namespace FunWithNinject.Conventions { [TestFixture] public class ConventionsTests { [Test] public void Bind_OneClassWithMultipleInterfaces_BindsOneInstanceToAll() { // Assemble using (var kernel = new StandardKernel()) { kernel.Bind(k => k.FromThisAssembly() .SelectAllClasses() .InNamespaceOf<ConventionsTests>() .BindAllInterfaces() .Configure(b => b.InSingletonScope())); // Act var face1 = kernel.Get<IFace1>(); var face2 = kernel.Get<IFace2>(); // Assemble Assert.AreSame(face1, face2); } } } public interface IFace1 { } public interface IFace2 { } public class AllFaces : IFace1, IFace2 { } }
mit
C#
ab42a1634f0946977f3203907d621555083b1850
Add user-controllable exception handling
treehopper-electronics/treehopper-sdk,treehopper-electronics/treehopper-sdk,treehopper-electronics/treehopper-sdk,treehopper-electronics/treehopper-sdk,treehopper-electronics/treehopper-sdk,treehopper-electronics/treehopper-sdk
NET/API/Treehopper/Settings.cs
NET/API/Treehopper/Settings.cs
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Treehopper { /// <summary> /// This class represents global settings used by the Treehopper API /// </summary> public class Settings { /// <summary> /// Get or sets whether exceptions should be thrown. /// </summary> /// <remarks> /// <para> /// If true, any exceptions received will be thrown to user code, as well as printed. If false, exceptions will only be printed. /// </para> /// </remarks> public bool ThrowExceptions { get; set; } /// <summary> /// The VID to search for /// </summary> public uint Vid { get; set; } = 0x10c4; /// <summary> /// The PID to search for /// </summary> public uint Pid { get; set; } = 0x8a7e; /// <summary> /// The PID used by the bootloader /// </summary> public uint BootloaderPid { get; set; } = 0xeac9; /// <summary> /// The VID used by the bootloader /// </summary> public uint BootloaderVid { get; set; } = 0x10c4; /// <summary> /// The WinUSB GUID used by the librarh /// </summary> public Guid Guid { get; set; } = new Guid("{5B34B38B-F4CD-49C3-B2BB-60E47A43E12D}"); /// <summary> /// Construct a new settings object with Treehopper defaults. /// </summary> public Settings() { } } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Treehopper { /// <summary> /// This class represents global settings used by the Treehopper API /// </summary> public class Settings { /// <summary> /// The VID to search for /// </summary> public uint Vid { get; set; } /// <summary> /// The PID to search for /// </summary> public uint Pid { get; set; } /// <summary> /// The PID used by the bootloader /// </summary> public uint BootloaderPid { get; set; } /// <summary> /// The VID used by the bootloader /// </summary> public uint BootloaderVid { get; set; } /// <summary> /// The WinUSB GUID used by the librarh /// </summary> public Guid Guid { get; set; } /// <summary> /// Construct a new settings object with Treehopper defaults. /// </summary> public Settings() { Guid = new Guid("{5B34B38B-F4CD-49C3-B2BB-60E47A43E12D}"); Vid = 0x10c4; Pid = 0x8a7e; BootloaderVid = 0x10c4; BootloaderPid = 0xeac9; } } }
mit
C#
ab0e52a1860b067d47a844dde60a0c9acf0c68e5
Split WCF functionality out of Autofac.Extras.Multitenant into a separate assembly/package, Autofac.Extras.Multitenant.Wcf. Both packages are versioned 3.1.0.
autofac/Autofac.Extras.DomainServices
Properties/VersionAssemblyInfo.cs
Properties/VersionAssemblyInfo.cs
//------------------------------------------------------------------------------ // <auto-generated> // This code was generated by a tool. // Runtime Version:4.0.30319.18051 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. // </auto-generated> //------------------------------------------------------------------------------ using System; using System.Reflection; using System.Resources; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; [assembly: AssemblyVersion("3.0.0.0")] [assembly: AssemblyFileVersion("3.0.0.0")] [assembly: AssemblyConfiguration("Release built on 2013-12-03 10:23")] [assembly: AssemblyCopyright("Copyright © 2013 Autofac Contributors")] [assembly: AssemblyDescription("Autofac.Extras.DomainServices 3.0.0")]
//------------------------------------------------------------------------------ // <auto-generated> // This code was generated by a tool. // Runtime Version:4.0.30319.34003 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. // </auto-generated> //------------------------------------------------------------------------------ using System; using System.Reflection; using System.Resources; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; [assembly: AssemblyVersion("3.0.0.0")] [assembly: AssemblyFileVersion("3.0.0.0")] [assembly: AssemblyConfiguration("Release built on 2013-10-23 22:48")] [assembly: AssemblyCopyright("Copyright © 2013 Autofac Contributors")] [assembly: AssemblyDescription("Autofac.Extras.DomainServices 3.0.0")]
mit
C#
1ce0ec8e8f3b5350e9c35167c30cdf56612a4bcf
Increase the default retries to 10 (#22)
projectkudu/KuduSync.NET,projectkudu/KuduSync.NET
KuduSync.NET/OperationManager.cs
KuduSync.NET/OperationManager.cs
using System; using System.Threading; namespace KuduSync.NET { internal static class OperationManager { private const int DefaultRetries = 10; private const int DefaultDelayBeforeRetry = 250; // 250 ms public static void Attempt(Action action, int retries = DefaultRetries, int delayBeforeRetry = DefaultDelayBeforeRetry) { OperationManager.Attempt<object>(() => { action(); return null; }, retries, delayBeforeRetry); } public static T Attempt<T>(Func<T> action, int retries = DefaultRetries, int delayBeforeRetry = DefaultDelayBeforeRetry) { T result = default(T); while (retries > 0) { try { result = action(); break; } catch { retries--; if (retries == 0) { throw; } } Thread.Sleep(delayBeforeRetry); } return result; } } }
using System; using System.Threading; namespace KuduSync.NET { internal static class OperationManager { private const int DefaultRetries = 3; private const int DefaultDelayBeforeRetry = 250; // 250 ms public static void Attempt(Action action, int retries = DefaultRetries, int delayBeforeRetry = DefaultDelayBeforeRetry) { OperationManager.Attempt<object>(() => { action(); return null; }, retries, delayBeforeRetry); } public static T Attempt<T>(Func<T> action, int retries = DefaultRetries, int delayBeforeRetry = DefaultDelayBeforeRetry) { T result = default(T); while (retries > 0) { try { result = action(); break; } catch { retries--; if (retries == 0) { throw; } } Thread.Sleep(delayBeforeRetry); } return result; } } }
apache-2.0
C#
68f98723db76f6e7ad0b0759360bf9dc81b692a6
Update _Layout.cshtml
CarmelSoftware/Generic-Data-Repository-for-ASP.NET-MVC
Views/Shared/_Layout.cshtml
Views/Shared/_Layout.cshtml
<!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width" /> <title>@ViewBag.Title</title> @Styles.Render("~/Content/css") @Scripts.Render("~/bundles/modernizr") <!-- Latest compiled and minified CSS --> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css"> <!-- Optional theme --> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap-theme.min.css"> <!-- Latest compiled and minified JavaScript --> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/js/bootstrap.min.js"></script> </head> <body> <div class="container"> @RenderBody() </div> @Scripts.Render("~/bundles/jquery") @RenderSection("scripts", required: false) <a href="http://themvcclub.blogspot.co.il/" >http://themvcclub.blogspot.co.il/</a> </body> </html>
<!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width" /> <title>@ViewBag.Title</title> @Styles.Render("~/Content/css") @Scripts.Render("~/bundles/modernizr") <!-- Latest compiled and minified CSS --> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css"> <!-- Optional theme --> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap-theme.min.css"> <!-- Latest compiled and minified JavaScript --> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/js/bootstrap.min.js"></script> </head> <body> <div class="container"> @RenderBody() </div> @Scripts.Render("~/bundles/jquery") @RenderSection("scripts", required: false) <a href="http://themvcclub.blogspot.co.il/" >http://themvcclub.blogspot.co.il/</a> </body> </html>
mit
C#
48bf7351dbbb8c05f005ba59661119dee9dbff66
Update FadeParticlesNearPoint.cs
grreuze/Utils
Scripts/FadeParticlesNearPoint.cs
Scripts/FadeParticlesNearPoint.cs
using UnityEngine; [ExecuteInEditMode] [RequireComponent(typeof(ParticleSystem))] public class FadeParticlesNearPoint : MonoBehaviour { ParticleSystem ps; [Header("Use \"Infinity\" to ignore an axis")] [SerializeField] Vector3 point; [SerializeField] float radius; [SerializeField] float startFadeDistance = 3; [SerializeField] bool killParticleWhenFaded; bool isLocal; bool ignoreX, ignoreY, ignoreZ; Color startColor; void Start() { ps = GetComponent<ParticleSystem>(); isLocal = ps.main.simulationSpace == ParticleSystemSimulationSpace.Local; ignoreX = point.x == Mathf.Infinity; ignoreY = point.y == Mathf.Infinity; ignoreZ = point.z == Mathf.Infinity; } void LateUpdate() { ParticleSystem.Particle[] particles = new ParticleSystem.Particle[ps.main.maxParticles]; startColor = ps.main.startColor.color; int count = ps.GetParticles(particles); for (int i = 0; i < count; i++) { ParticleSystem.Particle p = particles[i]; Vector3 pos = isLocal ? transform.TransformPoint(p.position) : p.position; if (ignoreX) point.x = pos.x; if (ignoreY) point.y = pos.y; if (ignoreZ) point.z = pos.z; float distance = Vector3.Distance(pos, point); if (distance < startFadeDistance + radius) { Color color = p.startColor; color.a = startColor.a * Mathf.InverseLerp(radius, startFadeDistance + radius, distance); p.startColor = color; if (killParticleWhenFaded && distance < radius) p.remainingLifetime = 0; particles[i] = p; } else { p.startColor = startColor; particles[i] = p; } } ps.SetParticles(particles, count); } }
using UnityEngine; [RequireComponent(typeof(ParticleSystem))] public class FadeParticlesNearPoint : MonoBehaviour { ParticleSystem ps; [Header("Use \"Infinity\" to ignore an axis")] [SerializeField] Vector3 point; [SerializeField] float radius; [SerializeField] float startFadeDistance = 3; bool isLocal; bool ignoreX, ignoreY, ignoreZ; void Start() { ps = GetComponent<ParticleSystem>(); isLocal = ps.main.simulationSpace == ParticleSystemSimulationSpace.Local; ignoreX = point.x == Mathf.Infinity; ignoreY = point.y == Mathf.Infinity; ignoreZ = point.z == Mathf.Infinity; } void Update() { ParticleSystem.Particle[] particles = new ParticleSystem.Particle[ps.main.maxParticles]; int count = ps.GetParticles(particles); for (int i = 0; i < count; i++) { ParticleSystem.Particle p = particles[i]; Vector3 pos = isLocal ? transform.TransformPoint(p.position) : p.position; if (ignoreX) point.x = pos.x; if (ignoreY) point.y = pos.y; if (ignoreZ) point.z = pos.z; float distance = Vector3.Distance(pos, point); if (distance < startFadeDistance + radius) { Color color = p.startColor; color.a = Mathf.Lerp(0, 1, Mathf.Max(0, distance - radius) / (startFadeDistance + radius)); p.startColor = color; if (distance < radius) p.remainingLifetime = 0; particles[i] = p; } } ps.SetParticles(particles, count); } }
mit
C#
b478972cc8f46d351b8f83198c0d4441cf2cfc0f
Modify the comment in IUtterance.cs.
AIWolfSharp/AIWolf_NET
AIWolfLib/IUtterance.cs
AIWolfLib/IUtterance.cs
// // IUtterance.cs // // Copyright (c) 2018 Takashi OTSUKI // // This software is released under the MIT License. // http://opensource.org/licenses/mit-license.php // namespace AIWolf.Lib { #if JHELP /// <summary> /// 発話クラスが実装すべきプロパティ /// </summary> #else /// <summary> /// The properties to be in the class for utterances. /// </summary> #endif public interface IUtterance { #if JHELP /// <summary> /// 発話のインデックス /// </summary> #else /// <summary> /// The index number of this utterance. /// </summary> #endif int Idx { get; } #if JHELP /// <summary> /// 発話日 /// </summary> #else /// <summary> /// The day of this utterance. /// </summary> #endif int Day { get; } #if JHELP /// <summary> /// 発話ターン /// </summary> #else /// <summary> /// The turn of this utterance. /// </summary> #endif int Turn { get; } #if JHELP /// <summary> /// 発話エージェント /// </summary> #else /// <summary> /// The agent who uttered. /// </summary> #endif Agent Agent { get; } #if JHELP /// <summary> /// 発話テキスト /// </summary> #else /// <summary> /// The contents of this utterance. /// </summary> #endif string Text { get; } } }
// // IUtterance.cs // // Copyright (c) 2018 Takashi OTSUKI // // This software is released under the MIT License. // http://opensource.org/licenses/mit-license.php // namespace AIWolf.Lib { #if JHELP /// <summary> /// 発話クラスが実装すべきプロパティとメソッド /// </summary> #else /// <summary> /// Abstract utterance class. /// </summary> #endif public interface IUtterance { #if JHELP /// <summary> /// 発話のインデックス /// </summary> #else /// <summary> /// The index number of this utterance. /// </summary> #endif int Idx { get; } #if JHELP /// <summary> /// 発話日 /// </summary> #else /// <summary> /// The day of this utterance. /// </summary> #endif int Day { get; } #if JHELP /// <summary> /// 発話ターン /// </summary> #else /// <summary> /// The turn of this utterance. /// </summary> #endif int Turn { get; } #if JHELP /// <summary> /// 発話エージェント /// </summary> #else /// <summary> /// The agent who uttered. /// </summary> #endif Agent Agent { get; } #if JHELP /// <summary> /// 発話テキスト /// </summary> #else /// <summary> /// The contents of this utterance. /// </summary> #endif string Text { get; } } }
mit
C#
a6e40d34f0c47a895e303eef36b3224bc28a478a
Change version to 1.2 prior tagging.
RajOpteamix/moq,tectronics/moq
Source/Properties/AssemblyInfo.cs
Source/Properties/AssemblyInfo.cs
using System.Reflection; using System.Runtime.CompilerServices; [assembly: AssemblyTitle("Moq")] [assembly: AssemblyDescription("Mocking library for .NET 3.5 and C# 3.0, heavily based on Linq")] [assembly: AssemblyCompany("Moq Project")] [assembly: AssemblyProduct("Moq")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] [assembly: AssemblyVersion("1.2.*")] [assembly: AssemblyFileVersion("1.2.0.0")] [assembly: InternalsVisibleTo("Moq.Tests, PublicKey=00240000048000009400000006020000002400005253413100040000010001009f7a95086500f8f66d892174803850fed9c22225c2ccfff21f39c8af8abfa5415b1664efd0d8e0a6f7f2513b1c11659bd84723dc7900c3d481b833a73a2bcf1ed94c16c4be64d54352c86956c89930444e9ac15124d3693e3f029818e8410f167399d6b995324b635e95353ba97bfab856abbaeb9b40c9b160070c6325e22ddc")]
using System.Reflection; using System.Runtime.CompilerServices; [assembly: AssemblyTitle("Moq")] [assembly: AssemblyDescription("Mocking library for .NET 3.5 and C# 3.0, heavily based on Linq")] [assembly: AssemblyCompany("Moq Project")] [assembly: AssemblyProduct("Moq")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] [assembly: AssemblyVersion("1.1.*")] [assembly: AssemblyFileVersion("1.1.0.0")] [assembly: InternalsVisibleTo("Moq.Tests, PublicKey=00240000048000009400000006020000002400005253413100040000010001009f7a95086500f8f66d892174803850fed9c22225c2ccfff21f39c8af8abfa5415b1664efd0d8e0a6f7f2513b1c11659bd84723dc7900c3d481b833a73a2bcf1ed94c16c4be64d54352c86956c89930444e9ac15124d3693e3f029818e8410f167399d6b995324b635e95353ba97bfab856abbaeb9b40c9b160070c6325e22ddc")]
bsd-3-clause
C#
922bbb03da514c993d46bf1d320d8830622f46e7
update version
jmkelly/elephanet,YoloDev/elephanet,jmkelly/elephanet,YoloDev/elephanet
Elephanet/Properties/AssemblyInfo.cs
Elephanet/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("Elephanet")] [assembly: AssemblyDescription("A .NET api to PostgreSQL's jsonb that's easy to use")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("James Kelly")] [assembly: AssemblyProduct("Elephanet")] [assembly: AssemblyCopyright("Copyright © 2015")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("65b6d608-9e5f-4eed-b765-ad6191d65bcb")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("0.1.2")] [assembly: AssemblyFileVersion("0.1.2")]
using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("Elephanet")] [assembly: AssemblyDescription("A .NET api to PostgreSQL's jsonb that's easy to use")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("James Kelly")] [assembly: AssemblyProduct("Elephanet")] [assembly: AssemblyCopyright("Copyright © 2015")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("65b6d608-9e5f-4eed-b765-ad6191d65bcb")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("0.1.1")] [assembly: AssemblyFileVersion("0.1.1")]
mit
C#
e04ad8357d1e32b849e059a65c71e10e0cecc97a
Make spinner piece respond to scale changes
DrabWeb/osu,naoey/osu,smoogipooo/osu,NeoAdonis/osu,johnneijzen/osu,naoey/osu,NeoAdonis/osu,UselessToucan/osu,ppy/osu,2yangk23/osu,peppy/osu,peppy/osu,ppy/osu,ZLima12/osu,peppy/osu,peppy/osu-new,ZLima12/osu,smoogipoo/osu,2yangk23/osu,smoogipoo/osu,johnneijzen/osu,smoogipoo/osu,ppy/osu,UselessToucan/osu,NeoAdonis/osu,DrabWeb/osu,UselessToucan/osu,DrabWeb/osu,EVAST9919/osu,EVAST9919/osu,naoey/osu
osu.Game.Rulesets.Osu/Edit/Masks/SpinnerMasks/Components/SpinnerPiece.cs
osu.Game.Rulesets.Osu/Edit/Masks/SpinnerMasks/Components/SpinnerPiece.cs
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>. // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Shapes; using osu.Game.Graphics; using osu.Game.Rulesets.Osu.Objects; using osu.Game.Rulesets.Osu.Objects.Drawables.Pieces; using OpenTK; namespace osu.Game.Rulesets.Osu.Edit.Masks.SpinnerMasks.Components { public class SpinnerPiece : CompositeDrawable { private readonly Spinner spinner; private readonly CircularContainer circle; public SpinnerPiece(Spinner spinner) { this.spinner = spinner; Origin = Anchor.Centre; RelativeSizeAxes = Axes.Both; FillMode = FillMode.Fit; Size = new Vector2(1.3f); RingPiece ring; InternalChildren = new Drawable[] { circle = new CircularContainer { RelativeSizeAxes = Axes.Both, Masking = true, Alpha = 0.5f, Child = new Box { RelativeSizeAxes = Axes.Both } }, ring = new RingPiece { Anchor = Anchor.Centre, Origin = Anchor.Centre } }; ring.Scale = new Vector2(spinner.Scale); spinner.PositionChanged += _ => updatePosition(); spinner.StackHeightChanged += _ => updatePosition(); spinner.ScaleChanged += _ => ring.Scale = new Vector2(spinner.Scale); updatePosition(); } [BackgroundDependencyLoader] private void load(OsuColour colours) { Colour = colours.Yellow; } private void updatePosition() => Position = spinner.Position; public override bool ReceivePositionalInputAt(Vector2 screenSpacePos) => circle.ReceivePositionalInputAt(screenSpacePos); } }
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>. // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Shapes; using osu.Game.Graphics; using osu.Game.Rulesets.Osu.Objects; using osu.Game.Rulesets.Osu.Objects.Drawables.Pieces; using OpenTK; namespace osu.Game.Rulesets.Osu.Edit.Masks.SpinnerMasks.Components { public class SpinnerPiece : CompositeDrawable { private readonly Spinner spinner; private readonly CircularContainer circle; public SpinnerPiece(Spinner spinner) { this.spinner = spinner; Origin = Anchor.Centre; RelativeSizeAxes = Axes.Both; FillMode = FillMode.Fit; Size = new Vector2(1.3f); RingPiece ring; InternalChildren = new Drawable[] { circle = new CircularContainer { RelativeSizeAxes = Axes.Both, Masking = true, Alpha = 0.5f, Child = new Box { RelativeSizeAxes = Axes.Both } }, ring = new RingPiece { Anchor = Anchor.Centre, Origin = Anchor.Centre } }; ring.Scale = new Vector2(spinner.Scale); spinner.PositionChanged += _ => updatePosition(); spinner.StackHeightChanged += _ => updatePosition(); updatePosition(); } [BackgroundDependencyLoader] private void load(OsuColour colours) { Colour = colours.Yellow; } private void updatePosition() => Position = spinner.Position; public override bool ReceivePositionalInputAt(Vector2 screenSpacePos) => circle.ReceivePositionalInputAt(screenSpacePos); } }
mit
C#
ccd828d9efb4741e844b4fa12003a1c48f2b8c32
Добавить интенты bot_ad_invite и bot_ad_promo (#892)
vknet/vk,vknet/vk
VkNet/Enums/SafetyEnums/Intent.cs
VkNet/Enums/SafetyEnums/Intent.cs
namespace VkNet.Enums.SafetyEnums { /// <summary> /// Метка, которая обозначает приблизительное содержание сообщения от сообщества /// </summary> public sealed class Intent : SafetyEnum<Intent> { /// <summary> /// Интент, который должен сопровождать рекламную рассылку для ботов. /// </summary> public static readonly Intent PromoNewsletter = RegisterPossibleValue(value: "promo_newsletter"); /// <summary> /// Интент, который должен сопровождать сообщения, запрашивающее подтверждение пользователя на отправку этому пользователю рекламы. /// </summary> public static readonly Intent BotAdInvite = RegisterPossibleValue(value: "bot_ad_invite"); /// <summary> /// Интент, который должен сопровождать сообщение содержащее рекламу от бота. /// </summary> public static readonly Intent BotAdPromo = RegisterPossibleValue(value: "bot_ad_promo"); } }
namespace VkNet.Enums.SafetyEnums { /// <summary> /// Метка, которая обозначает приблизительное содержание сообщения от сообщества /// </summary> public sealed class Intent : SafetyEnum<Intent> { /// <summary> /// Интент, который должен сопровождать рекламную рассылку для ботов. /// </summary> public static readonly Intent PromoNewsletter = RegisterPossibleValue(value: "promo_newsletter"); } }
mit
C#
9d1d7804daee4b81fab85f2e93fdfd1b0b30d6ff
Fix Razor tests broken by change to full string passing.
wasabii/Cogito,wasabii/Cogito
Cogito.Web.Razor.Tests/RazorTemplateBuilderTests.cs
Cogito.Web.Razor.Tests/RazorTemplateBuilderTests.cs
using System; using System.IO; using Microsoft.VisualStudio.TestTools.UnitTesting; namespace Cogito.Web.Razor.Tests { [TestClass] public class RazorTemplateBuilderTests { TextReader LoadTemplateText(string name) { return new StreamReader(typeof(RazorTemplateBuilderTests).Assembly .GetManifestResourceStream(typeof(RazorTemplateBuilderTests).Namespace + ".Templates." + name)); } [TestMethod] public void Test_simple_code_generation() { var t = RazorTemplateBuilder.ToCode(LoadTemplateText("Simple.cshtml").ReadToEnd()); Assert.IsTrue(t.Contains(@"@__CompiledTemplate")); } [TestMethod] public void Test_simple_helper_code_generation() { var t = RazorTemplateBuilder.ToCode(LoadTemplateText("SimpleWithHelper.cshtml").ReadToEnd()); Assert.IsTrue(t.Contains(@"@__CompiledTemplate")); } } }
using System; using System.IO; using Microsoft.VisualStudio.TestTools.UnitTesting; namespace Cogito.Web.Razor.Tests { [TestClass] public class RazorTemplateBuilderTests { TextReader LoadTemplateText(string name) { return new StreamReader(typeof(RazorTemplateBuilderTests).Assembly .GetManifestResourceStream(typeof(RazorTemplateBuilderTests).Namespace + ".Templates." + name)); } [TestMethod] public void Test_simple_code_generation() { var t = RazorTemplateBuilder.ToCode(() => LoadTemplateText("Simple.cshtml")); Assert.IsTrue(t.Contains(@"@__CompiledTemplate")); } [TestMethod] public void Test_simple_helper_code_generation() { var t = RazorTemplateBuilder.ToCode(() => LoadTemplateText("SimpleWithHelper.cshtml")); Assert.IsTrue(t.Contains(@"@__CompiledTemplate")); } } }
mit
C#
712a81c00bec3c6b371f47b76d66e8dde098c94d
Make ReflectionCoreNonPortable.GetTypeForRuntimeTypeHandle nonpublic.
kyulee1/corert,yizhang82/corert,shrah/corert,gregkalapos/corert,tijoytom/corert,botaberg/corert,krytarowski/corert,tijoytom/corert,krytarowski/corert,yizhang82/corert,kyulee1/corert,krytarowski/corert,gregkalapos/corert,krytarowski/corert,sandreenko/corert,kyulee1/corert,tijoytom/corert,shrah/corert,sandreenko/corert,shrah/corert,gregkalapos/corert,shrah/corert,yizhang82/corert,gregkalapos/corert,kyulee1/corert,botaberg/corert,yizhang82/corert,botaberg/corert,tijoytom/corert,botaberg/corert,sandreenko/corert,sandreenko/corert
src/System.Private.CoreLib/src/Internal/Reflection/Core/NonPortable/ReflectionCoreNonPortable.cs
src/System.Private.CoreLib/src/Internal/Reflection/Core/NonPortable/ReflectionCoreNonPortable.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.Runtime.CompilerServices; namespace Internal.Reflection.Core.NonPortable { public static class ReflectionCoreNonPortable { public static TypeLoadException CreateTypeLoadException(String message, String typeName) { return new TypeLoadException(message, typeName); } internal static Type GetTypeForRuntimeTypeHandle(RuntimeTypeHandle runtimeTypeHandle) { return RuntimeTypeUnifier.GetTypeForRuntimeTypeHandle(runtimeTypeHandle); } internal static Type GetRuntimeTypeForEEType(EETypePtr eeType) { return RuntimeTypeUnifier.GetTypeForRuntimeTypeHandle(new RuntimeTypeHandle(eeType)); } [MethodImpl(MethodImplOptions.AggressiveInlining)] internal static bool IsRuntimeImplemented(this Type type) { return type is IRuntimeImplementedType; } } }
// 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.Runtime.CompilerServices; namespace Internal.Reflection.Core.NonPortable { public static class ReflectionCoreNonPortable { public static Type GetTypeForRuntimeTypeHandle(RuntimeTypeHandle runtimeTypeHandle) { return RuntimeTypeUnifier.GetTypeForRuntimeTypeHandle(runtimeTypeHandle); } internal static Type GetRuntimeTypeForEEType(EETypePtr eeType) { return RuntimeTypeUnifier.GetTypeForRuntimeTypeHandle(new RuntimeTypeHandle(eeType)); } public static TypeLoadException CreateTypeLoadException(String message, String typeName) { return new TypeLoadException(message, typeName); } [MethodImpl(MethodImplOptions.AggressiveInlining)] internal static bool IsRuntimeImplemented(this Type type) { return type is IRuntimeImplementedType; } } }
mit
C#
b1ccdd4191e3249ccedbb58f76893d4a310429ff
Tweak SemaphoreDisposer to null out the held semaphore
CyrusNajmabadi/roslyn,dotnet/roslyn,KevinRansom/roslyn,weltkante/roslyn,KevinRansom/roslyn,bartdesmet/roslyn,shyamnamboodiripad/roslyn,mavasani/roslyn,weltkante/roslyn,sharwell/roslyn,mavasani/roslyn,CyrusNajmabadi/roslyn,bartdesmet/roslyn,KevinRansom/roslyn,sharwell/roslyn,sharwell/roslyn,CyrusNajmabadi/roslyn,diryboy/roslyn,dotnet/roslyn,jasonmalinowski/roslyn,jasonmalinowski/roslyn,bartdesmet/roslyn,weltkante/roslyn,shyamnamboodiripad/roslyn,jasonmalinowski/roslyn,diryboy/roslyn,shyamnamboodiripad/roslyn,dotnet/roslyn,mavasani/roslyn,diryboy/roslyn
src/Compilers/Core/Portable/InternalUtilities/SemaphoreSlimExtensions.cs
src/Compilers/Core/Portable/InternalUtilities/SemaphoreSlimExtensions.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.Threading; using System.Threading.Tasks; namespace Roslyn.Utilities { internal static class SemaphoreSlimExtensions { public static SemaphoreDisposer DisposableWait(this SemaphoreSlim semaphore, CancellationToken cancellationToken = default) { semaphore.Wait(cancellationToken); return new SemaphoreDisposer(semaphore); } [PerformanceSensitive("https://github.com/dotnet/roslyn/issues/36114", OftenCompletesSynchronously = true)] public static async ValueTask<SemaphoreDisposer> DisposableWaitAsync(this SemaphoreSlim semaphore, CancellationToken cancellationToken = default) { await semaphore.WaitAsync(cancellationToken).ConfigureAwait(false); return new SemaphoreDisposer(semaphore); } [NonCopyable] internal struct SemaphoreDisposer : IDisposable { private SemaphoreSlim? _semaphore; public SemaphoreDisposer(SemaphoreSlim semaphore) { _semaphore = semaphore; } public void Dispose() { // Officially, Dispose() being called more than once is allowable, but in this case // if that were to ever happen that means something is very, very wrong. Since it's an internal // type, better to be strict. // Nulling this out also means it's a bit easier to diagnose some async deadlocks; if you have an // async deadlock where a SemaphoreSlim is held but you're unsure why, as long all the users of the // SemaphoreSlim used the Disposable helpers, you can search memory and find the instance that // is pointing to the SemaphoreSlim that hasn't nulled out this field yet; in that case you know // that's holding the lock and can figure out who is holding that SemaphoreDisposer. var semaphoreToDispose = Interlocked.Exchange(ref _semaphore, null); if (semaphoreToDispose is null) { throw new ObjectDisposedException($"Somehow a {nameof(SemaphoreDisposer)} is being disposed twice."); } semaphoreToDispose.Release(); } } } }
// 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.Threading; using System.Threading.Tasks; namespace Roslyn.Utilities { internal static class SemaphoreSlimExtensions { public static SemaphoreDisposer DisposableWait(this SemaphoreSlim semaphore, CancellationToken cancellationToken = default) { semaphore.Wait(cancellationToken); return new SemaphoreDisposer(semaphore); } [PerformanceSensitive("https://github.com/dotnet/roslyn/issues/36114", OftenCompletesSynchronously = true)] public static async ValueTask<SemaphoreDisposer> DisposableWaitAsync(this SemaphoreSlim semaphore, CancellationToken cancellationToken = default) { await semaphore.WaitAsync(cancellationToken).ConfigureAwait(false); return new SemaphoreDisposer(semaphore); } [NonCopyable] internal struct SemaphoreDisposer : IDisposable { private readonly SemaphoreSlim _semaphore; public SemaphoreDisposer(SemaphoreSlim semaphore) { _semaphore = semaphore; } public void Dispose() { _semaphore.Release(); } } } }
mit
C#
3b74ed31389d1ce6cd08022bb625620b4e71f17b
Fix list view template for soldiers
mattgwagner/Battery-Commander,mattgwagner/Battery-Commander,mattgwagner/Battery-Commander,mattgwagner/Battery-Commander
BatteryCommander.Web/Views/Soldier/List.cshtml
BatteryCommander.Web/Views/Soldier/List.cshtml
@model IEnumerable<BatteryCommander.Common.Models.Soldier> @{ ViewBag.Title = "List"; } <h2>@ViewBag.Title</h2> <table class="table"> <tr> <th> @Html.DisplayNameFor(model => model.FirstOrDefault().LastName) </th> <th> @Html.DisplayNameFor(model => model.FirstOrDefault().FirstName) </th> <th> @Html.DisplayNameFor(model => model.FirstOrDefault().Rank) </th> <th> @Html.DisplayNameFor(model => model.FirstOrDefault().Status) </th> <th></th> </tr> @foreach (var item in Model) { <tr> <td> @Html.DisplayFor(modelItem => item.LastName) </td> <td> @Html.DisplayFor(modelItem => item.FirstName) </td> <td> @Html.DisplayFor(modelItem => item.Rank) </td> <td> @Html.DisplayFor(modelItem => item.Status) </td> <td> @Html.ActionLink("Edit", "Edit", new { soldierId = item.Id }) </td> </tr> } </table>
@model IEnumerable<BatteryCommander.Common.Models.Soldier> @{ ViewBag.Title = "List"; } <h2>List</h2> <table class="table"> <tr> <th> @Html.DisplayNameFor(model => model.LastName) </th> <th> @Html.DisplayNameFor(model => model.FirstName) </th> <th></th> </tr> @foreach (var item in Model) { <tr> <td> @Html.DisplayFor(modelItem => item.LastName) </td> <td> @Html.DisplayFor(modelItem => item.FirstName) </td> <td> @Html.ActionLink("Edit", "Edit", new { id = item.Id }) </td> </tr> } </table>
mit
C#
936776c28ba97ba9d3f6f5609736dce92140200f
Update Game.cs
svmnotn/friendly-guacamole
Assets/src/data/Game.cs
Assets/src/data/Game.cs
using System.Collections.Generic; using System; // TODO REMOVE using UnityEngine; public class Game { Queue<Player> players; public Player curr; public Action PlayerSwitch; public Action<Vector> GridAdded; public Action<Vector, Vector> CellWon; Dictionary<Vector, Grid> map; public Game(Queue<Player> players) { this.players = players; Next (); map = new Dictionary<Vector, Grid> (); } public void AddGrid(Vector pos) { map.Add (pos, new Grid ()); if (GridAdded != null) GridAdded (pos); } public void RemoveGrid(Vector pos) { //TODO FIX LAZY map.Clear (); } public bool Play(Vector grid, Vector cell) { var g = GetGrid (grid); var c = g.grid [cell.x, cell.y]; c = new Cell (curr); g.grid[cell.x, cell.y] = c; return Check (grid, cell); } void Next() { curr = players.Dequeue (); players.Enqueue (curr); if (PlayerSwitch != null) PlayerSwitch (); } bool Check(Vector grid, Vector cell) { var g = GetGrid (grid); for (int i = 0; i < g.grid.GetLength (0); i++) { var c1 = g.grid [i, 0].player != null ? g.grid [i, 0].player.type : null; var c2 = g.grid [i, 1].player != null ? g.grid [i, 1].player.type : null; var c3 = g.grid [i, 2].player != null ? g.grid [i, 2].player.type : null; if (c1 != null && c1 == c2 && c2 == c3) { return true; } } for (int i = 0; i < g.grid.GetLength (1); i++) { var c1 = g.grid [0, i].player != null ? g.grid [0, i].player.type : null; var c2 = g.grid [1, i].player != null ? g.grid [1, i].player.type : null; var c3 = g.grid [2, i].player != null ? g.grid [2, i].player.type : null; if (c1 != null && c1 == c2 && c2 == c3) { return true; } } var c1 = g.grid[1,1].player != null ? g.grid[1,1].player.type : null; if (c1 != null){ // TL var c2 = g.grid[0,0].player != null ? g.grid[0,0].player.type : null; var c3 = g.grid[2,2].player != null ? g.grid[2,2].player.type : null; if (c2 != null && c3 != null && c1 == c2 && c2 == c3){ return true; } // TR c2 = g.grid[2,0].player != null ? g.grid[2,0].player.type : null; c3 = g.grid[0,2].player != null ? g.grid[0,2].player.type : null; if (c2 != null && c3 != null && c1 == c2 && c2 == c3){ return true; } } Next (); return false; } Grid GetGrid(Vector click) { Grid grid; map.TryGetValue(click, out grid); return grid; } }
using System.Collections.Generic; using System; // TODO REMOVE using UnityEngine; public class Game { Queue<Player> players; public Player curr; public Action PlayerSwitch; public Action<Vector> GridAdded; public Action<Vector, Vector> CellWon; Dictionary<Vector, Grid> map; public Game(Queue<Player> players) { this.players = players; Next (); map = new Dictionary<Vector, Grid> (); } public void AddGrid(Vector pos) { map.Add (pos, new Grid ()); if (GridAdded != null) GridAdded (pos); } public void RemoveGrid(Vector pos) { //TODO FIX LAZY map.Clear (); } public bool Play(Vector grid, Vector cell) { var g = GetGrid (grid); var c = g.grid [cell.x, cell.y]; c = new Cell (curr); g.grid[cell.x, cell.y] = c; return Check (grid, cell); } void Next() { curr = players.Dequeue (); players.Enqueue (curr); if (PlayerSwitch != null) PlayerSwitch (); } bool Check(Vector grid, Vector cell) { var g = GetGrid (grid); for (int i = 0; i < g.grid.GetLength (0); i++) { var c1 = g.grid [i, 0].player != null ? g.grid [i, 0].player.type : null; var c2 = g.grid [i, 1].player != null ? g.grid [i, 1].player.type : null; var c3 = g.grid [i, 2].player != null ? g.grid [i, 2].player.type : null; if (c1 != null && c1 == c2 && c2 == c3) { return true; } } for (int i = 0; i < g.grid.GetLength (1); i++) { var c1 = g.grid [0, i].player != null ? g.grid [0, i].player.type : null; var c2 = g.grid [1, i].player != null ? g.grid [1, i].player.type : null; var c3 = g.grid [2, i].player != null ? g.grid [2, i].player.type : null; if (c1 != null && c1 == c2 && c2 == c3) { return true; } } Next (); return false; } Grid GetGrid(Vector click) { Grid grid; map.TryGetValue(click, out grid); return grid; } }
mit
C#
d874cda53fda3e3d17026d9a883facc8072935a5
Disable CS0660 where Full Solution Analysis produces a different result
dotnet/roslyn,shyamnamboodiripad/roslyn,weltkante/roslyn,AmadeusW/roslyn,brettfo/roslyn,tmat/roslyn,KevinRansom/roslyn,AmadeusW/roslyn,mgoertz-msft/roslyn,jmarolf/roslyn,jasonmalinowski/roslyn,jmarolf/roslyn,bartdesmet/roslyn,weltkante/roslyn,AlekseyTs/roslyn,sharwell/roslyn,aelij/roslyn,physhi/roslyn,weltkante/roslyn,jasonmalinowski/roslyn,gafter/roslyn,CyrusNajmabadi/roslyn,brettfo/roslyn,mgoertz-msft/roslyn,tannergooding/roslyn,panopticoncentral/roslyn,shyamnamboodiripad/roslyn,physhi/roslyn,aelij/roslyn,tannergooding/roslyn,genlu/roslyn,sharwell/roslyn,CyrusNajmabadi/roslyn,mavasani/roslyn,bartdesmet/roslyn,gafter/roslyn,dotnet/roslyn,AlekseyTs/roslyn,tmat/roslyn,KevinRansom/roslyn,wvdd007/roslyn,eriawan/roslyn,stephentoub/roslyn,shyamnamboodiripad/roslyn,CyrusNajmabadi/roslyn,gafter/roslyn,ErikSchierboom/roslyn,jasonmalinowski/roslyn,wvdd007/roslyn,tannergooding/roslyn,physhi/roslyn,AlekseyTs/roslyn,wvdd007/roslyn,ErikSchierboom/roslyn,KevinRansom/roslyn,eriawan/roslyn,KirillOsenkov/roslyn,heejaechang/roslyn,bartdesmet/roslyn,panopticoncentral/roslyn,heejaechang/roslyn,brettfo/roslyn,AmadeusW/roslyn,aelij/roslyn,KirillOsenkov/roslyn,heejaechang/roslyn,tmat/roslyn,mavasani/roslyn,genlu/roslyn,stephentoub/roslyn,genlu/roslyn,panopticoncentral/roslyn,mavasani/roslyn,diryboy/roslyn,jmarolf/roslyn,ErikSchierboom/roslyn,KirillOsenkov/roslyn,diryboy/roslyn,sharwell/roslyn,eriawan/roslyn,dotnet/roslyn,mgoertz-msft/roslyn,stephentoub/roslyn,diryboy/roslyn
src/Compilers/CSharp/Portable/Symbols/TypeSymbol.SymbolAndDiagnostics.cs
src/Compilers/CSharp/Portable/Symbols/TypeSymbol.SymbolAndDiagnostics.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.Collections.Immutable; #pragma warning disable CS0660 // Warning is reported only for Full Solution Analysis namespace Microsoft.CodeAnalysis.CSharp.Symbols { internal partial class TypeSymbol { /// <summary> /// Represents the method by which this type implements a given interface type /// and/or the corresponding diagnostics. /// </summary> protected class SymbolAndDiagnostics { public static readonly SymbolAndDiagnostics Empty = new SymbolAndDiagnostics(null, ImmutableArray<Diagnostic>.Empty); public readonly Symbol Symbol; public readonly ImmutableArray<Diagnostic> Diagnostics; public SymbolAndDiagnostics(Symbol symbol, ImmutableArray<Diagnostic> diagnostics) { this.Symbol = symbol; this.Diagnostics = diagnostics; } } } }
// 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.Collections.Immutable; namespace Microsoft.CodeAnalysis.CSharp.Symbols { internal partial class TypeSymbol { /// <summary> /// Represents the method by which this type implements a given interface type /// and/or the corresponding diagnostics. /// </summary> protected class SymbolAndDiagnostics { public static readonly SymbolAndDiagnostics Empty = new SymbolAndDiagnostics(null, ImmutableArray<Diagnostic>.Empty); public readonly Symbol Symbol; public readonly ImmutableArray<Diagnostic> Diagnostics; public SymbolAndDiagnostics(Symbol symbol, ImmutableArray<Diagnostic> diagnostics) { this.Symbol = symbol; this.Diagnostics = diagnostics; } } } }
mit
C#
a8a4dcfcd2fad4433659af12a359503ffecf41b4
Test commit
chefarbeiter/QuickIEnumerableToExcelExporter
src/QuickIEnumerableToExcelExporter/Extension.cs
src/QuickIEnumerableToExcelExporter/Extension.cs
using System.Collections.Generic; namespace QuickIEnumerableToExcelExporter { public static class Extension { /// <summary> /// /// </summary> /// <typeparam name="T"></typeparam> /// <param name="enumerable"></param> /// <param name="target"></param> public static void ExportToExcel<T>(this IEnumerable<T> enumerable, string target) => ExportToExcel(enumerable, target, new ExportConfiguration()); public static void ExportToExcel<T>(this IEnumerable<T> enumerable, string target, ExportConfiguration configuration) { // get metadata // write to intermediate // convert intermediate to excel } } }
using System.Collections.Generic; namespace QuickIEnumerableToExcelExporter { public static class Extension { public static void ExportToExcel<T>(this IEnumerable<T> enumerable, string target) => ExportToExcel(enumerable, target, new ExportConfiguration()); public static void ExportToExcel<T>(this IEnumerable<T> enumerable, string target, ExportConfiguration configuration) { // get metadata // write to intermediate // convert intermediate to excel } } }
mit
C#
0a14ffddc384f54ef7f5c13ef37eedb0423563f3
Update AssemblyInfo.cs
Socres/Socres
src/Socres.FakingEasy/Properties/AssemblyInfo.cs
src/Socres.FakingEasy/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("Socres.FakingEasy")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Socres")] [assembly: AssemblyProduct("Socres.FakingEasy")] [assembly: AssemblyCopyright("Copyright © Socres 2014")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("68f2e902-19f0-41c2-a141-e5a8be344343")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("2.0.*")] [assembly: AssemblyFileVersion("2.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("Socres.FakingEasy")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Socres")] [assembly: AssemblyProduct("Socres.FakingEasy")] [assembly: AssemblyCopyright("Copyright © Socres 2014")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("68f2e902-19f0-41c2-a141-e5a8be344343")] // 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#
6fb38737f72b8e4fbb41f1df5f580040f62170e3
Update UploadTicketQuota.cs
mfilippov/vimeo-dot-net,agricfowl/vimeo-dot-net,mohibsheth/vimeo-dot-net,cornem/vimeo-dot-net,needham-develop/vimeo-dot-net,justinspradlin/vimeo-dot-net
VimeoDotNet/VimeoDotNet/Models/UploadTicketQuota.cs
VimeoDotNet/VimeoDotNet/Models/UploadTicketQuota.cs
using System; namespace VimeoDotNet.Models { [Serializable] public class UploadTicketQuota { public bool sd { get; set; } public bool hd { get; set; } public long total_space { get; set; } public long space_used { get; set; } public long free_space { get; set; } public long max_file_size { get; set; } public DateTime resets { get; set; } } }
using System; namespace VimeoDotNet.Models { [Serializable] public class UploadTicketQuota { public bool sd { get; set; } public bool hd { get; set; } public long total_space { get; set; } public long space_used { get; set; } public int free_space { get; set; } public long max_file_size { get; set; } public DateTime resets { get; set; } } }
mit
C#
e9f605e35fcb84becd9777d366e495fb06d5893b
Update WalletWasabi/Services/Terminate/TerminateService.cs
nopara73/HiddenWallet,nopara73/HiddenWallet,nopara73/HiddenWallet,nopara73/HiddenWallet
WalletWasabi/Services/Terminate/TerminateService.cs
WalletWasabi/Services/Terminate/TerminateService.cs
using System; using System.Threading; using System.Threading.Tasks; using WalletWasabi.Logging; namespace WalletWasabi.Services.Terminate { public class TerminateService { private Func<Task> _terminateApplicationAsync; private const long TerminateStatusIdle = 0; private const long TerminateStatusInProgress = 1; private const long TerminateFinished = 2; private long _terminateStatus; public TerminateService(Func<Task> terminateApplicationAsync) { _terminateApplicationAsync = terminateApplicationAsync; AppDomain.CurrentDomain.ProcessExit += CurrentDomain_ProcessExit; Console.CancelKeyPress += Console_CancelKeyPress; } private void CurrentDomain_ProcessExit(object? sender, EventArgs e) { Logger.LogDebug("ProcessExit was called."); // This must be a blocking call because after this the OS will terminate Wasabi process if exists. Terminate(); } private void Console_CancelKeyPress(object? sender, ConsoleCancelEventArgs e) { Logger.LogWarning($"Process termination was requested using '{e.SpecialKey}' keyboard shortcut."); // This must be a blocking call because after this the OS will terminate Wasabi process if exists. // In some cases CurrentDomain_ProcessExit is called after this by the OS. Terminate(); } /// <summary> /// Terminates the application. /// </summary> /// <remark>This is a blocking method. Note that program execution ends at the end of this method due to <see cref="Environment.Exit(int)"/> call.</remark> public void Terminate(int exitCode = 0) { var prevValue = Interlocked.CompareExchange(ref _terminateStatus, TerminateStatusInProgress, TerminateStatusIdle); Logger.LogTrace($"Terminate was called from ThreadId: {Thread.CurrentThread.ManagedThreadId}"); if (prevValue != TerminateStatusIdle) { // Secondary callers will be blocked until the end of the termination. while (_terminateStatus != TerminateFinished) { } return; } // First caller starts the terminate procedure. Logger.LogDebug("Start shutting down the application."); // Async termination has to be started on another thread otherwise there is a possibility of deadlock. // We still need to block the caller so ManualResetEvent applied. using ManualResetEvent resetEvent = new ManualResetEvent(false); Task.Run(async () => { try { await _terminateApplicationAsync().ConfigureAwait(false); } catch (Exception ex) { Logger.LogWarning(ex.ToTypeMessageString()); } resetEvent.Set(); }); resetEvent.WaitOne(); AppDomain.CurrentDomain.ProcessExit -= CurrentDomain_ProcessExit; Console.CancelKeyPress -= Console_CancelKeyPress; // Indicate that the termination procedure finished. So other callers can return. Interlocked.Exchange(ref _terminateStatus, TerminateFinished); Environment.Exit(exitCode); } public bool IsTerminateRequested => Interlocked.Read(ref _terminateStatus) > TerminateStatusIdle; } }
using System; using System.Threading; using System.Threading.Tasks; using WalletWasabi.Logging; namespace WalletWasabi.Services.Terminate { public class TerminateService { private Func<Task> _terminateApplicationAsync; private const long TerminateStatusIdle = 0; private const long TerminateStatusInProgress = 1; private const long TerminateFinished = 2; private long _terminateStatus; public TerminateService(Func<Task> terminateApplicationAsync) { _terminateApplicationAsync = terminateApplicationAsync; AppDomain.CurrentDomain.ProcessExit += CurrentDomain_ProcessExit; Console.CancelKeyPress += Console_CancelKeyPress; } private void CurrentDomain_ProcessExit(object? sender, EventArgs e) { Logger.LogDebug("ProcessExit was called."); // This must be a blocking call because after this the OS will terminate Wasabi process if exists. Terminate(); } private void Console_CancelKeyPress(object? sender, ConsoleCancelEventArgs e) { Logger.LogWarning("Process was signaled for termination."); // This must be a blocking call because after this the OS will terminate Wasabi process if exists. // In some cases CurrentDomain_ProcessExit is called after this by the OS. Terminate(); } /// <summary> /// Terminates the application. /// </summary> /// <remark>This is a blocking method. Note that program execution ends at the end of this method due to <see cref="Environment.Exit(int)"/> call.</remark> public void Terminate(int exitCode = 0) { var prevValue = Interlocked.CompareExchange(ref _terminateStatus, TerminateStatusInProgress, TerminateStatusIdle); Logger.LogTrace($"Terminate was called from ThreadId: {Thread.CurrentThread.ManagedThreadId}"); if (prevValue != TerminateStatusIdle) { // Secondary callers will be blocked until the end of the termination. while (_terminateStatus != TerminateFinished) { } return; } // First caller starts the terminate procedure. Logger.LogDebug("Start shutting down the application."); // Async termination has to be started on another thread otherwise there is a possibility of deadlock. // We still need to block the caller so ManualResetEvent applied. using ManualResetEvent resetEvent = new ManualResetEvent(false); Task.Run(async () => { try { await _terminateApplicationAsync().ConfigureAwait(false); } catch (Exception ex) { Logger.LogWarning(ex.ToTypeMessageString()); } resetEvent.Set(); }); resetEvent.WaitOne(); AppDomain.CurrentDomain.ProcessExit -= CurrentDomain_ProcessExit; Console.CancelKeyPress -= Console_CancelKeyPress; // Indicate that the termination procedure finished. So other callers can return. Interlocked.Exchange(ref _terminateStatus, TerminateFinished); Environment.Exit(exitCode); } public bool IsTerminateRequested => Interlocked.Read(ref _terminateStatus) > TerminateStatusIdle; } }
mit
C#
a7d8d6938f867a134f6638248aea4b481163999b
Remove the unused bindattrs parameter from the ShaderStageProcessor delegate.
izrik/ChamberLib,izrik/ChamberLib,izrik/ChamberLib
Content/ProcessorDelegates.cs
Content/ProcessorDelegates.cs
using System; namespace ChamberLib.Content { public delegate IModel ModelProcessor(ModelContent asset, IContentProcessor processor); public delegate ITexture2D TextureProcessor(TextureContent asset, IContentProcessor processor); public delegate IShaderStage ShaderStageProcessor(ShaderContent asset, IContentProcessor processor); public delegate IFont FontProcessor(FontContent asset, IContentProcessor processor); public delegate ISong SongProcessor(SongContent asset, IContentProcessor processor); public delegate ISoundEffect SoundEffectProcessor(SoundEffectContent asset, IContentProcessor processor); }
using System; namespace ChamberLib.Content { public delegate IModel ModelProcessor(ModelContent asset, IContentProcessor processor); public delegate ITexture2D TextureProcessor(TextureContent asset, IContentProcessor processor); public delegate IShaderStage ShaderStageProcessor(ShaderContent asset, IContentProcessor processor, object bindattrs=null); public delegate IFont FontProcessor(FontContent asset, IContentProcessor processor); public delegate ISong SongProcessor(SongContent asset, IContentProcessor processor); public delegate ISoundEffect SoundEffectProcessor(SoundEffectContent asset, IContentProcessor processor); }
lgpl-2.1
C#
f35fb7aea5451aed8de063c3885c1c0d191456e6
Update assembly copyright date
Eastrall/Xamarin.Forms.WrapLayout
Xamarin.Forms.WrapLayout/Properties/AssemblyInfo.cs
Xamarin.Forms.WrapLayout/Properties/AssemblyInfo.cs
using System.Resources; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("Xamarin.Forms.WrapLayout")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("Xamarin.Forms.WrapLayout")] [assembly: AssemblyCopyright("Copyright © 2017")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] [assembly: NeutralResourcesLanguage("en")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]
using System.Resources; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("Xamarin.Forms.WrapLayout")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("Xamarin.Forms.WrapLayout")] [assembly: AssemblyCopyright("Copyright © 2014")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] [assembly: NeutralResourcesLanguage("en")] // 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#
42260eb0fd1b7b87ac1615065fed8ace9251bd48
improve nullable definitions in an interface
jbe2277/waf
src/System.Waf/Samples/Writer/Writer.Applications/Views/IShellView.cs
src/System.Waf/Samples/Writer/Writer.Applications/Views/IShellView.cs
using System; using System.Waf.Applications; using System.ComponentModel; namespace Waf.Writer.Applications.Views { public interface IShellView : IView { double Left { get; set; } double Top { get; set; } double Width { get; set; } double Height { get; set; } bool IsMaximized { get; set; } event CancelEventHandler? Closing; event EventHandler? Closed; void Show(); void Close(); } }
using System; using System.Waf.Applications; using System.ComponentModel; namespace Waf.Writer.Applications.Views { public interface IShellView : IView { double Left { get; set; } double Top { get; set; } double Width { get; set; } double Height { get; set; } bool IsMaximized { get; set; } event CancelEventHandler Closing; event EventHandler Closed; void Show(); void Close(); } }
mit
C#
6af2738b558eca360fa6ee80ac4882ac40398c25
Support high TemplateIds
jacobdufault/forge,jacobdufault/forge
Forge.Entities/Implementation/ContextObjects/TemplateConversionContext.cs
Forge.Entities/Implementation/ContextObjects/TemplateConversionContext.cs
// The MIT License (MIT) // // Copyright (c) 2013 Jacob Dufault // // 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 Forge.Collections; using Forge.Entities.Implementation.Content; using Forge.Entities.Implementation.Runtime; using Forge.Utilities; using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace Forge.Entities.Implementation.ContextObjects { internal class TemplateConversionContext : IContextObject { /// <summary> /// All of the created templates, indexed by template id. /// </summary> public Dictionary<int, ITemplate> CreatedTemplates = new Dictionary<int, ITemplate>(); /// <summary> /// Returns a template instance for the given TemplateId. If an instance for the given id /// already exists, then it is returned. Otherwise, either a RuntimeTemplate or /// ContentTemplate is created with an associated id based on the GameEngineContext. /// </summary> /// <param name="templateId">The id of the template to get an instance for.</param> /// <param name="context">The GameEngineContext, used to determine if we should create a /// ContentTemplate or RuntimeTemplate instance.</param> public ITemplate GetTemplateInstance(int templateId, GameEngineContext context) { if (CreatedTemplates.ContainsKey(templateId)) { return CreatedTemplates[templateId]; } ITemplate template; if (context.GameEngine.IsEmpty) { template = new ContentTemplate(templateId); } else { template = new RuntimeTemplate(templateId, context.GameEngine.Value); } CreatedTemplates[templateId] = template; return template; } } }
// The MIT License (MIT) // // Copyright (c) 2013 Jacob Dufault // // 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 Forge.Collections; using Forge.Entities.Implementation.Content; using Forge.Entities.Implementation.Runtime; using Forge.Utilities; using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace Forge.Entities.Implementation.ContextObjects { internal class TemplateConversionContext : IContextObject { public SparseArray<ITemplate> CreatedTemplates = new SparseArray<ITemplate>(); /// <summary> /// Returns a template instance for the given TemplateId. If an instance for the given id /// already exists, then it is returned. Otherwise, either a RuntimeTemplate or /// ContentTemplate is created with an associated id based on the GameEngineContext. /// </summary> /// <param name="templateId">The id of the template to get an instance for.</param> /// <param name="context">The GameEngineContext, used to determine if we should create a /// ContentTemplate or RuntimeTemplate instance.</param> public ITemplate GetTemplateInstance(int templateId, GameEngineContext context) { if (CreatedTemplates.Contains(templateId)) { return CreatedTemplates[templateId]; } ITemplate template; if (context.GameEngine.IsEmpty) { template = new ContentTemplate(templateId); } else { template = new RuntimeTemplate(templateId, context.GameEngine.Value); } CreatedTemplates[templateId] = template; return template; } } }
mit
C#
a79837c7e293052fdf3a974e4c91c07b870abf82
Add - Notifica della partenza su MeMo
vvfosprojects/sovvf,vvfosprojects/sovvf,vvfosprojects/sovvf,vvfosprojects/sovvf,vvfosprojects/sovvf
src/backend/SO115App.Models/Servizi/CQRS/Commands/ConfermaPartenze/ConfermaPartenzeNotification.cs
src/backend/SO115App.Models/Servizi/CQRS/Commands/ConfermaPartenze/ConfermaPartenzeNotification.cs
//----------------------------------------------------------------------- // <copyright file="ConfermaPartenzeNotification.cs" company="CNVVF"> // Copyright (C) 2017 - CNVVF // // This file is part of SOVVF. // SOVVF is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as // published by the Free Software Foundation, either version 3 of the // License, or (at your option) any later version. // // SOVVF 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 Affero General Public License for more details. // // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see http://www.gnu.org/licenses/. // </copyright> //----------------------------------------------------------------------- using CQRS.Commands.Notifiers; using Microsoft.AspNetCore.Mvc.Diagnostics; using Microsoft.AspNetCore.SignalR; using SO115App.Models.Classi.Matrix; using SO115App.Models.Servizi.Infrastruttura.Notification.CallMatrix; using SO115App.Models.Servizi.Infrastruttura.Notification.ComposizionePartenza; using SO115App.Models.Servizi.Infrastruttura.Notification.ComposizionePartenza.MezzoPrenotato; using SO115App.Models.Servizi.Infrastruttura.Notification.GestioneChiamateInCorso; using System; namespace DomainModel.CQRS.Commands.ConfermaPartenze { public class ConfermaPartenzeNotification : ICommandNotifier<ConfermaPartenzeCommand> { private readonly INotificationConfermaPartenze _sender; private readonly ICallMatrix _callMatrix; public ConfermaPartenzeNotification(INotificationConfermaPartenze sender, ICallMatrix callMatrix) { _sender = sender; _callMatrix = callMatrix; } public void Notify(ConfermaPartenzeCommand command) { _sender.SendNotification(command); foreach (var partenza in command.ConfermaPartenze.Partenze) { var messaggio = $"La squadra {partenza.Squadre[0].Nome} è partita alle ore {DateTime.Now.Hour}:{DateTime.Now.Minute} con il mezzo targato {partenza.Mezzo.Codice} per dirigersi a {command.ConfermaPartenze.richiesta.Localita.Indirizzo}. Codice Intervento: {command.ConfermaPartenze.richiesta.CodRichiesta}"; var infoMatrix = new MessageMatrix() { Messaggio = messaggio, CodSede = command.ConfermaPartenze.CodiceSede.Split('.')[0] }; _callMatrix.SendMessage(infoMatrix); } } } }
//----------------------------------------------------------------------- // <copyright file="ConfermaPartenzeNotification.cs" company="CNVVF"> // Copyright (C) 2017 - CNVVF // // This file is part of SOVVF. // SOVVF is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as // published by the Free Software Foundation, either version 3 of the // License, or (at your option) any later version. // // SOVVF 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 Affero General Public License for more details. // // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see http://www.gnu.org/licenses/. // </copyright> //----------------------------------------------------------------------- using CQRS.Commands.Notifiers; using Microsoft.AspNetCore.SignalR; using SO115App.Models.Servizi.Infrastruttura.Notification.ComposizionePartenza; using SO115App.Models.Servizi.Infrastruttura.Notification.ComposizionePartenza.MezzoPrenotato; using SO115App.Models.Servizi.Infrastruttura.Notification.GestioneChiamateInCorso; namespace DomainModel.CQRS.Commands.ConfermaPartenze { public class ConfermaPartenzeNotification : ICommandNotifier<ConfermaPartenzeCommand> { private readonly INotificationConfermaPartenze _sender; public ConfermaPartenzeNotification(INotificationConfermaPartenze sender) { _sender = sender; } public void Notify(ConfermaPartenzeCommand command) { _sender.SendNotification(command); } } }
agpl-3.0
C#
5dad289b4803282f1b230367b566779187f7fa5f
Fix ExampleGameManager
erebuswolf/LockstepFramework,SnpM/Lockstep-Framework,yanyiyun/LockstepFramework
Example/ExampleGameManager.cs
Example/ExampleGameManager.cs
using UnityEngine; using System.Collections; using Lockstep.Data; using TypeReferences; using System; namespace Lockstep.Example { public class ExampleGameManager : GameManager { [SerializeField,DataCode ("Agents")] private string _spawnCode; [SerializeField] private int _spawnAmount; private NetworkHelper _mainNetworkHelper = new ExampleNetworkHelper (); protected FastList<LSAgent> spawnedAgents = new FastList<LSAgent>(); public override void GetBehaviourHelpers (FastList<BehaviourHelper> output) { base.GetBehaviourHelpers(output); var go = new GameObject("BehaviourHandlers"); } public override NetworkHelper MainNetworkHelper { get { return _mainNetworkHelper; } } protected override void OnStartGame () { AgentController ac = new AgentController(); for (int i = 0; i < _spawnAmount; i++) { PlayerManager.AddController (ac); spawnedAgents.Add (ac.CreateAgent (_spawnCode,Vector2d.zero)); } } } }
using UnityEngine; using System.Collections; using Lockstep.Data; using TypeReferences; using System; namespace Lockstep.Example { public class ExampleGameManager : GameManager { [SerializeField,DataCode ("Agents")] private string _spawnCode; [SerializeField] private int _spawnAmount; private NetworkHelper _mainNetworkHelper = new ExampleNetworkHelper (); protected FastList<LSAgent> spawnedAgents = new FastList<LSAgent>(); public override void GetBehaviourHelpers (FastList<BehaviourHelper> output) { base.GetBehaviourHelpers(output); var go = new GameObject("BehaviourHandlers"); } public override NetworkHelper MainNetworkHelper { get { return _mainNetworkHelper; } } protected override void OnStartGame () { for (int i = 0; i < _spawnAmount; i++) { AgentController ac = new AgentController(); PlayerManager.AddController (ac); spawnedAgents.Add (ac.CreateAgent (_spawnCode,Vector2d.zero)); } } } }
mit
C#
9ba6d5f3a830c1c587424680d8dd88bb051468d2
Fix a bug where multi-level `include` elements get processed more than once.
lukyad/Eco
Eco/Elements/include.cs
Eco/Elements/include.cs
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Eco.Extensions; using Eco.SettingsVisitors; namespace Eco { /// <summary> /// Instructs serializer to include the specified configuration file. /// </summary> [EcoElement(typeof(include<>)), Doc("Specifies an external file to be included.")] public class include<T> { [Required, Doc("Path (relative or absolute) to the file to be included.")] public string file; [Optional, Namespace, Name("namespace")] [Doc("Namespace to be applied to all object IDs included from the referenced file. If specified, an object from the file should be referenced as '<Namesapce>.<ObjectId>'")] public string ns; [Optional, Doc("[Not supported yet] Format of the file to be included (xml, json etc). By default Eco library uses format defined by Settings.DefaultManager.")] public string format; [Default("true")] [Doc("If set to true, then Eco library would skip this file when saving the parent configuration file. Default value is true.")] public bool? readOnly; [Hidden, SkippedBy(typeof(IncludeElementReader), typeof(IncludeElementWriter))] public T data; public static string GetFile(object twin) => (string)twin.GetFieldValue(nameof(file)); public static string GetNamespace(object twin) => (string)twin.GetFieldValue("namespace"); public static string GetFormat(object twin) => (string)twin.GetFieldValue(nameof(format)); public static bool IsReadOnly(object twin) { object isReadOnly = twin.GetFieldValue(nameof(readOnly)); return isReadOnly.GetType() == typeof(string) ? isReadOnly.ToString() == Boolean.TrueString : (isReadOnly as bool?).Value; } public static object GetData(object twin) => twin.GetFieldValue(nameof(data)); public static void SetData(object twin, object value) => twin.SetFieldValue(nameof(data), value); public static Type GetDataType(object twin) => twin.GetType().GetField(nameof(data)).FieldType; } // Shortcut for the static functions. public class include : include<object> { } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Eco.Extensions; namespace Eco { /// <summary> /// Instructs serializer to include the specified configuration file. /// </summary> [EcoElement(typeof(include<>)), Doc("Specifies an external file to be included.")] public class include<T> { [Required, Doc("Path (relative or absolute) to the file to be included.")] public string file; [Optional, Namespace, Name("namespace")] [Doc("Namespace to be applied to all object IDs included from the referenced file. If specified, an object from the file should be referenced as '<Namesapce>.<ObjectId>'")] public string ns; [Optional, Doc("[Not supported yet] Format of the file to be included (xml, json etc). By default Eco library uses format defined by Settings.DefaultManager.")] public string format; [Default("true")] [Doc("If set to true, then Eco library would skip this file when saving the parent configuration file. Default value is true.")] public bool? readOnly; [Hidden] public T data; public static string GetFile(object twin) => (string)twin.GetFieldValue(nameof(file)); public static string GetNamespace(object twin) => (string)twin.GetFieldValue("namespace"); public static string GetFormat(object twin) => (string)twin.GetFieldValue(nameof(format)); public static bool IsReadOnly(object twin) { object isReadOnly = twin.GetFieldValue(nameof(readOnly)); return isReadOnly.GetType() == typeof(string) ? isReadOnly.ToString() == Boolean.TrueString : (isReadOnly as bool?).Value; } public static object GetData(object twin) => twin.GetFieldValue(nameof(data)); public static void SetData(object twin, object value) => twin.SetFieldValue(nameof(data), value); public static Type GetDataType(object twin) => twin.GetType().GetField(nameof(data)).FieldType; } // Shortcut for the static functions. public class include : include<object> { } }
apache-2.0
C#
a5d8ac3276ab9da2e266d84a3d6a3d3abdbbdf0b
Remove unused usings
Trencadis-Labs/Internship,Trencadis-Labs/Internship,Trencadis-Labs/Internship
Courses/Apps/Enumerables/PlayingWithIEnumerable/PlayingWithIEnumerable/CustomEnumeration.generic.cs
Courses/Apps/Enumerables/PlayingWithIEnumerable/PlayingWithIEnumerable/CustomEnumeration.generic.cs
using System.Collections; using System.Collections.Generic; namespace PlayingWithIEnumerable { public class CustomEnumeration<T> : IEnumerable<T> { private readonly T[] backingArray; public CustomEnumeration(params T[] elements) { if (elements == null) { elements = new T[0]; } this.backingArray = new T[elements.Length]; for (int i = 0; i < elements.Length; i++) { this.backingArray[i] = elements[i]; } } public IEnumerator<T> GetEnumerator() { return this.GetGenericEnumerator_UsingCustomArrayEnumerator(); } IEnumerator IEnumerable.GetEnumerator() { return this.GetEnumerator_UsingCustomArrayEnumerator(); } // generic enumerators private IEnumerator<T> GetGenericEnumerator_UsingForeach() { // Magic happens here!! DebuggingTool.DebugMsg($"CustomEnumeration<T> :: Called GetEnumerator (generic)"); foreach (var item in this.backingArray) { DebuggingTool.DebugMsg($"CustomEnumeration<T> :: New foreach iteration (generic):: current element is {item}"); yield return item; } } private IEnumerator<T> GetGenericEnumerator_UsingCustomArrayEnumerator() { var iterator = new ArrayEnumerator<T>(this.backingArray); return iterator; } // non-generic enumerators private IEnumerator GetNongenericEnumerator_UsingForeach() { // Magic happens here!! DebuggingTool.DebugMsg($"CustomEnumeration<T> :: Called GetEnumerator (non-generic)"); foreach (object item in this.backingArray) { DebuggingTool.DebugMsg($"CustomEnumeration<T> :: New foreach iteration (non-generic) :: current element is {item}"); yield return item; } } private IEnumerator GetNongenericEnumerator_UsingArrayClass() { // hides some types used internally (SZArrayEnumerator and ArrayEnumerator) // https://referencesource.microsoft.com/#mscorlib/system/array.cs,ac1786d68e16892e // https://referencesource.microsoft.com/#mscorlib/system/array.cs,4f49b6bfd66eb1e5 return this.backingArray.GetEnumerator(); } private IEnumerator GetEnumerator_UsingCustomArrayEnumerator() { var iterator = new ArrayEnumerator(this.backingArray); return iterator; } } }
using System; using System.Collections; using System.Collections.Generic; namespace PlayingWithIEnumerable { public class CustomEnumeration<T> : IEnumerable<T> { private readonly T[] backingArray; public CustomEnumeration(params T[] elements) { if (elements == null) { elements = new T[0]; } this.backingArray = new T[elements.Length]; for (int i = 0; i < elements.Length; i++) { this.backingArray[i] = elements[i]; } } public IEnumerator<T> GetEnumerator() { return this.GetGenericEnumerator_UsingCustomArrayEnumerator(); } IEnumerator IEnumerable.GetEnumerator() { return this.GetEnumerator_UsingCustomArrayEnumerator(); } // generic enumerators private IEnumerator<T> GetGenericEnumerator_UsingForeach() { // Magic happens here!! DebuggingTool.DebugMsg($"CustomEnumeration<T> :: Called GetEnumerator (generic)"); foreach (var item in this.backingArray) { DebuggingTool.DebugMsg($"CustomEnumeration<T> :: New foreach iteration (generic):: current element is {item}"); yield return item; } } private IEnumerator<T> GetGenericEnumerator_UsingCustomArrayEnumerator() { var iterator = new ArrayEnumerator<T>(this.backingArray); return iterator; } // non-generic enumerators private IEnumerator GetNongenericEnumerator_UsingForeach() { // Magic happens here!! DebuggingTool.DebugMsg($"CustomEnumeration<T> :: Called GetEnumerator (non-generic)"); foreach (object item in this.backingArray) { DebuggingTool.DebugMsg($"CustomEnumeration<T> :: New foreach iteration (non-generic) :: current element is {item}"); yield return item; } } private IEnumerator GetNongenericEnumerator_UsingArrayClass() { // hides some types used internally (SZArrayEnumerator and ArrayEnumerator) // https://referencesource.microsoft.com/#mscorlib/system/array.cs,ac1786d68e16892e // https://referencesource.microsoft.com/#mscorlib/system/array.cs,4f49b6bfd66eb1e5 return this.backingArray.GetEnumerator(); } private IEnumerator GetEnumerator_UsingCustomArrayEnumerator() { var iterator = new ArrayEnumerator(this.backingArray); return iterator; } } }
mit
C#