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
1e8c2224c744fe90fd4e844e31e27fba17ee37ce
bump version
Fody/PropertyChanged
CommonAssemblyInfo.cs
CommonAssemblyInfo.cs
using System.Reflection; [assembly: AssemblyTitle("PropertyChanged")] [assembly: AssemblyProduct("PropertyChanged")] [assembly: AssemblyCompany("Simon Cropp and Contributors")] [assembly: AssemblyDescription("Fody add-in for injecting INotifyPropertyChanged code into properties.")] [assembly: AssemblyVersion("2.1.2")] [assembly: AssemblyFileVersion("2.1.2")]
using System.Reflection; [assembly: AssemblyTitle("PropertyChanged")] [assembly: AssemblyProduct("PropertyChanged")] [assembly: AssemblyCompany("Simon Cropp and Contributors")] [assembly: AssemblyDescription("Fody add-in for injecting INotifyPropertyChanged code into properties.")] [assembly: AssemblyVersion("2.1.1")] [assembly: AssemblyFileVersion("2.1.1")]
mit
C#
6d5669450b6e1cf322b0c9eb175f17ae59e1d167
fix color grader description
ruarai/Trigrad,ruarai/Trigrad
Trigrad/ColorGraders/TriGrader.cs
Trigrad/ColorGraders/TriGrader.cs
using System; using System.Collections.Generic; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using PixelMapSharp; using Trigrad.DataTypes; namespace Trigrad.ColorGraders { /// <summary> Color grader that fills the triangle with the first sample color. </summary> public class TriGrader : IGrader { /// <summary> Produces a color from the specified coordinates and colors. </summary> public Pixel Grade(Sample u, Sample v, Sample w, DrawPoint p) { return u.Color; } } }
using System; using System.Collections.Generic; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using PixelMapSharp; using Trigrad.DataTypes; namespace Trigrad.ColorGraders { /// <summary> Color grader that fills the triangle with an average of the three vertice samples. </summary> public class TriGrader : IGrader { /// <summary> Produces a color from the specified coordinates and colors. </summary> public Pixel Grade(Sample u, Sample v, Sample w, DrawPoint p) { return u.Color; } } }
mit
C#
f6fd4919cdeca451c82e7ca99799e969a5293272
update version
cornem/vimeo-dot-net,needham-develop/vimeo-dot-net,justinspradlin/vimeo-dot-net,agricfowl/vimeo-dot-net,mfilippov/vimeo-dot-net,mohibsheth/vimeo-dot-net
VimeoDotNet/SharedAssemblyInfo.cs
VimeoDotNet/SharedAssemblyInfo.cs
using System.Reflection; using System.Runtime.InteropServices; [assembly: AssemblyCompany("Stephen Commisso")] [assembly: AssemblyProduct("VimeoDotNet")] [assembly: AssemblyCopyright("Copyright © 2014, Stephen Commisso")] // 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)] [assembly: AssemblyVersion("0.7.3")] [assembly: AssemblyFileVersion("0.7.3")]
using System.Reflection; using System.Runtime.InteropServices; [assembly: AssemblyCompany("Stephen Commisso")] [assembly: AssemblyProduct("VimeoDotNet")] [assembly: AssemblyCopyright("Copyright © 2014, Stephen Commisso")] // 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)] [assembly: AssemblyVersion("0.7.2")] [assembly: AssemblyFileVersion("0.7.2")]
mit
C#
a2151279b26d9ecb39f16b41bbf22ddb60c624b6
Bump version
jasonwoods-7/Vandelay
GlobalAssemblyInfo.cs
GlobalAssemblyInfo.cs
using System.Reflection; [assembly: AssemblyVersion("0.2.3.0")] [assembly: AssemblyFileVersion("0.2.3.0")] [assembly: AssemblyCopyright("Copyright 2015-2017")]
using System.Reflection; [assembly: AssemblyVersion("0.2.2.1")] [assembly: AssemblyFileVersion("0.2.2.1")] [assembly: AssemblyCopyright("Copyright 2015-2016")]
mit
C#
2d7f9bf29045e9096ad8cb9dc672a05ad6ab7c97
Revert RoomCategory naming change to avoid json deserialization failures
ppy/osu,peppy/osu,NeoAdonis/osu,ppy/osu,smoogipoo/osu,peppy/osu-new,ppy/osu,UselessToucan/osu,UselessToucan/osu,smoogipooo/osu,smoogipoo/osu,smoogipoo/osu,NeoAdonis/osu,peppy/osu,UselessToucan/osu,NeoAdonis/osu,peppy/osu
osu.Game/Online/Rooms/RoomCategory.cs
osu.Game/Online/Rooms/RoomCategory.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. namespace osu.Game.Online.Rooms { public enum RoomCategory { // used for osu-web deserialization so names shouldn't be changed. Normal, Spotlight, Realtime, } }
// 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. namespace osu.Game.Online.Rooms { public enum RoomCategory { Normal, Spotlight, Multiplayer, } }
mit
C#
a8845b914c6e67878e1f07841230b3d079d4f4b2
add attribution
mcdrummerman/Translatorizer,mcdrummerman/Translatorizer
AssemblyInfo.cs
AssemblyInfo.cs
using System.Reflection; // // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. // [assembly: AssemblyProductAttribute("Translatorizer")] [assembly: AssemblyCompanyAttribute("RedFern Ltd")] [assembly: AssemblyTitleAttribute("Translatorizer Console")] [assembly: AssemblyDescriptionAttribute("RedFern Ltd's Translatorizer")] [assembly: AssemblyCopyrightAttribute("Copyright (c) 2015 Redfern Ltd and Scott Hanselman (https://github.com/shanselman/Psuedoizer) and John Robbins and Gregory Morse (https://github.com/GregoryMorse/ResxTranslator)")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Revision and Build Numbers // by using the '*' as shown below: [assembly: AssemblyVersion("0.1.*")] // // In order to sign your assembly you must specify a key to use. Refer to the // Microsoft .NET Framework documentation for more information on assembly signing. // // Use the attributes below to control which key is used for signing. // // Notes: // (*) If no key is specified, the assembly is not signed. // (*) KeyName refers to a key that has been installed in the Crypto Service // Provider (CSP) on your machine. KeyFile refers to a file which contains // a key. // (*) If the KeyFile and the KeyName values are both specified, the // following processing occurs: // (1) If the KeyName can be found in the CSP, that key is used. // (2) If the KeyName does not exist and the KeyFile does exist, the key // in the KeyFile is installed into the CSP and used. // (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility. // When specifying the KeyFile, the location of the KeyFile should be // relative to the project output directory which is // %Project Directory%\obj\<configuration>. For example, if your KeyFile is // located in the project directory, you would specify the AssemblyKeyFile // attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")] // (*) Delay Signing is an advanced option - see the Microsoft .NET Framework // documentation for more information on this. // [assembly: AssemblyDelaySign(false)] [assembly: AssemblyKeyFile("")] [assembly: AssemblyKeyName("")]
using System.Reflection; // // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. // [assembly: AssemblyProductAttribute("Translatorizer")] [assembly: AssemblyCompanyAttribute("RedFern Ltd")] [assembly: AssemblyTitleAttribute("Translatorizer Console")] [assembly: AssemblyDescriptionAttribute("RedFern Ltd's Translatorizer")] [assembly: AssemblyCopyrightAttribute("Copyright (c) 2015 Redfern Ltd and Scott Hanselman and John Robbins")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Revision and Build Numbers // by using the '*' as shown below: [assembly: AssemblyVersion("0.1.*")] // // In order to sign your assembly you must specify a key to use. Refer to the // Microsoft .NET Framework documentation for more information on assembly signing. // // Use the attributes below to control which key is used for signing. // // Notes: // (*) If no key is specified, the assembly is not signed. // (*) KeyName refers to a key that has been installed in the Crypto Service // Provider (CSP) on your machine. KeyFile refers to a file which contains // a key. // (*) If the KeyFile and the KeyName values are both specified, the // following processing occurs: // (1) If the KeyName can be found in the CSP, that key is used. // (2) If the KeyName does not exist and the KeyFile does exist, the key // in the KeyFile is installed into the CSP and used. // (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility. // When specifying the KeyFile, the location of the KeyFile should be // relative to the project output directory which is // %Project Directory%\obj\<configuration>. For example, if your KeyFile is // located in the project directory, you would specify the AssemblyKeyFile // attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")] // (*) Delay Signing is an advanced option - see the Microsoft .NET Framework // documentation for more information on this. // [assembly: AssemblyDelaySign(false)] [assembly: AssemblyKeyFile("")] [assembly: AssemblyKeyName("")]
apache-2.0
C#
76a98fe28bcf3db056401040b962b666f64de96f
Make SourceRectangle nullable so it doesn't crash.
ethanmoffat/EndlessClient
EndlessClient/UIControls/PictureBox.cs
EndlessClient/UIControls/PictureBox.cs
// Original Work Copyright (c) Ethan Moffat 2014-2016 // This file is subject to the GPL v2 License // For additional details, see the LICENSE file using EOLib; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using XNAControls; namespace EndlessClient.UIControls { public class PictureBox : XNAControl { protected Texture2D _displayPicture; public Optional<Rectangle?> SourceRectangle { get; set; } public PictureBox(Texture2D displayPicture, XNAControl parent = null) : base(null, null, parent) { SetNewPicture(displayPicture); if (parent == null) Game.Components.Add(this); SourceRectangle = new Optional<Rectangle?>(); } public void SetNewPicture(Texture2D displayPicture) { _displayPicture = displayPicture; _setSize(displayPicture.Width, displayPicture.Height); } public override void Draw(GameTime gameTime) { SpriteBatch.Begin(); SpriteBatch.Draw( _displayPicture, DrawAreaWithOffset, SourceRectangle.HasValue ? SourceRectangle.Value : null, Color.White); SpriteBatch.End(); base.Draw(gameTime); } } }
// Original Work Copyright (c) Ethan Moffat 2014-2016 // This file is subject to the GPL v2 License // For additional details, see the LICENSE file using EOLib; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using XNAControls; namespace EndlessClient.UIControls { public class PictureBox : XNAControl { protected Texture2D _displayPicture; public Optional<Rectangle> SourceRectangle { get; set; } public PictureBox(Texture2D displayPicture, XNAControl parent = null) : base(null, null, parent) { SetNewPicture(displayPicture); if (parent == null) Game.Components.Add(this); SourceRectangle = new Optional<Rectangle>(); } public void SetNewPicture(Texture2D displayPicture) { _displayPicture = displayPicture; _setSize(displayPicture.Width, displayPicture.Height); } public override void Draw(GameTime gameTime) { SpriteBatch.Begin(); SpriteBatch.Draw( _displayPicture, DrawAreaWithOffset, SourceRectangle.HasValue ? SourceRectangle : null, Color.White); SpriteBatch.End(); base.Draw(gameTime); } } }
mit
C#
07ec163daa856235a5046d2428b2a924c41478bd
Fix version fallback logic
2yangk23/osu,UselessToucan/osu,johnneijzen/osu,NeoAdonis/osu,2yangk23/osu,peppy/osu,smoogipoo/osu,NeoAdonis/osu,johnneijzen/osu,peppy/osu,ppy/osu,peppy/osu-new,EVAST9919/osu,smoogipoo/osu,NeoAdonis/osu,ZLima12/osu,EVAST9919/osu,peppy/osu,ppy/osu,ppy/osu,UselessToucan/osu,UselessToucan/osu,smoogipoo/osu,ZLima12/osu,smoogipooo/osu
osu.Android/OsuGameAndroid.cs
osu.Android/OsuGameAndroid.cs
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. using System; using Android.App; using osu.Game; using osu.Game.Updater; namespace osu.Android { public class OsuGameAndroid : OsuGame { public override Version AssemblyVersion { get { var packageInfo = Application.Context.ApplicationContext.PackageManager.GetPackageInfo(Application.Context.ApplicationContext.PackageName, 0); try { string versionName = packageInfo.VersionCode.ToString(); // undo play store version garbling return new Version(int.Parse(versionName.Substring(0, 4)), int.Parse(versionName.Substring(4, 4)), int.Parse(versionName.Substring(8, 1))); } catch { } return new Version(packageInfo.VersionName); } } protected override void LoadComplete() { base.LoadComplete(); Add(new SimpleUpdateManager()); } } }
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. using System; using Android.App; using osu.Game; namespace osu.Android { public class OsuGameAndroid : OsuGame { public override Version AssemblyVersion { get { string versionName = Application.Context.ApplicationContext.PackageManager.GetPackageInfo(Application.Context.ApplicationContext.PackageName, 0).VersionCode.ToString(); try { // undo play store version garbling return new Version(int.Parse(versionName.Substring(0, 4)), int.Parse(versionName.Substring(4, 4)), int.Parse(versionName.Substring(8, 1))); } catch { } return new Version(versionName); } } } }
mit
C#
461ccf361322156e9587d88422bf2a64120a46a6
Make foreign key converter thread-safe.
ZhangLeiCharles/mobile,eatskolnikov/mobile,eatskolnikov/mobile,masterrr/mobile,peeedge/mobile,ZhangLeiCharles/mobile,masterrr/mobile,peeedge/mobile,eatskolnikov/mobile
Phoebe/Data/ForeignKeyJsonConverter.cs
Phoebe/Data/ForeignKeyJsonConverter.cs
using System; using Newtonsoft.Json; namespace Toggl.Phoebe.Data { public class ForeignKeyJsonConverter : JsonConverter { public override void WriteJson (JsonWriter writer, object value, JsonSerializer serializer) { var model = (Model)value; if (model == null) { writer.WriteNull (); return; } writer.WriteValue (model.RemoteId); } public override object ReadJson (JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) { if (reader.TokenType == JsonToken.Null) { return null; } var remoteId = Convert.ToInt64 (reader.Value); lock (Model.SyncRoot) { var model = Model.Manager.GetByRemoteId (objectType, remoteId); if (model == null) { model = (Model)Activator.CreateInstance (objectType); model.RemoteId = remoteId; model.ModifiedAt = new DateTime (); model = Model.Update (model); } return model; } } public override bool CanConvert (Type objectType) { return objectType.IsSubclassOf (typeof(Model)); } } }
using System; using Newtonsoft.Json; namespace Toggl.Phoebe.Data { public class ForeignKeyJsonConverter : JsonConverter { public override void WriteJson (JsonWriter writer, object value, JsonSerializer serializer) { var model = (Model)value; if (model == null) { writer.WriteNull (); return; } writer.WriteValue (model.RemoteId); } public override object ReadJson (JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) { if (reader.TokenType == JsonToken.Null) { return null; } var remoteId = Convert.ToInt64 (reader.Value); var model = Model.Manager.GetByRemoteId (objectType, remoteId); if (model == null) { model = (Model)Activator.CreateInstance (objectType); model.RemoteId = remoteId; model.ModifiedAt = new DateTime (); model = Model.Update (model); } return model; } public override bool CanConvert (Type objectType) { return objectType.IsSubclassOf (typeof(Model)); } } }
bsd-3-clause
C#
c5b73e4c7971eac30de0bcadb1ff6580e2d4c7e8
Update SkillsController.cs
NinjaVault/NinjaHive,NinjaVault/NinjaHive
NinjaHive.WebApp/Controllers/SkillsController.cs
NinjaHive.WebApp/Controllers/SkillsController.cs
using System; using System.Web.Mvc; using NinjaHive.Contract.Commands; using NinjaHive.Contract.DTOs; using NinjaHive.Contract.Queries; using NinjaHive.Core; using NinjaHive.WebApp.Services; namespace NinjaHive.WebApp.Controllers { public class SkillsController : Controller { private readonly IQueryProcessor queryProcessor; private readonly ICommandHandler<EditSkillCommand> editSkillCommandHandler; private readonly ICommandHandler<DeleteSkillCommand> deleteSkillCommandHandler; private readonly ICommandHandler<EditStatCommand> editStatCommandHandler; private readonly ICommandHandler<DeleteStatCommand> deleteStatCommand; public SkillsController( IQueryProcessor queryProcessor, ICommandHandler<EditSkillCommand> editSkillCommandHandler, ICommandHandler<DeleteSkillCommand> deleteSkillCommandHandler, ICommandHandler<EditStatCommand> editStatCommandHandler, ICommandHandler<DeleteStatCommand> deleteStatCommandHandler) { this.queryProcessor = queryProcessor; this.editSkillCommandHandler = editSkillCommandHandler; this.deleteSkillCommandHandler = deleteSkillCommandHandler; this.editStatCommandHandler = editStatCommandHandler; this.deleteStatCommand = deleteStatCommand; } // GET: Skills public ActionResult Index() { var skills = this.queryProcessor.Execute(new GetAllSkillsQuery()); return View(skills); } public ActionResult Edit(Guid skillId) { var skill = this.queryProcessor.Execute(new GetEntityByIdQuery<Skill>(skillId)); return View(skill); } public ActionResult Create() { return View(); } [HttpPost] public ActionResult Create(Skill skill) { skill.Id = Guid.NewGuid(); var command = new EditSkillCommand(skill, createNew: true); this.editSkillCommandHandler.Handle(command); var redirectUri = UrlProvider<SkillsController>.GetRouteValues(c => c.Index()); return RedirectToRoute(redirectUri); } public ActionResult Delete(Skill skill) { var command = new DeleteSkillCommand() { Skill = skill }; deleteSkillCommandHandler.Handle(command); var redirectUri = UrlProvider<SkillsController>.GetRouteValues(c => c.Index()); return RedirectToRoute(redirectUri); } } }
using System; using System.Web.Mvc; using NinjaHive.Contract.Commands; using NinjaHive.Contract.DTOs; using NinjaHive.Contract.Queries; using NinjaHive.Core; using NinjaHive.WebApp.Services; namespace NinjaHive.WebApp.Controllers { public class SkillsController : Controller { private readonly IQueryProcessor queryProcessor; private readonly ICommandHandler<EditSkillCommand> editSkillCommandHandler; private readonly ICommandHandler<DeleteSkillCommand> deleteSkillCommandHandler; public SkillsController( IQueryProcessor queryProcessor, ICommandHandler<EditSkillCommand> editSkillCommandHandler, ICommandHandler<DeleteSkillCommand> deleteSkillCommandHandler) { this.queryProcessor = queryProcessor; this.editSkillCommandHandler = editSkillCommandHandler; this.deleteSkillCommandHandler = deleteSkillCommandHandler; } // GET: Skills public ActionResult Index() { var skills = this.queryProcessor.Execute(new GetAllSkillsQuery()); return View(skills); } public ActionResult Edit(Guid skillId) { var skill = this.queryProcessor.Execute(new GetEntityByIdQuery<Skill>(skillId)); return View(skill); } public ActionResult Create() { return View(); } [HttpPost] public ActionResult Create(Skill skill) { skill.Id = Guid.NewGuid(); var command = new EditSkillCommand(skill, createNew: true); this.editSkillCommandHandler.Handle(command); var redirectUri = UrlProvider<SkillsController>.GetRouteValues(c => c.Index()); return RedirectToRoute(redirectUri); } public ActionResult Delete(Skill skill) { var command = new DeleteSkillCommand() { Skill = skill }; deleteSkillCommandHandler.Handle(command); var redirectUri = UrlProvider<SkillsController>.GetRouteValues(c => c.Index()); return RedirectToRoute(redirectUri); } } }
apache-2.0
C#
8c571a8100327491aa05b681445837466ce291d8
Remove imports
mikemajesty/coolvalidator
CoolValidator/Errors.cs
CoolValidator/Errors.cs
namespace CoolValidator { public class Errors { public string Erro { get; set; } public string Field { get; set; } } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace CoolValidator { public class Errors { public string Erro { get; set; } public string Field { get; set; } } }
mit
C#
716deb43b305554e696ace5c44d5ee260f0c68f5
update nuget
weitaolee/Orleans.EventSourcing
Orleans.EventSourcing/Properties/AssemblyInfo.cs
Orleans.EventSourcing/Properties/AssemblyInfo.cs
using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // 有关程序集的常规信息通过以下 // 特性集控制。更改这些特性值可修改 // 与程序集关联的信息。 [assembly: AssemblyTitle("Orleans.EventSourcing")] [assembly: AssemblyDescription("Orleans Event-Sourcing Libary")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Witte Lee")] [assembly: AssemblyProduct("Orleans.EventSourcing")] [assembly: AssemblyCopyright("Copyright © Witte Lee 2014")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // 将 ComVisible 设置为 false 使此程序集中的类型 // 对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型, // 则将该类型上的 ComVisible 特性设置为 true。 [assembly: ComVisible(false)] // 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID [assembly: Guid("f82b183c-c122-4e97-825a-636770f135d9")] // 程序集的版本信息由下面四个值组成: // // 主版本 // 次版本 // 生成号 // 修订号 // // 可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值, // 方法是按如下所示使用“*”: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.3.0")] [assembly: AssemblyFileVersion("1.0.3.0")]
using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // 有关程序集的常规信息通过以下 // 特性集控制。更改这些特性值可修改 // 与程序集关联的信息。 [assembly: AssemblyTitle("Orleans.EventSourcing")] [assembly: AssemblyDescription("Orleans Event-Sourcing Libary")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Witte Lee")] [assembly: AssemblyProduct("Orleans.EventSourcing")] [assembly: AssemblyCopyright("Copyright © Witte Lee 2014")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // 将 ComVisible 设置为 false 使此程序集中的类型 // 对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型, // 则将该类型上的 ComVisible 特性设置为 true。 [assembly: ComVisible(false)] // 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID [assembly: Guid("f82b183c-c122-4e97-825a-636770f135d9")] // 程序集的版本信息由下面四个值组成: // // 主版本 // 次版本 // 生成号 // 修订号 // // 可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值, // 方法是按如下所示使用“*”: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.2.5")] [assembly: AssemblyFileVersion("1.0.2.5")]
mit
C#
7059310993543eadf31a94b6178d9790fa466de0
Implement rest call to get teams.
makmu/outlook-matters,makmu/outlook-matters
OutlookMatters.Core/Mattermost/v4/RestService.cs
OutlookMatters.Core/Mattermost/v4/RestService.cs
using System; using System.Collections.Generic; using Newtonsoft.Json; using OutlookMatters.Core.Http; using OutlookMatters.Core.Mattermost.v4.Interface; namespace OutlookMatters.Core.Mattermost.v4 { public class RestService : IRestService { private readonly IHttpClient _httpClient; public RestService(IHttpClient httpClient) { _httpClient = httpClient; } public void Login(Uri baseUri, Login login, out string token) { var loginUrl = new Uri(baseUri, "api/v4/users/login"); using (var response = _httpClient.Request(loginUrl) .WithContentType("application/json") .Post(JsonConvert.SerializeObject(login))) { token = response.GetHeaderValue("Token"); } } public IEnumerable<Team> GetTeams(Uri baseUri, string token) { var teamsUrl = new Uri(baseUri, "api/v4/teams"); using (var response = _httpClient.Request(teamsUrl) .WithHeader("Authorization", "Bearer " + token) .Get()) { var payload = response.GetPayload(); return JsonConvert.DeserializeObject<IEnumerable<Team>>(payload); } } } }
using System; using System.Collections.Generic; using Newtonsoft.Json; using OutlookMatters.Core.Http; using OutlookMatters.Core.Mattermost.v4.Interface; namespace OutlookMatters.Core.Mattermost.v4 { public class RestService : IRestService { private readonly IHttpClient _httpClient; public RestService(IHttpClient httpClient) { _httpClient = httpClient; } public void Login(Uri baseUri, Login login, out string token) { var loginUrl = new Uri(baseUri, "api/v4/users/login"); using (var response = _httpClient.Request(loginUrl) .WithContentType("text/json") .Post(JsonConvert.SerializeObject(login))) { token = response.GetHeaderValue("Token"); } } public IEnumerable<Team> GetTeams(Uri baseUri, string token) { throw new NotImplementedException(); } } }
mit
C#
2959a622fbca88acb7c2df638c43bea4ecf372ad
Fix import error in demo.
justinjstark/Verdeler,justinjstark/Delivered
Demo/Program.cs
Demo/Program.cs
using System; using System.Collections.Generic; using Demo.Endpoints.FileSystem; using Demo.Endpoints.Sharepoint; using Distributor; namespace Demo { internal class Program { private static void Main(string[] args) { var distributables = new List<DistributableFile> { new DistributableFile { Id = Guid.NewGuid(), ProfileName = "TestProfile", Name = "test.pdf", Contents = null } }; //Configure the distributor var distributor = new Distributor<DistributableFile>(); distributor.EndpointDeliveryServices.Add(new SharepointDeliveryService()); distributor.EndpointDeliveryServices.Add(new FileSystemDeliveryService()); //Run the Distributor distributor.Distribute(distributables); Console.ReadLine(); } } }
using System; using System.Collections.Generic; using Demo.Endpoints; using Distributor; namespace Demo { internal class Program { private static void Main(string[] args) { var distributables = new List<DistributableFile> { new DistributableFile { Id = Guid.NewGuid(), ProfileName = "TestProfile", Name = "test.pdf", Contents = null } }; //Configure the distributor var distributor = new Distributor<DistributableFile>(); distributor.EndpointDeliveryServices.Add(new SharepointDeliveryService()); distributor.EndpointDeliveryServices.Add(new FileSystemDeliveryService()); //Run the Distributor distributor.Distribute(distributables); Console.ReadLine(); } } }
mit
C#
0f326023716fc4558f154e04647de4c70c6bdd46
Fix bug with TextItem alpha
golf1052/GLX
GLX/TextItem.cs
GLX/TextItem.cs
using System; using System.Collections.Generic; using System.Linq; using System.Text; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; namespace GLX { public class TextItem : SpriteBase { public SpriteFont font; string _text; public string text { get { return _text; } set { _text = value; textSize = font.MeasureString(_text); } } public Vector2 textSize { get; private set; } public TextItem(SpriteFont loadedFont, string spriteText = "") { font = loadedFont; text = spriteText; position = Vector2.Zero; velocity = Vector2.Zero; rectangle = new Rectangle((int)Math.Round(position.X), (int)Math.Round(position.Y), (int)Math.Round(textSize.X), (int)Math.Round(textSize.Y)); visible = true; color = Color.White; alpha = 1.0f; rotation = 0.0f; scale = 1.0f; origin = new Vector2(textSize.X / 2, textSize.Y / 2); } public override void Update() { position += velocity; rectangle = new Rectangle((int)Math.Round(position.X), (int)Math.Round(position.Y), (int)Math.Round(textSize.X), (int)Math.Round(textSize.Y)); } public override void Draw(SpriteBatch spriteBatch) { spriteBatch.DrawString(font, text, position, color * alpha, rotation, origin, scale, SpriteEffects.None, 0); } } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; namespace GLX { public class TextItem : SpriteBase { public SpriteFont font; string _text; public string text { get { return _text; } set { _text = value; textSize = font.MeasureString(_text); } } public Vector2 textSize { get; private set; } public TextItem(SpriteFont loadedFont, string spriteText = "") { font = loadedFont; text = spriteText; position = Vector2.Zero; velocity = Vector2.Zero; rectangle = new Rectangle((int)Math.Round(position.X), (int)Math.Round(position.Y), (int)Math.Round(textSize.X), (int)Math.Round(textSize.Y)); visible = true; color = Color.White; alpha = 1.0f; rotation = 0.0f; scale = 1.0f; origin = new Vector2(textSize.X / 2, textSize.Y / 2); } public override void Update() { position += velocity; rectangle = new Rectangle((int)Math.Round(position.X), (int)Math.Round(position.Y), (int)Math.Round(textSize.X), (int)Math.Round(textSize.Y)); } public override void Draw(SpriteBatch spriteBatch) { spriteBatch.DrawString(font, text, position, color, rotation, origin, scale, SpriteEffects.None, 0); } } }
mit
C#
262b584b6a7809d0544c4cd441be1692c2aa3095
update version to 1.0.6
DevExpress/BigQueryProvider
BigQueryProvider/Properties/AssemblyInfo.cs
BigQueryProvider/Properties/AssemblyInfo.cs
using System.Reflection; using System.Runtime.InteropServices; [assembly: AssemblyTitle("DevExpress.DataAccess.BigQuery")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("DevExpress.DataAccess.BigQuery")] [assembly: AssemblyCopyright("Copyright © 2015")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] [assembly: ComVisible(false)] [assembly: AssemblyVersion("1.0.6.0")] [assembly: AssemblyFileVersion("1.0.6.0")]
using System.Reflection; using System.Runtime.InteropServices; [assembly: AssemblyTitle("DevExpress.DataAccess.BigQuery")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("DevExpress.DataAccess.BigQuery")] [assembly: AssemblyCopyright("Copyright © 2015")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] [assembly: ComVisible(false)] [assembly: AssemblyVersion("1.0.5.0")] [assembly: AssemblyFileVersion("1.0.5.0")]
apache-2.0
C#
693dcdb9f32f4cae86590e68b825f353675a7bd4
Update WilliamRodriguez.cs
MabroukENG/planetxamarin,stvansolano/planetxamarin,planetxamarin/planetxamarin,planetxamarin/planetxamarin,stvansolano/planetxamarin,stvansolano/planetxamarin,beraybentesen/planetxamarin,MabroukENG/planetxamarin,beraybentesen/planetxamarin,planetxamarin/planetxamarin,beraybentesen/planetxamarin,planetxamarin/planetxamarin,MabroukENG/planetxamarin
src/Firehose.Web/Authors/WilliamRodriguez.cs
src/Firehose.Web/Authors/WilliamRodriguez.cs
using Firehose.Web.Infrastructure; using System; using System.Linq; using System.Collections.Generic; using System.ServiceModel.Syndication; namespace Firehose.Web.Authors { public class WilliamRodriguez : IAmAMicrosoftMVP, IAmAXamarinMVP { public string FirstName => "William"; public string LastName => "Rodriguez"; public string Title => "C# mobile developer and community enthusiast"; public string StateOrRegion => "Curitiba, Brasil"; public string TwitterHandle => "williamsrodz"; public string EmailAddress => "ping@williamsrz.com.br"; public string GravatarHash => "c8f3160f0a24c13821d14b8848d62cea"; DateTime IAmAMicrosoftMVP.FirstAwarded => new DateTime(2016, 4, 1); DateTime IAmAXamarinMVP.FirstAwarded => new DateTime(2016, 5, 27); public Uri WebSite => new Uri("http://www.williamsrz.com.br"); public IEnumerable<Uri> FeedUris { get { yield return new Uri("http://www.williamsrz.com.br/rss"); } } public bool Filter(SyndicationItem item) => item.Title.Text.ToLowerInvariant().Contains("xamarin") || item.Categories.Any(category => category.Name.ToLowerInvariant().Contains("xamarin")); } }
using Firehose.Web.Infrastructure; using System; using System.Linq; using System.Collections.Generic; using System.ServiceModel.Syndication; namespace Firehose.Web.Authors { public class WilliamRodriguez : IAmAMicrosoftMVP, IAmAXamarinMVP { public string FirstName => "William"; public string LastName => "Rodriguez"; public string Title => "C# mobile developer, community enthusiast, Microsoft & Xamarin MVP."; public string StateOrRegion => "Curitiba, Brasil"; public string TwitterHandle => "williamsrodz"; public string EmailAddress => "ping@williamsrz.com.br"; public string GravatarHash => "c8f3160f0a24c13821d14b8848d62cea"; DateTime IAmAMicrosoftMVP.FirstAwarded => new DateTime(2016, 4, 1); DateTime IAmAXamarinMVP.FirstAwarded => new DateTime(2016, 5, 27); public Uri WebSite => new Uri("http://www.williamsrz.com.br"); public IEnumerable<Uri> FeedUris { get { yield return new Uri("http://www.williamsrz.com.br/rss"); } } public bool Filter(SyndicationItem item) => item.Title.Text.ToLowerInvariant().Contains("xamarin") || item.Categories.Any(category => category.Name.ToLowerInvariant().Contains("xamarin")); } }
mit
C#
b78b2900dfe3dc835e0e79f6e542672826bdbc9a
Adjust GitStatusOptions to match structure of native libgit2
PKRoma/libgit2sharp,libgit2/libgit2sharp
LibGit2Sharp/Core/GitStatusOptions.cs
LibGit2Sharp/Core/GitStatusOptions.cs
using System; using System.Runtime.InteropServices; namespace LibGit2Sharp.Core { [StructLayout(LayoutKind.Sequential)] internal class GitStatusOptions : IDisposable { public uint Version = 1; public GitStatusShow Show; public GitStatusOptionFlags Flags; public GitStrArrayManaged PathSpec; public IntPtr Baseline = IntPtr.Zero; public void Dispose() { PathSpec.Dispose(); } } internal enum GitStatusShow { IndexAndWorkDir = 0, IndexOnly = 1, WorkDirOnly = 2, } [Flags] internal enum GitStatusOptionFlags { IncludeUntracked = (1 << 0), IncludeIgnored = (1 << 1), IncludeUnmodified = (1 << 2), ExcludeSubmodules = (1 << 3), RecurseUntrackedDirs = (1 << 4), DisablePathspecMatch = (1 << 5), RecurseIgnoredDirs = (1 << 6), RenamesHeadToIndex = (1 << 7), RenamesIndexToWorkDir = (1 << 8), SortCaseSensitively = (1 << 9), SortCaseInsensitively = (1 << 10), RenamesFromRewrites = (1 << 11), NoRefresh = (1 << 12), UpdateIndex = (1 << 13), IncludeUnreadable = (1 << 14), IncludeUnreadableAsUntracked = (1 << 15), } }
using System; using System.Runtime.InteropServices; namespace LibGit2Sharp.Core { [StructLayout(LayoutKind.Sequential)] internal class GitStatusOptions : IDisposable { public uint Version = 1; public GitStatusShow Show; public GitStatusOptionFlags Flags; public GitStrArrayManaged PathSpec; public void Dispose() { PathSpec.Dispose(); } } internal enum GitStatusShow { IndexAndWorkDir = 0, IndexOnly = 1, WorkDirOnly = 2, } [Flags] internal enum GitStatusOptionFlags { IncludeUntracked = (1 << 0), IncludeIgnored = (1 << 1), IncludeUnmodified = (1 << 2), ExcludeSubmodules = (1 << 3), RecurseUntrackedDirs = (1 << 4), DisablePathspecMatch = (1 << 5), RecurseIgnoredDirs = (1 << 6), RenamesHeadToIndex = (1 << 7), RenamesIndexToWorkDir = (1 << 8), SortCaseSensitively = (1 << 9), SortCaseInsensitively = (1 << 10), RenamesFromRewrites = (1 << 11), NoRefresh = (1 << 12), UpdateIndex = (1 << 13), IncludeUnreadable = (1 << 14), IncludeUnreadableAsUntracked = (1 << 15), } }
mit
C#
3284266192461ae5a55c1079ae131f302fb26535
Swap human/zombie spawn input so you can spawn zombies on touch screens
futurechris/zombai
Assets/Scripts/UserInput.cs
Assets/Scripts/UserInput.cs
using UnityEngine; using UnityEngine.EventSystems; using System.Collections; public class UserInput : MonoBehaviour, IPointerClickHandler { // void Start(){} // void Update(){} // Mutually exclusive for now, priority is in the following order: // Left click for human, // Right for zombie, // Middle for corpse public void OnPointerClick(PointerEventData e) { if(e.button == PointerEventData.InputButton.Left) { FindObjectOfType<AgentDirector>().spawnAgent(Agent.AgentType.ZOMBIE, Camera.main.ScreenToWorldPoint(e.position)); } else if(e.button == PointerEventData.InputButton.Right) { FindObjectOfType<AgentDirector>().spawnAgent(Agent.AgentType.HUMAN, Camera.main.ScreenToWorldPoint(e.position)); } else if(e.button == PointerEventData.InputButton.Middle) { FindObjectOfType<AgentDirector>().spawnAgent(Agent.AgentType.CORPSE, Camera.main.ScreenToWorldPoint(e.position)); } } }
using UnityEngine; using UnityEngine.EventSystems; using System.Collections; public class UserInput : MonoBehaviour, IPointerClickHandler { // void Start(){} // void Update(){} // Mutually exclusive for now, priority is in the following order: // Left click for human, // Right for zombie, // Middle for corpse public void OnPointerClick(PointerEventData e) { if(e.button == PointerEventData.InputButton.Left) { FindObjectOfType<AgentDirector>().spawnAgent(Agent.AgentType.HUMAN, Camera.main.ScreenToWorldPoint(e.position)); } else if(e.button == PointerEventData.InputButton.Right) { FindObjectOfType<AgentDirector>().spawnAgent(Agent.AgentType.ZOMBIE, Camera.main.ScreenToWorldPoint(e.position)); } else if(e.button == PointerEventData.InputButton.Middle) { FindObjectOfType<AgentDirector>().spawnAgent(Agent.AgentType.CORPSE, Camera.main.ScreenToWorldPoint(e.position)); } } }
mit
C#
ed6c3e80233af477dedfd65f7a167f4252133a7d
Replace default parameter with overload
MHeasell/Mappy,MHeasell/Mappy
Mappy/UI/Drawables/DrawableBandbox.cs
Mappy/UI/Drawables/DrawableBandbox.cs
namespace Mappy.UI.Drawables { using System; using System.Drawing; public class DrawableBandbox : IDrawable, IDisposable { private readonly Brush fillBrush; private readonly Pen borderPen; public DrawableBandbox(Brush fillBrush, Pen borderPen, Size size) { this.fillBrush = fillBrush; this.borderPen = borderPen; this.Size = size; } public Size Size { get; private set; } public int Width { get { return this.Size.Width; } } public int Height { get { return this.Size.Height; } } public static DrawableBandbox CreateSimple(Size size, Color color, Color borderColor) { return CreateSimple(size, color, borderColor, 1); } public static DrawableBandbox CreateSimple( Size size, Color color, Color borderColor, int borderWidth) { return new DrawableBandbox( new SolidBrush(color), new Pen(borderColor, borderWidth), size); } public void Draw(Graphics graphics, Rectangle clipRectangle) { graphics.FillRectangle(this.fillBrush, 0, 0, this.Width - 1, this.Height - 1); graphics.DrawRectangle(this.borderPen, 0, 0, this.Width - 1, this.Height - 1); } public void Dispose() { this.Dispose(true); GC.SuppressFinalize(this); } protected virtual void Dispose(bool disposing) { if (disposing) { this.fillBrush.Dispose(); this.borderPen.Dispose(); } } } }
namespace Mappy.UI.Drawables { using System; using System.Drawing; public class DrawableBandbox : IDrawable, IDisposable { private readonly Brush fillBrush; private readonly Pen borderPen; public DrawableBandbox(Brush fillBrush, Pen borderPen, Size size) { this.fillBrush = fillBrush; this.borderPen = borderPen; this.Size = size; } public Size Size { get; private set; } public int Width { get { return this.Size.Width; } } public int Height { get { return this.Size.Height; } } public static DrawableBandbox CreateSimple( Size size, Color color, Color borderColor, int borderWidth = 1) { return new DrawableBandbox( new SolidBrush(color), new Pen(borderColor, borderWidth), size); } public void Draw(Graphics graphics, Rectangle clipRectangle) { graphics.FillRectangle(this.fillBrush, 0, 0, this.Width - 1, this.Height - 1); graphics.DrawRectangle(this.borderPen, 0, 0, this.Width - 1, this.Height - 1); } public void Dispose() { this.Dispose(true); GC.SuppressFinalize(this); } protected virtual void Dispose(bool disposing) { if (disposing) { this.fillBrush.Dispose(); this.borderPen.Dispose(); } } } }
mit
C#
5c3b92bcae05111479950478d1173ae92c37d749
Increase version to 1.9 to reflect the new AdhocQuery capability change.
G3N7/MonJobs
MonJobs/Properties/AssemblyInfo.cs
MonJobs/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("MonJobs")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("MonJobs")] [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("763b7fef-ff24-407d-8dce-5313e6129941")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.9.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("MonJobs")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("MonJobs")] [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("763b7fef-ff24-407d-8dce-5313e6129941")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.8.0.0")]
mit
C#
348e7a5a6a2a6a66f46cb1f9ac7ef23851d79ca8
Use *our* serialiser!
modulexcite/DartVS,modulexcite/DartVS,modulexcite/DartVS,DartVS/DartVS,DartVS/DartVS,DartVS/DartVS
DanTup.DartAnalysis/Infrastructure/Event.cs
DanTup.DartAnalysis/Infrastructure/Event.cs
 namespace DanTup.DartAnalysis { /// <summary> /// Represents an event raised by the Analysis Service that has /// type parameters. /// </summary> /// <typeparam name="TParams">The type of the paramters for this event.</typeparam> class Event<TParams> : Event { public TParams @params = default(TParams); } /// <summary> /// Represents an event raised by the Analysis Service. /// </summary> class Event { public string @event = null; #region Equality checks // Since we know these objects are serialisable, this is a quick-but-hacky way of checking for structural equality. // TODO: Make this better (or convert to F#? ;)) public override bool Equals(object obj) { if (obj == null) return false; var serialiser = new JsonSerialiser(); return serialiser.Serialise(this).Equals(serialiser.Serialise(obj)); } public override int GetHashCode() { var serialiser = new JsonSerialiser(); return serialiser.Serialise(this).GetHashCode(); } #endregion } }
using System.Web.Script.Serialization; namespace DanTup.DartAnalysis { /// <summary> /// Represents an event raised by the Analysis Service that has /// type parameters. /// </summary> /// <typeparam name="TParams">The type of the paramters for this event.</typeparam> class Event<TParams> : Event { public TParams @params = default(TParams); } /// <summary> /// Represents an event raised by the Analysis Service. /// </summary> class Event { public string @event = null; #region Equality checks // Since we know these objects are serialisable, this is a quick-but-hacky way of checking for structural equality. // TODO: Make this better (or convert to F#? ;)) public override bool Equals(object obj) { if (obj == null) return false; var serialiser = new JavaScriptSerializer(); return serialiser.Serialize(this).Equals(serialiser.Serialize(obj)); } public override int GetHashCode() { var serialiser = new JavaScriptSerializer(); return serialiser.Serialize(this).GetHashCode(); } #endregion } }
mit
C#
479a1b7d5339fa1144a488cdf359b0d18a8a9800
Move local function.
FacilityApi/Facility
tools/Build/Build.cs
tools/Build/Build.cs
using System; using System.IO; using System.Linq; using System.Text.RegularExpressions; using Faithlife.Build; using static Faithlife.Build.AppRunner; using static Faithlife.Build.BuildUtility; using static Faithlife.Build.DotNetRunner; internal static class Build { public static int Main(string[] args) => BuildRunner.Execute(args, build => { var dotNetTools = new DotNetTools(Path.Combine("tools", "bin")).AddSource(Path.Combine("tools", "bin")); var dotNetBuildSettings = new DotNetBuildSettings { DocsSettings = new DotNetDocsSettings { GitLogin = new GitLoginInfo("FacilityApiBot", Environment.GetEnvironmentVariable("BUILD_BOT_PASSWORD") ?? ""), GitAuthor = new GitAuthorInfo("FacilityApiBot", "facilityapi@gmail.com"), SourceCodeUrl = "https://github.com/FacilityApi/Facility/tree/master/src", }, DotNetTools = dotNetTools, ProjectUsesSourceLink = name => !name.StartsWith("fsdgen", StringComparison.Ordinal), }; build.AddDotNetTargets(dotNetBuildSettings); build.Target("codegen") .DependsOn("build") .Does(() => codeGen(verify: false)); build.Target("verify-codegen") .DependsOn("build") .Does(() => codeGen(verify: true)); build.Target("test") .DependsOn("verify-codegen"); build.Target("default") .DependsOn("build"); void codeGen(bool verify) { string configuration = dotNetBuildSettings.BuildOptions.ConfigurationOption.Value; string versionSuffix = $"cg{DateTime.UtcNow:yyyyMMddHHmmss}"; RunDotNet("pack", Path.Combine("src", "fsdgenfsd", "fsdgenfsd.csproj"), "-c", configuration, "--no-build", "--output", Path.GetFullPath(Path.Combine("tools", "bin")), "--version-suffix", versionSuffix); string packagePath = FindFiles($"tools/bin/fsdgenfsd.*-{versionSuffix}.nupkg").Single(); string packageVersion = Regex.Match(packagePath, @"[/\\][^/\\]*\.([0-9]+\.[0-9]+\.[0-9]+(-.+)?)\.nupkg$").Groups[1].Value; string toolPath = dotNetTools.GetToolPath($"fsdgenfsd/{packageVersion}"); string verifyOption = verify ? "--verify" : null; RunApp(toolPath, "example/ExampleApi.fsd", "example/output", verifyOption); if (verify) RunApp(toolPath, "example/ExampleApi.fsd.md", "example/output", verifyOption); RunApp(toolPath, "example/ExampleApi.fsd", "example/output/ExampleApi-nowidgets.fsd", "--excludeTag", "widgets", verifyOption); if (verify) RunApp(toolPath, "example/ExampleApi.fsd.md", "example/output/ExampleApi-nowidgets.fsd", "--excludeTag", "widgets", verifyOption); } }); }
using System; using System.IO; using System.Linq; using System.Text.RegularExpressions; using Faithlife.Build; using static Faithlife.Build.AppRunner; using static Faithlife.Build.BuildUtility; using static Faithlife.Build.DotNetRunner; internal static class Build { public static int Main(string[] args) => BuildRunner.Execute(args, build => { var dotNetTools = new DotNetTools(Path.Combine("tools", "bin")).AddSource(Path.Combine("tools", "bin")); var dotNetBuildSettings = new DotNetBuildSettings { DocsSettings = new DotNetDocsSettings { GitLogin = new GitLoginInfo("FacilityApiBot", Environment.GetEnvironmentVariable("BUILD_BOT_PASSWORD") ?? ""), GitAuthor = new GitAuthorInfo("FacilityApiBot", "facilityapi@gmail.com"), SourceCodeUrl = "https://github.com/FacilityApi/Facility/tree/master/src", }, DotNetTools = dotNetTools, ProjectUsesSourceLink = name => !name.StartsWith("fsdgen", StringComparison.Ordinal), }; build.AddDotNetTargets(dotNetBuildSettings); void codeGen(bool verify) { string configuration = dotNetBuildSettings.BuildOptions.ConfigurationOption.Value; string versionSuffix = $"cg{DateTime.UtcNow:yyyyMMddHHmmss}"; RunDotNet("pack", Path.Combine("src", "fsdgenfsd", "fsdgenfsd.csproj"), "-c", configuration, "--no-build", "--output", Path.GetFullPath(Path.Combine("tools", "bin")), "--version-suffix", versionSuffix); string packagePath = FindFiles($"tools/bin/fsdgenfsd.*-{versionSuffix}.nupkg").Single(); string packageVersion = Regex.Match(packagePath, @"[/\\][^/\\]*\.([0-9]+\.[0-9]+\.[0-9]+(-.+)?)\.nupkg$").Groups[1].Value; string toolPath = dotNetTools.GetToolPath($"fsdgenfsd/{packageVersion}"); string verifyOption = verify ? "--verify" : null; RunApp(toolPath, "example/ExampleApi.fsd", "example/output", verifyOption); if (verify) RunApp(toolPath, "example/ExampleApi.fsd.md", "example/output", verifyOption); RunApp(toolPath, "example/ExampleApi.fsd", "example/output/ExampleApi-nowidgets.fsd", "--excludeTag", "widgets", verifyOption); if (verify) RunApp(toolPath, "example/ExampleApi.fsd.md", "example/output/ExampleApi-nowidgets.fsd", "--excludeTag", "widgets", verifyOption); } build.Target("codegen") .DependsOn("build") .Does(() => codeGen(verify: false)); build.Target("verify-codegen") .DependsOn("build") .Does(() => codeGen(verify: true)); build.Target("test") .DependsOn("verify-codegen"); build.Target("default") .DependsOn("build"); }); }
mit
C#
d4027ad4c3fdaa0f942da0bbc64965b60209c2dc
Set thread culture
ankurMalhotra/shouldly,chaitanyagurrapu/shouldly,JoeMighty/shouldly,AmadeusW/shouldly
src/Shouldly.Tests/TestHelpers/ShouldlyShouldFailureTestScenario.cs
src/Shouldly.Tests/TestHelpers/ShouldlyShouldFailureTestScenario.cs
using System.Globalization; using System.Threading; using NUnit.Framework; namespace Shouldly.Tests.TestHelpers { [TestFixture] public abstract class ShouldlyShouldFailureTestScenario { protected abstract void ShouldThrowAWobbly(); protected abstract string ChuckedAWobblyErrorMessage { get; } [TestFixtureSetUp] public void Setup() { Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture("en-GB"); } [Test] public void ShouldMethodShouldThrowAWobbly() { Should.Error(ShouldThrowAWobbly, ChuckedAWobblyErrorMessage); } } }
using NUnit.Framework; namespace Shouldly.Tests.TestHelpers { [TestFixture] public abstract class ShouldlyShouldFailureTestScenario { protected abstract void ShouldThrowAWobbly(); protected abstract string ChuckedAWobblyErrorMessage { get; } [Test] public void ShouldMethodShouldThrowAWobbly() { Should.Error(ShouldThrowAWobbly, ChuckedAWobblyErrorMessage); } } }
bsd-3-clause
C#
08e5a6c5f8db6ff7c66ccdd9eea0b37c32419620
Handle IPv4 Address and IPv6 Address
PatrickMcDonald/McIP
McIP/Program.cs
McIP/Program.cs
namespace McIP { using System; using System.Diagnostics; using System.IO; public static class Program { public static void Main() { var si = new ProcessStartInfo("ipconfig", "/all") { RedirectStandardOutput = true, UseShellExecute = false }; var p = Process.Start(si); StreamReader reader = p.StandardOutput; string heading = string.Empty; bool headingPrinted = false; string line; while ((line = reader.ReadLine()) != null) { if (!string.IsNullOrEmpty(line) && !line.StartsWith(" ", StringComparison.Ordinal)) { heading = line; headingPrinted = false; } if (line.ContainsAny("IP Address", "IPv4 Address", "IPv6 Address")) { if (!headingPrinted) { Console.WriteLine(); Console.WriteLine(heading); headingPrinted = true; } Console.WriteLine(line); } } } private static bool ContainsAny(this string target, params string[] values) { if (values == null) { throw new ArgumentNullException("values"); } foreach (var value in values) { if (target.Contains(value)) { return true; } } return false; } } }
namespace McIP { using System; using System.Diagnostics; using System.IO; public static class Program { public static void Main() { var si = new ProcessStartInfo("ipconfig", "/all") { RedirectStandardOutput = true, UseShellExecute = false }; var p = Process.Start(si); StreamReader reader = p.StandardOutput; string heading = string.Empty; string line; while ((line = reader.ReadLine()) != null) { if (!string.IsNullOrEmpty(line) && !line.StartsWith(" ", StringComparison.Ordinal)) { heading = line; } if (line.Contains("IP Address")) { Console.WriteLine(heading); Console.WriteLine(line); Console.WriteLine(); } } } } }
mit
C#
407e7144b4885693a46f73b58673fd1973ed87c3
add CsvRowReaderTest
nabehiro/TableIO
TableIO.Tests/CsvRowReaderTests.cs
TableIO.Tests/CsvRowReaderTests.cs
using Microsoft.VisualStudio.TestTools.UnitTesting; using TableIO; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.IO; namespace TableIO.Tests { [TestClass()] public class CsvRowReaderTests { [TestMethod()] public void ReadTest() { var sr = new StringReader("aaa,aaa,aaa\r\nbbb,bbb,bbb\r\n"); var reader = new CsvRowReader(sr); CollectionAssert.AreEqual(new[] { "aaa", "aaa", "aaa" }, reader.Read().ToArray()); CollectionAssert.AreEqual(new[] { "bbb", "bbb", "bbb" }, reader.Read().ToArray()); Assert.IsNull(reader.Read()); } [TestMethod] public void ReadNothingTest() { var sr = new StringReader(""); var reader = new CsvRowReader(sr); Assert.IsNull(reader.Read()); } [TestMethod] public void ReadEmptyTest() { var sr = new StringReader(",,\n,,\r\n,"); var reader = new CsvRowReader(sr); CollectionAssert.AreEqual(new[] { "", "", "" }, reader.Read().ToArray()); CollectionAssert.AreEqual(new[] { "", "", "" }, reader.Read().ToArray()); CollectionAssert.AreEqual(new[] { "", "" }, reader.Read().ToArray()); Assert.IsNull(reader.Read()); } [TestMethod] public void ReadEscapedTest() { var sr = new StringReader($@"""b"","" b"",""""""b"","""""""" ""c,"","","",""{'\r'}"",""{'\n'}"" "); var reader = new CsvRowReader(sr); CollectionAssert.AreEqual(new[] { "b", "\r\nb", "\"b", "\"" }, reader.Read().ToArray()); CollectionAssert.AreEqual(new[] { "c,", ",", "\r", "\n" }, reader.Read().ToArray()); Assert.IsNull(reader.Read()); } } }
using Microsoft.VisualStudio.TestTools.UnitTesting; using TableIO; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace TableIO.Tests { [TestClass()] public class CsvRowReaderTests { [TestMethod()] public void ReadTest() { // TODO: Assert.Fail(); } } }
apache-2.0
C#
a4256fad86b07ef7a58748a28105ba42384deead
Fix style in test
xamarin/SalesforceSDK,xamarin/SalesforceSDK
Tests.iOS/SalesforceClientTests.cs
Tests.iOS/SalesforceClientTests.cs
using System; using System.Diagnostics; using NUnit.Framework; using Salesforce; using System.Threading; using System.Threading.Tasks; using NUnit.Framework.Constraints; namespace Tests.iOS { [TestFixture] public class SalesforceClientTests { [Test] public void Pass () { var passed = false; var key = "3MVG9A2kN3Bn17hueOTBLV6amupuqyVHycNQ43Q4pIHuDhYcP0gUA0zxwtLPCcnDlOKy0gopxQ4dA6BcNWLab"; var secret = "5754078534436456018"; var callback = new Uri ("sfdc://success"); var authMan = new SalesforceClient (key, secret, callback); authMan.AuthenticationComplete += (sender, e) => { if (e.IsAuthenticated){ // Invoke completion handler. Debug.WriteLine("Auth success: " + e.Account.Username); passed = true; } }; try { var obj = authMan.GetLoginInterface(); Assert.NotNull(obj); } catch (Exception ex) { Debug.WriteLine (ex.Message); } Debug.WriteLine (passed); Assert.That (() => passed, new DelayedConstraint(new PredicateConstraint<bool>((o) => passed), 10000)); } [Test] public void Fail () { Assert.False (true); } [Test] [Ignore ("another time")] public void Ignore () { Assert.True (false); } } }
using System; using System.Diagnostics; using NUnit.Framework; using Salesforce; using System.Threading; using System.Threading.Tasks; using NUnit.Framework.Constraints; namespace Tests.iOS { [TestFixture] public class SalesforceClientTests { [Test] public void Pass () { var passed = false; var key = "3MVG9A2kN3Bn17hueOTBLV6amupuqyVHycNQ43Q4pIHuDhYcP0gUA0zxwtLPCcnDlOKy0gopxQ4dA6BcNWLab"; var secret = "5754078534436456018"; var callback = new Uri ("sfdc://success"); var authMan = new SalesforceClient (key, secret, callback); authMan.AuthenticationComplete += (sender, e) => { if (e.IsAuthenticated){ // Invoke completion handler. Debug.WriteLine("Auth success: " + e.Account.Username); passed = true; } }; try { var obj = authMan.GetLoginInterface(); Assert.NotNull(obj); } catch (Exception ex) { Debug.WriteLine (ex.Message); } Debug.WriteLine (passed); Assert.That (() => passed, new DelayedConstraint(new PredicateConstraint<bool>((o) => { return passed; }), 10000)); } [Test] public void Fail () { Assert.False (true); } [Test] [Ignore ("another time")] public void Ignore () { Assert.True (false); } } }
mit
C#
df3b569eb1f8da0524d1322139aab520918f2a1b
Fix enum codec
pythonnet/pythonnet,pythonnet/pythonnet,pythonnet/pythonnet
src/runtime/Codecs/EnumPyIntCodec.cs
src/runtime/Codecs/EnumPyIntCodec.cs
using System; namespace Python.Runtime.Codecs { [Obsolete] public sealed class EnumPyIntCodec : IPyObjectEncoder, IPyObjectDecoder { public static EnumPyIntCodec Instance { get; } = new EnumPyIntCodec(); public bool CanDecode(PyType objectType, Type targetType) { return targetType.IsEnum && objectType.IsSubclass(Runtime.PyLongType); } public bool CanEncode(Type type) { return type == typeof(object) || type == typeof(ValueType) || type.IsEnum; } public bool TryDecode<T>(PyObject pyObj, out T? value) { value = default; if (!typeof(T).IsEnum) return false; Type etype = Enum.GetUnderlyingType(typeof(T)); if (!PyInt.IsIntType(pyObj)) return false; object? result; try { result = pyObj.AsManagedObject(etype); } catch (InvalidCastException) { return false; } if (Enum.IsDefined(typeof(T), result) || typeof(T).IsFlagsEnum()) { value = (T)Enum.ToObject(typeof(T), result); return true; } return false; } public PyObject? TryEncode(object value) { if (value is null) return null; var enumType = value.GetType(); if (!enumType.IsEnum) return null; return new PyInt(Convert.ToInt64(value)); } private EnumPyIntCodec() { } } }
using System; namespace Python.Runtime.Codecs { [Obsolete] public sealed class EnumPyIntCodec : IPyObjectEncoder, IPyObjectDecoder { public static EnumPyIntCodec Instance { get; } = new EnumPyIntCodec(); public bool CanDecode(PyType objectType, Type targetType) { return targetType.IsEnum && objectType.IsSubclass(Runtime.PyLongType); } public bool CanEncode(Type type) { return type == typeof(object) || type == typeof(ValueType) || type.IsEnum; } public bool TryDecode<T>(PyObject pyObj, out T? value) { value = default; if (!typeof(T).IsEnum) return false; Type etype = Enum.GetUnderlyingType(typeof(T)); if (!PyInt.IsIntType(pyObj)) return false; object? result; try { result = pyObj.AsManagedObject(etype); } catch (InvalidCastException) { return false; } if (Enum.IsDefined(typeof(T), result) || typeof(T).IsFlagsEnum()) { value = (T)Enum.ToObject(typeof(T), result); return true; } return false; } public PyObject? TryEncode(object value) { if (value is null) return null; var enumType = value.GetType(); if (!enumType.IsEnum) return null; try { return new PyInt((long)value); } catch (InvalidCastException) { return new PyInt((ulong)value); } } private EnumPyIntCodec() { } } }
mit
C#
016c91b0354474a43f7392fd63afc5bf20eb7d87
Load multiple activity streams with InMemoryActivityStreamRepository
SayliS/ActivityStreams,Elders/ActivityStreams,spardadanthe/ActivityStreams,djimmytrovy/ActivityStreams
src/ActivityStreams/Persistence/InMemory/InMemoryActivityStreamRepository.cs
src/ActivityStreams/Persistence/InMemory/InMemoryActivityStreamRepository.cs
using System.Collections.Concurrent; using System.Collections.Generic; using System.Linq; namespace ActivityStreams.Persistence.InMemory { public class InMemoryActivityStreamRepository : IActivityStreamRepository { ConcurrentDictionary<byte[], SortedSet<Activity>> activityStreamStore = new ConcurrentDictionary<byte[], SortedSet<Activity>>(); public void Append(Activity activity) { SortedSet<Activity> stream; if (activityStreamStore.TryGetValue(activity.StreamId, out stream)) stream.Add(activity); else activityStreamStore.TryAdd(activity.StreamId, new SortedSet<Activity>(Activity.Comparer) { activity }); } /// <summary> /// FanIn /// </summary> public IEnumerable<Activity> Load(Subscription subscription) { var snapshot = new Dictionary<byte[], Queue<Activity>>(activityStreamStore.Count); foreach (var item in activityStreamStore) { snapshot.Add(item.Key, new Queue<Activity>(item.Value)); } SortedSet<Activity> buffer = new SortedSet<Activity>(Activity.Comparer); var streams = subscription.Streams.ToList(); var streamsCount = streams.Count; // Init for (int streamIndexInsideSubsciption = 0; streamIndexInsideSubsciption < streamsCount; streamIndexInsideSubsciption++) { var streamId = streams[streamIndexInsideSubsciption]; var activity = snapshot[streamId].Dequeue(); buffer.Add(activity); } while (buffer.Count > 0) { Activity nextActivity = buffer.FirstOrDefault(); buffer.Remove(nextActivity); var streamQueue = snapshot[nextActivity.StreamId]; if (streamQueue.Count > 0) { var candidate = snapshot[nextActivity.StreamId].Dequeue(); buffer.Add(candidate); } yield return nextActivity; } } } public class Paging { public Paging(int skip, int take) { Skip = skip; Take = take; } public int Skip { get; } = 5; public int Take { get; } public Paging Next(Paging paging) { return new Paging(paging.Skip + paging.Take, paging.Take); } } }
using System.Collections.Concurrent; using System.Collections.Generic; namespace ActivityStreams.Persistence.InMemory { public class InMemoryActivityStreamRepository : IActivityStreamRepository { ConcurrentDictionary<byte[], SortedSet<Activity>> activityStreamStore = new ConcurrentDictionary<byte[], SortedSet<Activity>>(); public void Append(Activity activity) { SortedSet<Activity> stream; if (activityStreamStore.TryGetValue(activity.StreamId, out stream)) stream.Add(activity); else activityStreamStore.TryAdd(activity.StreamId, new SortedSet<Activity>(Activity.Comparer) { activity }); } /// <summary> /// FanIn /// </summary> public IEnumerable<Activity> Load(Subscription subscription) { foreach (var streamId in subscription.Streams) { SortedSet<Activity> stream; if (activityStreamStore.TryGetValue(streamId, out stream)) { foreach (var activity in stream) { yield return activity; } } } } } public class Paging { public Paging(int skip, int take) { Skip = skip; Take = take; } public int Skip { get; } = 5; public int Take { get; } public Paging Next(Paging paging) { return new Paging(paging.Skip + paging.Take, paging.Take); } } }
apache-2.0
C#
10385d41cdaa3be4bff38d9fa27b060a0786c1cf
Fix comment spelling
mmitche/corefx,ericstj/corefx,mmitche/corefx,shimingsg/corefx,ViktorHofer/corefx,Jiayili1/corefx,BrennanConroy/corefx,Jiayili1/corefx,ericstj/corefx,Jiayili1/corefx,Jiayili1/corefx,ptoonen/corefx,ptoonen/corefx,ericstj/corefx,ptoonen/corefx,shimingsg/corefx,mmitche/corefx,shimingsg/corefx,shimingsg/corefx,Jiayili1/corefx,Jiayili1/corefx,ViktorHofer/corefx,ericstj/corefx,ptoonen/corefx,mmitche/corefx,wtgodbe/corefx,ViktorHofer/corefx,ptoonen/corefx,ericstj/corefx,ViktorHofer/corefx,mmitche/corefx,mmitche/corefx,ViktorHofer/corefx,ericstj/corefx,shimingsg/corefx,wtgodbe/corefx,wtgodbe/corefx,ericstj/corefx,ptoonen/corefx,ViktorHofer/corefx,wtgodbe/corefx,shimingsg/corefx,wtgodbe/corefx,wtgodbe/corefx,shimingsg/corefx,wtgodbe/corefx,mmitche/corefx,BrennanConroy/corefx,ptoonen/corefx,BrennanConroy/corefx,Jiayili1/corefx,ViktorHofer/corefx
src/Common/src/Interop/Unix/System.Net.Http.Native/Interop.Initialization.cs
src/Common/src/Interop/Unix/System.Net.Http.Native/Interop.Initialization.cs
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. using System; using System.Runtime.InteropServices; internal static partial class Interop { // Initialization of libcurl is done in a static constructor. // This enables a project simply to include this file, and any usage of any of // the Http functions will trigger initialization. internal static partial class Http { static Http() { HttpInitializer.Initialize(); } } internal static class HttpInitializer { static HttpInitializer() { #if !SYSNETHTTP_NO_OPENSSL string opensslVersion = Interop.Http.GetSslVersionDescription(); if (string.IsNullOrEmpty(opensslVersion) || opensslVersion.IndexOf(Interop.Http.OpenSsl10Description, StringComparison.OrdinalIgnoreCase) != -1) { // CURL uses OpenSSL which we must initialize first to guarantee thread-safety // Only initialize for OpenSSL/1.0, any newer versions may have mismatched // pointers, resulting in segfaults. CryptoInitializer.Initialize(); } #endif if (EnsureCurlIsInitialized() != 0) { throw new InvalidOperationException(); } } internal static void Initialize() { // No-op that exists to provide a hook for other static constructors } [DllImport(Libraries.HttpNative, EntryPoint = "HttpNative_EnsureCurlIsInitialized")] private static extern int EnsureCurlIsInitialized(); } }
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. using System; using System.Runtime.InteropServices; internal static partial class Interop { // Initialization of libcurl is done in a static constructor. // This enables a project simply to include this file, and any usage of any of // the Http functions will trigger initialization. internal static partial class Http { static Http() { HttpInitializer.Initialize(); } } internal static class HttpInitializer { static HttpInitializer() { #if !SYSNETHTTP_NO_OPENSSL string opensslVersion = Interop.Http.GetSslVersionDescription(); if (string.IsNullOrEmpty(opensslVersion) || opensslVersion.IndexOf(Interop.Http.OpenSsl10Description, StringComparison.OrdinalIgnoreCase) != -1) { // CURL uses OpenSSL which me must initialize first to guarantee thread-safety // Only initialize for OpenSSL/1.0, any newer versions may have mismatched // pointers, resulting in segfaults. CryptoInitializer.Initialize(); } #endif if (EnsureCurlIsInitialized() != 0) { throw new InvalidOperationException(); } } internal static void Initialize() { // No-op that exists to provide a hook for other static constructors } [DllImport(Libraries.HttpNative, EntryPoint = "HttpNative_EnsureCurlIsInitialized")] private static extern int EnsureCurlIsInitialized(); } }
mit
C#
660868414cce8b8cc93fb9729ab605d581cc06fb
Upgrade Faithlife.Build.
ejball/ArgsReading
tools/Build/Build.cs
tools/Build/Build.cs
using System; using Faithlife.Build; internal static class Build { public static int Main(string[] args) => BuildRunner.Execute(args, build => { build.AddDotNetTargets( new DotNetBuildSettings { DocsSettings = new DocsSettings { Projects = new[] { "ArgsReading" }, RepoUrl = "https://github.com/ejball/ArgsReading.git", SourceUrl = "https://github.com/ejball/ArgsReading/tree/master/src", }, GitLogin = new GitLoginInfo("ejball", Environment.GetEnvironmentVariable("BUILD_BOT_PASSWORD") ?? ""), GitAuthor = new GitAuthorInfo("ejball", "ejball@gmail.com"), }); }); }
using System; using Faithlife.Build; internal static class Build { public static int Main(string[] args) => BuildRunner.Execute(args, build => { build.AddDotNetTargets( new DotNetBuildSettings { XmlDocMarkdownSettings = new XmlDocMarkdownSettings { Projects = new[] { "ArgsReading" }, RepoUrl = "https://github.com/ejball/ArgsReading.git", SourceUrl = "https://github.com/ejball/ArgsReading/tree/master/src", }, BuildBotSettings = new BuildBotSettings { UserName = "ejball", Password = Environment.GetEnvironmentVariable("BUILD_BOT_PASSWORD"), DisplayName = "ejball", Email = "ejball@gmail.com", }, }); }); }
mit
C#
cfef4d7d8fce0d3e3734ebdafd580d37fc68536b
Update CombineMultipleWorksheetsSingleWorksheet.cs
maria-shahid-aspose/Aspose.Cells-for-.NET,aspose-cells/Aspose.Cells-for-.NET,asposecells/Aspose_Cells_NET,asposecells/Aspose_Cells_NET,maria-shahid-aspose/Aspose.Cells-for-.NET,aspose-cells/Aspose.Cells-for-.NET,maria-shahid-aspose/Aspose.Cells-for-.NET,maria-shahid-aspose/Aspose.Cells-for-.NET,aspose-cells/Aspose.Cells-for-.NET,asposecells/Aspose_Cells_NET,asposecells/Aspose_Cells_NET,aspose-cells/Aspose.Cells-for-.NET
Examples/CSharp/Articles/CombineMultipleWorksheetsSingleWorksheet.cs
Examples/CSharp/Articles/CombineMultipleWorksheetsSingleWorksheet.cs
using System.IO; using Aspose.Cells; namespace Aspose.Cells.Examples.Articles { public class CombineMultipleWorksheetsSingleWorksheet { public static void Main(string[] args) { //ExStart:1 // The path to the documents directory. string dataDir = Aspose.Cells.Examples.Utils.GetDataDir(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); string filePath = dataDir+ "SampleInput.xlsx"; Workbook workbook = new Workbook(filePath); Workbook destWorkbook = new Workbook(); Worksheet destSheet = destWorkbook.Worksheets[0]; int TotalRowCount = 0; for (int i = 0; i < workbook.Worksheets.Count; i++) { Worksheet sourceSheet = workbook.Worksheets[i]; Range sourceRange = sourceSheet.Cells.MaxDisplayRange; Range destRange = destSheet.Cells.CreateRange(sourceRange.FirstRow + TotalRowCount, sourceRange.FirstColumn, sourceRange.RowCount, sourceRange.ColumnCount); destRange.Copy(sourceRange); TotalRowCount = sourceRange.RowCount + TotalRowCount; } destWorkbook.Save(dataDir+ "Output.out.xlsx"); //ExEnd:1 } } }
using System.IO; using Aspose.Cells; namespace Aspose.Cells.Examples.Articles { public class CombineMultipleWorksheetsSingleWorksheet { public static void Main(string[] args) { // The path to the documents directory. string dataDir = Aspose.Cells.Examples.Utils.GetDataDir(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); string filePath = dataDir+ "SampleInput.xlsx"; Workbook workbook = new Workbook(filePath); Workbook destWorkbook = new Workbook(); Worksheet destSheet = destWorkbook.Worksheets[0]; int TotalRowCount = 0; for (int i = 0; i < workbook.Worksheets.Count; i++) { Worksheet sourceSheet = workbook.Worksheets[i]; Range sourceRange = sourceSheet.Cells.MaxDisplayRange; Range destRange = destSheet.Cells.CreateRange(sourceRange.FirstRow + TotalRowCount, sourceRange.FirstColumn, sourceRange.RowCount, sourceRange.ColumnCount); destRange.Copy(sourceRange); TotalRowCount = sourceRange.RowCount + TotalRowCount; } destWorkbook.Save(dataDir+ "Output.out.xlsx"); } } }
mit
C#
448ced12950dc1de4eec14ca2335af5b6f60adec
Update AssemblyVersion
Erikvl87/KNKVPlugin
KNKVPlugin/Properties/AssemblyInfo.cs
KNKVPlugin/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("KNKVPlugin")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("KNKVPlugin")] [assembly: AssemblyCopyright("Copyright © 2013")] [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("8744f6d4-c5e1-4fed-9d97-04922b3aab1f")] // 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.6.1.0")] [assembly: AssemblyFileVersion("0.6.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("KNKVPlugin")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("KNKVPlugin")] [assembly: AssemblyCopyright("Copyright © 2013")] [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("8744f6d4-c5e1-4fed-9d97-04922b3aab1f")] // 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.6.0.0")] [assembly: AssemblyFileVersion("0.6.0.0")]
mit
C#
609debc2ee80dfdd178dca9249a53253a9b3b4c0
fix bug in "s"
joycode/LibNVim
LibNVim/Editions/EditionChangeChar.cs
LibNVim/Editions/EditionChangeChar.cs
using System; using System.Collections.Generic; using System.Text; namespace LibNVim.Editions { class EditionChangeChar : AbstractVimEditionInsertText { public EditionChangeChar(Interfaces.IVimHost host, int repeat) : base(host, repeat) { } protected override void OnBeforeInsert(Interfaces.IVimHost host) { VimPoint from = host.CurrentPosition; VimPoint to = new VimPoint(from.X, Math.Min(from.Y + this.Repeat - 1, host.CurrentLineEndPosition.Y - 1)); VimSpan span = new VimSpan(from, to).GetClosedEnd(); VimRegister.YankRangeToDefaultRegister(host, span); host.DeleteRange(span); } } }
using System; using System.Collections.Generic; using System.Text; namespace LibNVim.Editions { class EditionChangeChar : AbstractVimEditionInsertText { public EditionChangeChar(Interfaces.IVimHost host, int repeat) : base(host, repeat) { } protected override void OnBeforeInsert(Interfaces.IVimHost host) { VimPoint from = host.CurrentPosition; VimPoint to = new VimPoint(from.X, Math.Min(from.Y + this.Repeat - 1, host.CurrentLineEndPosition.Y - 1)); VimSpan span = new VimSpan(from, to); VimRegister.YankRangeToDefaultRegister(host, span); host.DeleteRange(span); } } }
bsd-3-clause
C#
5cd970eb52c21c5f77273f3c109543c108effe4c
Address db model fully implemented.
transactionCompleteDB/MAutoSS,transactionCompleteDB/MAutoSS
MAutoSS/MAutoSS.DataModels/Address.cs
MAutoSS/MAutoSS.DataModels/Address.cs
namespace MAutoSS.DataModels { public class Address { public int Id { get; set; } public string AddressText { get; set; } public int DealershipId { get; set; } public virtual Dealership Dealership { get; set; } } }
namespace MAutoSS.DataModels { public class Address { public int Id { get; set; } } }
mit
C#
e351af781dec7e9d1ed768ea35bef744f5f1d273
Create server side API for single multiple answer question
Promact/trappist,Promact/trappist,Promact/trappist,Promact/trappist,Promact/trappist
Trappist/src/Promact.Trappist.Core/Controllers/QuestionController.cs
Trappist/src/Promact.Trappist.Core/Controllers/QuestionController.cs
using Microsoft.AspNetCore.Mvc; using Promact.Trappist.DomainModel.ApplicationClasses; using Promact.Trappist.Repository.Questions; using System; namespace Promact.Trappist.Core.Controllers { [Route("api")] public class QuestionController : Controller { private readonly IQuestionRepository _questionsRepository; public QuestionsController(IQuestionRepository questionsRepository) { _questionsRepository = questionsRepository; } /// <summary> /// Add single multiple answer question into model /// </summary> /// <param name="singleMultipleQuestion"></param> /// <returns></returns> [Route("singlemultiplequestion")] [HttpPost] public IActionResult AddSingleMultipleAnswerQuestion([FromBody]SingleMultipleQuestion singleMultipleQuestion) { _questionsRepository.AddSingleMultipleAnswerQuestion(singleMultipleQuestion.singleMultipleAnswerQuestion,singleMultipleQuestion.singleMultipleAnswerQuestionOption); return Ok(singleMultipleQuestion); } } }
using Microsoft.AspNetCore.Mvc; using Promact.Trappist.DomainModel.ApplicationClasses; using Promact.Trappist.Repository.Questions; using System; namespace Promact.Trappist.Core.Controllers { [Route("api")] public class QuestionController : Controller { private readonly IQuestionRepository _questionsRepository; public QuestionsController(IQuestionRepository questionsRepository) { _questionsRepository = questionsRepository; } /// <summary> /// Add single multiple answer question into model /// </summary> /// <param name="singleMultipleQuestion"></param> /// <returns></returns> [Route("singlemultiplequestion")] [HttpPost] public IActionResult AddSingleMultipleAnswerQuestion([FromBody]SingleMultipleQuestion singleMultipleQuestion) { _questionsRepository.AddSingleMultipleAnswerQuestion(singleMultipleQuestion.singleMultipleAnswerQuestion,singleMultipleQuestion.singleMultipleAnswerQuestionOption); return Ok(singleMultipleQuestion); } } }
mit
C#
659e0bb2007c14d9493468c8bb2631895b7d86c7
Remove timezone specification for scheduled triggers to use server timezone
nuke-build/nuke,nuke-build/nuke,nuke-build/nuke,nuke-build/nuke
source/Nuke.Common/CI/TeamCity/Configuration/TeamCityScheduledTrigger.cs
source/Nuke.Common/CI/TeamCity/Configuration/TeamCityScheduledTrigger.cs
// Copyright 2019 Maintainers of NUKE. // Distributed under the MIT License. // https://github.com/nuke-build/nuke/blob/master/LICENSE using System; using System.Linq; using Nuke.Common.Utilities; namespace Nuke.Common.CI.TeamCity.Configuration { public class TeamCityScheduledTrigger : TeamCityTrigger { public string BranchFilter { get; set; } public string TriggerRules { get; set; } public bool TriggerBuildAlways { get; set; } //TODO: check public bool WithPendingChangesOnly { get; set; } public bool EnableQueueOptimization { get; set; } public override void Write(CustomFileWriter writer) { using (writer.WriteBlock("schedule")) { using (writer.WriteBlock("schedulingPolicy = daily")) { writer.WriteLine("hour = 3"); } writer.WriteLine($"branchFilter = {BranchFilter.DoubleQuote()}"); writer.WriteLine($"triggerRules = {TriggerRules.DoubleQuote()}"); writer.WriteLine("triggerBuild = always()"); writer.WriteLine("withPendingChangesOnly = false"); writer.WriteLine($"enableQueueOptimization = {EnableQueueOptimization.ToString().ToLowerInvariant()}"); writer.WriteLine("param(\"cronExpression_min\", \"3\")"); } } } }
// Copyright 2019 Maintainers of NUKE. // Distributed under the MIT License. // https://github.com/nuke-build/nuke/blob/master/LICENSE using System; using System.Linq; using Nuke.Common.Utilities; namespace Nuke.Common.CI.TeamCity.Configuration { public class TeamCityScheduledTrigger : TeamCityTrigger { public string BranchFilter { get; set; } public string TriggerRules { get; set; } public bool TriggerBuildAlways { get; set; } //TODO: check public bool WithPendingChangesOnly { get; set; } public bool EnableQueueOptimization { get; set; } public override void Write(CustomFileWriter writer) { using (writer.WriteBlock("schedule")) { using (writer.WriteBlock("schedulingPolicy = daily")) { writer.WriteLine("hour = 3"); writer.WriteLine("timezone = \"Europe/Berlin\""); } writer.WriteLine($"branchFilter = {BranchFilter.DoubleQuote()}"); writer.WriteLine($"triggerRules = {TriggerRules.DoubleQuote()}"); writer.WriteLine("triggerBuild = always()"); writer.WriteLine("withPendingChangesOnly = false"); writer.WriteLine($"enableQueueOptimization = {EnableQueueOptimization.ToString().ToLowerInvariant()}"); writer.WriteLine("param(\"cronExpression_min\", \"3\")"); } } } }
mit
C#
01e47404c1687bf2d4123d4fb3d144b654a6cf4f
Change test-case for mono compatibility.
hach-que/JSIL,sq/JSIL,sq/JSIL,hach-que/JSIL,sq/JSIL,hach-que/JSIL,iskiselev/JSIL,FUSEEProjectTeam/JSIL,iskiselev/JSIL,iskiselev/JSIL,FUSEEProjectTeam/JSIL,FUSEEProjectTeam/JSIL,FUSEEProjectTeam/JSIL,sq/JSIL,iskiselev/JSIL,sq/JSIL,FUSEEProjectTeam/JSIL,hach-que/JSIL,hach-que/JSIL,iskiselev/JSIL
Tests/SimpleTestCasesForTranslatedBcl/Issue1008_MethodReturnType.cs
Tests/SimpleTestCasesForTranslatedBcl/Issue1008_MethodReturnType.cs
using System; using System.Linq.Expressions; public static class Program { public static void Main() { Expression<Action> exp = () => Method1<Test>(); var returnType = ((MethodCallExpression)exp.Body).Method.ReturnType; Console.WriteLine(returnType.GetType().IsSubclassOf(typeof(Type)) ? "true" : "false"); Console.WriteLine(typeof(Test) == returnType ? "true" : "false"); exp = () => Method1<int>(); returnType = ((MethodCallExpression)exp.Body).Method.ReturnType; Console.WriteLine(returnType.GetType().IsSubclassOf(typeof(Type)) ? "true" : "false"); Console.WriteLine(typeof(int) == returnType ? "true" : "false"); exp = () => Method2<Test>(); returnType = ((MethodCallExpression)exp.Body).Method.ReturnType; Console.WriteLine(returnType.GetType().IsSubclassOf(typeof(Type)) ? "true" : "false"); Console.WriteLine(typeof(Holder<Test>) == returnType ? "true" : "false"); exp = () => Method2<int>(); returnType = ((MethodCallExpression)exp.Body).Method.ReturnType; Console.WriteLine(returnType.GetType().IsSubclassOf(typeof(Type)) ? "true" : "false"); Console.WriteLine(typeof(Holder<int>) == returnType ? "true" : "false"); exp = () => Method3<Test>(); returnType = ((MethodCallExpression)exp.Body).Method.ReturnType; Console.WriteLine(returnType.GetType().IsSubclassOf(typeof(Type)) ? "true" : "false"); Console.WriteLine(typeof(Test[]) == returnType ? "true" : "false"); exp = () => Method3<int>(); returnType = ((MethodCallExpression)exp.Body).Method.ReturnType; Console.WriteLine(returnType.GetType().IsSubclassOf(typeof(Type)) ? "true" : "false"); Console.WriteLine(typeof(int[]) == returnType ? "true" : "false"); } public static T Method1<T>() { return default(T); } public static Holder<T> Method2<T>() { return default(Holder<T>); } public static T[] Method3<T>() { return default(T[]); } } public class Holder<T> { } public class Test { }
using System; using System.Linq.Expressions; public static class Program { public static void Main() { Expression<Action> exp = () => Method1<Test>(); var returnType = ((MethodCallExpression)exp.Body).Method.ReturnType; Console.WriteLine(returnType.GetType().FullName); Console.WriteLine(typeof(Test) == returnType ? "true" : "false"); exp = () => Method1<int>(); returnType = ((MethodCallExpression)exp.Body).Method.ReturnType; Console.WriteLine(returnType.GetType().FullName); Console.WriteLine(typeof(int) == returnType ? "true" : "false"); exp = () => Method2<Test>(); returnType = ((MethodCallExpression)exp.Body).Method.ReturnType; Console.WriteLine(returnType.GetType().FullName); Console.WriteLine(typeof(Holder<Test>) == returnType ? "true" : "false"); exp = () => Method2<int>(); returnType = ((MethodCallExpression)exp.Body).Method.ReturnType; Console.WriteLine(returnType.GetType().FullName); Console.WriteLine(typeof(Holder<int>) == returnType ? "true" : "false"); exp = () => Method3<Test>(); returnType = ((MethodCallExpression)exp.Body).Method.ReturnType; Console.WriteLine(returnType.GetType().FullName); Console.WriteLine(typeof(Test[]) == returnType ? "true" : "false"); exp = () => Method3<int>(); returnType = ((MethodCallExpression)exp.Body).Method.ReturnType; Console.WriteLine(returnType.GetType().FullName); Console.WriteLine(typeof(int[]) == returnType ? "true" : "false"); } public static T Method1<T>() { return default(T); } public static Holder<T> Method2<T>() { return default(Holder<T>); } public static T[] Method3<T>() { return default(T[]); } } public class Holder<T> { } public class Test { }
mit
C#
496826f3f7c5fe9dcb640a249eb7ad4a1df2ada5
Simplify part settings retrieval for DateEditorDriver (#5368)
OrchardCMS/Brochard,OrchardCMS/Brochard,stevetayloruk/Orchard2,stevetayloruk/Orchard2,stevetayloruk/Orchard2,petedavis/Orchard2,petedavis/Orchard2,xkproject/Orchard2,petedavis/Orchard2,stevetayloruk/Orchard2,petedavis/Orchard2,xkproject/Orchard2,xkproject/Orchard2,xkproject/Orchard2,stevetayloruk/Orchard2,xkproject/Orchard2,OrchardCMS/Brochard
src/OrchardCore.Modules/OrchardCore.Contents/Drivers/DateEditorDriver.cs
src/OrchardCore.Modules/OrchardCore.Contents/Drivers/DateEditorDriver.cs
using System; using System.Threading.Tasks; using OrchardCore.ContentManagement.Display.ContentDisplay; using OrchardCore.ContentManagement.Display.Models; using OrchardCore.Contents.Models; using OrchardCore.Contents.ViewModels; using OrchardCore.DisplayManagement.ModelBinding; using OrchardCore.DisplayManagement.Views; using OrchardCore.Modules; namespace OrchardCore.Contents.Drivers { public class DateEditorDriver : ContentPartDisplayDriver<CommonPart> { private readonly ILocalClock _localClock; public DateEditorDriver(ILocalClock localClock) { _localClock = localClock; } public override IDisplayResult Edit(CommonPart part, BuildPartEditorContext context) { var settings = context.TypePartDefinition.GetSettings<CommonPartSettings>(); if (settings.DisplayDateEditor) { return Initialize<DateEditorViewModel>("CommonPart_Edit__Date", async model => { model.LocalDateTime = part.ContentItem.CreatedUtc.HasValue ? (DateTime?) (await _localClock.ConvertToLocalAsync(part.ContentItem.CreatedUtc.Value)).DateTime : null; }); } return null; } public override async Task<IDisplayResult> UpdateAsync(CommonPart part, IUpdateModel updater, UpdatePartEditorContext context) { var settings = context.TypePartDefinition.GetSettings<CommonPartSettings>(); if (settings.DisplayDateEditor) { var model = new DateEditorViewModel(); await updater.TryUpdateModelAsync(model, Prefix); if (model.LocalDateTime == null) { part.ContentItem.CreatedUtc = null; } else { part.ContentItem.CreatedUtc = await _localClock.ConvertToUtcAsync(model.LocalDateTime.Value); } } return Edit(part,context); } } }
using System; using System.Linq; using System.Threading.Tasks; using OrchardCore.ContentManagement.Display.ContentDisplay; using OrchardCore.ContentManagement.Metadata; using OrchardCore.Contents.Models; using OrchardCore.Contents.ViewModels; using OrchardCore.DisplayManagement.ModelBinding; using OrchardCore.DisplayManagement.Views; using OrchardCore.Modules; namespace OrchardCore.Contents.Drivers { public class DateEditorDriver : ContentPartDisplayDriver<CommonPart> { private readonly IContentDefinitionManager _contentDefinitionManager; private readonly ILocalClock _localClock; public DateEditorDriver(IContentDefinitionManager contentDefinitionManager, ILocalClock localClock) { _contentDefinitionManager = contentDefinitionManager; _localClock = localClock; } public override IDisplayResult Edit(CommonPart part) { var settings = GetSettings(part); if (settings.DisplayDateEditor) { return Initialize<DateEditorViewModel>("CommonPart_Edit__Date", async model => { model.LocalDateTime = part.ContentItem.CreatedUtc.Value == null ? (DateTime?)null : (await _localClock.ConvertToLocalAsync(part.ContentItem.CreatedUtc.Value)).DateTime; }); } return null; } public override async Task<IDisplayResult> UpdateAsync(CommonPart part, IUpdateModel updater) { var settings = GetSettings(part); if (settings.DisplayDateEditor) { var model = new DateEditorViewModel(); await updater.TryUpdateModelAsync(model, Prefix); if (model.LocalDateTime == null) { part.ContentItem.CreatedUtc = null; } else { part.ContentItem.CreatedUtc = await _localClock.ConvertToUtcAsync(model.LocalDateTime.Value); } } return Edit(part); } public CommonPartSettings GetSettings(CommonPart part) { var contentTypeDefinition = _contentDefinitionManager.GetTypeDefinition(part.ContentItem.ContentType); var contentTypePartDefinition = contentTypeDefinition.Parts.FirstOrDefault(x => String.Equals(x.PartDefinition.Name, "CommonPart")); return contentTypePartDefinition.GetSettings<CommonPartSettings>(); } } }
bsd-3-clause
C#
d97588e5f88f152250558ab78f4f2076c6dafb5d
Remove one virtual call from StreamHelpers.ValidateCopyToArgs (#2283)
gregkalapos/corert,krytarowski/corert,sandreenko/corert,gregkalapos/corert,shrah/corert,krytarowski/corert,tijoytom/corert,botaberg/corert,shrah/corert,sandreenko/corert,yizhang82/corert,yizhang82/corert,shrah/corert,gregkalapos/corert,krytarowski/corert,yizhang82/corert,tijoytom/corert,tijoytom/corert,krytarowski/corert,botaberg/corert,tijoytom/corert,gregkalapos/corert,yizhang82/corert,botaberg/corert,botaberg/corert,shrah/corert,sandreenko/corert,sandreenko/corert
src/System.Private.CoreLib/src/System/IO/StreamHelpers.CopyValidation.cs
src/System.Private.CoreLib/src/System/IO/StreamHelpers.CopyValidation.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. namespace System.IO { /// <summary>Provides methods to help in the implementation of Stream-derived types.</summary> internal static partial class StreamHelpers { /// <summary>Validate the arguments to CopyTo, as would Stream.CopyTo.</summary> public static void ValidateCopyToArgs(Stream source, Stream destination, int bufferSize) { if (destination == null) { throw new ArgumentNullException(nameof(destination)); } if (bufferSize <= 0) { throw new ArgumentOutOfRangeException(nameof(bufferSize), bufferSize, SR.ArgumentOutOfRange_NeedPosNum); } bool sourceCanRead = source.CanRead; if (!sourceCanRead && !source.CanWrite) { throw new ObjectDisposedException(null, SR.ObjectDisposed_StreamClosed); } bool destinationCanWrite = destination.CanWrite; if (!destinationCanWrite && !destination.CanRead) { throw new ObjectDisposedException(nameof(destination), SR.ObjectDisposed_StreamClosed); } if (!sourceCanRead) { throw new NotSupportedException(SR.NotSupported_UnreadableStream); } if (!destinationCanWrite) { throw new NotSupportedException(SR.NotSupported_UnwritableStream); } } } }
// 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. namespace System.IO { /// <summary>Provides methods to help in the implementation of Stream-derived types.</summary> internal static partial class StreamHelpers { /// <summary>Validate the arguments to CopyTo, as would Stream.CopyTo.</summary> public static void ValidateCopyToArgs(Stream source, Stream destination, int bufferSize) { if (destination == null) { throw new ArgumentNullException(nameof(destination)); } if (bufferSize <= 0) { throw new ArgumentOutOfRangeException(nameof(bufferSize), bufferSize, SR.ArgumentOutOfRange_NeedPosNum); } bool sourceCanRead = source.CanRead; if (!sourceCanRead && !source.CanWrite) { throw new ObjectDisposedException(null, SR.ObjectDisposed_StreamClosed); } bool destinationCanWrite = destination.CanWrite; if (!destination.CanRead && !destinationCanWrite) { throw new ObjectDisposedException(nameof(destination), SR.ObjectDisposed_StreamClosed); } if (!sourceCanRead) { throw new NotSupportedException(SR.NotSupported_UnreadableStream); } if (!destinationCanWrite) { throw new NotSupportedException(SR.NotSupported_UnwritableStream); } } } }
mit
C#
4adb8f16c698fad6100197bd6e4cd8d7f2639301
Fix detecting mono runtime when using Xamarin.Mac linker by testing for additional type
l8s/Eto,PowerOfCode/Eto,bbqchickenrobot/Eto-1,l8s/Eto,l8s/Eto,PowerOfCode/Eto,PowerOfCode/Eto,bbqchickenrobot/Eto-1,bbqchickenrobot/Eto-1
Source/Eto/OperatingSystemPlatform.cs
Source/Eto/OperatingSystemPlatform.cs
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Runtime.InteropServices; namespace Eto { /// <summary> /// Operating system platform information /// </summary> /// <remarks> /// Access this information from <see cref="EtoEnvironment.Platform"/> /// </remarks> public sealed class OperatingSystemPlatform { /// <summary> /// Gets a value indicating that the current .NET runtime is mono /// </summary> public bool IsMono { get; private set; } /// <summary> /// Gets a value indicating that the current OS is windows system /// </summary> public bool IsWindows { get; private set; } /// <summary> /// Gets a value indicating that the current OS is a unix-based system /// </summary> /// <remarks> /// This will be true for both Unix (e.g. OS X) and all Linux variants. /// </remarks> public bool IsUnix { get; private set; } /// <summary> /// Gets a value indicating that the current OS is a Mac OS X system /// </summary> public bool IsMac { get; private set; } /// <summary> /// Gets a value indicating that the current OS is a Linux system /// </summary> public bool IsLinux { get; private set; } [DllImport ("libc")] static extern int uname (IntPtr buf); static string GetUnixType () { IntPtr buf = IntPtr.Zero; string osName = ""; try { buf = Marshal.AllocHGlobal (8192); if (uname (buf) == 0) osName = Marshal.PtrToStringAnsi (buf); } catch { } finally { if (buf != IntPtr.Zero) Marshal.FreeHGlobal (buf); } return osName; } /// <summary> /// Initializes a new instance of the OperatingSystemPlatform class /// </summary> public OperatingSystemPlatform () { if (Type.GetType ("Mono.Runtime", false) != null || Type.GetType ("Mono.Interop.IDispatch", false) != null) IsMono = true; switch (System.Environment.OSVersion.Platform) { case PlatformID.MacOSX: IsMac = true; IsUnix = true; break; case PlatformID.Unix: IsUnix = true; switch (GetUnixType ().ToLowerInvariant ()) { case "darwin": IsMac = true; break; case "linux": IsLinux = true; break; } break; default: case PlatformID.Win32NT: case PlatformID.Win32S: case PlatformID.Win32Windows: case PlatformID.WinCE: IsWindows = true; break; } } } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Runtime.InteropServices; namespace Eto { /// <summary> /// Operating system platform information /// </summary> /// <remarks> /// Access this information from <see cref="EtoEnvironment.Platform"/> /// </remarks> public sealed class OperatingSystemPlatform { /// <summary> /// Gets a value indicating that the current .NET runtime is mono /// </summary> public bool IsMono { get; private set; } /// <summary> /// Gets a value indicating that the current OS is windows system /// </summary> public bool IsWindows { get; private set; } /// <summary> /// Gets a value indicating that the current OS is a unix-based system /// </summary> /// <remarks> /// This will be true for both Unix (e.g. OS X) and all Linux variants. /// </remarks> public bool IsUnix { get; private set; } /// <summary> /// Gets a value indicating that the current OS is a Mac OS X system /// </summary> public bool IsMac { get; private set; } /// <summary> /// Gets a value indicating that the current OS is a Linux system /// </summary> public bool IsLinux { get; private set; } [DllImport ("libc")] static extern int uname (IntPtr buf); static string GetUnixType () { IntPtr buf = IntPtr.Zero; string osName = ""; try { buf = Marshal.AllocHGlobal (8192); if (uname (buf) == 0) osName = Marshal.PtrToStringAnsi (buf); } catch { } finally { if (buf != IntPtr.Zero) Marshal.FreeHGlobal (buf); } return osName; } /// <summary> /// Initializes a new instance of the OperatingSystemPlatform class /// </summary> public OperatingSystemPlatform () { if (Type.GetType ("Mono.Runtime", false) != null) IsMono = true; switch (System.Environment.OSVersion.Platform) { case PlatformID.MacOSX: IsMac = true; IsUnix = true; break; case PlatformID.Unix: IsUnix = true; switch (GetUnixType ().ToLowerInvariant ()) { case "darwin": IsMac = true; break; case "linux": IsLinux = true; break; } break; default: case PlatformID.Win32NT: case PlatformID.Win32S: case PlatformID.Win32Windows: case PlatformID.WinCE: IsWindows = true; break; } } } }
bsd-3-clause
C#
48fdac6d80d1a946da7ffc40a2ad5b2e3b9c288a
Remove unnecessary code at designation draw
alandariva/RimworldMorePlanning,alandariva/RimworldMorePlanning
Source/MorePlanning/HarmonyPatches.cs
Source/MorePlanning/HarmonyPatches.cs
using Harmony; using System.Reflection; using UnityEngine; using Verse; namespace MorePlanning { [StaticConstructorOnStartup] public static class HarmonyPatches { static HarmonyPatches() { var harmony = HarmonyInstance.Create(MorePlanningMod.Identifier); harmony.PatchAll(Assembly.GetExecutingAssembly()); } } [HarmonyPatch(typeof(Designation))] [HarmonyPatch("DesignationDraw")] class DesignationPlanningDraw { static bool Prefix(Designation __instance) { if (__instance.def is PlanningDesignationDef == false) { return true; } if (Designator_PlanningVisibility.PlanningVisibility == false) { return false; } int colorId = 0; if (__instance is PlanDesignation) { colorId = (__instance as PlanDesignation).color; } Vector3 position = position = __instance.target.Cell.ToVector3ShiftedWithAltitude(__instance.DesignationDrawAltitude); Graphics.DrawMesh(MeshPool.plane10, position, Quaternion.identity, (__instance.def as PlanningDesignationDef).iconMatColor[colorId], 0); return false; } } [HarmonyPatch(typeof(Designation))] [HarmonyPatch("ExposeData")] class DesignatioPlanningExposeData { static bool Prefix(Designation __instance) { if (__instance is PlanDesignation) { Scribe_Values.LookValue<int>(ref (__instance as PlanDesignation).color, "Color", 0, true); } return true; } } }
using Harmony; using System.Reflection; using UnityEngine; using Verse; namespace MorePlanning { [StaticConstructorOnStartup] public static class HarmonyPatches { static HarmonyPatches() { var harmony = HarmonyInstance.Create(MorePlanningMod.Identifier); harmony.PatchAll(Assembly.GetExecutingAssembly()); } } [HarmonyPatch(typeof(Designation))] [HarmonyPatch("DesignationDraw")] class DesignationPlanningDraw { static bool Prefix(Designation __instance) { if (__instance.def is PlanningDesignationDef == false) { return true; } if (Designator_PlanningVisibility.PlanningVisibility == false) { return false; } int colorId = 0; if (__instance is PlanDesignation) { colorId = (__instance as PlanDesignation).color; } if (__instance.target.HasThing && !__instance.target.Thing.Spawned) { return false; } Vector3 position = default(Vector3); if (__instance.target.HasThing) { position = __instance.target.Thing.DrawPos; position.y = __instance.DesignationDrawAltitude; } else { position = __instance.target.Cell.ToVector3ShiftedWithAltitude(__instance.DesignationDrawAltitude); } Graphics.DrawMesh(MeshPool.plane10, position, Quaternion.identity, (__instance.def as PlanningDesignationDef).iconMatColor[colorId], 0); return false; } } [HarmonyPatch(typeof(Designation))] [HarmonyPatch("ExposeData")] class DesignatioPlanningExposeData { static bool Prefix(Designation __instance) { if (__instance is PlanDesignation) { Scribe_Values.LookValue<int>(ref (__instance as PlanDesignation).color, "Color", 0, true); } return true; } } }
mit
C#
4176b7a5864a81255d90fbf747ac801e6a04b28e
update version info: v1.0.1 -> v1.0.2
Treer/ip4
src/Properties/AssemblyInfo.cs
src/Properties/AssemblyInfo.cs
using System; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: AssemblyCompany("")] [assembly: AssemblyCopyright("Copyright © 2014 by Primoz Licen, Glenn Fisher")] [assembly: AssemblyDescription("Lists all the IPs")] [assembly: AssemblyFileVersion("1.0.0.1")] [assembly: AssemblyVersion("1.0.0.2")] [assembly: AssemblyProduct("ip4")] [assembly: AssemblyTitle("ip4")] [assembly: AssemblyTrademark("")] [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: ComVisible(false)] [assembly: Guid("9146ccd0-954f-43c8-8e86-14ed72982b35")]
using System; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: AssemblyCompany("")] [assembly: AssemblyCopyright("Copyright © 2014 by Primoz Licen, Glenn Fisher")] [assembly: AssemblyDescription("Lists all the IPs")] [assembly: AssemblyFileVersion("1.0.0.1")] [assembly: AssemblyVersion("1.0.0.1")] [assembly: AssemblyProduct("ip4")] [assembly: AssemblyTitle("ip4")] [assembly: AssemblyTrademark("")] [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: ComVisible(false)] [assembly: Guid("9146ccd0-954f-43c8-8e86-14ed72982b35")]
mit
C#
e4f78544f7414b6656229ac4de236e3035cb72ae
Change char to byte in gaf frame header
MHeasell/TAUtil,MHeasell/TAUtil
TAUtil/Gaf/Structures/GafFrameData.cs
TAUtil/Gaf/Structures/GafFrameData.cs
namespace TAUtil.Gaf.Structures { using System.IO; public struct GafFrameData { public ushort Width; public ushort Height; public ushort XPos; public ushort YPos; public byte Unknown1; public bool Compressed; public ushort FramePointers; public uint Unknown2; public uint PtrFrameData; public uint Unknown3; public static void Read(Stream f, ref GafFrameData e) { BinaryReader b = new BinaryReader(f); e.Width = b.ReadUInt16(); e.Height = b.ReadUInt16(); e.XPos = b.ReadUInt16(); e.YPos = b.ReadUInt16(); e.Unknown1 = b.ReadByte(); e.Compressed = b.ReadBoolean(); e.FramePointers = b.ReadUInt16(); e.Unknown2 = b.ReadUInt32(); e.PtrFrameData = b.ReadUInt32(); e.Unknown3 = b.ReadUInt32(); } } }
namespace TAUtil.Gaf.Structures { using System.IO; public struct GafFrameData { public ushort Width; public ushort Height; public ushort XPos; public ushort YPos; public char Unknown1; public bool Compressed; public ushort FramePointers; public uint Unknown2; public uint PtrFrameData; public uint Unknown3; public static void Read(Stream f, ref GafFrameData e) { BinaryReader b = new BinaryReader(f); e.Width = b.ReadUInt16(); e.Height = b.ReadUInt16(); e.XPos = b.ReadUInt16(); e.YPos = b.ReadUInt16(); e.Unknown1 = b.ReadChar(); e.Compressed = b.ReadBoolean(); e.FramePointers = b.ReadUInt16(); e.Unknown2 = b.ReadUInt32(); e.PtrFrameData = b.ReadUInt32(); e.Unknown3 = b.ReadUInt32(); } } }
mit
C#
6cc98764d3dbbd69dc10dc9485890ade24463de8
Make SplitTrimmed give empty list when given white-space-only string
mccarthyrb/libpalaso,hatton/libpalaso,JohnThomson/libpalaso,andrew-polk/libpalaso,ermshiperete/libpalaso,andrew-polk/libpalaso,ddaspit/libpalaso,glasseyes/libpalaso,glasseyes/libpalaso,tombogle/libpalaso,tombogle/libpalaso,chrisvire/libpalaso,ermshiperete/libpalaso,chrisvire/libpalaso,ermshiperete/libpalaso,darcywong00/libpalaso,marksvc/libpalaso,marksvc/libpalaso,darcywong00/libpalaso,gmartin7/libpalaso,gtryus/libpalaso,sillsdev/libpalaso,darcywong00/libpalaso,gtryus/libpalaso,glasseyes/libpalaso,mccarthyrb/libpalaso,ermshiperete/libpalaso,hatton/libpalaso,chrisvire/libpalaso,ddaspit/libpalaso,hatton/libpalaso,ddaspit/libpalaso,JohnThomson/libpalaso,glasseyes/libpalaso,gmartin7/libpalaso,gmartin7/libpalaso,mccarthyrb/libpalaso,JohnThomson/libpalaso,andrew-polk/libpalaso,tombogle/libpalaso,JohnThomson/libpalaso,ddaspit/libpalaso,chrisvire/libpalaso,gmartin7/libpalaso,gtryus/libpalaso,mccarthyrb/libpalaso,hatton/libpalaso,sillsdev/libpalaso,sillsdev/libpalaso,andrew-polk/libpalaso,marksvc/libpalaso,tombogle/libpalaso,gtryus/libpalaso,sillsdev/libpalaso
Palaso/Extensions/StringExtensions.cs
Palaso/Extensions/StringExtensions.cs
using System.Collections.Generic; namespace Palaso.Extensions { public static class StringExtensions { public static List<string> SplitTrimmed(this string s, char seperator) { if(s.Trim() == string.Empty) return new List<string>(); var x = s.Split(seperator); var r = new List<string>(); foreach (var part in x) { r.Add(part.Trim()); } return r; } } }
using System.Collections.Generic; namespace Palaso.Extensions { public static class StringExtensions { public static List<string> SplitTrimmed(this string s, char seperator) { var x = s.Split(seperator); var r = new List<string>(); foreach (var part in x) { r.Add(part.Trim()); } return r; } } }
mit
C#
64eab373e2e50257175a002d24d23088ec3d7e24
add properties to ShippingLine
addsb/ShopifySharp,clement911/ShopifySharp,nozzlegear/ShopifySharp
ShopifySharp/Entities/ShippingLine.cs
ShopifySharp/Entities/ShippingLine.cs
using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace ShopifySharp { public class ShippingLine { /// <summary> /// The carrier provided identifier. /// </summary> [JsonProperty("carrier_identifier")] public string CarrierIdentifier { get; set; } /// <summary> /// A reference to the shipping method. /// </summary> [JsonProperty("code")] public string Code { get; set; } /// <summary> /// The price of this shipping method. /// </summary> [JsonProperty("price")] public decimal? Price { get; set; } /// <summary> /// The discounted price of this shipping method. /// </summary> [JsonProperty("discounted_price")] public decimal? DiscountedPrice { get; set; } /// <summary> /// The source of the shipping method. /// </summary> [JsonProperty("source")] public string Source { get; set; } /// <summary> /// The title of the shipping method. /// </summary> [JsonProperty("title")] public string Title { get; set; } /// <summary> /// A list of <see cref="TaxLine"/> objects, each of which details the taxes applicable to this <see cref="ShippingLine"/>. /// </summary> [JsonProperty("tax_lines")] public IEnumerable<TaxLine> TaxLines { get; set; } } }
using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace ShopifySharp { public class ShippingLine { /// <summary> /// A reference to the shipping method. /// </summary> [JsonProperty("code")] public string Code { get; set; } /// <summary> /// The price of this shipping method. /// </summary> [JsonProperty("price")] public decimal? Price { get; set; } /// <summary> /// The source of the shipping method. /// </summary> [JsonProperty("source")] public string Source { get; set; } /// <summary> /// The title of the shipping method. /// </summary> [JsonProperty("title")] public string Title { get; set; } /// <summary> /// A list of <see cref="TaxLine"/> objects, each of which details the taxes applicable to this <see cref="ShippingLine"/>. /// </summary> [JsonProperty("tax_lines")] public IEnumerable<TaxLine> TaxLines { get; set; } } }
mit
C#
1885cefbd0ebb06d65ed0eb2b0bea014dae8295c
Make sure password validation works after saving
dlidstrom/Snittlistan,dlidstrom/Snittlistan,dlidstrom/Snittlistan
Snittlistan.Test/SerializationTest.cs
Snittlistan.Test/SerializationTest.cs
namespace Snittlistan.Test { using System.IO; using System.Text; using Models; using Raven.Imports.Newtonsoft.Json; using Xunit; public class SerializationTest : DbTest { [Fact] public void CanSerialize8x4Match() { // Arrange var serializer = Store.Conventions.CreateSerializer(); var builder = new StringBuilder(); // Act serializer.Serialize(new StringWriter(builder), DbSeed.Create8x4Match()); string text = builder.ToString(); var match = serializer.Deserialize<Match8x4>(new JsonTextReader(new StringReader(text))); // Assert TestData.VerifyTeam(match.AwayTeam); } [Fact] public void CanSerialize4x4Match() { // Arrange var serializer = Store.Conventions.CreateSerializer(); var builder = new StringBuilder(); // Act serializer.Serialize(new StringWriter(builder), DbSeed.Create4x4Match()); string text = builder.ToString(); var match = serializer.Deserialize<Match4x4>(new JsonTextReader(new StringReader(text))); // Assert TestData.VerifyTeam(match.HomeTeam); } [Fact] public void CanSerializeUser() { // Arrange var user = new User("firstName", "lastName", "e@d.com", "some-pass"); // Act using (var session = Store.OpenSession()) { session.Store(user); session.SaveChanges(); } // Assert using (var session = Store.OpenSession()) { var loadedUser = session.Load<User>(user.Id); Assert.True(loadedUser.ValidatePassword("some-pass"), "Password validation failed"); } } } }
namespace Snittlistan.Test { using System.IO; using System.Text; using Models; using Raven.Imports.Newtonsoft.Json; using Xunit; public class SerializationTest : DbTest { [Fact] public void CanSerialize8x4Match() { // Arrange var serializer = Store.Conventions.CreateSerializer(); var builder = new StringBuilder(); // Act serializer.Serialize(new StringWriter(builder), DbSeed.Create8x4Match()); string text = builder.ToString(); var match = serializer.Deserialize<Match8x4>(new JsonTextReader(new StringReader(text))); // Assert TestData.VerifyTeam(match.AwayTeam); } [Fact] public void CanSerialize4x4Match() { // Arrange var serializer = Store.Conventions.CreateSerializer(); var builder = new StringBuilder(); // Act serializer.Serialize(new StringWriter(builder), DbSeed.Create4x4Match()); string text = builder.ToString(); var match = serializer.Deserialize<Match4x4>(new JsonTextReader(new StringReader(text))); // Assert TestData.VerifyTeam(match.HomeTeam); } } }
mit
C#
6875f734cf25452816e6ea2124d8db34ada5a055
Update Program.cs
miladinoviczeljko/GitTest1
ConsoleApp1/ConsoleApp1/Program.cs
ConsoleApp1/ConsoleApp1/Program.cs
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace ConsoleApp1 { class Program { static void Main(string[] args) { // Code was added in GitHub } } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace ConsoleApp1 { class Program { static void Main(string[] args) { } } }
mit
C#
1a884b9653ce346cd31a1a823430d7aa08a2661f
Introduce FindExisting on to ConstructorArgList
DivineInject/DivineInject,DivineInject/DivineInject
DivineInject/ConstructorArgList.cs
DivineInject/ConstructorArgList.cs
using System.Collections.Generic; using System.Reflection.Emit; namespace DivineInject { public interface IConstructorArgList { void Add(IConstructorArgDefinition defn); IList<IConstructorArg> Arguments { get; } IConstructorArg FindExisting(IConstructorArgDefinition defn); } internal class ConstructorArgList : IConstructorArgList { private readonly TypeBuilder m_tb; public ConstructorArgList(TypeBuilder tb) { m_tb = tb; Arguments = new List<IConstructorArg>(); } public IList<IConstructorArg> Arguments { get; private set; } public void Add(IConstructorArgDefinition defn) { if (FindExisting(defn) == null) Arguments.Add(defn.Define(m_tb)); } public IConstructorArg FindExisting(IConstructorArgDefinition defn) { return defn.FindExisting(Arguments); } } }
using System.Collections.Generic; using System.Reflection.Emit; namespace DivineInject { public interface IConstructorArgList { void Add(IConstructorArgDefinition defn); IList<IConstructorArg> Arguments { get; } } internal class ConstructorArgList : IConstructorArgList { private readonly TypeBuilder m_tb; public ConstructorArgList(TypeBuilder tb) { m_tb = tb; Arguments = new List<IConstructorArg>(); } public void Add(IConstructorArgDefinition defn) { if (defn.FindExisting(Arguments) == null) Arguments.Add(defn.Define(m_tb)); } public IList<IConstructorArg> Arguments { get; private set; } } }
mit
C#
ed9d9b321955700cb9c551ac72057a40aa02ff7a
make it possible to set flags (e.g. PadFlags.ProxyCaps)
freedesktop-unofficial-mirror/gstreamer__gstreamer-sharp,GStreamer/gstreamer-sharp,gstreamer-sharp/gstreamer-sharp,gstreamer-sharp/gstreamer-sharp,gstreamer-sharp/gstreamer-sharp,freedesktop-unofficial-mirror/gstreamer__gstreamer-sharp,freedesktop-unofficial-mirror/gstreamer__gstreamer-sharp,GStreamer/gstreamer-sharp,GStreamer/gstreamer-sharp
sources/custom/Pad.cs
sources/custom/Pad.cs
// Copyright (C) 2013 Stephan Sundermann <stephansundermann@gmail.com> // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2.1 of the License, or (at your option) any later version. // // 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., 51 Franklin Street, Fifth Floor, Boston, MA // 02110-1301 USA namespace Gst { using System; using System.Runtime.InteropServices; partial class Pad { [GLib.Property ("caps")] public Gst.Caps Caps { get { GLib.Value val = GetProperty ("caps"); Gst.Caps ret = (Gst.Caps) val.Val; val.Dispose (); return ret; } } public new PadFlags Flags { get { return (PadFlags)base.Flags; } set { base.Flags = (uint)value; } } } }
// Copyright (C) 2013 Stephan Sundermann <stephansundermann@gmail.com> // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2.1 of the License, or (at your option) any later version. // // 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., 51 Franklin Street, Fifth Floor, Boston, MA // 02110-1301 USA namespace Gst { using System; using System.Runtime.InteropServices; partial class Pad { [GLib.Property ("caps")] public Gst.Caps Caps { get { GLib.Value val = GetProperty ("caps"); Gst.Caps ret = (Gst.Caps) val.Val; val.Dispose (); return ret; } } } }
lgpl-2.1
C#
930c46ba27ba9b2c0cb3c08b8ef48edad3d42994
add _OpenBrower for two kind of behavior
NDark/ndinfrastructure,NDark/ndinfrastructure
Unity/UnityTools/OnClickOpenBrower.cs
Unity/UnityTools/OnClickOpenBrower.cs
/** MIT License Copyright (c) 2017 NDark Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /** @file OnClickOpenBrower.cs @author NDark @date 20170501 . file started. */ using UnityEngine; public class OnClickOpenBrower : MonoBehaviour { public string m_Url = string.Empty ; public void OpenBrower() { _OpenBrower( true ) ; } public void RefreshBrower() { _OpenBrower( false ) ; } void _OpenBrower( bool _NewWindow ) { // Debug.Log( Application.platform ) ; if( Application.platform == RuntimePlatform.WebGLPlayer ) { string url = (true == _NewWindow ) ? "window.open('" + m_Url + "','aNewWindow')" : "window.open('" + m_Url + "','_self')" ; // Debug.Log( url ) ; Application.ExternalEval( url ); } else /*if( Application.platform == RuntimePlatform.WindowsPlayer || Application.platform == RuntimePlatform.WindowsEditor )*/ { Application.OpenURL( m_Url ) ; } } void OnClick() { OpenBrower() ; } }
/** MIT License Copyright (c) 2017 NDark Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /** @file OnClickOpenBrower.cs @author NDark @date 20170501 . file started. */ using UnityEngine; public class OnClickOpenBrower : MonoBehaviour { public string m_Url = string.Empty ; public void OpenBrower() { // Debug.Log( Application.platform ) ; if( Application.platform == RuntimePlatform.WebGLPlayer ) { string url = "window.open('" + m_Url + "','aNewWindow')" ; // Debug.Log( url ) ; Application.ExternalEval( url ); } else /*if( Application.platform == RuntimePlatform.WindowsPlayer || Application.platform == RuntimePlatform.WindowsEditor )*/ { Application.OpenURL( m_Url ) ; } } public void RefreshBrower() { // Debug.Log( Application.platform ) ; if( Application.platform == RuntimePlatform.WebGLPlayer ) { string url = "window.open('" + m_Url + "')" ; // Debug.Log( url ) ; Application.ExternalEval( url ); } else /*if( Application.platform == RuntimePlatform.WindowsPlayer || Application.platform == RuntimePlatform.WindowsEditor )*/ { Application.OpenURL( m_Url ) ; } } void OnClick() { OpenBrower() ; } }
mit
C#
ab7de76847aa6613c65066d0f3b0d89fe9bd5b9c
Update Producer.cs
Nikey646/VndbSharp
VndbSharp/Models/Producer/Producer.cs
VndbSharp/Models/Producer/Producer.cs
using System; using System.Collections.ObjectModel; using VndbSharp.Models.Common; using VndbSharp.Attributes; namespace VndbSharp.Models.Producer { public class Producer : ProducerCommon { public String Language { get; private set; } public ProducerLinks Links { get; private set; } [IsCsv] public ReadOnlyCollection<String> Aliases { get; private set; } public String Description { get; private set; } public ReadOnlyCollection<Relationship> Relations { get; private set; } } }
using System; using System.Collections.ObjectModel; using VndbSharp.Models.Common; namespace VndbSharp.Models.Producer { public class Producer : ProducerCommon { public String Language { get; private set; } public ProducerLinks Links { get; private set; } [IsCsv] public ReadOnlyCollection<String> Aliases { get; private set; } public String Description { get; private set; } public ReadOnlyCollection<Relationship> Relations { get; private set; } } }
mit
C#
f7a7dd8bc47ba974808ae9385ef1cc7c49f19854
Add overload for subscriptions on IBus
rbouallou/Zebus,Abc-Arbitrage/Zebus,biarne-a/Zebus,AtwooTM/Zebus
src/Abc.Zebus/IBus.cs
src/Abc.Zebus/IBus.cs
using System; using System.Threading.Tasks; namespace Abc.Zebus { public interface IBus : IDisposable { PeerId PeerId { get; } string Environment { get; } bool IsRunning { get; } void Configure(PeerId peerId, string environment); void Publish(IEvent message); Task<CommandResult> Send(ICommand message); Task<CommandResult> Send(ICommand message, Peer peer); IDisposable Subscribe(Subscription subscription, SubscriptionOptions options = SubscriptionOptions.Default); IDisposable Subscribe(Subscription[] subscriptions, SubscriptionOptions options = SubscriptionOptions.Default); IDisposable Subscribe<T>(Action<T> handler) where T : class, IMessage; IDisposable Subscribe(Subscription[] subscriptions, Action<IMessage> handler); IDisposable Subscribe(Subscription subscription, Action<IMessage> handler); void Reply(int errorCode); void Reply(IMessage response); void Start(); void Stop(); event Action Starting; event Action Started; event Action Stopping; event Action Stopped; } }
using System; using System.Threading.Tasks; namespace Abc.Zebus { public interface IBus : IDisposable { PeerId PeerId { get; } string Environment { get; } bool IsRunning { get; } void Configure(PeerId peerId, string environment); void Publish(IEvent message); Task<CommandResult> Send(ICommand message); Task<CommandResult> Send(ICommand message, Peer peer); IDisposable Subscribe(Subscription subscription, SubscriptionOptions options = SubscriptionOptions.Default); IDisposable Subscribe(Subscription[] subscriptions, SubscriptionOptions options = SubscriptionOptions.Default); IDisposable Subscribe<T>(Action<T> handler) where T : class, IMessage; IDisposable Subscribe(Subscription[] subscriptions, Action<IMessage> handler); void Reply(int errorCode); void Reply(IMessage response); void Start(); void Stop(); event Action Starting; event Action Started; event Action Stopping; event Action Stopped; } }
mit
C#
068524f077b3c6089b798678f0dadce8d031404c
Bump to version 0.1.4.
FacilityApi/FacilityCSharp
SolutionInfo.cs
SolutionInfo.cs
using System.Reflection; [assembly: AssemblyVersion("0.1.4.0")] [assembly: AssemblyCompany("")] [assembly: AssemblyCopyright("Copyright 2016 Ed Ball")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")]
using System.Reflection; [assembly: AssemblyVersion("0.1.3.0")] [assembly: AssemblyCompany("")] [assembly: AssemblyCopyright("Copyright 2016 Ed Ball")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")]
mit
C#
3efb396e5f5bf0e8ad4842ff2a64ec829ac94560
Bump version with from bootstrapper
jam40jeff/Paket,Stift/Paket,NatElkins/Paket,isaacabraham/Paket,snowcrazed/Paket,NatElkins/Paket,artur-s/Paket,simonhdickson/Paket,mrinaldi/Paket,0x53A/Paket,isaacabraham/Paket,sergey-tihon/Paket,Thorium/Paket,0x53A/Paket,isaacabraham/Paket,Thorium/Paket,vbfox/Paket,baronfel/Paket,mrinaldi/Paket,thinkbeforecoding/Paket,simonhdickson/Paket,inosik/Paket,lexarchik/Paket,cloudRoutine/Paket,fsprojects/Paket,lexarchik/Paket,lexarchik/Paket,vbfox/Paket,0x53A/Paket,theimowski/Paket,NatElkins/Paket,artur-s/Paket,lexarchik/Paket,cloudRoutine/Paket,vbfox/Paket,cloudRoutine/Paket,Stift/Paket,simonhdickson/Paket,sergey-tihon/Paket,baronfel/Paket,jam40jeff/Paket,theimowski/Paket,vbfox/Paket,thinkbeforecoding/Paket,isaacabraham/Paket,mrinaldi/Paket,thinkbeforecoding/Paket,simonhdickson/Paket,0x53A/Paket,snowcrazed/Paket,inosik/Paket,Thorium/Paket,Stift/Paket,Stift/Paket,Thorium/Paket,snowcrazed/Paket,snowcrazed/Paket,mrinaldi/Paket,fsprojects/Paket,cloudRoutine/Paket,NatElkins/Paket,thinkbeforecoding/Paket
src/Paket.Bootstrapper/PaketRunner.cs
src/Paket.Bootstrapper/PaketRunner.cs
using System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; namespace Paket.Bootstrapper { class PaketRunner { static readonly Version VersionWithFromBootstrapper = new Version("3.23.3"); static IEnumerable<string> SetBootstrapperArgument(string program, IEnumerable<string> arguments) { var versionInfo = FileVersionInfo.GetVersionInfo(program); var version = new Version(versionInfo.FileVersion); return version >= VersionWithFromBootstrapper ? new[] {"--from-bootstrapper"}.Concat(arguments) : arguments; } public static int Run(string program, IEnumerable<string> arguments) { arguments = SetBootstrapperArgument(program, arguments); var argString = WindowsProcessArguments.ToString(arguments); var process = new Process { StartInfo = { FileName = program, Arguments = argString, UseShellExecute = false } }; process.Start(); process.WaitForExit(); return process.ExitCode; } } }
using System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; namespace Paket.Bootstrapper { class PaketRunner { static readonly Version VersionWithFromBootstrapper = new Version("3.23.2"); static IEnumerable<string> SetBootstrapperArgument(string program, IEnumerable<string> arguments) { var versionInfo = FileVersionInfo.GetVersionInfo(program); var version = new Version(versionInfo.FileVersion); return version >= VersionWithFromBootstrapper ? new[] {"--from-bootstrapper"}.Concat(arguments) : arguments; } public static int Run(string program, IEnumerable<string> arguments) { arguments = SetBootstrapperArgument(program, arguments); var argString = WindowsProcessArguments.ToString(arguments); var process = new Process { StartInfo = { FileName = program, Arguments = argString, UseShellExecute = false } }; process.Start(); process.WaitForExit(); return process.ExitCode; } } }
mit
C#
cf1a1818f9663af183d26e0b9916960f8d7835b2
Update undocumented org.freedesktop.DBus members
Tragetaschen/dbus-sharp,arfbtwn/dbus-sharp,openmedicus/dbus-sharp,mono/dbus-sharp,arfbtwn/dbus-sharp,mono/dbus-sharp,Tragetaschen/dbus-sharp,openmedicus/dbus-sharp
src/DBus.cs
src/DBus.cs
// Copyright 2006 Alp Toker <alp@atoker.com> // This software is made available under the MIT License // See COPYING for details using System; using NDesk.DBus; //namespace org.freedesktop.DBus namespace org.freedesktop.DBus { /* //what's this for? public class DBusException : ApplicationException { } */ #if UNDOCUMENTED_IN_SPEC //TODO: maybe this should be mapped to its CLR counterpart directly? //not yet used [Interface ("org.freedesktop.DBus.Error.InvalidArgs")] public class InvalidArgsException : ApplicationException { } #endif [Flags] public enum NameFlag : uint { None = 0, AllowReplacement = 0x1, ReplaceExisting = 0x2, DoNotQueue = 0x4, } public enum NameReply : uint { PrimaryOwner = 1, InQueue, Exists, AlreadyOwner, } public enum ReleaseNameReply : uint { Released = 1, NonExistent, NotOwner, } public enum StartReply : uint { //The service was successfully started. Success = 1, //A connection already owns the given name. AlreadyRunning, } public delegate void NameOwnerChangedHandler (string name, string old_owner, string new_owner); public delegate void NameAcquiredHandler (string name); public delegate void NameLostHandler (string name); [Interface ("org.freedesktop.DBus.Peer")] public interface Peer { void Ping (); [return: Argument ("machine_uuid")] string GetMachineId (); } [Interface ("org.freedesktop.DBus.Introspectable")] public interface Introspectable { [return: Argument ("data")] string Introspect (); } [Interface ("org.freedesktop.DBus.Properties")] public interface Properties { //TODO: some kind of indexer mapping? //object this [string propname] {get; set;} [return: Argument ("value")] object Get (string @interface, string propname); //void Get (string @interface, string propname, out object value); void Set (string @interface, string propname, object value); } [Interface ("org.freedesktop.DBus")] public interface IBus : Introspectable { NameReply RequestName (string name, NameFlag flags); ReleaseNameReply ReleaseName (string name); string Hello (); string[] ListNames (); string[] ListActivatableNames (); bool NameHasOwner (string name); event NameOwnerChangedHandler NameOwnerChanged; event NameLostHandler NameLost; event NameAcquiredHandler NameAcquired; StartReply StartServiceByName (string name, uint flags); string GetNameOwner (string name); uint GetConnectionUnixUser (string connection_name); void AddMatch (string rule); void RemoveMatch (string rule); #if UNDOCUMENTED_IN_SPEC //undocumented in spec string[] ListQueuedOwners (string name); uint GetConnectionUnixProcessID (string connection_name); byte[] GetConnectionSELinuxSecurityContext (string connection_name); void ReloadConfig (); #endif } }
// Copyright 2006 Alp Toker <alp@atoker.com> // This software is made available under the MIT License // See COPYING for details using System; using NDesk.DBus; //namespace org.freedesktop.DBus namespace org.freedesktop.DBus { /* //what's this for? public class DBusException : ApplicationException { } */ #if UNDOCUMENTED_IN_SPEC //TODO: maybe this should be mapped to its CLR counterpart directly? //not yet used [Interface ("org.freedesktop.DBus.Error.InvalidArgs")] public class InvalidArgsException : ApplicationException { } #endif [Flags] public enum NameFlag : uint { None = 0, AllowReplacement = 0x1, ReplaceExisting = 0x2, DoNotQueue = 0x4, } public enum NameReply : uint { PrimaryOwner = 1, InQueue, Exists, AlreadyOwner, } public enum ReleaseNameReply : uint { Released = 1, NonExistent, NotOwner, } public enum StartReply : uint { //The service was successfully started. Success = 1, //A connection already owns the given name. AlreadyRunning, } public delegate void NameOwnerChangedHandler (string name, string old_owner, string new_owner); public delegate void NameAcquiredHandler (string name); public delegate void NameLostHandler (string name); [Interface ("org.freedesktop.DBus.Peer")] public interface Peer { void Ping (); [return: Argument ("machine_uuid")] string GetMachineId (); } [Interface ("org.freedesktop.DBus.Introspectable")] public interface Introspectable { [return: Argument ("data")] string Introspect (); } [Interface ("org.freedesktop.DBus.Properties")] public interface Properties { //TODO: some kind of indexer mapping? //object this [string propname] {get; set;} [return: Argument ("value")] object Get (string @interface, string propname); //void Get (string @interface, string propname, out object value); void Set (string @interface, string propname, object value); } [Interface ("org.freedesktop.DBus")] public interface IBus : Introspectable { NameReply RequestName (string name, NameFlag flags); ReleaseNameReply ReleaseName (string name); string Hello (); string[] ListNames (); string[] ListActivatableNames (); bool NameHasOwner (string name); event NameOwnerChangedHandler NameOwnerChanged; event NameLostHandler NameLost; event NameAcquiredHandler NameAcquired; StartReply StartServiceByName (string name, uint flags); string GetNameOwner (string name); uint GetConnectionUnixUser (string connection_name); void AddMatch (string rule); void RemoveMatch (string rule); #if UNDOCUMENTED_IN_SPEC //undocumented in spec //there are more of these void ReloadConfig (); #endif } }
mit
C#
fdf5a53d0e5248c05248be1cf71c78a7ce7e75ad
Update Scene Loader script-side
Prouser123/Unity-Collectables
Assets/Scripts/EventHandler.cs
Assets/Scripts/EventHandler.cs
using UnityEngine; using UnityEngine.SceneManagement; using UnityEngine.UI; public class EventHandler : MonoBehaviour { // Quit the Game public void Exit() { Application.Quit(); } // Loading Stats public Text Stats_HLCText; public bool statsOpen = false; private void Update() { if (statsOpen == true) { PlayerPrefs.Save(); Stats_HLCText.text = PlayerPrefs.GetString("HLC"); if (PlayerPrefs.GetString("HLC") == "") { Stats_HLCText.text = "No Levels Completed"; } } } // Running Settings public Button settingsResetButton; public Color settingsHighlightOff = new Color(255, 255, 255, 255); // public GameObject levelID; public void Settings_ResetData() { PlayerPrefs.DeleteAll(); Debug.LogWarning("All PlayerPrefs have been deleted."); // Fix Button Colour ColorBlock cb = settingsResetButton.colors; cb.highlightedColor = settingsHighlightOff; settingsResetButton.colors = cb; } // Scene Loader public void LoadScene(int scene) { SceneManager.LoadSceneAsync(scene, LoadSceneMode.Single); } }
using UnityEngine; using UnityEngine.SceneManagement; using UnityEngine.UI; public class EventHandler : MonoBehaviour { // Quit the Game public void Exit() { Application.Quit(); } // Loading Stats public Text Stats_HLCText; public bool statsOpen = false; private void Update() { if (statsOpen == true) { PlayerPrefs.Save(); Stats_HLCText.text = PlayerPrefs.GetString("HLC"); if (PlayerPrefs.GetString("HLC") == "") { Stats_HLCText.text = "No Levels Completed"; } } } // Running Settings public Button settingsResetButton; public Color settingsHighlightOff = new Color(255, 255, 255, 255); // public GameObject levelID; public void Settings_ResetData() { PlayerPrefs.DeleteAll(); Debug.LogWarning("All PlayerPrefs have been deleted."); // Fix Button Colour ColorBlock cb = settingsResetButton.colors; cb.highlightedColor = settingsHighlightOff; settingsResetButton.colors = cb; } // Loading Scenes // Menu - 0 // Stats - 6 // Settings - 1 // About - 4 // L1 - 2 // L2 - 3 // L3 - 5 public void Scene_Menu() { SceneManager.LoadSceneAsync(0, LoadSceneMode.Single); } public void Scene_Stats() { SceneManager.LoadSceneAsync(6, LoadSceneMode.Single); } public void Scene_Settings() { SceneManager.LoadSceneAsync(1, LoadSceneMode.Single); } public void Scene_About() { SceneManager.LoadSceneAsync(4, LoadSceneMode.Single); } public void Scene_L1() { SceneManager.LoadSceneAsync(2, LoadSceneMode.Single); } public void Scene_L2() { SceneManager.LoadSceneAsync(3, LoadSceneMode.Single); } public void Scene_L3() { SceneManager.LoadSceneAsync(5, LoadSceneMode.Single); } }
apache-2.0
C#
83f850a299f31e2f0e65dbd467dd33e2b4a84476
Fix UTF-16.
pleroy/Principia,pleroy/Principia,pleroy/Principia,mockingbirdnest/Principia,mockingbirdnest/Principia,mockingbirdnest/Principia,pleroy/Principia,mockingbirdnest/Principia
ksp_plugin_adapter/utf16_marshaler.cs
ksp_plugin_adapter/utf16_marshaler.cs
using System; using System.Runtime.InteropServices; namespace principia { namespace ksp_plugin_adapter { // A marshaler that knows how to encode/decode UTF-16 strings whose ownership is // not taken from C++. internal class UnownedUTF16Marshaler : MonoMarshaler { public static ICustomMarshaler GetInstance(string s) { return instance_; } public override void CleanUpNativeDataImplementation(IntPtr native_data) { throw Log.Fatal("use |MarshalAs(UnmanagedType.LPWStr)| for in parameters"); } public override IntPtr MarshalManagedToNativeImplementation( object managed_object) { throw Log.Fatal("use |MarshalAs(UnmanagedType.LPWStr)| for in parameters"); } public override object MarshalNativeToManaged(IntPtr native_data) { return Marshal.PtrToStringUni(native_data); } private static readonly UnownedUTF16Marshaler instance_ = new UnownedUTF16Marshaler(); } // A marshaler for UTF-16 strings whose ownership is taken from C++. Useful for // out parameters and returned values. internal class OwnedUTF16Marshaler : UnownedUTF16Marshaler { public new static ICustomMarshaler GetInstance(string s) { return instance_; } public override object MarshalNativeToManaged(IntPtr native_data) { var result = base.MarshalNativeToManaged(native_data); Interface.DeleteU16String(ref native_data); return result; } private static readonly OwnedUTF16Marshaler instance_ = new OwnedUTF16Marshaler(); } } // namespace ksp_plugin_adapter } // namespace principia
using System; using System.Runtime.InteropServices; namespace principia { namespace ksp_plugin_adapter { // A marshaler that knows how to encode/decode UTF-16 strings whose ownership is // not taken from C++. internal class UnownedUTF16Marshaler : MonoMarshaler { public static ICustomMarshaler GetInstance(string s) { return instance_; } public override void CleanUpNativeDataImplementation(IntPtr native_data) { throw Log.Fatal("use |MarshalAs(UnmanagedType.LPWStr)| for in parameters"); Interface.DeleteU16String(ref native_data); } public override IntPtr MarshalManagedToNativeImplementation( object managed_object) { throw Log.Fatal("use |MarshalAs(UnmanagedType.LPWStr)| for in parameters"); } public override object MarshalNativeToManaged(IntPtr native_data) { return Marshal.PtrToStringUni(native_data); } private static readonly UnownedUTF16Marshaler instance_ = new UnownedUTF16Marshaler(); } // A marshaler for UTF-16 strings whose ownership is taken from C++. Useful for // out parameters and returned values. internal class OwnedUTF16Marshaler : UnownedUTF16Marshaler { public new static ICustomMarshaler GetInstance(string s) { return instance_; } public override object MarshalNativeToManaged(IntPtr native_data) { var result = base.MarshalNativeToManaged(native_data); Interface.DeleteString(ref native_data); return result; } private static readonly OwnedUTF16Marshaler instance_ = new OwnedUTF16Marshaler(); } } // namespace ksp_plugin_adapter } // namespace principia
mit
C#
2927097e8e95d8d506fa52ae49a0930c61b5f548
Add TLS 1.3 to default security protocols
chylex/TweetDuck,chylex/TweetDuck,chylex/TweetDuck,chylex/TweetDuck
lib/TweetLib.Utils/Static/WebUtils.cs
lib/TweetLib.Utils/Static/WebUtils.cs
using System; using System.ComponentModel; using System.IO; using System.Net; namespace TweetLib.Utils.Static { public static class WebUtils { public static string DefaultUserAgent { get; set; } = ""; private static bool hasMicrosoftBeenBroughtTo2008Yet; private static bool hasSystemProxyBeenEnabled; private static void EnsureModernTLS() { if (!hasMicrosoftBeenBroughtTo2008Yet) { #pragma warning disable CS0618 ServicePointManager.SecurityProtocol |= SecurityProtocolType.Tls12 | SecurityProtocolType.Tls13; ServicePointManager.SecurityProtocol &= ~(SecurityProtocolType.Ssl3 | SecurityProtocolType.Tls | SecurityProtocolType.Tls11); #pragma warning restore CS0618 hasMicrosoftBeenBroughtTo2008Yet = true; } } private static bool UseSystemProxy { get; set; } = false; public static void EnableSystemProxy() { if (!hasSystemProxyBeenEnabled) { UseSystemProxy = true; hasSystemProxyBeenEnabled = true; } } public static WebClient NewClient(string? userAgent = null) { EnsureModernTLS(); WebClient client = new WebClient(); if (!UseSystemProxy) { client.Proxy = null; } client.Headers[HttpRequestHeader.UserAgent] = userAgent ?? DefaultUserAgent; return client; } public static AsyncCompletedEventHandler FileDownloadCallback(string file, Action? onSuccess, Action<Exception>? onFailure) { return (_, args) => { if (args.Cancelled) { TryDeleteFile(file); } else if (args.Error != null) { TryDeleteFile(file); onFailure?.Invoke(args.Error); } else { onSuccess?.Invoke(); } }; } private static void TryDeleteFile(string file) { try { File.Delete(file); } catch { // didn't want it deleted anyways } } } }
using System; using System.ComponentModel; using System.IO; using System.Net; namespace TweetLib.Utils.Static { public static class WebUtils { public static string DefaultUserAgent { get; set; } = ""; private static bool hasMicrosoftBeenBroughtTo2008Yet; private static bool hasSystemProxyBeenEnabled; private static void EnsureTLS12() { if (!hasMicrosoftBeenBroughtTo2008Yet) { #pragma warning disable CS0618 ServicePointManager.SecurityProtocol |= SecurityProtocolType.Tls12; ServicePointManager.SecurityProtocol &= ~(SecurityProtocolType.Ssl3 | SecurityProtocolType.Tls | SecurityProtocolType.Tls11); #pragma warning restore CS0618 hasMicrosoftBeenBroughtTo2008Yet = true; } } private static bool UseSystemProxy { get; set; } = false; public static void EnableSystemProxy() { if (!hasSystemProxyBeenEnabled) { UseSystemProxy = true; hasSystemProxyBeenEnabled = true; } } public static WebClient NewClient(string? userAgent = null) { EnsureTLS12(); WebClient client = new WebClient(); if (!UseSystemProxy) { client.Proxy = null; } client.Headers[HttpRequestHeader.UserAgent] = userAgent ?? DefaultUserAgent; return client; } public static AsyncCompletedEventHandler FileDownloadCallback(string file, Action? onSuccess, Action<Exception>? onFailure) { return (_, args) => { if (args.Cancelled) { TryDeleteFile(file); } else if (args.Error != null) { TryDeleteFile(file); onFailure?.Invoke(args.Error); } else { onSuccess?.Invoke(); } }; } private static void TryDeleteFile(string file) { try { File.Delete(file); } catch { // didn't want it deleted anyways } } } }
mit
C#
72b6c4406857e01bfaae505d224471d6094ed466
Fix docs
treehopper-electronics/treehopper-sdk,treehopper-electronics/treehopper-sdk,treehopper-electronics/treehopper-sdk,treehopper-electronics/treehopper-sdk,treehopper-electronics/treehopper-sdk,treehopper-electronics/treehopper-sdk
NET/Demos/Console/Blink/Program.cs
NET/Demos/Console/Blink/Program.cs
using System; using Treehopper; using System.Threading.Tasks; using System.Diagnostics; using System.Collections.Generic; using System.Threading; namespace Blink { /// <summary> /// This demo blinks the built-in LED using async programming. /// </summary> class Program { static TreehopperUsb Board; static void Main(string[] args) { // We can't do async calls from the Console's Main() function, so we run all our code in a separate async method. RunBlink().Wait(); } static async Task RunBlink() { while (true) { Console.Write("Waiting for board..."); // Get a reference to the first TreehopperUsb board connected. This will await indefinitely until a board is connected. Board = await ConnectionService.Instance.GetFirstDeviceAsync(); Console.WriteLine("Found board: " + Board); Console.WriteLine("Version: " + Board.Version); // You must explicitly connect to a board before communicating with it await Board.ConnectAsync(); Board.Pins[0].SoftPwm.Enabled = true; Board.Pins[0].SoftPwm.DutyCycle = 0.5; Console.WriteLine("Start blinking. Press any key to stop."); while (Board.IsConnected && !Console.KeyAvailable) { // toggle the LED. Board.Led = !Board.Led; await Task.Delay(100); } } } } }
using System; using Treehopper; using System.Threading.Tasks; using System.Diagnostics; using System.Collections.Generic; namespace Blink { /// <summary> /// This demo blinks the built-in LED using basic procedural programming. /// </summary> /// <remarks> /// <para> /// This example illustrates how to work with Treehopper boards procedurally to blink an LED. /// </para> /// </remarks> class Program { static TreehopperUsb Board; static void Main(string[] args) { RunBlink().Wait(); } static async Task RunBlink() { while (true) { Console.Write("Waiting for board..."); // Get a reference to the first TreehopperUsb board connected. This will await indefinitely until a board is connected. //TreehopperManager manager = new TreehopperManager(); //manager.BoardAdded += Manager_BoardAdded; Board = await ConnectionService.Instance.GetFirstDeviceAsync(); Console.WriteLine("Found board: " + Board); Console.WriteLine("Version: " + Board.Version); // You must explicitly open a board before communicating with it await Board.ConnectAsync(); while (Board.IsConnected) { // toggle the LED Board.Led = !Board.Led; // wait 500 ms await Task.Delay(100); } // We arrive here when the board has been disconnected Console.WriteLine("Board has been disconnected."); } } } }
mit
C#
34679399f3757ede649ec0219f03522651f11eca
Fix incorrect version number in the About dialog
PintaProject/Pinta,Fenex/Pinta,jakeclawson/Pinta,Mailaender/Pinta,Mailaender/Pinta,Fenex/Pinta,jakeclawson/Pinta,PintaProject/Pinta,PintaProject/Pinta
Pinta/Dialogs/AboutPintaTabPage.cs
Pinta/Dialogs/AboutPintaTabPage.cs
// AboutPintaTabPage.cs // // Author: // Viktoria Dudka (viktoriad@remobjects.com) // // Copyright (c) 2009 RemObjects Software // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. // // using System; using Gtk; using Mono.Unix; namespace Pinta { internal class AboutPintaTabPage : VBox { public AboutPintaTabPage () { Label label = new Label (); label.Markup = String.Format ( "<b>{0}</b>\n {1}", Catalog.GetString ("Version"), "1.1"); HBox hBoxVersion = new HBox (); hBoxVersion.PackStart (label, false, false, 5); this.PackStart (hBoxVersion, false, true, 0); label = null; label = new Label (); label.Markup = string.Format ("<b>{0}</b>\n {1}", Catalog.GetString ("License"), Catalog.GetString ("Released under the MIT X11 License.")); HBox hBoxLicense = new HBox (); hBoxLicense.PackStart (label, false, false, 5); this.PackStart (hBoxLicense, false, true, 5); label = null; label = new Label (); label.Markup = string.Format ("<b>{0}</b>\n (c) 2010-2011 {1}", Catalog.GetString ("Copyright"), Catalog.GetString ("by Pinta contributors")); HBox hBoxCopyright = new HBox (); hBoxCopyright.PackStart (label, false, false, 5); this.PackStart (hBoxCopyright, false, true, 5); this.ShowAll (); } } }
// AboutPintaTabPage.cs // // Author: // Viktoria Dudka (viktoriad@remobjects.com) // // Copyright (c) 2009 RemObjects Software // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. // // using System; using Gtk; using Mono.Unix; namespace Pinta { internal class AboutPintaTabPage : VBox { public AboutPintaTabPage () { Label label = new Label (); label.Markup = String.Format ( "<b>{0}</b>\n {1}", Catalog.GetString ("Version"), "0.8"); HBox hBoxVersion = new HBox (); hBoxVersion.PackStart (label, false, false, 5); this.PackStart (hBoxVersion, false, true, 0); label = null; label = new Label (); label.Markup = string.Format ("<b>{0}</b>\n {1}", Catalog.GetString ("License"), Catalog.GetString ("Released under the MIT X11 License.")); HBox hBoxLicense = new HBox (); hBoxLicense.PackStart (label, false, false, 5); this.PackStart (hBoxLicense, false, true, 5); label = null; label = new Label (); label.Markup = string.Format ("<b>{0}</b>\n (c) 2010-2011 {1}", Catalog.GetString ("Copyright"), Catalog.GetString ("by Pinta contributors")); HBox hBoxCopyright = new HBox (); hBoxCopyright.PackStart (label, false, false, 5); this.PackStart (hBoxCopyright, false, true, 5); this.ShowAll (); } } }
mit
C#
4100c4fe9f70147f964e9e9cc275359b84cedc36
Fix order of methods
naoey/osu,DrabWeb/osu,NeoAdonis/osu,2yangk23/osu,johnneijzen/osu,EVAST9919/osu,2yangk23/osu,Nabile-Rahmani/osu,peppy/osu,osu-RP/osu-RP,peppy/osu-new,ZLima12/osu,UselessToucan/osu,Damnae/osu,naoey/osu,UselessToucan/osu,DrabWeb/osu,EVAST9919/osu,smoogipoo/osu,naoey/osu,smoogipooo/osu,peppy/osu,ppy/osu,smoogipoo/osu,NeoAdonis/osu,johnneijzen/osu,Drezi126/osu,Frontear/osuKyzer,peppy/osu,smoogipoo/osu,UselessToucan/osu,tacchinotacchi/osu,ppy/osu,DrabWeb/osu,NeoAdonis/osu,ZLima12/osu,ppy/osu
osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SpinnerBackground.cs
osu.Game.Rulesets.Osu/Objects/Drawables/Pieces/SpinnerBackground.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 OpenTK.Graphics; using osu.Framework.Allocation; using osu.Framework.Extensions.Color4Extensions; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Sprites; using osu.Game.Graphics; namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces { public class SpinnerBackground : CircularContainer, IHasAccentColour { public override bool HandleInput => false; protected Sprite Disc; public Color4 AccentColour { get { return Disc.Colour; } set { Disc.Colour = value; } } public SpinnerBackground() { RelativeSizeAxes = Axes.Both; Masking = true; Children = new Drawable[] { Disc = new Box { Origin = Anchor.Centre, Anchor = Anchor.Centre, RelativeSizeAxes = Axes.Both, Alpha = 1, }, }; } [BackgroundDependencyLoader] private void load(OsuColour colours) { EdgeEffect = new EdgeEffect { Type = EdgeEffectType.Glow, Radius = 14, Colour = colours.BlueLight.Opacity(0.3f), }; } } }
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>. // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using OpenTK.Graphics; using osu.Framework.Allocation; using osu.Framework.Extensions.Color4Extensions; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Sprites; using osu.Game.Graphics; namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces { public class SpinnerBackground : CircularContainer, IHasAccentColour { public override bool HandleInput => false; protected Sprite Disc; public Color4 AccentColour { get { return Disc.Colour; } set { Disc.Colour = value; } } [BackgroundDependencyLoader] private void load(OsuColour colours) { EdgeEffect = new EdgeEffect { Type = EdgeEffectType.Glow, Radius = 14, Colour = colours.BlueLight.Opacity(0.3f), }; } public SpinnerBackground() { RelativeSizeAxes = Axes.Both; Masking = true; Children = new Drawable[] { Disc = new Box { Origin = Anchor.Centre, Anchor = Anchor.Centre, RelativeSizeAxes = Axes.Both, Alpha = 1, }, }; } } }
mit
C#
6abeff9f0987170c24c34f9ad1933f37acdd2faf
Add missing [NotNull] attributes on StringLocalizerExtensions
aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore
src/Microsoft.Framework.Localization.Abstractions/StringLocalizerExtensions.cs
src/Microsoft.Framework.Localization.Abstractions/StringLocalizerExtensions.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 Microsoft.Framework.Internal; namespace Microsoft.Framework.Localization { public static class StringLocalizerExtensions { /// <summary> /// Gets the string resource with the given name. /// </summary> /// <param name="name">The name of the string resource.</param> /// <returns>The string resource as a <see cref="LocalizedString"/>.</returns> public static LocalizedString GetString([NotNull] this IStringLocalizer stringLocalizer, [NotNull] string name) { return stringLocalizer[name]; } /// <summary> /// Gets the string resource with the given name and formatted with the supplied arguments. /// </summary> /// <param name="name">The name of the string resource.</param> /// <param name="arguments">The values to format the string with.</param> /// <returns>The formatted string resource as a <see cref="LocalizedString"/>.</returns> public static LocalizedString GetString([NotNull] this IStringLocalizer stringLocalizer, [NotNull] string name, params object[] arguments) { return stringLocalizer[name, arguments]; } } }
// 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. namespace Microsoft.Framework.Localization { public static class StringLocalizerExtensions { /// <summary> /// Gets the string resource with the given name. /// </summary> /// <param name="name">The name of the string resource.</param> /// <returns>The string resource as a <see cref="LocalizedString"/>.</returns> public static LocalizedString GetString(this IStringLocalizer stringLocalizer, string name) { return stringLocalizer[name]; } /// <summary> /// Gets the string resource with the given name and formatted with the supplied arguments. /// </summary> /// <param name="name">The name of the string resource.</param> /// <param name="arguments">The values to format the string with.</param> /// <returns>The formatted string resource as a <see cref="LocalizedString"/>.</returns> public static LocalizedString GetString(this IStringLocalizer stringLocalizer, string name, params object[] arguments) { return stringLocalizer[name, arguments]; } } }
apache-2.0
C#
cf35f52f2b8050b6deb3536856a9686936bcc0c7
Switch to 1.1.7
Abc-Arbitrage/Zebus,Abc-Arbitrage/Zebus.Directory
src/SharedVersionInfo.cs
src/SharedVersionInfo.cs
using System.Reflection; [assembly: AssemblyVersion("1.1.7")] [assembly: AssemblyFileVersion("1.1.7")] [assembly: AssemblyInformationalVersion("1.1.7")]
using System.Reflection; [assembly: AssemblyVersion("1.1.6")] [assembly: AssemblyFileVersion("1.1.6")] [assembly: AssemblyInformationalVersion("1.1.6")]
mit
C#
ff73abd77b74a4841513545da648c7fda9372522
Fix broken config settings
mike-ward/tweetz-desktop
tweetz/tweetz5/App.xaml.cs
tweetz/tweetz5/App.xaml.cs
using System; using System.Configuration; using System.IO; using System.Threading.Tasks; using System.Windows; using tweetz5.Properties; using tweetz5.Utilities.ExceptionHandling; using tweetz5.Utilities.Translate; namespace tweetz5 { public partial class App { private void ApplicationStart(object sender, StartupEventArgs e) { AppDomain.CurrentDomain.UnhandledException += (o, args) => ShowCrashReport((Exception)args.ExceptionObject); Current.DispatcherUnhandledException += (o, args) => ShowCrashReport(args.Exception); TaskScheduler.UnobservedTaskException += (o, args) => ShowCrashReport(args.Exception); TranslationService.Instance.TranslationProvider = new TranslationProviderNameValueFile(); try { if (Settings.Default.UpgradeSettings) { Settings.Default.Upgrade(); Settings.Default.UpgradeSettings = false; Settings.Default.Save(); } } catch (ConfigurationException ex) { System.Windows.MessageBox.Show("User settings are corrupted. Click OK and restart Tweetz-Desktop to correct the problem."); File.Delete(((ConfigurationException)ex.InnerException).Filename); Environment.Exit(1); } } private static void ShowCrashReport(Exception exception) { var crashReport = new CrashReport(exception); MessageBox.Show(crashReport.Report); Environment.Exit(110); } private void AppSessionEnding(object sender, SessionEndingCancelEventArgs e) { Settings.Default.Save(); } private void AppExit(object sender, ExitEventArgs e) { Settings.Default.Save(); } } }
using System; using System.Threading.Tasks; using System.Windows; using tweetz5.Properties; using tweetz5.Utilities.ExceptionHandling; using tweetz5.Utilities.Translate; namespace tweetz5 { public partial class App { private void ApplicationStart(object sender, StartupEventArgs e) { AppDomain.CurrentDomain.UnhandledException += (o, args) => ShowCrashReport((Exception)args.ExceptionObject); Current.DispatcherUnhandledException += (o, args) => ShowCrashReport(args.Exception); TaskScheduler.UnobservedTaskException += (o, args) => ShowCrashReport(args.Exception); TranslationService.Instance.TranslationProvider = new TranslationProviderNameValueFile(); if (Settings.Default.UpgradeSettings) { Settings.Default.Upgrade(); Settings.Default.UpgradeSettings = false; Settings.Default.Save(); } } private static void ShowCrashReport(Exception exception) { var crashReport = new CrashReport(exception); MessageBox.Show(crashReport.Report); Environment.Exit(110); } private void AppSessionEnding(object sender, SessionEndingCancelEventArgs e) { Settings.Default.Save(); } private void AppExit(object sender, ExitEventArgs e) { Settings.Default.Save(); } } }
mit
C#
4d97b96705214a6d8da94363c8cb96236651108d
Remove the framework settings. It is not used.
johnneijzen/osu,peppy/osu,UselessToucan/osu,ZLima12/osu,UselessToucan/osu,ppy/osu,smoogipoo/osu,EVAST9919/osu,smoogipoo/osu,peppy/osu-new,NeoAdonis/osu,DrabWeb/osu,NeoAdonis/osu,smoogipoo/osu,naoey/osu,peppy/osu,2yangk23/osu,naoey/osu,johnneijzen/osu,ppy/osu,EVAST9919/osu,naoey/osu,DrabWeb/osu,peppy/osu,NeoAdonis/osu,smoogipooo/osu,UselessToucan/osu,DrabWeb/osu,2yangk23/osu,ppy/osu,ZLima12/osu
build.cake
build.cake
#addin "nuget:?package=CodeFileSanity&version=0.0.21" #addin "nuget:?package=JetBrains.ReSharper.CommandLineTools&version=2018.2.2" #tool "nuget:?package=NVika.MSBuild&version=1.0.1" /////////////////////////////////////////////////////////////////////////////// // ARGUMENTS /////////////////////////////////////////////////////////////////////////////// var target = Argument("target", "Build"); var configuration = Argument("configuration", "Release"); var osuSolution = new FilePath("./osu.sln"); /////////////////////////////////////////////////////////////////////////////// // TASKS /////////////////////////////////////////////////////////////////////////////// Task("Restore") .Does(() => { DotNetCoreRestore(osuSolution.FullPath); }); Task("Compile") .IsDependentOn("Restore") .Does(() => { DotNetCoreBuild(osuSolution.FullPath, new DotNetCoreBuildSettings { Configuration = configuration, NoRestore = true, }); }); Task("Test") .IsDependentOn("Compile") .Does(() => { var testAssemblies = GetFiles("**/*.Tests/bin/**/*.Tests.dll"); DotNetCoreVSTest(testAssemblies, new DotNetCoreVSTestSettings { Logger = AppVeyor.IsRunningOnAppVeyor ? "Appveyor" : $"trx", Parallel = true, ToolTimeout = TimeSpan.FromMinutes(10), }); }); // windows only because both inspectcore and nvika depend on net45 Task("InspectCode") .WithCriteria(IsRunningOnWindows()) .IsDependentOn("Compile") .Does(() => { var nVikaToolPath = GetFiles("./tools/NVika.MSBuild.*/tools/NVika.exe").First(); InspectCode(osuSolution, new InspectCodeSettings { CachesHome = "inspectcode", OutputFile = "inspectcodereport.xml", }); StartProcess(nVikaToolPath, @"parsereport ""inspectcodereport.xml"" --treatwarningsaserrors"); }); Task("CodeFileSanity") .Does(() => { ValidateCodeSanity(new ValidateCodeSanitySettings { RootDirectory = ".", IsAppveyorBuild = AppVeyor.IsRunningOnAppVeyor }); }); Task("Build") .IsDependentOn("CodeFileSanity") .IsDependentOn("InspectCode") .IsDependentOn("Test"); RunTarget(target);
#addin "nuget:?package=CodeFileSanity&version=0.0.21" #addin "nuget:?package=JetBrains.ReSharper.CommandLineTools&version=2018.2.2" #tool "nuget:?package=NVika.MSBuild&version=1.0.1" /////////////////////////////////////////////////////////////////////////////// // ARGUMENTS /////////////////////////////////////////////////////////////////////////////// var target = Argument("target", "Build"); var framework = Argument("framework", "netcoreapp2.1"); var configuration = Argument("configuration", "Release"); var osuSolution = new FilePath("./osu.sln"); /////////////////////////////////////////////////////////////////////////////// // TASKS /////////////////////////////////////////////////////////////////////////////// Task("Restore") .Does(() => { DotNetCoreRestore(osuSolution.FullPath); }); Task("Compile") .IsDependentOn("Restore") .Does(() => { DotNetCoreBuild(osuSolution.FullPath, new DotNetCoreBuildSettings { Configuration = configuration, NoRestore = true, }); }); Task("Test") .IsDependentOn("Compile") .Does(() => { var testAssemblies = GetFiles("**/*.Tests/bin/**/*.Tests.dll"); DotNetCoreVSTest(testAssemblies, new DotNetCoreVSTestSettings { Logger = AppVeyor.IsRunningOnAppVeyor ? "Appveyor" : $"trx", Parallel = true, ToolTimeout = TimeSpan.FromMinutes(10), }); }); // windows only because both inspectcore and nvika depend on net45 Task("InspectCode") .WithCriteria(IsRunningOnWindows()) .IsDependentOn("Compile") .Does(() => { var nVikaToolPath = GetFiles("./tools/NVika.MSBuild.*/tools/NVika.exe").First(); InspectCode(osuSolution, new InspectCodeSettings { CachesHome = "inspectcode", OutputFile = "inspectcodereport.xml", }); StartProcess(nVikaToolPath, @"parsereport ""inspectcodereport.xml"" --treatwarningsaserrors"); }); Task("CodeFileSanity") .Does(() => { ValidateCodeSanity(new ValidateCodeSanitySettings { RootDirectory = ".", IsAppveyorBuild = AppVeyor.IsRunningOnAppVeyor }); }); Task("Build") .IsDependentOn("CodeFileSanity") .IsDependentOn("InspectCode") .IsDependentOn("Test"); RunTarget(target);
mit
C#
99712151ee268f00278654a30991bc236d615b95
Rename variable
setchi/n_back_tracer,setchi/n_back_tracer
Assets/Scripts/Main/TimeKeeper.cs
Assets/Scripts/Main/TimeKeeper.cs
using UnityEngine; using UnityEngine.UI; using System; using System.Collections; using UniRx; public class TimeKeeper : MonoBehaviour { public event Action TimeUp; public float timeLimit; public Slider slider; public void StartCountdown() { Observable.EveryUpdate() .TakeUntil(Observable.Timer(TimeSpan.FromSeconds(timeLimit))) .Select(_ => Time.deltaTime) .Scan((total, delta) => total + delta) .Subscribe(elapsedTime => slider.value = (timeLimit - elapsedTime) / timeLimit, TimeUp); } }
using UnityEngine; using UnityEngine.UI; using System; using System.Collections; using UniRx; public class TimeKeeper : MonoBehaviour { public event Action TimeUp; public float timeLimit; public Slider slider; public void StartCountdown() { Observable.EveryUpdate() .TakeUntil(Observable.Timer(TimeSpan.FromSeconds(timeLimit))) .Select(_ => Time.deltaTime) .Scan((total, current) => total + current) .Subscribe(elapsedTime => slider.value = (timeLimit - elapsedTime) / timeLimit, TimeUp); } }
mit
C#
5f18d7709560a53540ca81456da01766e00d8327
Migrate to L10NSharp 4.0
ermshiperete/libpalaso,ermshiperete/libpalaso,sillsdev/libpalaso,gmartin7/libpalaso,gmartin7/libpalaso,sillsdev/libpalaso,sillsdev/libpalaso,gmartin7/libpalaso,gmartin7/libpalaso,ermshiperete/libpalaso,sillsdev/libpalaso,ermshiperete/libpalaso
TestApps/SIL.Windows.Forms.TestApp/Program.cs
TestApps/SIL.Windows.Forms.TestApp/Program.cs
using System; using System.IO; using System.Threading; using System.Windows.Forms; using L10NSharp; using SIL.IO; using SIL.WritingSystems; namespace SIL.Windows.Forms.TestApp { static class Program { /// <summary> /// The main entry point for the application. /// </summary> [STAThread] static void Main(string[] args) { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Sldr.Initialize(); var localizationFolder = Path.GetDirectoryName(FileLocationUtilities.GetFileDistributedWithApplication("Palaso.en.tmx")); LocalizationManager.Create(TranslationMemory.Tmx, "fr", "Palaso", "Palaso", "1.0.0", localizationFolder, "SIL/Palaso", null, ""); if(args.Length>0) //for testing commandlinerunner { for (int i = 0; i < 10; i++) { Console.WriteLine(i); Thread.Sleep(1000); } return; } Application.Run(new TestAppForm()); Sldr.Cleanup(); } } }
using System; using System.IO; using System.Threading; using System.Windows.Forms; using L10NSharp; using SIL.IO; using SIL.WritingSystems; namespace SIL.Windows.Forms.TestApp { static class Program { /// <summary> /// The main entry point for the application. /// </summary> [STAThread] static void Main(string[] args) { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Sldr.Initialize(); var localizationFolder = Path.GetDirectoryName(FileLocationUtilities.GetFileDistributedWithApplication("Palaso.en.tmx")); LocalizationManager.Create("fr", "Palaso", "Palaso", "1.0.0", localizationFolder, "SIL/Palaso", null, ""); if(args.Length>0) //for testing commandlinerunner { for (int i = 0; i < 10; i++) { Console.WriteLine(i); Thread.Sleep(1000); } return; } Application.Run(new TestAppForm()); Sldr.Cleanup(); } } }
mit
C#
1f37516455774ebbccae9db8f65a1091b04b690a
Fix bug in the StringCollection converter when DataServicePackage.Authors is a simple string.
pratikkagda/nuget,oliver-feng/nuget,antiufo/NuGet2,ctaggart/nuget,rikoe/nuget,mrward/NuGet.V2,GearedToWar/NuGet2,mono/nuget,alluran/node.net,pratikkagda/nuget,indsoft/NuGet2,jholovacs/NuGet,dolkensp/node.net,alluran/node.net,xoofx/NuGet,OneGet/nuget,zskullz/nuget,atheken/nuget,indsoft/NuGet2,ctaggart/nuget,dolkensp/node.net,zskullz/nuget,RichiCoder1/nuget-chocolatey,chocolatey/nuget-chocolatey,jholovacs/NuGet,rikoe/nuget,RichiCoder1/nuget-chocolatey,mrward/nuget,chocolatey/nuget-chocolatey,oliver-feng/nuget,GearedToWar/NuGet2,anurse/NuGet,indsoft/NuGet2,chocolatey/nuget-chocolatey,pratikkagda/nuget,antiufo/NuGet2,zskullz/nuget,GearedToWar/NuGet2,mono/nuget,rikoe/nuget,mrward/nuget,zskullz/nuget,ctaggart/nuget,akrisiun/NuGet,xoofx/NuGet,RichiCoder1/nuget-chocolatey,chocolatey/nuget-chocolatey,RichiCoder1/nuget-chocolatey,mrward/NuGet.V2,antiufo/NuGet2,chester89/nugetApi,xoofx/NuGet,mrward/NuGet.V2,pratikkagda/nuget,GearedToWar/NuGet2,themotleyfool/NuGet,mrward/NuGet.V2,antiufo/NuGet2,antiufo/NuGet2,GearedToWar/NuGet2,jmezach/NuGet2,akrisiun/NuGet,jholovacs/NuGet,dolkensp/node.net,themotleyfool/NuGet,RichiCoder1/nuget-chocolatey,RichiCoder1/nuget-chocolatey,mrward/NuGet.V2,alluran/node.net,xoofx/NuGet,indsoft/NuGet2,mrward/nuget,dolkensp/node.net,antiufo/NuGet2,ctaggart/nuget,rikoe/nuget,chocolatey/nuget-chocolatey,oliver-feng/nuget,oliver-feng/nuget,jholovacs/NuGet,xoofx/NuGet,mono/nuget,pratikkagda/nuget,kumavis/NuGet,alluran/node.net,chocolatey/nuget-chocolatey,jholovacs/NuGet,mrward/nuget,xero-github/Nuget,OneGet/nuget,OneGet/nuget,oliver-feng/nuget,jmezach/NuGet2,themotleyfool/NuGet,xoofx/NuGet,atheken/nuget,jmezach/NuGet2,mrward/NuGet.V2,indsoft/NuGet2,anurse/NuGet,chester89/nugetApi,oliver-feng/nuget,jmezach/NuGet2,jmezach/NuGet2,GearedToWar/NuGet2,OneGet/nuget,indsoft/NuGet2,jmezach/NuGet2,jholovacs/NuGet,mono/nuget,mrward/nuget,kumavis/NuGet,pratikkagda/nuget,mrward/nuget
NuPack.Dialog/PackageManagerUI/Converters/StringCollectionsToStringConverter.cs
NuPack.Dialog/PackageManagerUI/Converters/StringCollectionsToStringConverter.cs
using System; using System.Collections.Generic; using System.Windows.Data; namespace NuPack.Dialog.PackageManagerUI { public class StringCollectionsToStringConverter : IValueConverter { public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) { if (targetType == typeof(string)) { string stringValue = value as string; if (stringValue != null) { return stringValue; } else { IEnumerable<string> parts = (IEnumerable<string>)value; return String.Join(", ", parts); } } return value; } public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) { throw new NotImplementedException(); } } }
using System; using System.Collections.Generic; using System.Windows.Data; namespace NuPack.Dialog.PackageManagerUI { public class StringCollectionsToStringConverter : IValueConverter { public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) { if (targetType == typeof(string)) { IEnumerable<string> parts = (IEnumerable<string>)value; return String.Join(", ", parts); } return value; } public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) { throw new NotImplementedException(); } } }
apache-2.0
C#
9e4094bc8188ec50825cc817ba7b317580593fc3
add 'get set'
vostok/core
Vostok.Airlock.Client/Logging/LogEventData.cs
Vostok.Airlock.Client/Logging/LogEventData.cs
using System; using System.Collections.Generic; using System.Reflection; using Vostok.Logging; namespace Vostok.Airlock.Logging { public sealed class LogEventData { public LogEventData(Exception ex = null) { if (ex == null) return; Message = ex.Message; Exceptions = new List<LogEventException>(); var currentEx = ex; while (currentEx != null) { Exceptions.Add(new LogEventException(currentEx)); currentEx = currentEx.InnerException; } if (!(ex is ReflectionTypeLoadException typeLoadException)) return; foreach (var loaderException in typeLoadException.LoaderExceptions) Exceptions.Add(new LogEventException(loaderException)); } public DateTimeOffset Timestamp { get; set; } public LogLevel Level { get; set; } public string Message { get; set; } public List<LogEventException> Exceptions { get; set; } public IDictionary<string, string> Properties { get; set; } } }
using System; using System.Collections.Generic; using System.Reflection; using Vostok.Logging; namespace Vostok.Airlock.Logging { public sealed class LogEventData { public LogEventData(Exception ex = null) { if (ex == null) return; Message = ex.Message; Exceptions = new List<LogEventException>(); var currentEx = ex; while (currentEx != null) { Exceptions.Add(new LogEventException(currentEx)); currentEx = currentEx.InnerException; } if (!(ex is ReflectionTypeLoadException typeLoadException)) return; foreach (var loaderException in typeLoadException.LoaderExceptions) Exceptions.Add(new LogEventException(loaderException)); } public DateTimeOffset Timestamp { get; set; } public LogLevel Level { get; set; } public string Message { get; set; } public List<LogEventException> Exceptions; public IDictionary<string, string> Properties { get; set; } } }
mit
C#
14de19c01aeb4c6d74f9c171b5cf8bb83696da04
Remove Flags
mstrother/BmpListener
BMPClient/BMP/BmpPeerHeader.cs
BMPClient/BMP/BmpPeerHeader.cs
using System; using System.Linq; using System.Net; using Newtonsoft.Json; using Newtonsoft.Json.Converters; namespace BmpListener.Bmp { public class PeerHeader { public PeerHeader(byte[] data) { Decode(data); } [JsonConverter(typeof(StringEnumConverter))] public PeerType PeerType { get; private set; } public bool IsPostPolicy { get; private set; } public ulong PeerDistinguisher { get; private set; } public IPAddress PeerAddress { get; private set; } public uint PeerAS { get; private set; } public IPAddress PeerBGPId { get; private set; } public DateTime Timestamp { get; private set; } public void Decode(byte[] data) { PeerType = (PeerType) data[0]; var flags = data[1]; if ((flags & (1 << 6)) != 0) IsPostPolicy = true; if ((flags & (1 << 7)) != 0) { var ipBytes = data.Skip(10).Take(16).ToArray(); PeerAddress = new IPAddress(ipBytes); } else { var ipBytes = data.Skip(22).Take(4).ToArray(); PeerAddress = new IPAddress(ipBytes); } PeerDistinguisher = BitConverter.ToUInt64(data.Skip(2).Take(8).Reverse().ToArray(), 0); PeerAS = data.ToUInt32(26); var bytes = new byte[4]; Buffer.BlockCopy(data, 30, bytes, 0, 4); PeerBGPId = new IPAddress(bytes); var seconds = data.ToUInt32(34); var microSeconds = data.ToUInt32(38); Timestamp = DateTimeOffset.FromUnixTimeSeconds(seconds).AddTicks(microSeconds * 10).DateTime.ToUniversalTime(); } } }
using System; using System.Linq; using System.Net; using Newtonsoft.Json; using Newtonsoft.Json.Converters; namespace BmpListener.Bmp { public class PeerHeader { public PeerHeader(byte[] data) { Decode(data); } [JsonConverter(typeof(StringEnumConverter))] public PeerType PeerType { get; private set; } public bool IsPostPolicy { get; private set; } public ulong PeerDistinguisher { get; private set; } public IPAddress PeerAddress { get; private set; } public uint PeerAS { get; private set; } public IPAddress PeerBGPId { get; private set; } public DateTime Timestamp { get; private set; } public byte Flags { get; private set; } public void Decode(byte[] data) { PeerType = (PeerType) data[0]; Flags = data[1]; if ((Flags & (1 << 6)) != 0) IsPostPolicy = true; if ((Flags & (1 << 7)) != 0) { var ipBytes = data.Skip(10).Take(16).ToArray(); PeerAddress = new IPAddress(ipBytes); } else { var ipBytes = data.Skip(22).Take(4).ToArray(); PeerAddress = new IPAddress(ipBytes); } PeerDistinguisher = BitConverter.ToUInt64(data.Skip(2).Take(8).Reverse().ToArray(), 0); PeerAS = data.ToUInt32(26); var bytes = new byte[4]; Buffer.BlockCopy(data, 30, bytes, 0, 4); PeerBGPId = new IPAddress(bytes); var seconds = data.ToUInt32(34); var microSeconds = data.ToUInt32(38); Timestamp = DateTimeOffset.FromUnixTimeSeconds(seconds).AddTicks(microSeconds * 10).DateTime.ToUniversalTime(); } } }
mit
C#
5bec955372c5617c3ad4b6361e2ef093e47fc3a3
fix typo
IFS-HSR/ADMentor
ADMentor/ADTechnology/DiagramTypes.cs
ADMentor/ADTechnology/DiagramTypes.cs
using EAAddInBase.MDGBuilder; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace ADMentor.ADTechnology { public static class DiagramTypes { public static readonly Diagram ProblemSpace = new Diagram( name: "ProblemSpace", displayName: "Problem Space", description: "ADMentor Problem Space Diagrams visualize recurring architectural design problems and known solutions to them. " + "They also visualize the relationships between these model elements.", type: DiagramType.Activity, toolbox: Toolboxes.ProblemSpaceTools); public static readonly Diagram QOC = new Diagram( name: "QOC", displayName: "Questions, Options and Criteria", description: "Question, Options and Criteria (QOC) Diagrams visualize recurring architectural design problems similar to Problem Space Diagrams. " + "Additionally, they support detailed visualization based on optional criteria.", type: DiagramType.Activity, toolbox: Toolboxes.ProblemSpaceTools); public static readonly Diagram SolutionOverview = new Diagram( name: "SolutionOverview", displayName: "Solution Overview", description: "ADMentor Solution Space Diagrams collect architectural design problems that occured on a particular project and " + "the design options investigated and chosen to address them.", type: DiagramType.Activity, toolbox: Toolboxes.SolutionSpaceTools); } }
using EAAddInBase.MDGBuilder; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace ADMentor.ADTechnology { public static class DiagramTypes { public static readonly Diagram ProblemSpace = new Diagram( name: "ProblemSpace", displayName: "Problem Space", description: "ADMentor Problem Space Diagrams visualize recurring architectural design problems and known solutions to them. " + "They also visualize the relationships between these model elements.", type: DiagramType.Activity, toolbox: Toolboxes.ProblemSpaceTools); public static readonly Diagram QOC = new Diagram( name: "QOC", displayName: "Questions, Options and Criterions", description: "Question, Options and Criterions (QOC) Diagrams visualize recurring architectural design problems similar to Problem Space Diagrams." + "Additionally, they support detailed assessments based on optional criterions.", type: DiagramType.Activity, toolbox: Toolboxes.ProblemSpaceTools); public static readonly Diagram SolutionOverview = new Diagram( name: "SolutionOverview", displayName: "Solution Overview", description: "ADMentor Solution Space Diagrams collect architectural design problems that occured on a particular project and " + "the design options investigated and chosen to address them.", type: DiagramType.Activity, toolbox: Toolboxes.SolutionSpaceTools); } }
epl-1.0
C#
d53234ca89a280d6869c074b39f8b3667459a49c
Update search plugins to adhere to interface changes.
GetTabster/Tabster.Core
Searching/ITablatureSearchEngine.cs
Searching/ITablatureSearchEngine.cs
#region using System.Net; using Tabster.Core.Types; #endregion namespace Tabster.Core.Searching { /// <summary> /// Tablature search engine service. /// </summary> public interface ITablatureSearchEngine { /// <summary> /// Search engine name. /// </summary> string Name { get; } /// <summary> /// Determines whether the search engine requires an artist parameter be set. /// </summary> bool RequiresArtistParameter { get; } /// <summary> /// Determines whether the search engine requires a title parameter be set; /// </summary> bool RequiresTitleParameter { get; } /// <summary> /// Determines whether the search engine requires a type parameter be set. /// </summary> bool RequiresTypeParamter { get; } /// <summary> /// Determines whether the search engine supports ratings. /// </summary> bool SupportsRatings { get; } /// <summary> /// Determines whether the search engine supports pre-filtering of specific tablature types. /// </summary> bool SupportsPrefilteredTypes { get; } /// <summary> /// Queries Search engine and returns results based on search parameters. /// </summary> /// <param name="query"> Search query. </param> /// <param name="proxy"> Optional proxy settings.</param> TablatureSearchResult[] Search(TablatureSearchQuery query, WebProxy proxy); /// <summary> /// Determines whether a specific TablatureType is supported by the search engine. /// </summary> /// <param name="type"> The type to check. </param> /// <returns> True if the type is supported by the search engine; otherwise, False. </returns> bool SupportsTabType(TablatureType type); } }
#region using System.Net; using Tabster.Core.Types; #endregion namespace Tabster.Core.Searching { /// <summary> /// Tablature search engine service. /// </summary> public interface ITablatureSearchEngine { /// <summary> /// Search engine name. /// </summary> string Name { get; } /// <summary> /// Determines whether the search engine requires an artist parameter be set. /// </summary> bool RequiresArtistParameter { get; set; } /// <summary> /// Determines whether the search engine requires a title parameter be set; /// </summary> bool RequiresTitleParameter { get; set; } /// <summary> /// Determines whether the search engine requires a type parameter be set. /// </summary> bool RequiresTypeParamter { get; set; } /// <summary> /// Determines whether the search engine supports ratings. /// </summary> bool SupportsRatings { get; } /// <summary> /// Determines whether the search engine supports pre-filtering of specific tablature types. /// </summary> bool SupportsPrefilteredTypes { get; } /// <summary> /// Queries Search engine and returns results based on search parameters. /// </summary> /// <param name="query"> Search query. </param> /// <param name="proxy"> Optional proxy settings.</param> TablatureSearchResult[] Search(TablatureSearchQuery query, WebProxy proxy); /// <summary> /// Determines whether a specific TablatureType is supported by the search engine. /// </summary> /// <param name="type"> The type to check. </param> /// <returns> True if the type is supported by the search engine; otherwise, False. </returns> bool SupportsTabType(TablatureType type); } }
apache-2.0
C#
ea6b9d1a7228b11fa19cb5a48c166dbbc5a13819
remove extra whitespace
SamuelKnox/F.R.E.D.,Evorlor/F.R.E.D.
Fred/Systems/MovementSystem.cs
Fred/Systems/MovementSystem.cs
using Artemis; using Artemis.Attributes; using Artemis.Manager; using Artemis.System; using Fred.Components; using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace Fred.Systems { [ArtemisEntitySystem(GameLoopType = GameLoopType.Update, Layer = 1)] class MovementSystem : EntityProcessingSystem<TransformComponent, VelocityComponent, HealthComponent> { protected override void Process(Entity entity, TransformComponent transformComponent, VelocityComponent velocityComponent, HealthComponent healthComponent) { if (velocityComponent != null && transformComponent != null && healthComponent != null) { if (healthComponent.IsAlive) { float ms = TimeSpan.FromTicks(this.EntityWorld.Delta).Milliseconds; transformComponent.X += entity.GetComponent<VelocityComponent>().xVelocity * ms; transformComponent.Y += entity.GetComponent<VelocityComponent>().yVelocity * ms; } } } } }
using Artemis; using Artemis.Attributes; using Artemis.Manager; using Artemis.System; using Fred.Components; using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace Fred.Systems { [ArtemisEntitySystem(GameLoopType = GameLoopType.Update, Layer = 1)] class MovementSystem : EntityProcessingSystem<TransformComponent, VelocityComponent, HealthComponent> { protected override void Process(Entity entity, TransformComponent transformComponent, VelocityComponent velocityComponent, HealthComponent healthComponent) { if (velocityComponent != null && transformComponent != null && healthComponent != null) { if (healthComponent.IsAlive) { float ms = TimeSpan.FromTicks(this.EntityWorld.Delta).Milliseconds; transformComponent.X += entity.GetComponent<VelocityComponent>().xVelocity * ms; transformComponent.Y += entity.GetComponent<VelocityComponent>().yVelocity * ms; } } } } }
mit
C#
ce4e80534776f5b6cbea89d572c05c4e8f574ecc
Fix update of incorrect texture
k-t/SharpHaven
MonoHaven.Client/Graphics/Text.cs
MonoHaven.Client/Graphics/Text.cs
using System; using System.Drawing; using System.Windows.Forms; namespace MonoHaven.Graphics { public class Text : IDisposable { private readonly Font font; private Texture texture; private Color color; private string value; public Text(Font font) : this(font, string.Empty) {} public Text(Font font, string value) : this(font, value, Color.Black) { } public Text(Font font, string value, Color color) { this.font = font; this.value = value; this.Color = color; this.texture = new Texture(0, 0); } public Color Color { get { return color; } set { this.color = value; UpdateTexture(); } } public Texture Texture { get { return texture; } } public string Value { get { return value; } set { this.value = value; UpdateTexture(); } } public void Dispose() { if (texture != null) { texture.Dispose(); texture = null; } } private void UpdateTexture() { var size = TextRenderer.MeasureText(value, font); if (size == Size.Empty) return; using (var bitmap = new Bitmap(size.Width + 2, size.Height + 2)) using (var g = System.Drawing.Graphics.FromImage(bitmap)) using (var brush = new SolidBrush(Color)) { g.DrawString(value, font, brush, 0, 0, StringFormat.GenericDefault); texture.Bind(); texture.Upload(bitmap); } } } }
using System; using System.Drawing; using System.Windows.Forms; namespace MonoHaven.Graphics { public class Text : IDisposable { private readonly Font font; private Texture texture; private Color color; private string value; public Text(Font font) : this(font, string.Empty) {} public Text(Font font, string value) : this(font, value, Color.Black) { } public Text(Font font, string value, Color color) { this.font = font; this.value = value; this.Color = color; this.texture = new Texture(0, 0); } public Color Color { get { return color; } set { this.color = value; UpdateTexture(); } } public Texture Texture { get { return texture; } } public string Value { get { return value; } set { this.value = value; UpdateTexture(); } } public void Dispose() { if (texture != null) { texture.Dispose(); texture = null; } } private void UpdateTexture() { var size = TextRenderer.MeasureText(value, font); if (size == Size.Empty) return; using (var bitmap = new Bitmap(size.Width + 2, size.Height + 2)) using (var g = System.Drawing.Graphics.FromImage(bitmap)) using (var brush = new SolidBrush(Color)) { g.DrawString(value, font, brush, 0, 0, StringFormat.GenericDefault); texture.Upload(bitmap); } } } }
mit
C#
67f55206dc7ca96471312a90894edb74ccd35cf5
Add Empty Packet Type
martindevans/MumbleSharp,kluchrj/MumbleSharp
MumbleSharp/Packets/PacketType.cs
MumbleSharp/Packets/PacketType.cs
using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace MumbleSharp.Packets { public enum PacketType :short { Version = 0, UDPTunnel = 1, Authenticate = 2, Ping = 3, Reject = 4, ServerSync = 5, ChannelRemove = 6, ChannelState = 7, UserRemove = 8, UserState = 9, BanList = 10, TextMessage = 11, PermissionDenied= 12, ACL = 13, QueryUsers = 14, CryptSetup = 15, ContextActionAdd= 16, ContextAction = 17, UserList = 18, VoiceTarget = 19, PermissionQuery = 20, CodecVersion = 21, UserStats = 22, RequestBlob = 23, ServerConfig = 24, Empty = 32767 } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace MumbleSharp.Packets { public enum PacketType :short { Version = 0, UDPTunnel = 1, Authenticate = 2, Ping = 3, Reject = 4, ServerSync = 5, ChannelRemove = 6, ChannelState = 7, UserRemove = 8, UserState = 9, BanList = 10, TextMessage = 11, PermissionDenied= 12, ACL = 13, QueryUsers = 14, CryptSetup = 15, ContextActionAdd= 16, ContextAction = 17, UserList = 18, VoiceTarget = 19, PermissionQuery = 20, CodecVersion = 21, UserStats = 22, RequestBlob = 23, ServerConfig = 24 } }
mit
C#
e8b99972eca0561dce2b96eab8dca16edced88a2
remove test modification
brizuelal/Nager.Date,brizuelal/Nager.Date
Nager.Date.TestConsole/Program.cs
Nager.Date.TestConsole/Program.cs
using System; namespace Nager.Date.TestConsole { class Program { static void Main(string[] args) { var publicHolidays = DateSystem.GetPublicHoliday("CH", 2017); foreach (var publicHoliday in publicHolidays) { Console.WriteLine("{0:dd.MM.yyyy} {1} {2}", publicHoliday.Date, publicHoliday.LocalName, publicHoliday.Global); } Console.ReadLine(); } } }
using System; namespace Nager.Date.TestConsole { class Program { static void Main(string[] args) { var publicHolidays = DateSystem.GetPublicHoliday("CH", 2017); foreach (var publicHoliday in publicHolidays) { Console.WriteLine("{0:dd.MM.yyyy} {1} {2}", publicHoliday.Date, publicHoliday.LocalName, publicHoliday.Global); } Console.WriteLine("test2"); Console.ReadLine(); } } }
apache-2.0
C#
84a1f76a9890e5ddbb3d6bf5b5b701fd1e17489b
Split WCF functionality out of Autofac.Extras.Multitenant into a separate assembly/package, Autofac.Extras.Multitenant.Wcf. Both packages are versioned 3.1.0.
caioproiete/Autofac.Wcf,autofac/Autofac.Wcf
Properties/VersionAssemblyInfo.cs
Properties/VersionAssemblyInfo.cs
//------------------------------------------------------------------------------ // <auto-generated> // This code was generated by a tool. // Runtime Version:4.0.30319.18051 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. // </auto-generated> //------------------------------------------------------------------------------ using System; using System.Reflection; using System.Resources; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; [assembly: AssemblyVersion("3.0.0.0")] [assembly: AssemblyFileVersion("3.0.0.0")] [assembly: AssemblyConfiguration("Release built on 2013-12-03 10:23")] [assembly: AssemblyCopyright("Copyright © 2013 Autofac Contributors")] [assembly: AssemblyDescription("Autofac.Wcf 3.0.0")]
//------------------------------------------------------------------------------ // <auto-generated> // This code was generated by a tool. // Runtime Version:4.0.30319.34003 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. // </auto-generated> //------------------------------------------------------------------------------ using System; using System.Reflection; using System.Resources; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; [assembly: AssemblyVersion("3.0.0.0")] [assembly: AssemblyFileVersion("3.0.0.0")] [assembly: AssemblyConfiguration("Release built on 2013-10-23 22:48")] [assembly: AssemblyCopyright("Copyright © 2013 Autofac Contributors")] [assembly: AssemblyDescription("Autofac.Wcf 3.0.0")]
mit
C#
bcdeab093240852a138cde996a94149f8e74abb1
Update parameter summary
SouleDesigns/SouleDesigns.Orchard,SouleDesigns/SouleDesigns.Orchard,SouleDesigns/SouleDesigns.Orchard,SouleDesigns/SouleDesigns.Orchard,SouleDesigns/SouleDesigns.Orchard
src/Orchard.Web/Modules/PlanetTelex.ContactForm/Services/IContactFormService.cs
src/Orchard.Web/Modules/PlanetTelex.ContactForm/Services/IContactFormService.cs
using Orchard; using PlanetTelex.ContactForm.Models; namespace PlanetTelex.ContactForm.Services { public interface IContactFormService : IDependency { /// <summary> /// Gets the contact form record. /// </summary> /// <param name="id">The record id.</param> ContactFormRecord GetContactForm(int id); /// <summary> /// Sends a contact email. /// </summary> /// <param name="name">The name of the sender.</param> /// <param name="email">The email address of the sender.</param> /// <param name="spamBotEmail">The email address entered in by spam bot</param> /// <param name="subject">The email subject.</param> /// <param name="message">The email message.</param> /// <param name="sendTo">The email address to send the message to.</param> /// <param name="requiredName">Bool of Name is required</param> /// <param name="recaptcha">Recaptcha response string to be validated prior to sending</param> void SendContactEmail(string name, string email, string spamBotEmail, string subject, string message, string sendTo, bool requiredName, string recaptcha); } }
using Orchard; using PlanetTelex.ContactForm.Models; namespace PlanetTelex.ContactForm.Services { public interface IContactFormService : IDependency { /// <summary> /// Gets the contact form record. /// </summary> /// <param name="id">The record id.</param> ContactFormRecord GetContactForm(int id); /// <summary> /// Sends a contact email. /// </summary> /// <param name="name">The name of the sender.</param> /// <param name="email">The email address of the sender.</param> /// <param name="spamBotEmail">The email address entered in by spam bot</param> /// <param name="subject">The email subject.</param> /// <param name="message">The email message.</param> /// <param name="sendTo">The email address to send the message to.</param> /// <param name="requiredName">Bool of Name is required</param> void SendContactEmail(string name, string email, string spamBotEmail, string subject, string message, string sendTo, bool requiredName, string recaptcha); } }
bsd-3-clause
C#
752d16e816feec77d01256fbf6a5f79e5bbeb09f
Fix Destroy compile time error
sschmid/Entitas-CSharp,sschmid/Entitas-CSharp,vkuskov/Entitas-CSharp,vkuskov/Entitas-CSharp
Entitas.Unity/Assets/Entitas/Unity/VisualDebugging/GameObjectDestroyExtension.cs
Entitas.Unity/Assets/Entitas/Unity/VisualDebugging/GameObjectDestroyExtension.cs
using UnityEngine; namespace Entitas.Unity.VisualDebugging { public static class GameObjectDestroyExtension { public static void DestroyGameObject(this GameObject gameObject) { #if (UNITY_EDITOR) if (Application.isPlaying) { Object.Destroy(gameObject); } else { Object.DestroyImmediate(gameObject); } #else Object.Destroy(gameObject); #endif } } }
using UnityEngine; namespace Entitas.Unity.VisualDebugging { public static class GameObjectDestroyExtension { public static void DestroyGameObject(this GameObject gameObject) { #if (UNITY_EDITOR) if (Application.isPlaying) { Object.Destroy(gameObject); } else { Object.DestroyImmediate(gameObject); } #else Destroy(gameObject); #endif } } }
mit
C#
2cfd47b6edd8c3fb1c6620ba6aa6a459a7d2c3b0
Implement DevicesCollection
alesliehughes/monoDX,alesliehughes/monoDX
Microsoft.DirectX.DirectSound/Microsoft.DirectX.DirectSound/DevicesCollection.cs
Microsoft.DirectX.DirectSound/Microsoft.DirectX.DirectSound/DevicesCollection.cs
/* * The MIT License (MIT) * * Copyright (c) 2013 Alistair Leslie-Hughes * * Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation files (the "Software"), to deal in * the Software without restriction, including without limitation the rights to * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of * the Software, and to permit persons to whom the Software is furnished to do so, * subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ using System; using System.Collections; using System.Runtime.InteropServices; namespace Microsoft.DirectX.DirectSound { public sealed class DevicesCollection : IEnumerable, IEnumerator { ArrayList m_devices; int m_index; public DeviceInformation this [int index] { get { return (DeviceInformation)m_devices[index]; } } public int Count { get { if (m_devices != null) { return m_devices.Count; } return -1; } } public object Current { get { if (m_devices != null || m_devices.Count == 0) { return null; } if (m_index >= 0) return m_devices[m_index]; return null; } } [UnmanagedFunctionPointerAttribute(CallingConvention.StdCall)] [return: MarshalAs(UnmanagedType.I4)] delegate bool ds_enum_cb(UIntPtr guid, [MarshalAs(UnmanagedType.LPWStr)] string desc, [MarshalAs(UnmanagedType.LPWStr)] string module, IntPtr context); [DllImport("dsound.dll", CallingConvention=CallingConvention.StdCall)] extern static int DirectSoundEnumerateW([MarshalAs(UnmanagedType.FunctionPtr)] ds_enum_cb func , IntPtr context); private bool my_enum(UIntPtr guid, string desc, string module, IntPtr context) { DeviceInformation info = new DeviceInformation(); Guid local = new Guid(); if(guid != null) return true; info.m_modulename = module; info.m_description = desc; if(guid != null) { local = Guid.NewGuid(); // FIXME("Convert UIntPtr to GUID"); } info.m_driver = local; m_devices.Add(info); return true; } public DevicesCollection () { System.IntPtr va = (IntPtr)0; m_index = -1; ds_enum_cb del = this.my_enum; m_devices = new ArrayList(); DirectSoundEnumerateW(del, va); } public void Reset () { m_index = -1; } public bool MoveNext () { if (m_devices == null || m_index+1 > m_devices.Count - 1) return false; m_index++; return true; } public IEnumerator GetEnumerator () { return this; } } }
/* * The MIT License (MIT) * * Copyright (c) 2013 Alistair Leslie-Hughes * * Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation files (the "Software"), to deal in * the Software without restriction, including without limitation the rights to * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of * the Software, and to permit persons to whom the Software is furnished to do so, * subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ using System; using System.Collections; namespace Microsoft.DirectX.DirectSound { public sealed class DevicesCollection : IEnumerable, IEnumerator { public DeviceInformation this [int index] { get { throw new NotImplementedException (); } } public int Count { get { throw new NotImplementedException (); } } public object Current { get { throw new NotImplementedException (); } } public DevicesCollection () { throw new NotImplementedException (); } public void Reset () { throw new NotImplementedException (); } public bool MoveNext () { throw new NotImplementedException (); } public IEnumerator GetEnumerator () { return this; } } }
mit
C#
3b47075d326984f1355e6ac4734e56f58ade9e2b
Allow custom app settings.
Squidex/squidex,Squidex/squidex,Squidex/squidex,Squidex/squidex,Squidex/squidex
src/Squidex/Program.cs
src/Squidex/Program.cs
// ========================================================================== // Squidex Headless CMS // ========================================================================== // Copyright (c) Squidex UG (haftungsbeschränkt) // All rights reserved. Licensed under the MIT license. // ========================================================================== using System.IO; using Microsoft.AspNetCore.Hosting; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.Logging; using Squidex.Config; using Squidex.Infrastructure.Log.Adapter; namespace Squidex { public static class Program { public static void Main(string[] args) { BuildWebHost(args).Run(); } public static IWebHost BuildWebHost(string[] args) => new WebHostBuilder() .UseKestrel(k => { k.AddServerHeader = false; }) .UseContentRoot(Directory.GetCurrentDirectory()) .UseIIS() .UseStartup<WebStartup>() .ConfigureLogging((hostingContext, builder) => { builder.AddConfiguration(hostingContext.Configuration.GetSection("logging")); builder.AddSemanticLog(); builder.AddFilters(); }) .ConfigureAppConfiguration((hostContext, builder) => { builder.Sources.Clear(); builder.AddJsonFile($"appsettings.json", true); builder.AddJsonFile($"appsettings.Custom.json", true); builder.AddJsonFile($"appsettings.{hostContext.HostingEnvironment.EnvironmentName}.json", true); builder.AddEnvironmentVariables(); builder.AddCommandLine(args); }) .Build(); } }
// ========================================================================== // Squidex Headless CMS // ========================================================================== // Copyright (c) Squidex UG (haftungsbeschränkt) // All rights reserved. Licensed under the MIT license. // ========================================================================== using System.IO; using Microsoft.AspNetCore.Hosting; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.Logging; using Squidex.Config; using Squidex.Infrastructure.Log.Adapter; namespace Squidex { public static class Program { public static void Main(string[] args) { BuildWebHost(args).Run(); } public static IWebHost BuildWebHost(string[] args) => new WebHostBuilder() .UseKestrel(k => { k.AddServerHeader = false; }) .UseContentRoot(Directory.GetCurrentDirectory()) .UseIIS() .UseStartup<WebStartup>() .ConfigureLogging((hostingContext, builder) => { builder.AddConfiguration(hostingContext.Configuration.GetSection("logging")); builder.AddSemanticLog(); builder.AddFilters(); }) .ConfigureAppConfiguration((hostContext, builder) => { builder.Sources.Clear(); builder.AddJsonFile($"appsettings.json", true, true); builder.AddJsonFile($"appsettings.{hostContext.HostingEnvironment.EnvironmentName}.json", true); builder.AddEnvironmentVariables(); builder.AddCommandLine(args); }) .Build(); } }
mit
C#
d6c072a8fda30924f10fae6ff9b32c1e91d4c197
Update 3DES.cs
kogoia/MRTD.NET
HelloWord/Cryptography/3DES.cs
HelloWord/Cryptography/3DES.cs
using System; using System.Collections.Generic; using System.Linq; using System.Security.Cryptography; using System.Text; namespace HelloWord.Cryptography { /// <summary> /// ICAO Doc 9303 /// Part 11: Security Mechanisms for MRTDs / Page: 17 /// http://www.icao.int/publications/pages/publication.aspx?docnum=9303 /// /// 3DES[FIPS 46 - 3] SHALL be used in Retail-mode according to[ISO / IEC 9797 - 1] MAC algorithm 3 / padding method 2 /// with block cipher DES and IV = 0. /// </summary> public class TripleDES : IBinary { private readonly byte[] _keyBytes; private readonly byte[] _textBytes; public TripleDES(IBinary key, IBinary textForEncrypt) : this(key.Binary(), textForEncrypt.Binary()) { } public TripleDES(byte[] keyBytes, byte[] textBytes) { this._keyBytes = keyBytes; this._textBytes = textBytes; } public byte[] Binary() { using ( var tdes = new TripleDESCryptoServiceProvider() { Key = this._keyBytes, Mode = CipherMode.CBC, Padding = PaddingMode.None, IV = new byte[] { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } } ) { ICryptoTransform cTransform = tdes.CreateEncryptor(); byte[] resultArray = cTransform.TransformFinalBlock(this._textBytes, 0, this._textBytes.Length); //tdes.Clear(); return resultArray; } } } }
using System; using System.Collections.Generic; using System.Linq; using System.Security.Cryptography; using System.Text; namespace HelloWord.Cryptography { /// <summary> /// ICAO Doc 9303 /// Part 11: Security Mechanisms for MRTDs / Page: 17 /// http://www.icao.int/publications/pages/publication.aspx?docnum=9303 /// /// 3DES /// /// 3DES[FIPS 46 - 3] SHALL be used in Retail-mode according to[ISO / IEC 9797 - 1] MAC algorithm 3 / padding method 2 /// with block cipher DES and IV = 0. /// </summary> public class TripleDES : IBinary { private readonly byte[] _keyBytes; private readonly byte[] _textBytes; public TripleDES(IBinary key, IBinary textForEncrypt) : this(key.Binary(), textForEncrypt.Binary()) { } public TripleDES(byte[] keyBytes, byte[] textBytes) { this._keyBytes = keyBytes; this._textBytes = textBytes; } public byte[] Binary() { using ( var tdes = new TripleDESCryptoServiceProvider() { Key = this._keyBytes, Mode = CipherMode.CBC, Padding = PaddingMode.None, IV = new byte[] { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } } ) { ICryptoTransform cTransform = tdes.CreateEncryptor(); byte[] resultArray = cTransform.TransformFinalBlock(this._textBytes, 0, this._textBytes.Length); //tdes.Clear(); return resultArray; } } } }
mit
C#
2256b348fb5a58a215a2a661c8a9185a43f5f947
Handle null id for Cars/Details action
ajaree/tdd-carfuel,ajaree/tdd-carfuel,ajaree/tdd-carfuel
CarFuel/Controllers/CarsController.cs
CarFuel/Controllers/CarsController.cs
using CarFuel.DataAccess; using CarFuel.Models; using CarFuel.Services; using Microsoft.AspNet.Identity; using System; using System.Collections.Generic; using System.Linq; using System.Net; using System.Web; using System.Web.Mvc; namespace CarFuel.Controllers { public class CarsController : Controller { private ICarDb db; private CarService carService; public CarsController() { db = new CarDb(); carService = new CarService(db); } [Authorize] public ActionResult Index() { var userId = new Guid(User.Identity.GetUserId()); IEnumerable<Car> cars = carService.GetCarsByMember(userId); return View(cars); } [Authorize] public ActionResult Create() { return View(); } [HttpPost] [Authorize] public ActionResult Create(Car item) { var userId = new Guid(User.Identity.GetUserId()); try { carService.AddCar(item, userId); } catch (OverQuotaException ex) { TempData["error"] = ex.Message; } return RedirectToAction("Index"); } public ActionResult Details(Guid? id) { if (id == null) { return new HttpStatusCodeResult(HttpStatusCode.BadRequest); } var userId = new Guid(User.Identity.GetUserId()); var c = carService.GetCarsByMember(userId).SingleOrDefault(x => x.Id == id); return View(c); } } }
using CarFuel.DataAccess; using CarFuel.Models; using CarFuel.Services; using Microsoft.AspNet.Identity; using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; namespace CarFuel.Controllers { public class CarsController : Controller { private ICarDb db; private CarService carService; public CarsController() { db = new CarDb(); carService = new CarService(db); } [Authorize] public ActionResult Index() { var userId = new Guid(User.Identity.GetUserId()); IEnumerable<Car> cars = carService.GetCarsByMember(userId); return View(cars); } [Authorize] public ActionResult Create() { return View(); } [HttpPost] [Authorize] public ActionResult Create(Car item) { var userId = new Guid(User.Identity.GetUserId()); try { carService.AddCar(item, userId); } catch (OverQuotaException ex) { TempData["error"] = ex.Message; } return RedirectToAction("Index"); } public ActionResult Details(Guid id) { var userId = new Guid(User.Identity.GetUserId()); var c = carService.GetCarsByMember(userId).SingleOrDefault(x => x.Id == id); return View(c); } } }
mit
C#
091d6d318ccb0c80b310ef0aac5d324ae0ec6c4c
fix info logger for apple iap
bitwarden/core,bitwarden/core,bitwarden/core,bitwarden/core
src/Billing/Controllers/AppleController.cs
src/Billing/Controllers/AppleController.cs
using Bit.Core; using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; using Newtonsoft.Json; using System; using System.IO; using System.Text; using System.Threading.Tasks; namespace Bit.Billing.Controllers { [Route("apple")] public class AppleController : Controller { private readonly BillingSettings _billingSettings; private readonly ILogger<AppleController> _logger; public AppleController( IOptions<BillingSettings> billingSettings, ILogger<AppleController> logger) { _billingSettings = billingSettings?.Value; _logger = logger; } [HttpPost("iap")] public async Task<IActionResult> PostIap() { if(HttpContext?.Request?.Query == null) { return new BadRequestResult(); } var key = HttpContext.Request.Query.ContainsKey("key") ? HttpContext.Request.Query["key"].ToString() : null; if(key != _billingSettings.AppleWebhookKey) { return new BadRequestResult(); } string body = null; using(var reader = new StreamReader(HttpContext.Request.Body, Encoding.UTF8)) { body = await reader.ReadToEndAsync(); } if(string.IsNullOrWhiteSpace(body)) { return new BadRequestResult(); } try { var json = JsonConvert.SerializeObject(JsonConvert.DeserializeObject(body), Formatting.Indented); _logger.LogInformation(Constants.BypassFiltersEventId, "Apple IAP Notification:\n\n{0}", json); return new OkResult(); } catch(Exception e) { _logger.LogError(e, "Error processing IAP status notification."); return new BadRequestResult(); } } } }
using Bit.Core; using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; using Newtonsoft.Json; using System; using System.IO; using System.Text; using System.Threading.Tasks; namespace Bit.Billing.Controllers { [Route("apple")] public class AppleController : Controller { private readonly BillingSettings _billingSettings; private readonly ILogger<AppleController> _logger; public AppleController( IOptions<BillingSettings> billingSettings, ILogger<AppleController> logger) { _billingSettings = billingSettings?.Value; _logger = logger; } [HttpPost("iap")] public async Task<IActionResult> PostIap() { if(HttpContext?.Request?.Query == null) { return new BadRequestResult(); } var key = HttpContext.Request.Query.ContainsKey("key") ? HttpContext.Request.Query["key"].ToString() : null; if(key != _billingSettings.AppleWebhookKey) { return new BadRequestResult(); } string body = null; using(var reader = new StreamReader(HttpContext.Request.Body, Encoding.UTF8)) { body = await reader.ReadToEndAsync(); } if(string.IsNullOrWhiteSpace(body)) { return new BadRequestResult(); } try { var json = JsonConvert.SerializeObject(JsonConvert.DeserializeObject(body), Formatting.Indented); _logger.LogInformation("Apple IAP Notification:\n\n" + Constants.BypassFiltersEventId, json); return new OkResult(); } catch(Exception e) { _logger.LogError(e, "Error processing IAP status notification."); return new BadRequestResult(); } } } }
agpl-3.0
C#
004ac9656960e507d9da846862d2d345f527aa98
Add JobEngineSupported property to WellKnownServerFeatures list. This property inverts JobEngineNotSupported property which will be removed in future release and therefore has been marked as obsolete.
ZEISS-PiWeb/PiWeb-Api
src/Common/Data/WellKnownServerFeatures.cs
src/Common/Data/WellKnownServerFeatures.cs
#region copyright /* * * * * * * * * * * * * * * * * * * * * * * * * */ /* Carl Zeiss IMT (IZfM Dresden) */ /* Softwaresystem PiWeb */ /* (c) Carl Zeiss 2015 */ /* * * * * * * * * * * * * * * * * * * * * * * * * */ #endregion using System; using Zeiss.IMT.PiWeb.Api.DataService.Rest; namespace Zeiss.IMT.PiWeb.Api.Common.Data { /// <summary> /// Static class with constants that are used by <see cref="ServiceInformation.FeatureList"/> /// to indicate the availability of certain server features. /// </summary> public static class WellKnownServerFeatures { /// <summary>Server supports server side querying of merged measurements (like a primary key for measurement search).</summary> public const string MergeAttributes = "MergeAttributes"; /// <summary>Server supports defining conditions ('MergeCondition' + 'MergeMasterPart') /// for server side querying of merged measurements (like a primary key for measurement search).</summary> public const string MergeConditions = "MergeConditions"; /// <summary>Server supports the measurement aggregation feature.</summary> public const string MeasurementAggregation = "MeasurementAggregation"; /// <summary>Server supports the distinct search for specific attribute values.</summary> public const string DistinctMeasurementSearch = "DistinctMeasurementSearch"; /// <summary>The server database is readonly and cannot be modified.</summary> public const string ReadOnlyDatabase = "ReadOnlyDB"; /// <summary>The server does not support jobs.</summary> [Obsolete("Property will be removed in future release. Please use inverted JobEngineSupported property instead.")] public const string JobEngineNotSupported = "JobEngineNotSupported"; /// <summary>The server supports jobs.</summary> public const string JobEngineSupported = "JobEngineSupported"; /// <summary>The server supports characteristics below the root part and measurements attached to the root part.</summary> public const string CharacteristicsBelowRoot = "CharacteristicsBelowRoot"; /// <summary>The server supports the modification of catalog attributes without data loss /// (without this feature the only possibility is to delete and recreated the catalog).</summary> public const string CatalogAttributesUpdate = "CatalogAttributesUpdate"; /// <summary>The server supports the ignore search filter flag for users and groups.</summary> public const string IgnoreSearchFilterSupport = "IgnoreSearchFilterSupport"; /// <summary>The server supports measurement filter attributes with a LastN value greater than <see cref="short.MaxValue"/>.</summary> public const string MeasurementLimitResultInt32 = "MeasurementLimitResultInt32"; /// <summary>The server supports generation of notifications.</summary> public const string NotificationFeatureSupported = "NotificationFeatureSupported"; /// <summary>The server supports internal generation of event based alarms.</summary> public const string AlarmFeatureSupported = "AlarmFeatureSupported"; } }
#region copyright /* * * * * * * * * * * * * * * * * * * * * * * * * */ /* Carl Zeiss IMT (IZfM Dresden) */ /* Softwaresystem PiWeb */ /* (c) Carl Zeiss 2015 */ /* * * * * * * * * * * * * * * * * * * * * * * * * */ #endregion using Zeiss.IMT.PiWeb.Api.DataService.Rest; namespace Zeiss.IMT.PiWeb.Api.Common.Data { /// <summary> /// Static class with constants that are used by <see cref="ServiceInformation.FeatureList"/> /// to indicate the availability of certain server features. /// </summary> public static class WellKnownServerFeatures { /// <summary>Server supports server side querying of merged measurements (like a primary key for measurement search).</summary> public const string MergeAttributes = "MergeAttributes"; /// <summary>Server supports defining conditions ('MergeCondition' + 'MergeMasterPart') /// for server side querying of merged measurements (like a primary key for measurement search).</summary> public const string MergeConditions = "MergeConditions"; /// <summary>Server supports the measurement aggregation feature.</summary> public const string MeasurementAggregation = "MeasurementAggregation"; /// <summary>Server supports the distinct search for specific attribute values.</summary> public const string DistinctMeasurementSearch = "DistinctMeasurementSearch"; /// <summary>The server database is readonly and cannot be modified.</summary> public const string ReadOnlyDatabase = "ReadOnlyDB"; /// <summary>The server does not support jobs.</summary> public const string JobEngineNotSupported = "JobEngineNotSupported"; /// <summary>The server supports characteristics below the root part and measurements attached to the root part.</summary> public const string CharacteristicsBelowRoot = "CharacteristicsBelowRoot"; /// <summary>The server supports the modification of catalog attributes without data loss /// (without this feature the only possibility is to delete and recreated the catalog).</summary> public const string CatalogAttributesUpdate = "CatalogAttributesUpdate"; /// <summary>The server supports the ignore search filter flag for users and groups.</summary> public const string IgnoreSearchFilterSupport = "IgnoreSearchFilterSupport"; /// <summary>The server supports measurement filter attributes with a LastN value greater than <see cref="short.MaxValue"/>.</summary> public const string MeasurementLimitResultInt32 = "MeasurementLimitResultInt32"; /// <summary>The server supports generation of notifications.</summary> public const string NotificationFeatureSupported = "NotificationFeatureSupported"; /// <summary>The server supports internal generation of event based alarms.</summary> public const string AlarmFeatureSupported = "AlarmFeatureSupported"; } }
bsd-3-clause
C#
85f73c9873f56fe2778b5d9ff3a41b3f390f1c7e
Fix that build
planetxamarin/planetxamarin,MabroukENG/planetxamarin,MabroukENG/planetxamarin,planetxamarin/planetxamarin,planetxamarin/planetxamarin,MabroukENG/planetxamarin,planetxamarin/planetxamarin
src/Firehose.Web/Authors/TomaszCielecki.cs
src/Firehose.Web/Authors/TomaszCielecki.cs
using System; using System.Collections.Generic; using System.ServiceModel.Syndication; using Firehose.Web.Infrastructure; namespace Firehose.Web.Authors { public class TomaszCielecki : IAmAXamarinMVP, IFilterMyBlogPosts { public IEnumerable<Uri> FeedUris { get { yield return new Uri("http://blog.ostebaronen.dk/feeds/posts/default"); } } public string FirstName => "Tomasz"; public string LastName => "Cielecki"; public string StateOrRegion => "Copenhagen, Denmark"; public string EmailAddress => "tomasz@ostebaronen.dk"; public string ShortBioOrTagLine => "loves long walks on the beach, yelling at the screen. More importantly writes code."; public Uri WebSite => new Uri("http://blog.ostebaronen.dk"); public string TwitterHandle => "Cheesebaron"; public string GitHubHandle => "Cheesebaron"; public string GravatarHash => "f780d57997526876b0625e517c1e0884"; public GeoPosition Position => new GeoPosition(55.8019193, 12.523124); public bool Filter(SyndicationItem item) => item.Title.Text.ToLowerInvariant().Contains("xamarin") || item.Categories.Any(c => c.Name.Equals("xamarin", StringComparison.OrdinalIgnoreCase)); } }
using System; using System.Collections.Generic; using Firehose.Web.Infrastructure; namespace Firehose.Web.Authors { public class TomaszCielecki : IAmAXamarinMVP, IFilterMyBlogPosts { public IEnumerable<Uri> FeedUris { get { yield return new Uri("http://blog.ostebaronen.dk/feeds/posts/default"); } } public string FirstName => "Tomasz"; public string LastName => "Cielecki"; public string StateOrRegion => "Copenhagen, Denmark"; public string EmailAddress => "tomasz@ostebaronen.dk"; public string ShortBioOrTagLine => "loves long walks on the beach, yelling at the screen. More importantly writes code."; public Uri WebSite => new Uri("http://blog.ostebaronen.dk"); public string TwitterHandle => "Cheesebaron"; public string GitHubHandle => "Cheesebaron"; public string GravatarHash => "f780d57997526876b0625e517c1e0884"; public GeoPosition Position => new GeoPosition(55.8019193, 12.523124); public bool Filter(SyndicationItem item) => item.Title.Text.ToLowerInvariant().Contains("xamarin") || item.Categories.Any(c => c.Name.Equals("xamarin", StringComparison.OrdinalIgnoreCase)); } }
mit
C#
c3a75833fe979ea05b56adccf8d192cd404d46c9
Update AssemblyInfo.cs
EmphaticFist/Fluky,EmphaticFistGames/Fluky,michaeljbaird/Fluky,michaeljbaird/Fluky
src/Fluky.Tests/Properties/AssemblyInfo.cs
src/Fluky.Tests/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: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("Fluky.Tests")] [assembly: AssemblyTrademark("")] [assembly: AssemblyVersion("2.0.0.0")] [assembly: AssemblyFileVersion("2.0.0.0")] [assembly: AssemblyInformationalVersion("2.0.0.0")] // 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("b6621d43-e103-4475-98cc-15a72933b9d9")]
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: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("Fluky.Tests")] [assembly: AssemblyTrademark("")] [assembly: AssemblyVersion("2.0.0.0")] [assembly: AssemblyFileVersion("2.0.0.0")] [assembly: AssemblyInformationalVersion("2.0.0")] // 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("b6621d43-e103-4475-98cc-15a72933b9d9")]
mit
C#
dc26e90a8dad211abce21888944145f9b8add92a
Remove unused usings
johnneijzen/osu,UselessToucan/osu,UselessToucan/osu,ZLima12/osu,ZLima12/osu,NeoAdonis/osu,ppy/osu,peppy/osu,2yangk23/osu,smoogipooo/osu,DrabWeb/osu,2yangk23/osu,DrabWeb/osu,smoogipoo/osu,ppy/osu,smoogipoo/osu,DrabWeb/osu,UselessToucan/osu,EVAST9919/osu,peppy/osu-new,johnneijzen/osu,NeoAdonis/osu,ppy/osu,peppy/osu,smoogipoo/osu,EVAST9919/osu,NeoAdonis/osu,peppy/osu
osu.Game/Screens/Play/ScreenWithBeatmapBackground.cs
osu.Game/Screens/Play/ScreenWithBeatmapBackground.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.Game.Screens.Backgrounds; namespace osu.Game.Screens.Play { public abstract class ScreenWithBeatmapBackground : OsuScreen { protected override BackgroundScreen CreateBackground() => new BackgroundScreenBeatmap(Beatmap.Value); protected new BackgroundScreenBeatmap Background => (BackgroundScreenBeatmap)base.Background; } }
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. using osu.Framework.Allocation; using osu.Framework.Bindables; using osu.Game.Configuration; using osu.Game.Screens.Backgrounds; namespace osu.Game.Screens.Play { public abstract class ScreenWithBeatmapBackground : OsuScreen { protected override BackgroundScreen CreateBackground() => new BackgroundScreenBeatmap(Beatmap.Value); protected new BackgroundScreenBeatmap Background => (BackgroundScreenBeatmap)base.Background; } }
mit
C#
bdf4a61b5aa55d38c40f04a0d8b8ee884bbf4e90
Add null check to Branch
GitTools/GitVersion,GitTools/GitVersion,asbjornu/GitVersion,gep13/GitVersion,gep13/GitVersion,asbjornu/GitVersion
src/GitVersion.LibGit2Sharp/Git/Branch.cs
src/GitVersion.LibGit2Sharp/Git/Branch.cs
using GitVersion.Extensions; using GitVersion.Helpers; namespace GitVersion; internal sealed class Branch : IBranch { private static readonly LambdaEqualityHelper<IBranch> equalityHelper = new(x => x.Name.Canonical); private static readonly LambdaKeyComparer<IBranch, string> comparerHelper = new(x => x.Name.Canonical); private readonly LibGit2Sharp.Branch innerBranch; internal Branch(LibGit2Sharp.Branch branch) { this.innerBranch = branch.NotNull(); Name = new ReferenceName(branch.CanonicalName); var commit = this.innerBranch.Tip; Tip = commit is null ? null : new Commit(commit); var commits = this.innerBranch.Commits; Commits = commits is null ? null : new CommitCollection(commits); } public ReferenceName Name { get; } public ICommit? Tip { get; } public ICommitCollection? Commits { get; } public int CompareTo(IBranch other) => comparerHelper.Compare(this, other); public bool Equals(IBranch? other) => equalityHelper.Equals(this, other); public bool IsDetachedHead => Name.Canonical.Equals("(no branch)", StringComparison.OrdinalIgnoreCase); public bool IsRemote => this.innerBranch.IsRemote; public bool IsTracking => this.innerBranch.IsTracking; public override bool Equals(object obj) => Equals((obj as IBranch)); public override int GetHashCode() => equalityHelper.GetHashCode(this); public override string ToString() => Name.ToString(); public static implicit operator LibGit2Sharp.Branch(Branch d) => d.innerBranch; }
using GitVersion.Helpers; namespace GitVersion; internal sealed class Branch : IBranch { private static readonly LambdaEqualityHelper<IBranch> equalityHelper = new(x => x.Name.Canonical); private static readonly LambdaKeyComparer<IBranch, string> comparerHelper = new(x => x.Name.Canonical); private readonly LibGit2Sharp.Branch innerBranch; internal Branch(LibGit2Sharp.Branch branch) { this.innerBranch = branch; Name = new ReferenceName(branch.CanonicalName); var commit = this.innerBranch.Tip; Tip = commit is null ? null : new Commit(commit); var commits = this.innerBranch.Commits; Commits = commits is null ? null : new CommitCollection(commits); } public ReferenceName Name { get; } public ICommit? Tip { get; } public ICommitCollection? Commits { get; } public int CompareTo(IBranch other) => comparerHelper.Compare(this, other); public bool Equals(IBranch? other) => equalityHelper.Equals(this, other); public override bool Equals(object obj) => Equals((obj as IBranch)); public override int GetHashCode() => equalityHelper.GetHashCode(this); public override string ToString() => Name.ToString(); public static implicit operator LibGit2Sharp.Branch(Branch d) => d.innerBranch; public bool IsDetachedHead => Name.Canonical.Equals("(no branch)", StringComparison.OrdinalIgnoreCase); public bool IsRemote => this.innerBranch.IsRemote; public bool IsTracking => this.innerBranch.IsTracking; }
mit
C#
ee76f0427527d144e4ecdc6111f5844ad37c9563
Clarify build.cake
HangfireIO/Cronos
build.cake
build.cake
#tool "nuget:?package=xunit.runner.console" #tool "nuget:?package=OpenCover" var configuration = Argument("configuration", "Release"); var version = Argument<string>("buildVersion", null); var target = Argument("target", "Default"); Task("Default").IsDependentOn("Pack"); Task("CI").IsDependentOn("Pack"); Task("Clean").Does(()=> { CleanDirectory("./build"); StartProcess("dotnet", "clean -c:" + configuration); }); Task("Restore").Does(()=> { DotNetCoreRestore(); }); Task("Build") .IsDependentOn("UseAppVeyorVersion") .IsDependentOn("Clean") .IsDependentOn("Restore") .Does(()=> { var buildSettings = new DotNetCoreBuildSettings { Configuration = configuration }; if(!string.IsNullOrEmpty(version)) buildSettings.ArgumentCustomization = args => args.Append("/p:Version=" + version); DotNetCoreBuild("src/Cronos/Cronos.csproj", buildSettings); }); Task("Test").IsDependentOn("Build").Does(() => { DotNetCoreTest("./tests/Cronos.Tests/Cronos.Tests.csproj", new DotNetCoreTestSettings { Configuration = "Release", ArgumentCustomization = args => args.Append("/p:BuildProjectReferences=false") }); }); Task("TestCoverage").IsDependentOn("Test").Does(() => { OpenCover( tool => { tool.XUnit2("tests/Cronos.Tests/bin/" + configuration + "/**/Cronos.Tests.dll", new XUnit2Settings { ShadowCopy = false }); }, new FilePath("coverage.xml"), new OpenCoverSettings() .WithFilter("+[Cronos]*") .WithFilter("-[Cronos.Tests]*")); }); Task("Pack").IsDependentOn("TestCoverage").Does(()=> { CreateDirectory("build"); CopyFiles(GetFiles("./src/Cronos/bin/**/*.nupkg"), "build"); Zip("./src/Cronos/bin/" + configuration, "build/Cronos-" + version +".zip"); }); Task("UseAppVeyorVersion").WithCriteria(AppVeyor.IsRunningOnAppVeyor).Does(() => { version = AppVeyor.Environment.Build.Version; if (AppVeyor.Environment.Repository.Tag.IsTag) { var tagName = AppVeyor.Environment.Repository.Tag.Name; if(tagName.StartsWith("v")) { version = tagName.Substring(1); } AppVeyor.UpdateBuildVersion(version); } }); RunTarget(target);
#tool "nuget:?package=xunit.runner.console" #tool "nuget:?package=OpenCover" var configuration = Argument("configuration", "Release"); var version = Argument<string>("buildVersion", null); var target = Argument("target", "Default"); Task("Restore") .Does(()=> { DotNetCoreRestore(); }); Task("Clean") .Does(()=> { CleanDirectory("./build"); StartProcess("dotnet", "clean -c:" + configuration); }); Task("SpecifyPackageVersion") .WithCriteria(AppVeyor.IsRunningOnAppVeyor) .Does(() => { version = AppVeyor.Environment.Build.Version; if (AppVeyor.Environment.Repository.Tag.IsTag) { var tagName = AppVeyor.Environment.Repository.Tag.Name; if(tagName.StartsWith("v")) { version = tagName.Substring(1); } AppVeyor.UpdateBuildVersion(version); } }); Task("Build") .IsDependentOn("SpecifyPackageVersion") .IsDependentOn("Clean") .IsDependentOn("Restore") .Does(()=> { var buildSettings = new DotNetCoreBuildSettings { Configuration = configuration }; if(!string.IsNullOrEmpty(version)) buildSettings.ArgumentCustomization = args => args.Append("/p:Version=" + version); DotNetCoreBuild("src/Cronos/Cronos.csproj", buildSettings); }); Task("Test") .IsDependentOn("Build") .Does(() => { DotNetCoreTest("./tests/Cronos.Tests/Cronos.Tests.csproj", new DotNetCoreTestSettings { Configuration = "Release", ArgumentCustomization = args => args.Append("/p:BuildProjectReferences=false") }); }); Task("OpenCover") .IsDependentOn("Test") .Does(() => { OpenCover( tool => { tool.XUnit2("tests/Cronos.Tests/bin/" + configuration + "/**/Cronos.Tests.dll", new XUnit2Settings { ShadowCopy = false }); }, new FilePath("coverage.xml"), new OpenCoverSettings() .WithFilter("+[Cronos]*") .WithFilter("-[Cronos.Tests]*")); }); Task("Pack") .IsDependentOn("OpenCover") .Does(()=> { CreateDirectory("build"); CopyFiles(GetFiles("./src/Cronos/bin/**/*.nupkg"), "build"); Zip("./src/Cronos/bin/" + configuration, "build/Cronos-" + version +".zip"); }); Task("Default") .IsDependentOn("Pack"); Task("CI") .IsDependentOn("Pack"); RunTarget(target);
mit
C#
fd663a2b7d5d1bf76af0c28627b151aeda8674a2
Clean up cake file
mrjavaguy/ericholton.me,mrjavaguy/ericholton.me,mrjavaguy/ericholton.me
build.cake
build.cake
#tool "nuget:https://api.nuget.org/v3/index.json?package=Wyam&version=1.4.1" #addin "nuget:https://api.nuget.org/v3/index.json?package=Cake.Wyam&version=1.4.1" DirectoryPath outputPath = MakeAbsolute(Directory("./output")); string target = Argument("target", "Generate-Blog"); Task("Clean-Blog") .Does(() => { CleanDirectory(outputPath); }); Task("Generate-Blog") .IsDependentOn("Clean-Blog") .Does(() => { Wyam(new WyamSettings { Recipe = "Blog", Theme = "CleanBlog", OutputPath = outputPath }); }); Task("Deploy") .Does(() => { // Add NETLIFY_TOKEN to your enviornment variables string token = EnvironmentVariable("NETLIFY_TOKEN"); if(string.IsNullOrEmpty(token)) { throw new Exception("Could not get NETLIFY_TOKEN environment variable"); } // zip the output directory and upload using curl Zip("./output", "output.zip", "./output/**/*"); StartProcess("curl", "--header \"Content-Type: application/zip\" " + "--header \"Authorization: Bearer " + token + "\" " + "--data-binary \"@output.zip\" " + "--url https://api.netlify.com/api/v1/sites/yoursite.netlify.com/deploys"); }); RunTarget(target);
#tool "nuget:https://api.nuget.org/v3/index.json?package=Wyam&version=1.4.1" #addin "nuget:https://api.nuget.org/v3/index.json?package=Cake.Wyam&version=1.4.1" #addin "Cake.Npm" DirectoryPath outputPath = MakeAbsolute(Directory("./output")); string target = Argument("target", "Generate-Blog"), baseUri = EnvironmentVariable("KUDU_CLIENT_BASEURI"), userName = EnvironmentVariable("KUDU_CLIENT_USERNAME"), password = EnvironmentVariable("KUDU_CLIENT_PASSWORD"); Task("Clean-Blog") .Does(() => { CleanDirectory(outputPath); }); Task("Generate-Blog") .IsDependentOn("Clean-Blog") .Does(() => { Wyam(new WyamSettings { Recipe = "Blog", Theme = "CleanBlog", OutputPath = outputPath }); }); Task("Kudu-Publish-Blog") .IsDependentOn("Generate-Blog") .WithCriteria(!string.IsNullOrEmpty(baseUri) && !string.IsNullOrEmpty(userName) && !string.IsNullOrEmpty(password) ) .Does(()=> { IKuduClient kuduClient = KuduClient( baseUri, userName, password); kuduClient.ZipDeployDirectory( outputPath); }); Task("Deploy") .Does(() => { // Add NETLIFY_TOKEN to your enviornment variables string token = EnvironmentVariable("NETLIFY_TOKEN"); if(string.IsNullOrEmpty(token)) { throw new Exception("Could not get NETLIFY_TOKEN environment variable"); } // zip the output directory and upload using curl Zip("./output", "output.zip", "./output/**/*"); StartProcess("curl", "--header \"Content-Type: application/zip\" " + "--header \"Authorization: Bearer " + token + "\" " + "--data-binary \"@output.zip\" " + "--url https://api.netlify.com/api/v1/sites/yoursite.netlify.com/deploys"); }); RunTarget(target);
apache-2.0
C#
45d5305e747905ca0f2ea8464bdc41007fc193e5
Update annotations for types implementing IErrorTypeSymbol
physhi/roslyn,eriawan/roslyn,eriawan/roslyn,AlekseyTs/roslyn,weltkante/roslyn,gafter/roslyn,physhi/roslyn,aelij/roslyn,brettfo/roslyn,dotnet/roslyn,KirillOsenkov/roslyn,shyamnamboodiripad/roslyn,shyamnamboodiripad/roslyn,bartdesmet/roslyn,jasonmalinowski/roslyn,heejaechang/roslyn,mavasani/roslyn,CyrusNajmabadi/roslyn,tmat/roslyn,KirillOsenkov/roslyn,tannergooding/roslyn,diryboy/roslyn,bartdesmet/roslyn,bartdesmet/roslyn,abock/roslyn,reaction1989/roslyn,shyamnamboodiripad/roslyn,agocke/roslyn,wvdd007/roslyn,mavasani/roslyn,wvdd007/roslyn,abock/roslyn,stephentoub/roslyn,AlekseyTs/roslyn,AlekseyTs/roslyn,tmat/roslyn,KevinRansom/roslyn,abock/roslyn,diryboy/roslyn,sharwell/roslyn,tannergooding/roslyn,genlu/roslyn,mgoertz-msft/roslyn,stephentoub/roslyn,weltkante/roslyn,stephentoub/roslyn,reaction1989/roslyn,weltkante/roslyn,aelij/roslyn,jmarolf/roslyn,wvdd007/roslyn,ErikSchierboom/roslyn,eriawan/roslyn,heejaechang/roslyn,davkean/roslyn,tannergooding/roslyn,agocke/roslyn,genlu/roslyn,KirillOsenkov/roslyn,davkean/roslyn,jasonmalinowski/roslyn,agocke/roslyn,physhi/roslyn,brettfo/roslyn,panopticoncentral/roslyn,aelij/roslyn,sharwell/roslyn,ErikSchierboom/roslyn,diryboy/roslyn,jasonmalinowski/roslyn,KevinRansom/roslyn,tmat/roslyn,jmarolf/roslyn,gafter/roslyn,sharwell/roslyn,AmadeusW/roslyn,jmarolf/roslyn,CyrusNajmabadi/roslyn,ErikSchierboom/roslyn,AmadeusW/roslyn,reaction1989/roslyn,brettfo/roslyn,mavasani/roslyn,dotnet/roslyn,panopticoncentral/roslyn,KevinRansom/roslyn,genlu/roslyn,gafter/roslyn,mgoertz-msft/roslyn,panopticoncentral/roslyn,dotnet/roslyn,AmadeusW/roslyn,mgoertz-msft/roslyn,CyrusNajmabadi/roslyn,davkean/roslyn,heejaechang/roslyn
src/Compilers/CSharp/Portable/Symbols/PublicModel/ErrorTypeSymbol.cs
src/Compilers/CSharp/Portable/Symbols/PublicModel/ErrorTypeSymbol.cs
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. #nullable enable using System.Collections.Immutable; using System.Diagnostics; namespace Microsoft.CodeAnalysis.CSharp.Symbols.PublicModel { internal sealed class ErrorTypeSymbol : NamedTypeSymbol, IErrorTypeSymbol { private readonly Symbols.ErrorTypeSymbol _underlying; public ErrorTypeSymbol(Symbols.ErrorTypeSymbol underlying, CodeAnalysis.NullableAnnotation nullableAnnotation) : base(nullableAnnotation) { Debug.Assert(underlying is object); _underlying = underlying; } protected override ITypeSymbol WithNullableAnnotation(CodeAnalysis.NullableAnnotation nullableAnnotation) { Debug.Assert(nullableAnnotation != _underlying.DefaultNullableAnnotation); Debug.Assert(nullableAnnotation != this.NullableAnnotation); return new ErrorTypeSymbol(_underlying, nullableAnnotation); } internal override CSharp.Symbol UnderlyingSymbol => _underlying; internal override Symbols.NamespaceOrTypeSymbol UnderlyingNamespaceOrTypeSymbol => _underlying; internal override Symbols.TypeSymbol UnderlyingTypeSymbol => _underlying; internal override Symbols.NamedTypeSymbol UnderlyingNamedTypeSymbol => _underlying; ImmutableArray<ISymbol> IErrorTypeSymbol.CandidateSymbols => _underlying.CandidateSymbols.SelectAsArray(s => s.GetPublicSymbol()); CandidateReason IErrorTypeSymbol.CandidateReason => _underlying.CandidateReason; } }
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System.Collections.Immutable; using System.Diagnostics; namespace Microsoft.CodeAnalysis.CSharp.Symbols.PublicModel { internal sealed class ErrorTypeSymbol : NamedTypeSymbol, IErrorTypeSymbol { private readonly Symbols.ErrorTypeSymbol _underlying; public ErrorTypeSymbol(Symbols.ErrorTypeSymbol underlying, CodeAnalysis.NullableAnnotation nullableAnnotation) : base(nullableAnnotation) { Debug.Assert(underlying is object); _underlying = underlying; } protected override ITypeSymbol WithNullableAnnotation(CodeAnalysis.NullableAnnotation nullableAnnotation) { Debug.Assert(nullableAnnotation != _underlying.DefaultNullableAnnotation); Debug.Assert(nullableAnnotation != this.NullableAnnotation); return new ErrorTypeSymbol(_underlying, nullableAnnotation); } internal override CSharp.Symbol UnderlyingSymbol => _underlying; internal override Symbols.NamespaceOrTypeSymbol UnderlyingNamespaceOrTypeSymbol => _underlying; internal override Symbols.TypeSymbol UnderlyingTypeSymbol => _underlying; internal override Symbols.NamedTypeSymbol UnderlyingNamedTypeSymbol => _underlying; ImmutableArray<ISymbol> IErrorTypeSymbol.CandidateSymbols => _underlying.CandidateSymbols.SelectAsArray(s => s.GetPublicSymbol()); CandidateReason IErrorTypeSymbol.CandidateReason => _underlying.CandidateReason; } }
mit
C#
55b22fb420646d53cb3fb267d1577a1c3c4f1f69
Add IRepository changes to the RepositoryGetAll
generik0/Smooth.IoC.Dapper.Repository.UnitOfWork,generik0/Smooth.IoC.Dapper.Repository.UnitOfWork
src/Smooth.IoC.Dapper.Repository.UnitOfWork/Repo/RepositoryGetAll.cs
src/Smooth.IoC.Dapper.Repository.UnitOfWork/Repo/RepositoryGetAll.cs
using System.Collections.Generic; using System.Threading.Tasks; using Smooth.IoC.Dapper.Repository.UnitOfWork.Data; namespace Smooth.IoC.Dapper.Repository.UnitOfWork.Repo { public abstract partial class Repository<TEntity, TPk> where TEntity : class { public IEnumerable<TEntity> GetAll(ISession session) { return session.Find<TEntity>(); } public IEnumerable<TEntity> GetAll<TSesssion>() where TSesssion : class, ISession { using (var session = Factory.Create<TSesssion>()) { return GetAll(session); } } public async Task<IEnumerable<TEntity>> GetAllAsync(ISession session) { return await session.FindAsync<TEntity>(); } public Task<IEnumerable<TEntity>> GetAllAsync<TSesssion>() where TSesssion : class, ISession { using (var session = Factory.Create<TSesssion>()) { return GetAllAsync(session); } } } }
using System.Collections.Generic; using System.Threading.Tasks; using Smooth.IoC.Dapper.Repository.UnitOfWork.Data; namespace Smooth.IoC.Dapper.Repository.UnitOfWork.Repo { public abstract partial class Repository<TEntity, TPk> where TEntity : class { public IEnumerable<TEntity> GetAll(ISession session) { return GetAllAsync(session).Result; } public async Task<IEnumerable<TEntity>> GetAllAsync(ISession session) { return await session.FindAsync<TEntity>(); } } }
mit
C#
8e6c8fb3d3082522409a216d2e69d71b2dd25548
use Command static properties and check json type with regex ending
takenet/blip-sdk-csharp
src/Take.Blip.Builder/Actions/ProcessCommand/ProcessCommandAction.cs
src/Take.Blip.Builder/Actions/ProcessCommand/ProcessCommandAction.cs
using Lime.Protocol; using Lime.Protocol.Serialization; using Newtonsoft.Json.Linq; using System; using System.Text.RegularExpressions; using System.Threading; using System.Threading.Tasks; using Take.Blip.Client; namespace Take.Blip.Builder.Actions.ProcessCommand { public class ProcessCommandAction : IAction { private readonly ISender _sender; private readonly IEnvelopeSerializer _envelopeSerializer; private const string SERIALIZABLE_PATTERN = @".+[/|\+]json"; public ProcessCommandAction(ISender sender, IEnvelopeSerializer envelopeSerializer) { _sender = sender; _envelopeSerializer = envelopeSerializer; } public string Type => nameof(ProcessCommand); public async Task ExecuteAsync(IContext context, JObject settings, CancellationToken cancellationToken) { if (context == null) throw new ArgumentNullException(nameof(context)); if (settings == null) throw new ArgumentNullException(nameof(settings), $"The settings are required for '{nameof(ProcessCommandAction)}' action"); string variable = null; if (settings.TryGetValue(nameof(variable), out var variableToken)) { variable = variableToken.ToString().Trim('"'); } var command = ConvertToCommand(settings); command.Id = EnvelopeId.NewId(); var resultCommand = await _sender.ProcessCommandAsync(command, cancellationToken); if (string.IsNullOrWhiteSpace(variable)) return; var resultCommandJson = _envelopeSerializer.Serialize(resultCommand); await context.SetVariableAsync(variable, resultCommandJson, cancellationToken); } private Command ConvertToCommand(JObject settings) { if (settings.TryGetValue(Command.TYPE_KEY, out var type) && Regex.IsMatch(type.ToString(), SERIALIZABLE_PATTERN) && settings.TryGetValue(Command.RESOURCE_KEY, out var resource)) { settings.Property(Command.RESOURCE_KEY).Value = JObject.Parse(resource.ToString()); } return settings.ToObject<Command>(LimeSerializerContainer.Serializer); } } }
using Lime.Protocol; using Lime.Protocol.Serialization; using Newtonsoft.Json.Linq; using System; using System.Threading; using System.Threading.Tasks; using Take.Blip.Client; namespace Take.Blip.Builder.Actions.ProcessCommand { public class ProcessCommandAction : IAction { private readonly ISender _sender; private readonly IEnvelopeSerializer _envelopeSerializer; private const string RESOURCE_KEY = "resource"; private const string RESOURCE_TYPE_KEY = "type"; private const string SERIALIZABLE_TYPE = "json"; public ProcessCommandAction(ISender sender, IEnvelopeSerializer envelopeSerializer) { _sender = sender; _envelopeSerializer = envelopeSerializer; } public string Type => nameof(ProcessCommand); public async Task ExecuteAsync(IContext context, JObject settings, CancellationToken cancellationToken) { if (context == null) throw new ArgumentNullException(nameof(context)); if (settings == null) throw new ArgumentNullException(nameof(settings), $"The settings are required for '{nameof(ProcessCommandAction)}' action"); string variable = null; if (settings.TryGetValue(nameof(variable), out var variableToken)) { variable = variableToken.ToString().Trim('"'); } var command = ConvertToCommand(settings); command.Id = EnvelopeId.NewId(); var resultCommand = await _sender.ProcessCommandAsync(command, cancellationToken); if (string.IsNullOrWhiteSpace(variable)) return; var resultCommandJson = _envelopeSerializer.Serialize(resultCommand); await context.SetVariableAsync(variable, resultCommandJson, cancellationToken); } private Command ConvertToCommand(JObject settings) { if (settings.TryGetValue(RESOURCE_TYPE_KEY, out var type) && type.ToString().Contains(SERIALIZABLE_TYPE, StringComparison.OrdinalIgnoreCase) && settings.TryGetValue(RESOURCE_KEY, out var resource)) { settings.Property(RESOURCE_KEY).Value = JObject.Parse(resource.ToString()); } return settings.ToObject<Command>(LimeSerializerContainer.Serializer); } } }
apache-2.0
C#
e36423cf95c9312f9cc5c9bd358c498f816fb754
Fix parsing number value when no default value specified
Prof9/PixelPet
PixelPet/CLI/ParameterValue.cs
PixelPet/CLI/ParameterValue.cs
using LibPixelPet; using System; namespace PixelPet.CLI { internal class ParameterValue { public string Name { get; } public string DefaultValue { get; } public string CurrentValue { get; private set; } public bool HasDefaultValue => this.DefaultValue != null; public bool HasCurrentValue => this.CurrentValue != null; public bool HasValue => this.HasCurrentValue || this.HasDefaultValue; public string Value { get => this.CurrentValue ?? this.DefaultValue; set => this.CurrentValue = value; } public ParameterValue(in string name) : this(name, null) { } public ParameterValue(in string name, in string defaultValue) { if (name == null) throw new ArgumentNullException(nameof(name)); if (string.IsNullOrWhiteSpace(name)) throw new ArgumentException("Name cannot consist of only white-space characters.", nameof(name)); this.Name = name; this.DefaultValue = defaultValue; this.CurrentValue = null; } public void Clear() => this.CurrentValue = null; public int ToInt32() { if (this.Value is not null && NumberParser.TryParseInt32(this.Value, out int r)) { return r; } else { return 0; } } public long ToInt64() { if (NumberParser.TryParseInt64(this.Value, out long r)) { return r; } else { return 0; } } public override string ToString() => this.Value ?? ""; } }
using LibPixelPet; using System; namespace PixelPet.CLI { internal class ParameterValue { public string Name { get; } public string DefaultValue { get; } public string CurrentValue { get; private set; } public bool HasDefaultValue => this.DefaultValue != null; public bool HasCurrentValue => this.CurrentValue != null; public bool HasValue => this.HasCurrentValue || this.HasDefaultValue; public string Value { get => this.CurrentValue ?? this.DefaultValue; set => this.CurrentValue = value; } public ParameterValue(in string name) : this(name, null) { } public ParameterValue(in string name, in string defaultValue) { if (name == null) throw new ArgumentNullException(nameof(name)); if (string.IsNullOrWhiteSpace(name)) throw new ArgumentException("Name cannot consist of only white-space characters.", nameof(name)); this.Name = name; this.DefaultValue = defaultValue; this.CurrentValue = null; } public void Clear() => this.CurrentValue = null; public int ToInt32() { if (NumberParser.TryParseInt32(this.Value, out int r)) { return r; } else { return 0; } } public long ToInt64() { if (NumberParser.TryParseInt64(this.Value, out long r)) { return r; } else { return 0; } } public override string ToString() => this.Value ?? ""; } }
mit
C#
5e66bc13ab103a9d72d9f6778e8366d486eac048
Update version info
pjb7687/single
Single2013/Properties/AssemblyInfo.cs
Single2013/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("Single2013")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("Single2013")] [assembly: AssemblyCopyright("Copyright © 2013")] [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("673cf2c5-12fa-48fe-b516-a5556be676f3")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.3.0")] [assembly: AssemblyFileVersion("1.0.3.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("Single2013")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("Single2013")] [assembly: AssemblyCopyright("Copyright © 2013")] [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("673cf2c5-12fa-48fe-b516-a5556be676f3")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.2.0")] [assembly: AssemblyFileVersion("1.0.2.0")]
bsd-2-clause
C#
37550e40384f9b50b5bb93fbafeee4b679f3c17b
Remove redundant comments
kornelijepetak/incident-cs
IncidentTests/MathExt.cs
IncidentTests/MathExt.cs
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace IncidentTests { public static class MathExt { public static double StdDev(this int[] values) { var mean = values.Average(); var variance = values .Select(x => Math.Pow(mean - x, 2)) .Average(); return Math.Sqrt(variance); } public static bool Validate(this int[] values, int numbers, double upperBoundForStdDev) { var stdDev = values.StdDev(); // Normalize percentage upperBoundForStdDev /= 100.0; var expectedCountInBucket = 1.0 * numbers / values.Length; var relativeStdDev = stdDev / expectedCountInBucket; return relativeStdDev < upperBoundForStdDev; } } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace IncidentTests { public static class MathExt { public static double StdDev(this int[] values) { var mean = values.Average(); var variance = values .Select(x => Math.Pow(mean - x, 2)) .Average(); return Math.Sqrt(variance); } public static bool Validate(this int[] values, int numbers, double upperBoundForStdDev) { var stdDev = values.StdDev(); // Normalize percentage upperBoundForStdDev /= 100.0; var expectedCountInBucket = 1.0 * numbers / values.Length; var relativeStdDev = stdDev / expectedCountInBucket; return relativeStdDev < upperBoundForStdDev; //return sigmaTooHightPercentage <= allowedPercentage; } } }
mit
C#
09b9ad27cc4ea99d793243baddcc2fb59ce75819
debug output
2gis/nuclear-river,xakep139/nuclear-river,xakep139/nuclear-river,2gis/nuclear-river-validation-rules,2gis/nuclear-river
StateInitialization/StateInitialization.Core/Actors/UpdateTableStatisticsActor.cs
StateInitialization/StateInitialization.Core/Actors/UpdateTableStatisticsActor.cs
using System; using System.Collections.Generic; using System.Data.SqlClient; using System.Diagnostics; using System.Linq; using LinqToDB.Mapping; using NuClear.Replication.Core; using NuClear.Replication.Core.Actors; using NuClear.StateInitialization.Core.Commands; namespace NuClear.StateInitialization.Core.Actors { public sealed class UpdateTableStatisticsActor<TDataObject> : IActor { private readonly SqlConnection _sqlConnection; public UpdateTableStatisticsActor(SqlConnection sqlConnection) { _sqlConnection = sqlConnection; } public IReadOnlyCollection<IEvent> ExecuteCommands(IReadOnlyCollection<ICommand> commands) { foreach (var c in commands) { Debug.WriteLine(c.ToString()); } var command = commands.OfType<UpdateTableStatisticsCommand>().SingleOrDefault(); if (command == null) { return Array.Empty<IEvent>(); } Debug.WriteLine(command.ToString()); Debug.WriteLine(command.MappingSchema.ToString()); var attributes = command.MappingSchema.GetAttributes<TableAttribute>(typeof(TDataObject)); var tableName = attributes.Select(x => x.Name).FirstOrDefault() ?? typeof(TDataObject).Name; try { var database = _sqlConnection.GetDatabase(); var schemaName = attributes.Select(x => x.Schema).FirstOrDefault(); var builder = new SqlCommandBuilder(); tableName = builder.QuoteIdentifier(tableName); if (!string.IsNullOrEmpty(schemaName)) { schemaName = builder.QuoteIdentifier(schemaName); database.Tables[tableName, schemaName].UpdateStatistics(); } else { database.Tables[tableName].UpdateStatistics(); } return Array.Empty<IEvent>(); } catch (Exception ex) { throw new Exception($"Error occured while statistics updating for table {tableName}", ex); ; } } } }
using System; using System.Collections.Generic; using System.Data.SqlClient; using System.Diagnostics; using System.Linq; using LinqToDB.Mapping; using NuClear.Replication.Core; using NuClear.Replication.Core.Actors; using NuClear.StateInitialization.Core.Commands; namespace NuClear.StateInitialization.Core.Actors { public sealed class UpdateTableStatisticsActor<TDataObject> : IActor { private readonly SqlConnection _sqlConnection; public UpdateTableStatisticsActor(SqlConnection sqlConnection) { _sqlConnection = sqlConnection; } public IReadOnlyCollection<IEvent> ExecuteCommands(IReadOnlyCollection<ICommand> commands) { var command = commands.OfType<UpdateTableStatisticsCommand>().SingleOrDefault(); if (command == null) { return Array.Empty<IEvent>(); } Debug.WriteLine(command.ToString()); Debug.WriteLine(command.MappingSchema.ToString()); var attributes = command.MappingSchema.GetAttributes<TableAttribute>(typeof(TDataObject)); var tableName = attributes.Select(x => x.Name).FirstOrDefault() ?? typeof(TDataObject).Name; try { var database = _sqlConnection.GetDatabase(); var schemaName = attributes.Select(x => x.Schema).FirstOrDefault(); var builder = new SqlCommandBuilder(); tableName = builder.QuoteIdentifier(tableName); if (!string.IsNullOrEmpty(schemaName)) { schemaName = builder.QuoteIdentifier(schemaName); database.Tables[tableName, schemaName].UpdateStatistics(); } else { database.Tables[tableName].UpdateStatistics(); } return Array.Empty<IEvent>(); } catch (Exception ex) { throw new Exception($"Error occured while statistics updating for table {tableName}", ex); ; } } } }
mpl-2.0
C#
619063b7b15836d573d25b9cd144d57202c95df4
change color
DOTNET2016/GOL
GOL/MainWindow.xaml.cs
GOL/MainWindow.xaml.cs
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows; using System.Windows.Controls; using System.Windows.Data; using System.Windows.Documents; using System.Windows.Input; using System.Windows.Media; using System.Windows.Media.Imaging; using System.Windows.Navigation; using System.Windows.Shapes; namespace GOL { /// <summary> /// Interaction logic for MainWindow.xaml /// </summary> public partial class MainWindow : Window { public MainWindow() { InitializeComponent(); Paint(); } private void Paint() { int[,] gameBoard = new int[800,600]; for (int i = 0;i < 800; i += 10) { for(int j = 0; j < 600; j += 10) { DrawPoint(i, j); } } } private void DrawPoint(int x,int y) { Ellipse e = new Ellipse(); e.Width = 5; e.Height = 5; e.Fill = (Brushes.Black); Canvas.SetLeft(e, x); Canvas.SetTop(e, y); gameBoardCanvas.Children.Add(e); } } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows; using System.Windows.Controls; using System.Windows.Data; using System.Windows.Documents; using System.Windows.Input; using System.Windows.Media; using System.Windows.Media.Imaging; using System.Windows.Navigation; using System.Windows.Shapes; namespace GOL { /// <summary> /// Interaction logic for MainWindow.xaml /// </summary> public partial class MainWindow : Window { public MainWindow() { InitializeComponent(); Paint(); } private void Paint() { int[,] gameBoard = new int[800,600]; for (int i = 0;i < 800; i += 10) { for(int j = 0; j < 600; j += 10) { DrawPoint(i, j); } } } private void DrawPoint(int x,int y) { Ellipse e = new Ellipse(); e.Width = 5; e.Height = 5; e.Fill = (Brushes.Red); Canvas.SetLeft(e, x); Canvas.SetTop(e, y); gameBoardCanvas.Children.Add(e); } } }
mit
C#