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>© @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>© @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 »
</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 »
</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 »
</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 »
</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 |