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
eb81bb36846dfadc19846d29a4ca3f476f6bf85b
Fix a comment
y-iihoshi/ThScoreFileConverter,y-iihoshi/ThScoreFileConverter
ThScoreFileConverter/Models/Th135/LevelFlags.cs
ThScoreFileConverter/Models/Th135/LevelFlags.cs
//----------------------------------------------------------------------- // <copyright file="LevelFlags.cs" company="None"> // Copyright (c) IIHOSHI Yoshinori. // Licensed under the BSD-2-Clause license. See LICENSE.txt file in the project root for full license information. // </copyright> //----------------------------------------------------------------------- using System; namespace ThScoreFileConverter.Models.Th135 { /// <summary> /// Represents bit flags of levels. /// </summary> [Flags] public enum LevelFlags { /// <summary> /// Represents that any level is not related. /// </summary> None = 0, /// <summary> /// Represents level Easy. /// </summary> Easy = 1, /// <summary> /// Represents level Normal. /// </summary> Normal = 2, /// <summary> /// Represents level Hard. /// </summary> Hard = 4, /// <summary> /// Represents level Lunatic. /// </summary> Lunatic = 8, } }
//----------------------------------------------------------------------- // <copyright file="LevelFlag.cs" company="None"> // Copyright (c) IIHOSHI Yoshinori. // Licensed under the BSD-2-Clause license. See LICENSE.txt file in the project root for full license information. // </copyright> //----------------------------------------------------------------------- using System; namespace ThScoreFileConverter.Models.Th135 { /// <summary> /// Represents bit flags of levels. /// </summary> [Flags] public enum LevelFlags { /// <summary> /// Represents that any level is not related. /// </summary> None = 0, /// <summary> /// Represents level Easy. /// </summary> Easy = 1, /// <summary> /// Represents level Normal. /// </summary> Normal = 2, /// <summary> /// Represents level Hard. /// </summary> Hard = 4, /// <summary> /// Represents level Lunatic. /// </summary> Lunatic = 8, } }
bsd-2-clause
C#
d1edafb142a9aefe62809194cbae897e6d1d1281
Update UI/ConferencesIO.UI.Web/Views/Home/Index.cshtml
tekconf/tekconf,tekconf/tekconf
UI/ConferencesIO.UI.Web/Views/Home/Index.cshtml
UI/ConferencesIO.UI.Web/Views/Home/Index.cshtml
@{ ViewBag.Title = "Home Page"; } <h3>We suggest the following steps:</h3>
@{ ViewBag.Title = "Home Page"; } <h3>We suggest the following:</h3>
mit
C#
d6c0ad052513d5f0a1b368dfb1830f8a7afe86f4
Fix new version notification
lyftzeigen/SnakeBattle
Launcher/Updater.cs
Launcher/Updater.cs
using System; using System.Net; using System.Threading.Tasks; using System.Windows.Forms; namespace Launcher { public static class Updater { static readonly string version = "v1.1.0"; public static void CheckUpdates() { var t = new Task(new Action(CompareWithGitHub)); t.Start(); } private static void CompareWithGitHub() { using (var client = new WebClient()) { try { var data = client.DownloadString("https://raw.githubusercontent.com/lyftzeigen/SnakeBattle/master/README.md"); var v = data.Split('\n')[0].Split(' ')[2]; if (version != v) { MessageBox.Show("Update available!\n" + "Please check new version: https://github.com/lyftzeigen/SnakeBattle", "Update", MessageBoxButtons.OK, MessageBoxIcon.Information); } } catch { } } } } }
using System; using System.Net; using System.Threading.Tasks; using System.Windows.Forms; namespace Launcher { public static class Updater { static readonly string version = "v1.1.0"; public static void CheckUpdates() { var t = new Task(new Action(CompareWithGitHub)); t.Start(); } private static void CompareWithGitHub() { using (var client = new WebClient()) { try { var data = client.DownloadString("https://raw.githubusercontent.com/lyftzeigen/SnakeBattle/master/README.md"); var v = data.Split('\n')[0].Split(' ')[1]; if (version != v) { MessageBox.Show("Update available!\n" + "Please check new version: https://github.com/lyftzeigen/SnakeBattle", "Update", MessageBoxButtons.OK, MessageBoxIcon.Information); } } catch { } } } } }
mit
C#
0e6f9ca22cea350d4a813641acb52270f04f134e
Update assembly titles
mstrother/BmpListener
BMPClient/Properties/AssemblyInfo.cs
BMPClient/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("BMPClient")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("BMPClient")] [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("77cdfb9b-daf0-4910-ac2e-a6de4a3ccaaf")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]
using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("TcpTest")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("TcpTest")] [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("77cdfb9b-daf0-4910-ac2e-a6de4a3ccaaf")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]
mit
C#
e1ef093e0117aee017bd063ef580e43882e633e9
Add CornerRadius Attached Property
shannan1989/ShannanWPF
DoingWell/Controls/ControlsHelper.cs
DoingWell/Controls/ControlsHelper.cs
using System.Windows; using System.Windows.Media; namespace Shannan.DoingWell.Controls { class ControlsHelper : DependencyObject { public static Brush GetFocusBorderBrush(DependencyObject obj) { return (Brush)obj.GetValue(FocusBorderBrushProperty); } public static void SetFocusBorderBrush(DependencyObject obj, Brush value) { obj.SetValue(FocusBorderBrushProperty, value); } public static readonly DependencyProperty FocusBorderBrushProperty = DependencyProperty.RegisterAttached("FocusBorderBrush", typeof(Brush), typeof(ControlsHelper), new FrameworkPropertyMetadata(Brushes.Transparent, FrameworkPropertyMetadataOptions.AffectsRender | FrameworkPropertyMetadataOptions.Inherits)); public static Brush GetMouseOverBorderBrush(DependencyObject obj) { return (Brush)obj.GetValue(MouseOverBorderBrushProperty); } public static void SetMouseOverBorderBrush(DependencyObject obj, Brush value) { obj.SetValue(MouseOverBorderBrushProperty, value); } public static readonly DependencyProperty MouseOverBorderBrushProperty = DependencyProperty.RegisterAttached("MouseOverBorderBrush", typeof(Brush), typeof(ControlsHelper), new FrameworkPropertyMetadata(Brushes.Transparent, FrameworkPropertyMetadataOptions.AffectsRender | FrameworkPropertyMetadataOptions.Inherits)); public static CornerRadius GetCornerRadius(DependencyObject obj) { return (CornerRadius)obj.GetValue(CornerRadiusProperty); } public static void SetCornerRadius(DependencyObject obj, CornerRadius value) { obj.SetValue(CornerRadiusProperty, value); } public static readonly DependencyProperty CornerRadiusProperty = DependencyProperty.RegisterAttached("CornerRadius", typeof(CornerRadius), typeof(ControlsHelper), new FrameworkPropertyMetadata(new CornerRadius(), FrameworkPropertyMetadataOptions.AffectsMeasure | FrameworkPropertyMetadataOptions.AffectsRender)); } }
using System.Windows; using System.Windows.Media; namespace Shannan.DoingWell.Controls { class ControlsHelper : DependencyObject { public static Brush GetFocusBorderBrush(DependencyObject obj) { return (Brush)obj.GetValue(FocusBorderBrushProperty); } public static void SetFocusBorderBrush(DependencyObject obj, Brush value) { obj.SetValue(FocusBorderBrushProperty, value); } public static readonly DependencyProperty FocusBorderBrushProperty = DependencyProperty.RegisterAttached("FocusBorderBrush", typeof(Brush), typeof(ControlsHelper), new FrameworkPropertyMetadata(Brushes.Transparent, FrameworkPropertyMetadataOptions.AffectsRender | FrameworkPropertyMetadataOptions.Inherits)); public static Brush GetMouseOverBorderBrush(DependencyObject obj) { return (Brush)obj.GetValue(MouseOverBorderBrushProperty); } public static void SetMouseOverBorderBrush(DependencyObject obj, Brush value) { obj.SetValue(MouseOverBorderBrushProperty, value); } public static readonly DependencyProperty MouseOverBorderBrushProperty = DependencyProperty.RegisterAttached("MouseOverBorderBrush", typeof(Brush), typeof(ControlsHelper), new FrameworkPropertyMetadata(Brushes.Transparent, FrameworkPropertyMetadataOptions.AffectsRender | FrameworkPropertyMetadataOptions.Inherits)); } }
apache-2.0
C#
2b202f4a98d0a6adc0e2ec3af76f1bc229a769e3
Add Backlight as a supported Led.
WolfspiritM/Colore,danpierce1/Colore,CoraleStudios/Colore
Corale.Colore/Razer/Mouse/Led.cs
Corale.Colore/Razer/Mouse/Led.cs
// --------------------------------------------------------------------------------------- // <copyright file="Led.cs" company="Corale"> // Copyright © 2015 by Adam Hellberg and Brandon Scott. // // Permission is hereby granted, free of charge, to any person obtaining a copy of // this software and associated documentation files (the "Software"), to deal in // the Software without restriction, including without limitation the rights to // use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies // of the Software, and to permit persons to whom the Software is furnished to do // so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in all // copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // // Disclaimer: Corale and/or Colore is in no way affiliated with Razer and/or any // of its employees and/or licensors. Corale, Adam Hellberg, and/or Brandon Scott // do not take responsibility for any harm caused, direct or indirect, to any // Razer peripherals via the use of Colore. // // "Razer" is a trademark of Razer USA Ltd. // </copyright> // --------------------------------------------------------------------------------------- namespace Corale.Colore.Razer.Mouse { using Corale.Colore.Annotations; /// <summary> /// LEDs that can be the target of color changes. /// </summary> public enum Led : uint { /// <summary> /// No LED. /// </summary> [PublicAPI] None = 0, /// <summary> /// The LED illuminating the scroll wheel. /// </summary> [PublicAPI] ScrollWheel = 0x0001, /// <summary> /// The LED illuminating the logo present on the mouse. /// </summary> [PublicAPI] Logo = 0x0002, /// <summary> /// The mouse backlight. /// </summary> [PublicAPI] Backlight = 0x0003, /// <summary> /// Invalid LED. /// </summary> [PublicAPI] Invalid = 0xFFFF } }
// --------------------------------------------------------------------------------------- // <copyright file="Led.cs" company="Corale"> // Copyright © 2015 by Adam Hellberg and Brandon Scott. // // Permission is hereby granted, free of charge, to any person obtaining a copy of // this software and associated documentation files (the "Software"), to deal in // the Software without restriction, including without limitation the rights to // use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies // of the Software, and to permit persons to whom the Software is furnished to do // so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in all // copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // // Disclaimer: Corale and/or Colore is in no way affiliated with Razer and/or any // of its employees and/or licensors. Corale, Adam Hellberg, and/or Brandon Scott // do not take responsibility for any harm caused, direct or indirect, to any // Razer peripherals via the use of Colore. // // "Razer" is a trademark of Razer USA Ltd. // </copyright> // --------------------------------------------------------------------------------------- namespace Corale.Colore.Razer.Mouse { using Corale.Colore.Annotations; /// <summary> /// LEDs that can be the target of color changes. /// </summary> public enum Led : uint { /// <summary> /// No LED. /// </summary> [PublicAPI] None = 0, /// <summary> /// The LED illuminating the scroll wheel. /// </summary> [PublicAPI] ScrollWheel = 0x0001, /// <summary> /// The LED illuminating the logo present on the mouse. /// </summary> [PublicAPI] Logo = 0x0002, /// <summary> /// Invalid LED. /// </summary> [PublicAPI] Invalid = 0xFFFF } }
mit
C#
94d9c303c224189ce22a9c22c1627ddd93206e6f
Add delay to observable.
slashdotdash/Duplicity
src/Duplicity/Duplicator.cs
src/Duplicity/Duplicator.cs
using System; using System.IO; using System.Reactive.Linq; using Duplicity.DuplicationStrategy; namespace Duplicity { /// <summary> /// Duplicates file system changes in one directory to another. /// </summary> /// <remarks>Assumes that targetDirectory contains the same files/folders as the observable source.</remarks> public sealed class Duplicator : IDisposable { private readonly string _sourceDirectory; private readonly FileSystemObservable _observable; private readonly IDisposable _subscription; private readonly DuplicationHandlerFactory _handlerFactory; public Duplicator(string sourceDirectory, string targetDirectory) { if (string.IsNullOrWhiteSpace(sourceDirectory)) throw new ArgumentNullException("sourceDirectory"); if (string.IsNullOrWhiteSpace(targetDirectory)) throw new ArgumentNullException("targetDirectory"); if (!Directory.Exists(sourceDirectory)) throw new DirectoryNotFoundException(); if (!Directory.Exists(targetDirectory)) throw new DirectoryNotFoundException(); if (sourceDirectory == targetDirectory) throw new ArgumentException("Cannot duplicate the source diretory to itself"); _sourceDirectory = sourceDirectory; _handlerFactory = new DuplicationHandlerFactory(sourceDirectory, targetDirectory); _observable = new FileSystemObservable(sourceDirectory); _subscription = Observable.Create<FileSystemChange>(observer => _observable.Subscribe(observer)) //.Delay(TimeSpan.FromSeconds(1)) .Subscribe(OnFileSystemChange); } private void OnFileSystemChange(FileSystemChange change) { var handler = _handlerFactory.Create(change); handler.Handle(change.FileOrDirectoryPath); } public void Dispose() { _subscription.Dispose(); _observable.Dispose(); } } }
using System; using System.IO; using System.Reactive.Linq; using Duplicity.DuplicationStrategy; namespace Duplicity { /// <summary> /// Duplicates file system changes in one directory to another. /// </summary> /// <remarks>Assumes that targetDirectory contains the same files/folders as the observable source.</remarks> public sealed class Duplicator : IDisposable { private readonly string _sourceDirectory; private readonly FileSystemObservable _observable; private readonly IDisposable _subscription; private readonly DuplicationHandlerFactory _handlerFactory; public Duplicator(string sourceDirectory, string targetDirectory) { if (string.IsNullOrWhiteSpace(sourceDirectory)) throw new ArgumentNullException("sourceDirectory"); if (string.IsNullOrWhiteSpace(targetDirectory)) throw new ArgumentNullException("targetDirectory"); if (!Directory.Exists(sourceDirectory)) throw new DirectoryNotFoundException(); if (!Directory.Exists(targetDirectory)) throw new DirectoryNotFoundException(); if (sourceDirectory == targetDirectory) throw new ArgumentException("Cannot duplicate the source diretory to itself"); _sourceDirectory = sourceDirectory; _handlerFactory = new DuplicationHandlerFactory(sourceDirectory, targetDirectory); _observable = new FileSystemObservable(sourceDirectory); _subscription = Observable.Create<FileSystemChange>(observer => _observable.Subscribe(observer)) .Subscribe(OnFileSystemChange); } private void OnFileSystemChange(FileSystemChange change) { var handler = _handlerFactory.Create(change); handler.Handle(change.FileOrDirectoryPath); } public void Dispose() { _subscription.Dispose(); _observable.Dispose(); } } }
mit
C#
4ddd08cc9733abfa7859840782c331109e5b5627
Change interop calls to directly pinvoke.
orbitcowboy/MIEngine,rajkumar42/MIEngine,caslan/MIEngine,edumunoz/MIEngine,csiusers/MIEngine,pieandcakes/MIEngine,wesrupert/MIEngine,edumunoz/MIEngine,caslan/MIEngine,chuckries/MIEngine,xingshenglu/MIEngine,devilman3d/MIEngine,wiktork/MIEngine,caslan/MIEngine,csiusers/MIEngine,orbitcowboy/MIEngine,Microsoft/MIEngine,wesrupert/MIEngine,rajkumar42/MIEngine,csiusers/MIEngine,edumunoz/MIEngine,faxue-msft/MIEngine,pieandcakes/MIEngine,xingshenglu/MIEngine,faxue-msft/MIEngine,orbitcowboy/MIEngine,wiktork/MIEngine,devilman3d/MIEngine,xingshenglu/MIEngine,orbitcowboy/MIEngine,faxue-msft/MIEngine,caslan/MIEngine,chuckries/MIEngine,wiktork/MIEngine,jacdavis/MIEngine,rajkumar42/MIEngine,devilman3d/MIEngine,pieandcakes/MIEngine,devilman3d/MIEngine,wesrupert/MIEngine,Microsoft/MIEngine,edumunoz/MIEngine,Microsoft/MIEngine,csiusers/MIEngine,pieandcakes/MIEngine,jacdavis/MIEngine,jacdavis/MIEngine,chuckries/MIEngine,faxue-msft/MIEngine,chuckries/MIEngine,wesrupert/MIEngine,Microsoft/MIEngine,rajkumar42/MIEngine
src/MICore/NativeMethods.cs
src/MICore/NativeMethods.cs
// Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. using System; using System.Runtime.InteropServices; namespace MICore { internal class NativeMethods { private const string Libc = "libc"; [DllImport(Libc, EntryPoint = "kill", SetLastError = true)] internal static extern int Kill(int pid, int mode); [DllImport(Libc, EntryPoint = "mkfifo", SetLastError = true)] internal static extern int MkFifo(string name, int mode); [DllImport(Libc, EntryPoint = "geteuid", SetLastError = true)] internal static extern uint GetEUid(); } }
// Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. using System; using System.Runtime.InteropServices; namespace MICore { internal class NativeMethods { // TODO: It would be better to route these to the correct .so files directly rather than pasing through system.native. [DllImport("System.Native", SetLastError = true)] internal static extern int Kill(int pid, int mode); [DllImport("System.Native", SetLastError = true)] internal static extern int MkFifo(string name, int mode); [DllImport("System.Native", SetLastError = true)] internal static extern uint GetEUid(); } }
mit
C#
189042a175ce3f46d9e0f9d21d2c22e24039d283
Fix build
MetacoSA/NBitcoin,MetacoSA/NBitcoin,NicolasDorier/NBitcoin
NBitcoin/Utils/ThreadSafeList.cs
NBitcoin/Utils/ThreadSafeList.cs
using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace NBitcoin { public class ThreadSafeList<T> : IEnumerable<T> { private List<T> _Behaviors; private object _lock = new object(); private Lazy<List<T>> _EnumeratorList; public ThreadSafeList() { _Behaviors = new List<T>(); Modified(); } private void Modified() { if (_EnumeratorList == null || _EnumeratorList.IsValueCreated is true) _EnumeratorList = new Lazy<List<T>>(() => { lock (_lock) { return _Behaviors.ToList(); } }); } /// <summary> /// Add an item to the collection /// </summary> /// <param name="item"></param> /// <returns>When disposed, the item is removed</returns> public IDisposable Add(T item) { if (item == null) throw new ArgumentNullException(nameof(item)); OnAdding(item); lock (_lock) { _Behaviors.Add(item); Modified(); } return new ActionDisposable(() => { }, () => Remove(item)); } protected virtual void OnAdding(T obj) { } protected virtual void OnRemoved(T obj) { } public bool Remove(T item) { bool removed = false; lock (_lock) { removed = _Behaviors.Remove(item); Modified(); } if (removed) OnRemoved(item); return removed; } public void Clear() { foreach (var behavior in this) Remove(behavior); } public T FindOrCreate<U>() where U : T, new() { return FindOrCreate<U>(() => new U()); } public U FindOrCreate<U>(Func<U> create) where U : T { var result = this.OfType<U>().FirstOrDefault(); if (result == null) { result = create(); Add(result); } return result; } public U Find<U>() where U : T { return this.OfType<U>().FirstOrDefault(); } public void Remove<U>() where U : T { foreach (var b in this.OfType<U>()) { Remove(b); } } #region IEnumerable<T> Members public IEnumerator<T> GetEnumerator() { return _EnumeratorList.Value.GetEnumerator(); } #endregion #region IEnumerable Members System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { return GetEnumerator(); } #endregion } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace NBitcoin { public class ThreadSafeList<T> : IEnumerable<T> { private List<T> _Behaviors; private object _lock = new object(); private Lazy<List<T>> _EnumeratorList; public ThreadSafeList() { _Behaviors = new List<T>(); Modified(); } private void Modified() { if (_EnumeratorList?.IsValueCreated is true) _EnumeratorList = new Lazy<List<T>>(() => { lock (_lock) { return _Behaviors.ToList(); } }); } /// <summary> /// Add an item to the collection /// </summary> /// <param name="item"></param> /// <returns>When disposed, the item is removed</returns> public IDisposable Add(T item) { if (item == null) throw new ArgumentNullException(nameof(item)); OnAdding(item); lock (_lock) { _Behaviors.Add(item); Modified(); } return new ActionDisposable(() => { }, () => Remove(item)); } protected virtual void OnAdding(T obj) { } protected virtual void OnRemoved(T obj) { } public bool Remove(T item) { bool removed = false; lock (_lock) { removed = _Behaviors.Remove(item); Modified(); } if (removed) OnRemoved(item); return removed; } public void Clear() { foreach (var behavior in this) Remove(behavior); } public T FindOrCreate<U>() where U : T, new() { return FindOrCreate<U>(() => new U()); } public U FindOrCreate<U>(Func<U> create) where U : T { var result = this.OfType<U>().FirstOrDefault(); if (result == null) { result = create(); Add(result); } return result; } public U Find<U>() where U : T { return this.OfType<U>().FirstOrDefault(); } public void Remove<U>() where U : T { foreach (var b in this.OfType<U>()) { Remove(b); } } #region IEnumerable<T> Members public IEnumerator<T> GetEnumerator() { return _EnumeratorList.Value.GetEnumerator(); } #endregion #region IEnumerable Members System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { return GetEnumerator(); } #endregion } }
mit
C#
66212a22b0506f357817007f13a7b1e194b13de8
Refactor TodoRepository and include Add and Remove methods
OkraFramework/Okra-Todo
Okra-Todo/Data/TodoRepository.cs
Okra-Todo/Data/TodoRepository.cs
using System; using System.Collections.Generic; using System.Composition; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Okra.TodoSample.Data { [Export(typeof(ITodoRepository))] public class TodoRepository : ITodoRepository { private IList<TodoItem> todoItems; public TodoRepository() { this.todoItems = new List<TodoItem> { new TodoItem() { Id = "1", Title = "First item"}, new TodoItem() { Id = "2", Title = "Second item"}, new TodoItem() { Id = "3", Title = "Third item"} }; } public TodoItem GetTodoItemById(string id) { return todoItems.Where(item => item.Id == id).FirstOrDefault(); } public IList<TodoItem> GetTodoItems() { return todoItems; } public void AddTodoItem(TodoItem todoItem) { this.todoItems.Add(todoItem); } public void RemoveTodoItem(TodoItem todoItem) { this.todoItems.Remove(todoItem); } } }
using System; using System.Collections.Generic; using System.Composition; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Okra.TodoSample.Data { [Export(typeof(ITodoRepository))] public class TodoRepository : ITodoRepository { public TodoItem GetTodoItemById(string id) { return GetTodoItems().Where(item => item.Id == id).FirstOrDefault(); } public IList<TodoItem> GetTodoItems() { return new List<TodoItem> { new TodoItem() { Id = "1", Title = "First item"}, new TodoItem() { Id = "2", Title = "Second item"}, new TodoItem() { Id = "3", Title = "Third item"} }; } } }
apache-2.0
C#
885ce1464d84f35c0ca8b16aef4ccf5245d99081
use fields for sub processes
Pondidum/Stronk,Pondidum/Stronk
src/Stronk/ConfigBuilder.cs
src/Stronk/ConfigBuilder.cs
using System.Linq; using System.Reflection; using Stronk.PropertyWriters; namespace Stronk { public class ConfigBuilder { private readonly IStronkConfig _options; private readonly ConverterSelector _converterSelector; private readonly ValueSelector _valueSelector; private readonly ConversionProcess _conversionProcess; public ConfigBuilder(IStronkConfig options) { _options = options; _converterSelector = new ConverterSelector(_options); _valueSelector = new ValueSelector(_options); _conversionProcess = new ConversionProcess(_options); } public void Populate(object target) { LogPopulationStart(target); var writerArgs = new PropertyWriterArgs(_options.WriteLog, target.GetType()); var properties = _options .PropertyWriters .SelectMany(writer => writer.Select(writerArgs)) .ToArray(); _options.WriteLog( "Selected {count} properties to populate: {properties}", properties.Length, properties.Select(p => p.Name)); foreach (var property in properties) { var value = _conversionProcess.Convert( property, _converterSelector.Select(property), _valueSelector.Select(property)); try { property.Assign(target, value); } catch (TargetInvocationException e) { throw e.InnerException ?? e; } } } private void LogPopulationStart(object target) { var message = "Populating '{typeName}'...\n" + "Reading from: {sourceTypeName}\n" + "Writing to: {propertyWriters}\n" + "Matching keys to properties with: {valueSelectors}\n" + "Converting values using: {valueConverters}."; _options.WriteLog( message, target.GetType().Name, _options.ConfigSources.SelectTypeNames(), _options.PropertyWriters.SelectTypeNames(), _options.Mappers.SelectTypeNames(), _options.ValueConverters.SelectTypeNames()); } } }
using System.Linq; using System.Reflection; using Stronk.PropertyWriters; namespace Stronk { public class ConfigBuilder { private readonly IStronkConfig _options; public ConfigBuilder(IStronkConfig options) { _options = options; } public void Populate(object target) { LogPopulationStart(target); var writerArgs = new PropertyWriterArgs(_options.WriteLog, target.GetType()); var properties = _options .PropertyWriters .SelectMany(writer => writer.Select(writerArgs)) .ToArray(); _options.WriteLog( "Selected {count} properties to populate: {properties}", properties.Length, properties.Select(p => p.Name)); var converterSelector = new ConverterSelector(_options); var valueSelector = new ValueSelector(_options); var converter = new ConversionProcess(_options); foreach (var property in properties) { var value = converter.Convert( property, converterSelector.Select(property), valueSelector.Select(property)); try { property.Assign(target, value); } catch (TargetInvocationException e) { throw e.InnerException ?? e; } } } private void LogPopulationStart(object target) { var message = "Populating '{typeName}'...\n" + "Reading from: {sourceTypeName}\n" + "Writing to: {propertyWriters}\n" + "Matching keys to properties with: {valueSelectors}\n" + "Converting values using: {valueConverters}."; _options.WriteLog( message, target.GetType().Name, _options.ConfigSources.SelectTypeNames(), _options.PropertyWriters.SelectTypeNames(), _options.Mappers.SelectTypeNames(), _options.ValueConverters.SelectTypeNames()); } } }
lgpl-2.1
C#
c82c0d995f48e9b4b89b798a82f8fcece4e03d44
Update run.csx
rfennell/vNextBuild,rfennell/vNextBuild,ChrisLGardner/vNextBuild,ChrisLGardner/vNextBuild,rfennell/vNextBuild,ChrisLGardner/vNextBuild,rfennell/vNextBuild,ChrisLGardner/vNextBuild
AzureFunctions/VSTSExtensionGate/run.csx
AzureFunctions/VSTSExtensionGate/run.csx
#r "Newtonsoft.Json" using System.Net; using System.Net.Http; using System.Net.Http.Headers; using Newtonsoft.Json.Linq; using System.Net.Http.Formatting; public static async Task<HttpResponseMessage> Run(HttpRequestMessage req, TraceWriter log) { log.Info("C# HTTP trigger function processed a request."); // Get request body dynamic data = await req.Content.ReadAsAsync<object>(); string pat = data?.pat; string instance = data?.instance; string taskGuid = data?.taskguid; string version = data?.version; if ((pat == null ) || (instance == null) || (taskGuid == null) || (version == null)) { log.Info("Invalid parameters passed"); return req.CreateResponse(HttpStatusCode.BadRequest, "Please pass a VSTS instance name, PAT and TaskGuid in the request body"); } try { log.Info($"Requesting deployed task with GUID {taskGuid} to see if it is version {version} from VSTS instance {instance}"); var client = new HttpClient(); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", Convert.ToBase64String( System.Text.ASCIIEncoding.ASCII.GetBytes( string.Format("{0}:{1}", "", pat)))); client.BaseAddress = new Uri($"https://{instance}.visualstudio.com/_apis/distributedtask/tasks/{taskGuid}"); var result = await client.GetAsync(""); string resultContent = await result.Content.ReadAsStringAsync(); var o= JObject.Parse(resultContent); var count = (int) o.SelectToken("count"); log.Info($"There are {count} versions of the task present"); var isDeployed = false; for (int i =0; i < count; i++) { log.Info($"Checking {o.SelectToken("value")[i].SelectToken("contributionVersion").ToString()}"); isDeployed = isDeployed || version.Equals(o.SelectToken("value")[i].SelectToken("contributionVersion").ToString()); ; } var returnValue = new { Deployed = isDeployed}; log.Info($"The response payload is {returnValue}"); return req.CreateResponse( HttpStatusCode.OK, returnValue, JsonMediaTypeFormatter.DefaultMediaType); } catch (Exception ex) { return req.CreateResponse(HttpStatusCode.BadRequest, $"Exception thrown making API call or Parsing result. {ex.Message}"); } }
#r "Newtonsoft.Json" using System.Net; using System.Net.Http; using System.Net.Http.Headers; using Newtonsoft.Json.Linq; using System.Net.Http.Formatting; public static async Task<HttpResponseMessage> Run(HttpRequestMessage req, TraceWriter log) { log.Info("C# HTTP trigger function processed a request."); // Get request body dynamic data = await req.Content.ReadAsAsync<object>(); string pat = data?.pat; string instance = data?.instance; string taskGuid = data?.taskguid; string version = data?.version; if ((pat == null ) || (instance == null) || (taskGuid == null) || (version == null)) { log.Info("Invalid parameters passed"); return req.CreateResponse(HttpStatusCode.BadRequest, "Please pass a VSTS instance name, PAT and TaskGuid in the request body"); } try { log.Info($"Requesting deployed task with GUID {taskGuid} to see if it is version {version} from VSTS instance {instance}"); var client = new HttpClient(); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", Convert.ToBase64String( System.Text.ASCIIEncoding.ASCII.GetBytes( string.Format("{0}:{1}", "", pat)))); client.BaseAddress = new Uri($"https://{instance}.visualstudio.com/_apis/distributedtask/tasks/{taskGuid}"); var result = await client.GetAsync(""); string resultContent = await result.Content.ReadAsStringAsync(); var o= JObject.Parse(resultContent); var count = (int) o.SelectToken("count"); log.Info($"There are {count} versions of the task present"); var isDeployed = false; for (int i =0; i < count; i++) { log.Info($"Checking {o.SelectToken("value")[i].SelectToken("contributionVersion").ToString()}"); isDeployed = isDeployed || version.Equals(o.SelectToken("value")[i].SelectToken("contributionVersion").ToString()); ; } log.Info($"The response payload is {isDeployed}"); return req.CreateResponse( HttpStatusCode.OK, isDeployed, JsonMediaTypeFormatter.DefaultMediaType); } catch (Exception ex) { return req.CreateResponse(HttpStatusCode.BadRequest, $"Exception thrown making API call or Parsing result. {ex.Message}"); } }
mit
C#
3908e816d3649cf52f79baab1e6b3e1d4deea5d4
Rename again!
DartVS/DartVS,DartVS/DartVS,DartVS/DartVS,modulexcite/DartVS,modulexcite/DartVS,modulexcite/DartVS
DanTup.DartVS.Vsix/DartProjectTracker.cs
DanTup.DartVS.Vsix/DartProjectTracker.cs
using System; using System.Collections.Concurrent; using System.ComponentModel.Composition; using System.IO; using System.Linq; using EnvDTE; using Microsoft.VisualStudio.Shell; namespace DanTup.DartVS { /// <summary> /// Tracks which open projects ar possible Dart projects so that they can be analysed. /// </summary> [PartCreationPolicy(CreationPolicy.Shared)] [Export] public class DartProjectTracker { [Import] internal SVsServiceProvider ServiceProvider = null; ConcurrentDictionary<string, Project> dartProjects = new ConcurrentDictionary<string, Project>(); [ImportingConstructor] public DartProjectTracker([Import]SVsServiceProvider serviceProvider) { var dte = (EnvDTE.DTE)serviceProvider.GetService(typeof(EnvDTE.DTE)); // Subscribe to project changes. dte.Events.SolutionEvents.ProjectAdded += TrackProject; dte.Events.SolutionEvents.ProjectRemoved += UntrackProject; dte.Events.SolutionEvents.BeforeClosing += UntrackAllProjects; // Subscribe for existing projects already open when we were triggered. foreach (Project project in dte.Solution.Projects) TrackProject(project); } void TrackProject(Project project) { if (!IsDartProject(project)) return; dartProjects.TryAdd(GetProjectLocation(project), project); } void UntrackProject(Project project) { Project _; dartProjects.TryRemove(GetProjectLocation(project), out _); } void UntrackAllProjects() { dartProjects.Clear(); } string GetProjectLocation(Project project) { // This way seems to be reliable for both projects and "web sites" (whereas project.FullName gives URL for web sites). return (string)project.Properties.Item("FullPath").Value; } bool IsDartProject(Project project) { if (project == null) return false; var allProjectItems = project.ProjectItems == null ? null : project.ProjectItems.Cast<ProjectItem>().Flatten(pi => pi.ProjectItems == null ? null : pi.ProjectItems.Cast<ProjectItem>()); return allProjectItems .Any(pi => // Has a filename that's a Dart file. Enumerable.Range(0, pi.FileCount) .Select(fi => pi.FileNames[(short)fi]) .Any(IsDartFile) ); } bool IsDartFile(string filename) { return string.Equals(Path.GetExtension(filename), ".dart", StringComparison.OrdinalIgnoreCase); } } }
using System; using System.Collections.Concurrent; using System.ComponentModel.Composition; using System.IO; using System.Linq; using EnvDTE; using Microsoft.VisualStudio.Shell; namespace DanTup.DartVS { /// <summary> /// Tracks which open projects ar possible Dart projects so that they can be analysed. /// </summary> [PartCreationPolicy(CreationPolicy.Shared)] [Export] public class DartProjectTracker { [Import] internal SVsServiceProvider ServiceProvider = null; ConcurrentDictionary<string, Project> trackedDartProjects = new ConcurrentDictionary<string, Project>(); [ImportingConstructor] public DartProjectTracker([Import]SVsServiceProvider serviceProvider) { var dte = (EnvDTE.DTE)serviceProvider.GetService(typeof(EnvDTE.DTE)); // Subscribe to project changes. dte.Events.SolutionEvents.ProjectAdded += TrackProject; dte.Events.SolutionEvents.ProjectRemoved += UntrackProject; dte.Events.SolutionEvents.BeforeClosing += UntrackAllProjects; // Subscribe for existing projects already open when we were triggered. foreach (Project project in dte.Solution.Projects) TrackProject(project); } void TrackProject(Project project) { if (!IsDartProject(project)) return; trackedDartProjects.TryAdd(GetProjectLocation(project), project); } void UntrackProject(Project project) { Project _; trackedDartProjects.TryRemove(GetProjectLocation(project), out _); } void UntrackAllProjects() { trackedDartProjects.Clear(); } string GetProjectLocation(Project project) { // This way seems to be reliable for both projects and "web sites" (whereas project.FullName gives URL for web sites). return (string)project.Properties.Item("FullPath").Value; } bool IsDartProject(Project project) { if (project == null) return false; var allProjectItems = project.ProjectItems == null ? null : project.ProjectItems.Cast<ProjectItem>().Flatten(pi => pi.ProjectItems == null ? null : pi.ProjectItems.Cast<ProjectItem>()); return allProjectItems .Any(pi => // Has a filename that's a Dart file. Enumerable.Range(0, pi.FileCount) .Select(fi => pi.FileNames[(short)fi]) .Any(IsDartFile) ); } bool IsDartFile(string filename) { return string.Equals(Path.GetExtension(filename), ".dart", StringComparison.OrdinalIgnoreCase); } } }
mit
C#
72f8e8b75d43e3d2aabd17f8f9f776fed1132330
Fix broken build
gideonkorir/jaeger4net
src/Jaeger4Net/Reporters/NoopReporter.cs
src/Jaeger4Net/Reporters/NoopReporter.cs
using System; using System.Collections.Generic; using System.Text; namespace Jaeger4Net.Reporters { class NoopReporter : IReporter { public void Dispose() { } public int Report(Span span) => 0; } }
using System; using System.Collections.Generic; using System.Text; namespace Jaeger4Net.Reporters { class NoopReporter : IReporter { public void Dispose() { } public int Report(Span span) { } } }
mit
C#
45e4004e91ac3e54c4f01585c47986f46d2af83b
Remove GetSign() (this was stupid).
chtoucas/Narvalo.NET,chtoucas/Narvalo.NET
src/Narvalo.Finance/Numerics/Decimal$.cs
src/Narvalo.Finance/Numerics/Decimal$.cs
// Copyright (c) Narvalo.Org. All rights reserved. See LICENSE.txt in the project root for license information. namespace Narvalo.Finance.Numerics { using System; internal static class DecimalExtensions { //private const int SIGN_MASK = unchecked((int)0x80000000); //private const byte DECIMAL_NEG = 0x80; //private const byte DECIMAL_ADD = 0x00; private const int SCALE_MASK = 0x00FF0000; private const int SCALE_SHIFT = 16; // The maximum power of 10 that a 32 bit integer can store. //private const int MAX_INT_SCALE = 9; // https://msdn.microsoft.com/en-us/library/system.decimal.getbits.aspx // GetBits() returns an array // - The first, second and third elements represent the low, middle, and high 32 bits // of the 96-bit integer number. // - The fourth element contains the scale factor and sign: // * bits 0 to 15, the lower word, are unused and must be zero. // * bits 16 to 23 must contain an exponent between 0 and 28 inclusive, // which indicates the power of 10 to divide the integer number. // * bits 24 to 30 are unused and must be zero. // * bit 31 contains the sign: 0 mean positive, and 1 means negative. public static int GetScale(this decimal @this) { int flags = Decimal.GetBits(@this)[3]; // Bits 16 to 23 contains an exponent between 0 and 28, which indicates the power // of 10 to divide the integer number. //return (flags >> 16) & 0xFF; return (flags & SCALE_MASK) >> SCALE_SHIFT; } //public static bool GetSign(this decimal @this) //{ // return @this > 0; // //int flags = Decimal.GetBits(@this)[3]; // //// The last bit contains the sign: 0 means positive, and 1 means negative. // //return (flags & SIGN_MASK) != 0; //} } }
// Copyright (c) Narvalo.Org. All rights reserved. See LICENSE.txt in the project root for license information. namespace Narvalo.Finance.Numerics { using System; internal static class DecimalExtensions { private const int SIGN_MASK = unchecked((int)0x80000000); //private const byte DECIMAL_NEG = 0x80; //private const byte DECIMAL_ADD = 0x00; private const int SCALE_MASK = 0x00FF0000; private const int SCALE_SHIFT = 16; // The maximum power of 10 that a 32 bit integer can store. //private const int MAX_INT_SCALE = 9; // https://msdn.microsoft.com/en-us/library/system.decimal.getbits.aspx // GetBits() returns an array // - The first, second and third elements represent the low, middle, and high 32 bits // of the 96-bit integer number. // - The fourth element contains the scale factor and sign: // * bits 0 to 15, the lower word, are unused and must be zero. // * bits 16 to 23 must contain an exponent between 0 and 28 inclusive, // which indicates the power of 10 to divide the integer number. // * bits 24 to 30 are unused and must be zero. // * bit 31 contains the sign: 0 mean positive, and 1 means negative. public static int GetScale(this decimal @this) { int flags = Decimal.GetBits(@this)[3]; // Bits 16 to 23 contains an exponent between 0 and 28, which indicates the power // of 10 to divide the integer number. //return (flags >> 16) & 0xFF; return (flags & SCALE_MASK) >> SCALE_SHIFT; } public static bool GetSign(this decimal @this) { int flags = Decimal.GetBits(@this)[3]; // The last bit contains the sign: 0 means positive, and 1 means negative. return (flags & SIGN_MASK) != 0; } } }
bsd-2-clause
C#
ad3173410a61bedf6d0fb395a4cc81bfd7adfd1f
Correct `Options.ArrayDiff` documentation
wbish/jsondiffpatch.net
Src/JsonDiffPatchDotNet/Options.cs
Src/JsonDiffPatchDotNet/Options.cs
namespace JsonDiffPatchDotNet { public sealed class Options { public Options() { ArrayDiff = ArrayDiffMode.Efficient; TextDiff = TextDiffMode.Efficient; MinEfficientTextDiffLength = 50; } /// <summary> /// Specifies how arrays are diffed. The default is Efficient. /// </summary> public ArrayDiffMode ArrayDiff { get; set; } /// <summary> /// Specifies how string values are diffed. The default is Efficient. /// </summary> public TextDiffMode TextDiff { get; set; } /// <summary> /// The minimum string length required to use Efficient text diff. If the minimum /// length is not met, simple text diff will be used. The default length is 50 characters. /// </summary> public long MinEfficientTextDiffLength { get; set; } } }
namespace JsonDiffPatchDotNet { public sealed class Options { public Options() { ArrayDiff = ArrayDiffMode.Efficient; TextDiff = TextDiffMode.Efficient; MinEfficientTextDiffLength = 50; } /// <summary> /// Specifies how arrays are diffed. The default is Simple. /// </summary> public ArrayDiffMode ArrayDiff { get; set; } /// <summary> /// Specifies how string values are diffed. The default is Efficient. /// </summary> public TextDiffMode TextDiff { get; set; } /// <summary> /// The minimum string length required to use Efficient text diff. If the minimum /// length is not met, simple text diff will be used. The default length is 50 characters. /// </summary> public long MinEfficientTextDiffLength { get; set; } } }
mit
C#
a69e7491618de288c379afc56817f46f451ccab3
Make boxes not take focus ever
lytico/xwt,antmicro/xwt,mono/xwt,hwthomas/xwt,TheBrainTech/xwt
Xwt.XamMac/Xwt.Mac/BoxBackend.cs
Xwt.XamMac/Xwt.Mac/BoxBackend.cs
// // BoxBackend.cs // // Author: // Lluis Sanchez <lluis@xamarin.com> // // Copyright (c) 2011 Xamarin Inc // // 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 AppKit; using CoreGraphics; using Xwt.Backends; namespace Xwt.Mac { public class BoxBackend: ViewBackend<NSView,IWidgetEventSink>, IBoxBackend { public BoxBackend () { } public override void Initialize () { ViewObject = new WidgetView (EventSink, ApplicationContext); CanGetFocus = false; } public void Add (IWidgetBackend widget) { ViewBackend b = (ViewBackend) widget; Widget.AddSubview (b.Widget); } public void Remove (IWidgetBackend widget) { var w = GetWidget (widget); if (w.Superview != Widget) throw new InvalidOperationException ("Widget is not a child of this container"); w.RemoveFromSuperview (); } public void SetAllocation (IWidgetBackend[] widgets, Rectangle[] rects) { for (int n=0; n<widgets.Length; n++) { var w = GetWidget (widgets[n]); var r = rects[n]; w.Frame = new CGRect ((nfloat)r.Left, (nfloat)r.Top, (nfloat)r.Width, (nfloat)r.Height); w.NeedsDisplay = true; } } } }
// // BoxBackend.cs // // Author: // Lluis Sanchez <lluis@xamarin.com> // // Copyright (c) 2011 Xamarin Inc // // 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 AppKit; using CoreGraphics; using Xwt.Backends; namespace Xwt.Mac { public class BoxBackend: ViewBackend<NSView,IWidgetEventSink>, IBoxBackend { public BoxBackend () { } public override void Initialize () { ViewObject = new WidgetView (EventSink, ApplicationContext); } public void Add (IWidgetBackend widget) { ViewBackend b = (ViewBackend) widget; Widget.AddSubview (b.Widget); } public void Remove (IWidgetBackend widget) { var w = GetWidget (widget); if (w.Superview != Widget) throw new InvalidOperationException ("Widget is not a child of this container"); w.RemoveFromSuperview (); } public void SetAllocation (IWidgetBackend[] widgets, Rectangle[] rects) { for (int n=0; n<widgets.Length; n++) { var w = GetWidget (widgets[n]); var r = rects[n]; w.Frame = new CGRect ((nfloat)r.Left, (nfloat)r.Top, (nfloat)r.Width, (nfloat)r.Height); w.NeedsDisplay = true; } } } }
mit
C#
0eaf453f769ad32008d8541f875f87041cf65393
Update IDupDetector.cs
unruledboy/SharpDups
Logic/IDupDetector.cs
Logic/IDupDetector.cs
using System.Collections.Generic; using Xnlab.SharpDups.Model; namespace Xnlab.SharpDups.Logic { public interface IDupDetector { (List<Duplicate> duplicates, IList<string> failedToProcessFiles) Find(IEnumerable<string> files, int workers, int quickHashSize = 3, int bufferSize = 0); } }
using System.Collections.Generic; using Xnlab.SharpDups.Model; namespace Xnlab.SharpDups.Logic { public interface IDupDetector { (List<Duplicate> duplicates, IList<string> failedToProcessFiles) Find(IEnumerable<string> files, int workers, int quickHashSize = 3, int bufferSize = 0); } }
apache-2.0
C#
6ee1ce2e1bb48b6e595f0f5ed0d11bedaec09dce
Add OnSuspending log
DanieleScipioni/TestApp
TestAppUWP.AppShell/App.xaml.cs
TestAppUWP.AppShell/App.xaml.cs
using System; using System.Diagnostics; using System.IO; using TestAppUWP.AppShell.Samples.RootNavigation; using TestAppUWP.Logic.Logs; using TestAppUWP.Samples.CertTutorial; using Windows.ApplicationModel; using Windows.ApplicationModel.Activation; using Windows.Storage; using Windows.UI.Xaml; namespace TestAppUWP.AppShell { sealed partial class App { private RootNavigationViewModel _rootNavigationViewModel; public App() { InitializeComponent(); Suspending += OnSuspending; } protected override void OnLaunched(LaunchActivatedEventArgs args) { LogFactory.Init(Path.Combine(ApplicationData.Current.LocalFolder.Path, "Logs")); Logger logger = LogFactory.GetLogger(nameof(OnLaunched)); logger.Log($"PreviousExecutionState {args.PreviousExecutionState}"); #if DEBUG if (Debugger.IsAttached) { //DebugSettings.EnableFrameRateCounter = true; } #endif UIElement rootContent = Window.Current.Content; if (rootContent == null) { _rootNavigationViewModel = new RootNavigationViewModel(args.PreviousExecutionState); rootContent = new RootNavigationPage { DataContext = _rootNavigationViewModel }; Window.Current.Content = rootContent; } Type type = typeof(SamePage); if (args.TileId.StartsWith(type.Name)) { Type landingPageType = typeof(CertTutorial); string landingParams = args.Arguments; _rootNavigationViewModel.SetLandingPage(landingPageType, landingParams); } if (args.PrelaunchActivated) return; // Ensure the current window is active Window.Current.Activate(); } protected override void OnActivated(IActivatedEventArgs args) { Debugger.Break(); } private void OnSuspending(object sender, SuspendingEventArgs e) { Logger logger = LogFactory.GetLogger(nameof(OnSuspending)); logger.Log($"SuspendingOperation.Deadline {e.SuspendingOperation.Deadline}"); logger.Flush(); } } }
using System; using System.Diagnostics; using System.IO; using TestAppUWP.AppShell.Samples.RootNavigation; using TestAppUWP.Logic.Logs; using TestAppUWP.Samples.CertTutorial; using Windows.ApplicationModel; using Windows.ApplicationModel.Activation; using Windows.Storage; using Windows.UI.Xaml; namespace TestAppUWP.AppShell { sealed partial class App { private RootNavigationViewModel _rootNavigationViewModel; public App() { InitializeComponent(); Suspending += OnSuspending; } protected override void OnLaunched(LaunchActivatedEventArgs args) { LogFactory.Init(Path.Combine(ApplicationData.Current.LocalFolder.Path, "Logs")); Logger logger = LogFactory.GetLogger(nameof(OnLaunched)); logger.Log($"OnLaunched {args.PreviousExecutionState}"); #if DEBUG if (Debugger.IsAttached) { //DebugSettings.EnableFrameRateCounter = true; } #endif UIElement rootContent = Window.Current.Content; if (rootContent == null) { _rootNavigationViewModel = new RootNavigationViewModel(args.PreviousExecutionState); rootContent = new RootNavigationPage { DataContext = _rootNavigationViewModel }; Window.Current.Content = rootContent; } Type type = typeof(SamePage); if (args.TileId.StartsWith(type.Name)) { Type landingPageType = typeof(CertTutorial); string landingParams = args.Arguments; _rootNavigationViewModel.SetLandingPage(landingPageType, landingParams); } if (args.PrelaunchActivated) return; // Ensure the current window is active Window.Current.Activate(); } protected override void OnActivated(IActivatedEventArgs args) { Debugger.Break(); } private void OnSuspending(object sender, SuspendingEventArgs e) { LogFactory.GetLogger(nameof(OnSuspending)).Flush(); } } }
mit
C#
5d0db6250b39f85cce2653edab728cc3e8e60aaa
Support commit listing for single file within repository
thedillonb/GitHubSharp
Controllers/CommitsController.cs
Controllers/CommitsController.cs
using System; using GitHubSharp.Models; using System.Collections.Generic; namespace GitHubSharp.Controllers { public class CommitsController : Controller { public string FilePath { get; set; } public RepositoryController RepositoryController { get; private set; } public CommitController this[string key] { get { return new CommitController(Client, RepositoryController, key); } } public CommitsController(Client client, RepositoryController repo) : base(client) { RepositoryController = repo; } public GitHubRequest<List<CommitModel>> GetAll(string sha = null) { if (sha == null) return GitHubRequest.Get<List<CommitModel>>(Uri); else return GitHubRequest.Get<List<CommitModel>>(Uri, new { sha = sha }); } public override string Uri { get { return RepositoryController.Uri + "/commits" + (string.IsNullOrEmpty(this.FilePath) ? string.Empty : "?path=" + this.FilePath); } } } public class CommitController : Controller { public RepositoryController RepositoryController { get; private set; } public string Sha { get; private set; } public CommitCommentsController Comments { get { return new CommitCommentsController(Client, this); } } public CommitController(Client client, RepositoryController repositoryController, string sha) : base(client) { RepositoryController = repositoryController; Sha = sha; } public GitHubRequest<CommitModel> Get() { return GitHubRequest.Get<CommitModel>(Uri); } public override string Uri { get { return RepositoryController.Uri + "/commits/" + Sha; } } } }
using System; using GitHubSharp.Models; using System.Collections.Generic; namespace GitHubSharp.Controllers { public class CommitsController : Controller { public RepositoryController RepositoryController { get; private set; } public CommitController this[string key] { get { return new CommitController(Client, RepositoryController, key); } } public CommitsController(Client client, RepositoryController repo) : base(client) { RepositoryController = repo; } public GitHubRequest<List<CommitModel>> GetAll(string sha = null) { if (sha == null) return GitHubRequest.Get<List<CommitModel>>(Uri); else return GitHubRequest.Get<List<CommitModel>>(Uri, new { sha = sha }); } public override string Uri { get { return RepositoryController.Uri + "/commits"; } } } public class CommitController : Controller { public RepositoryController RepositoryController { get; private set; } public string Sha { get; private set; } public CommitCommentsController Comments { get { return new CommitCommentsController(Client, this); } } public CommitController(Client client, RepositoryController repositoryController, string sha) : base(client) { RepositoryController = repositoryController; Sha = sha; } public GitHubRequest<CommitModel> Get() { return GitHubRequest.Get<CommitModel>(Uri); } public override string Uri { get { return RepositoryController.Uri + "/commits/" + Sha; } } } }
mit
C#
9b702296fb46e2e96748d7cc835d733a86c83fd7
Update AssemblyInfo.cs
wieslawsoltes/SimpleWavSplitter,wieslawsoltes/SimpleWavSplitter,wieslawsoltes/SimpleWavSplitter,wieslawsoltes/SimpleWavSplitter
WavFile/Properties/AssemblyInfo.cs
WavFile/Properties/AssemblyInfo.cs
// Copyright (c) Wiesław Šoltés. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. using System.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("WavFile")] [assembly: AssemblyDescription("WavFile by Wiesław Šoltés")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Wiesław Šoltés")] [assembly: AssemblyProduct("WavFile")] [assembly: AssemblyCopyright("Copyright © Wiesław Šoltés 2010-2012. All Rights Reserved")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("6b828b56-d237-4cb6-92c7-2398197521e9")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("0.1.0.0")] [assembly: AssemblyFileVersion("0.1.0.0")]
using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("WavFile")] [assembly: AssemblyDescription("WavFile by Wiesław Šoltés")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Wiesław Šoltés")] [assembly: AssemblyProduct("WavFile")] [assembly: AssemblyCopyright("Copyright © Wiesław Šoltés 2010-2012. All Rights Reserved")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("6b828b56-d237-4cb6-92c7-2398197521e9")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("0.1.0.0")] [assembly: AssemblyFileVersion("0.1.0.0")]
mit
C#
b46e4be02b60facf704a2ed9face814d218ffee1
update snippets
matt-gibbs/azbits,matt-gibbs/azbits,matt-gibbs/azbits,matt-gibbs/azbits,matt-gibbs/azbits
demo/HelloApp/HelloApp/Program.cs
demo/HelloApp/HelloApp/Program.cs
 using System; namespace HelloApp { class Program { static void Main(string[] args) { Console.WriteLine("hi"); Console.ReadKey(); } } } /* // Hello demo using System; using Demo; namespace HelloApp { class Program { static void Main(string[] args) { HelloClient client = new HelloClient(); string result = client.Greeting(); Console.WriteLine(result); Console.ReadKey(); } } } */ /* // Rock demo using System; using Demo; using Demo.Models; namespace HelloApp { class Program { static void Main(string[] args) { RockClient client = new RockClient(); Rock rock = client.ExampleRock(); Console.Write($"Rock {rock.Name} is {rock.Color} and {rock.Weight}"); Console.ReadKey(); } } } */ /* // Pet demo using System; using Demo; using Demo.Models; namespace HelloApp { class Program { static void Main(string[] args) { PetClient petClient = new PetClient(); Pet pet = petClient.FindPetById(2); Dog dog = pet as Dog; if(dog != null) { Console.WriteLine($"Dog {dog.Name} PackSize {dog.PackSize}"); } } } } */
 using System; namespace HelloApp { class Program { static void Main(string[] args) { Console.Write("hi"); Console.ReadKey(); } } } /* using System; using Demo; namespace HelloApp { class Program { static void Main(string[] args) { HelloClient client = new HelloClient(); string result = client.Greeting(); Console.WriteLine(result); Console.ReadKey(); } } } */
mit
C#
062e9128489e7fa4cb7d35a89c91abe23e110244
fix BoldText() and ItalicText()
Notulp/Pluton,Notulp/Pluton
Pluton/StringExtensions.cs
Pluton/StringExtensions.cs
using System; namespace Pluton { public static class StringExtensions { public static string BoldText(this string self) { return String.Format("<b>{0}</b>", self); } public static string ColorText(this string self, string color) { return String.Format("<color=#{0}>{1}</color>", color, self); } public static string ItalicText(this string self) { return String.Format("<i>{0}</i>", self); } public static string SetSize(this string self, int size) { return String.Format("<size={0}>{1}</size>", size, self); } public static string SetSize(this string self, string size) { return String.Format("<size={0}>{1}</size>", size, self); } public static string QuoteSafe(this string self) { return global::UnityEngine.StringExtensions.QuoteSafe(self); } } }
using System; namespace Pluton { public static class StringExtensions { public static string BoldText(this string self) { return String.Format("<b>self</b>", self); } public static string ColorText(this string self, string color) { return String.Format("<color=#{0}>{1}</color>", color, self); } public static string ItalicText(this string self) { return String.Format("<i>self</i>", self); } public static string SetSize(this string self, int size) { return String.Format("<size={0}>{1}</size>", size, self); } public static string SetSize(this string self, string size) { return String.Format("<size={0}>{1}</size>", size, self); } public static string QuoteSafe(this string self) { return global::UnityEngine.StringExtensions.QuoteSafe(self); } } }
mit
C#
0a3f54147bfd11ff5d64aafa7cfb1d2214766afe
Bump version to 0.4.3
FatturaElettronicaPA/FatturaElettronicaPA
Properties/AssemblyInfo.cs
Properties/AssemblyInfo.cs
using System.Reflection; using System.Resources; // 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("FatturaElettronica.NET")] [assembly: AssemblyDescription("Fattura Elettronica per le aziende e la Pubblica Amministrazione Italiana")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Nicola Iarocci, CIR2000")] [assembly: AssemblyProduct("FatturaElettronica.NET")] [assembly: AssemblyCopyright("Copyright © CIR2000 2017")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] [assembly: NeutralResourcesLanguage("en")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("0.4.3.0")] [assembly: AssemblyFileVersion("0.4.3.0")]
using System.Reflection; using System.Resources; // 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("FatturaElettronica.NET")] [assembly: AssemblyDescription("Fattura Elettronica per le aziende e la Pubblica Amministrazione Italiana")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Nicola Iarocci, CIR2000")] [assembly: AssemblyProduct("FatturaElettronica.NET")] [assembly: AssemblyCopyright("Copyright © CIR2000 2017")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] [assembly: NeutralResourcesLanguage("en")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("0.4.2.0")] [assembly: AssemblyFileVersion("0.4.2.0")]
bsd-3-clause
C#
d9efeabf530b690ecd0dfb71ea57a26b9c5e65db
Change contact default
stewartmatheson/CollAction,CollActionteam/CollAction,CollActionteam/CollAction,stewartmatheson/CollAction,stewartmatheson/CollAction,CollActionteam/CollAction,CollActionteam/CollAction,CollActionteam/CollAction,stewartmatheson/CollAction
src/CollAction/Views/Home/Contact.cshtml
src/CollAction/Views/Home/Contact.cshtml
@{ ViewData["Title"] = "Contact"; } <h2>@ViewData["Title"].</h2> <h3>@ViewData["Message"]</h3> <address> TODO: Address here<br /> TODO: Address here<br /> <abbr title="Phone">...</abbr> </address> <address> <strong>Support:</strong> <a href="mailto:Support@example.com">Support@example.com</a><br /> <strong>Marketing:</strong> <a href="mailto:Marketing@example.com">Marketing@example.com</a> </address>
@{ ViewData["Title"] = "Contact"; } <h2>@ViewData["Title"].</h2> <h3>@ViewData["Message"]</h3> <address> One Microsoft Way<br /> Redmond, WA 98052-6399<br /> <abbr title="Phone">P:</abbr> 425.555.0100 </address> <address> <strong>Support:</strong> <a href="mailto:Support@example.com">Support@example.com</a><br /> <strong>Marketing:</strong> <a href="mailto:Marketing@example.com">Marketing@example.com</a> </address>
agpl-3.0
C#
9c0887ab7e0a36b9b0ac003e0511aced0d7a422b
fix unit tests for GitVersionTask
ParticularLabs/GitVersion,GitTools/GitVersion,gep13/GitVersion,GitTools/GitVersion,asbjornu/GitVersion,asbjornu/GitVersion,ermshiperete/GitVersion,ermshiperete/GitVersion,dazinator/GitVersion,dazinator/GitVersion,gep13/GitVersion,ParticularLabs/GitVersion,ermshiperete/GitVersion,ermshiperete/GitVersion
src/GitVersionTask.Tests/TestTaskBase.cs
src/GitVersionTask.Tests/TestTaskBase.cs
using System.Collections.Generic; using System.Linq; using GitTools.Testing; using GitVersion.BuildServers; using GitVersionCore.Tests.Helpers; using GitVersionTask.Tests.Helpers; using LibGit2Sharp; using Microsoft.Build.Framework; namespace GitVersion.MSBuildTask.Tests { public class TestTaskBase : TestBase { protected static EmptyRepositoryFixture CreateLocalRepositoryFixture() { var fixture = new EmptyRepositoryFixture(); fixture.MakeATaggedCommit("1.2.3"); fixture.MakeACommit(); return fixture; } protected static RemoteRepositoryFixture CreateRemoteRepositoryFixture() { var fixture = new RemoteRepositoryFixture(); fixture.Repository.MakeACommit(); fixture.Repository.MakeATaggedCommit("1.0.0"); fixture.Repository.MakeACommit(); fixture.Repository.CreateBranch("develop"); Commands.Fetch((Repository)fixture.LocalRepositoryFixture.Repository, fixture.LocalRepositoryFixture.Repository.Network.Remotes.First().Name, new string[0], new FetchOptions(), null); Commands.Checkout(fixture.LocalRepositoryFixture.Repository, fixture.Repository.Head.Tip); fixture.LocalRepositoryFixture.Repository.Branches.Remove("master"); fixture.InitializeRepo(); return fixture; } protected static MsBuildExecutionResult<T> ExecuteMsBuildTask<T>(T task) where T : ITask { var msbuildFixture = new MsBuildFixture(); return msbuildFixture.Execute(task); } protected static MsBuildExecutionResult<T> ExecuteMsBuildTaskInBuildServer<T>(T task) where T : ITask { var env = new Dictionary<string, string> { { AzurePipelines.EnvironmentVariableName, "true" }, { "BUILD_SOURCEBRANCH", null } }; var msbuildFixture = new MsBuildFixture(); msbuildFixture.WithEnv(env.ToArray()); return msbuildFixture.Execute(task); } } }
using System.Collections.Generic; using System.Linq; using GitTools.Testing; using GitVersion.BuildServers; using GitVersionCore.Tests.Helpers; using GitVersionTask.Tests.Helpers; using LibGit2Sharp; using Microsoft.Build.Framework; namespace GitVersion.MSBuildTask.Tests { public class TestTaskBase : TestBase { protected static EmptyRepositoryFixture CreateLocalRepositoryFixture() { var fixture = new EmptyRepositoryFixture(); fixture.MakeATaggedCommit("1.2.3"); fixture.MakeACommit(); return fixture; } protected static RemoteRepositoryFixture CreateRemoteRepositoryFixture() { var fixture = new RemoteRepositoryFixture(); fixture.Repository.MakeACommit(); fixture.Repository.MakeATaggedCommit("1.0.0"); fixture.Repository.MakeACommit(); fixture.Repository.CreateBranch("develop"); Commands.Fetch((Repository)fixture.LocalRepositoryFixture.Repository, fixture.LocalRepositoryFixture.Repository.Network.Remotes.First().Name, new string[0], new FetchOptions(), null); Commands.Checkout(fixture.LocalRepositoryFixture.Repository, fixture.Repository.Head.Tip); fixture.LocalRepositoryFixture.Repository.Branches.Remove("master"); fixture.InitializeRepo(); return fixture; } protected static MsBuildExecutionResult<T> ExecuteMsBuildTask<T>(T task) where T : ITask { var msbuildFixture = new MsBuildFixture(); return msbuildFixture.Execute(task); } protected static MsBuildExecutionResult<T> ExecuteMsBuildTaskInBuildServer<T>(T task) where T : ITask { var env = new Dictionary<string, string> { { AzurePipelines.EnvironmentVariableName, "true" } }; var msbuildFixture = new MsBuildFixture(); msbuildFixture.WithEnv(env.ToArray()); return msbuildFixture.Execute(task); } } }
mit
C#
474ebe36ce5bee1c4ccc50829a63f0e8299070a0
Add xml comments to ExecutionResult (#1615)
graphql-dotnet/graphql-dotnet,graphql-dotnet/graphql-dotnet,joemcbride/graphql-dotnet,graphql-dotnet/graphql-dotnet,joemcbride/graphql-dotnet
src/GraphQL/Execution/ExecutionResult.cs
src/GraphQL/Execution/ExecutionResult.cs
using System; using System.Collections.Generic; using GraphQL.Execution; using GraphQL.Instrumentation; using GraphQL.Language.AST; namespace GraphQL { public class ExecutionResult { /// <summary> /// Returns the data from the graph resolvers. This property is serialized as part of the GraphQL json response. /// </summary> public object Data { get; set; } /// <summary> /// Returns a set of errors that occurred during any stage of processing (parsing, validating, executing, etc.). This property is serialized as part of the GraphQL json response. /// </summary> public ExecutionErrors Errors { get; set; } /// <summary> /// Returns the original GraphQL query. /// </summary> public string Query { get; set; } /// <summary> /// Returns the parsed GraphQL request. /// </summary> public Document Document { get; set; } /// <summary> /// Returns the GraphQL operation that is being executed. /// </summary> public Operation Operation { get; set; } /// <summary> /// Returns the performance metrics (Apollo Tracing) when enabled by <see cref="ExecutionOptions.EnableMetrics"/>. /// </summary> public PerfRecord[] Perf { get; set; } /// <summary> /// Indicates that unhandled <see cref="Exception"/> stack traces should be serialized into GraphQL response json along with exception messages; otherwise only <see cref="Exception.Message"/> should be serialized /// </summary> public bool ExposeExceptions { get; set; } /// <summary> /// Returns additional user-defined data; see <see cref="IExecutionContext.Extensions"/> and <see cref="IResolveFieldContext.Extensions"/>. This property is serialized as part of the GraphQL json response. /// </summary> public Dictionary<string, object> Extensions { get; set; } public ExecutionResult() { } protected ExecutionResult(ExecutionResult result) { if (result == null) throw new ArgumentNullException(nameof(result)); Data = result.Data; Errors = result.Errors; Query = result.Query; Operation = result.Operation; Document = result.Document; Perf = result.Perf; ExposeExceptions = result.ExposeExceptions; Extensions = result.Extensions; } } }
using System; using System.Collections.Generic; using GraphQL.Instrumentation; using GraphQL.Language.AST; namespace GraphQL { public class ExecutionResult { public object Data { get; set; } public ExecutionErrors Errors { get; set; } public string Query { get; set; } public Document Document { get; set; } public Operation Operation { get; set; } public PerfRecord[] Perf { get; set; } public bool ExposeExceptions { get; set; } public Dictionary<string, object> Extensions { get; set; } public ExecutionResult() { } protected ExecutionResult(ExecutionResult result) { if (result == null) throw new ArgumentNullException(nameof(result)); Data = result.Data; Errors = result.Errors; Query = result.Query; Operation = result.Operation; Document = result.Document; Perf = result.Perf; ExposeExceptions = result.ExposeExceptions; Extensions = result.Extensions; } } }
mit
C#
0c0dfd0903ab185c5404564bd148b7e32e0769b8
Add multi-touch events.
roblillack/monoberry,roblillack/monoberry,roblillack/monoberry,roblillack/monoberry
libblackberry/screen/Context.cs
libblackberry/screen/Context.cs
using System; using System.Collections.Generic; using System.Text; using System.Runtime.InteropServices; namespace BlackBerry.Screen { public class Context : IDisposable { [DllImport ("screen")] static extern int screen_create_context (out IntPtr pctx, ContextType flags); [DllImport ("screen")] static extern int screen_destroy_context (IntPtr ctx); [DllImport ("bps")] static extern int screen_request_events (IntPtr ctx); [DllImport ("bps")] static extern int screen_stop_events (IntPtr ctx); [DllImport ("screen")] static extern int screen_get_domain (); IntPtr handle; public IntPtr Handle { get { return handle; } } private int eventDomain; public Action<Window> OnCloseWindow { get; set; } public Action<Window> OnCreateWindow { get; set; } public Action<int,int> OnFingerTouch { get; set; } public Action<int,int> OnFingerMove { get; set; } public Action<int,int> OnFingerRelease { get; set; } public Context() { PlatformServices.Initialize (); if (screen_create_context (out handle, ContextType.SCREEN_APPLICATION_CONTEXT) != 0) { // TODO: read errno to describe problem throw new Exception ("Unable to create screen context"); } screen_request_events (handle); eventDomain = screen_get_domain (); PlatformServices.AddEventHandler (eventDomain, HandleEvent); } void HandleEvent (IntPtr eventHandle) { var e = ScreenEvent.FromEventHandle (eventHandle); switch (e.Type) { case EventType.SCREEN_EVENT_CLOSE: if (OnCloseWindow != null) { OnCloseWindow (new Window (this, e.GetIntPtrProperty (Property.SCREEN_PROPERTY_WINDOW))); } break; case EventType.SCREEN_EVENT_CREATE: if (OnCreateWindow != null) { OnCreateWindow (new Window (this, e.GetIntPtrProperty (Property.SCREEN_PROPERTY_WINDOW))); } break; case EventType.SCREEN_EVENT_MTOUCH_TOUCH: if (OnFingerTouch != null) { OnFingerTouch (e.X, e.Y); } break; case EventType.SCREEN_EVENT_MTOUCH_MOVE: if (OnFingerMove != null) { OnFingerMove (e.X, e.Y); } break; case EventType.SCREEN_EVENT_MTOUCH_RELEASE: if (OnFingerRelease != null) { OnFingerRelease (e.X, e.Y); } break; default: Console.WriteLine ("UNHANDLED SCREEN EVENT, TYPE: {0}", e.Type); break; } } public void Dispose () { PlatformServices.RemoveEventHandler (eventDomain); screen_stop_events (handle); screen_destroy_context (handle); } } }
using System; using System.Collections.Generic; using System.Text; using System.Runtime.InteropServices; namespace BlackBerry.Screen { public class Context : IDisposable { [DllImport ("screen")] static extern int screen_create_context (out IntPtr pctx, ContextType flags); [DllImport ("screen")] static extern int screen_destroy_context (IntPtr ctx); [DllImport ("bps")] static extern int screen_request_events (IntPtr ctx); [DllImport ("bps")] static extern int screen_stop_events (IntPtr ctx); [DllImport ("screen")] static extern int screen_get_domain (); IntPtr handle; public IntPtr Handle { get { return handle; } } private int eventDomain; public Action<Window> OnCloseWindow { get; set; } public Action<Window> OnCreateWindow { get; set; } public Context() { PlatformServices.Initialize (); if (screen_create_context (out handle, ContextType.SCREEN_APPLICATION_CONTEXT) != 0) { // TODO: read errno to describe problem throw new Exception ("Unable to create screen context"); } screen_request_events (handle); eventDomain = screen_get_domain (); PlatformServices.AddEventHandler (eventDomain, HandleEvent); } void HandleEvent (IntPtr eventHandle) { var e = ScreenEvent.FromEventHandle (eventHandle); switch (e.Type) { case EventType.SCREEN_EVENT_CLOSE: if (OnCloseWindow != null) { OnCloseWindow (new Window (this, e.GetIntPtrProperty (Property.SCREEN_PROPERTY_WINDOW))); } break; case EventType.SCREEN_EVENT_CREATE: if (OnCreateWindow != null) { OnCreateWindow (new Window (this, e.GetIntPtrProperty (Property.SCREEN_PROPERTY_WINDOW))); } break; //case EventType.SCREEN_EVENT_MTOUCH_TOUCH: //case EventType.SCREEN_EVENT_MTOUCH_MOVE: //case EventType.SCREEN_EVENT_MTOUCH_RELEASE: default: Console.WriteLine ("UNHANDLED SCREEN EVENT, TYPE: {0}", e.Type); break; } } public void Dispose () { PlatformServices.RemoveEventHandler (eventDomain); screen_stop_events (handle); screen_destroy_context (handle); } } }
mit
C#
e6aca3116dafd3bcebebf1246e43f2e3c2378897
clean up code
IvanZheng/IFramework,IvanZheng/IFramework,IvanZheng/IFramework
Src/ConsoleTest/Program.cs
Src/ConsoleTest/Program.cs
using System; using System.Collections.Generic; using System.Net.Http; using System.Threading; using System.Threading.Tasks; namespace ConsoleTest { internal class Program { private static readonly HttpClient HttpClient = new HttpClient {BaseAddress = new Uri("https://www.baidu.com") }; private static void Main(string[] args) { ThreadPool.GetAvailableThreads(out var workerThreads, out var completionPortThreads); Console.WriteLine($"init: workerThreads: {workerThreads} completionPortThreads: {completionPortThreads}"); ThreadPool.SetMinThreads(2, 200); ThreadPool.SetMaxThreads(5, 200); ThreadPool.GetAvailableThreads(out workerThreads, out completionPortThreads); Console.WriteLine($"current: workerThreads: {workerThreads} completionPortThreads: {completionPortThreads}"); var batch = 500; var tasks = new List<Task<string>>(); for (var i = 0; i < batch; i++) { tasks.Add(Task.Run(DoTaskAsync)); } int j = 0; foreach (var task in tasks) { var result = task.Result; Console.WriteLine($"{result} {j++}"); } Console.ReadLine(); } private static async Task<string> DoTaskAsync() { await Task.Delay(200); return "done"; } private static Task<string> DoIOTaskAsync() { return HttpClient.GetAsync($"api/command?wd={DateTime.Now.ToShortDateString()}") .Result .Content .ReadAsStringAsync(); } } }
using System; using System.Collections.Generic; using System.Net.Http; using System.Threading; using System.Threading.Tasks; namespace ConsoleTest { internal class Program { private static readonly HttpClient HttpClient = new HttpClient {BaseAddress = new Uri("https://www.baidu.com") }; private static void Main(string[] args) { ThreadPool.SetMinThreads(2, 200); ThreadPool.SetMaxThreads(5, 200); ThreadPool.GetAvailableThreads(out var workerThreads, out var completionPortThreads); Console.WriteLine($"workerThreads: {workerThreads} completionPortThreads: {completionPortThreads}"); var batch = 5; var tasks = new List<Task<string>>(); for (var i = 0; i < batch; i++) { tasks.Add(Task.Run(DoTaskAsync)); } int j = 0; foreach (var task in tasks) { var result = task.Result; Console.WriteLine($"{result} {j++}"); } Console.ReadLine(); } private static async Task<string> DoTaskAsync() { await Task.Delay(2000); return "done"; } private static Task<string> DoIOTaskAsync() { return HttpClient.GetAsync($"api/command?wd={DateTime.Now.ToShortDateString()}") .Result .Content .ReadAsStringAsync(); } } }
mit
C#
5e5f69ba98eeb1a0eef7cc621454aedb8605936d
send opponent pokemon too.
NextLight/PokeBattle_Server
PokeBattle/PokeBattle/Program.cs
PokeBattle/PokeBattle/Program.cs
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace PokeBattle { class Program { static void Main(string[] args) { Console.WriteLine("Waiting for 2 players."); Player[] players = new Player[2] { new Player(), new Player() }; players[0].Connect(); //players[1].Connect(); players[0].WritePokeTeam(); //players[1].WritePokeTeam(); players[0].WritePokemon(players[1].PokeTeam[0]); //players[1].WritePokemon(players[0].PokeTeam[0]); Console.ReadKey(); } } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace PokeBattle { class Program { static void Main(string[] args) { Console.WriteLine("Waiting for 2 players."); Player[] players = new Player[2] { new Player(), new Player() }; players[0].Connect(); //players[1].Connect(); players[0].WritePokeTeam(); //players[1].WritePokeTeam(); Console.ReadKey(); } } }
mit
C#
73f19dbc3cbe33915d2c65ae9558ed665fdfd704
add (c) header
buserror/aften,buserror/aften,buserror/aften
bindings/cs/FrameEventArgs.cs
bindings/cs/FrameEventArgs.cs
/******************************************************************************** * Copyright (C) 2007 by Prakash Punnoor * * prakash@punnoor.de * * * * 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 of the License * * * * 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 * ********************************************************************************/ using System; namespace Aften { /// <summary> /// EventArgs for frame related events /// </summary> public class FrameEventArgs : EventArgs { private readonly int m_nFrameNumber; private readonly int m_nSize; private readonly Status m_Status; /// <summary> /// Gets the status. /// </summary> /// <value>The status.</value> public Status Status { get { return m_Status; } } /// <summary> /// Gets the size of the encoded frame. /// </summary> /// <value>The size.</value> public int Size { get { return m_nSize; } } /// <summary> /// Gets the frame number. /// </summary> /// <value>The frame number.</value> public int FrameNumber { get { return m_nFrameNumber; } } /// <summary> /// Initializes a new instance of the <see cref="FrameEventArgs"/> class. /// </summary> /// <param name="frameNumber">The frame number.</param> /// <param name="size">The size of the encoded frame.</param> /// <param name="status">The status.</param> public FrameEventArgs( int frameNumber, int size, Status status ) { m_nFrameNumber = frameNumber; m_nSize = size; m_Status = status; } } }
using System; namespace Aften { /// <summary> /// EventArgs for frame related events /// </summary> public class FrameEventArgs : EventArgs { private readonly int m_nFrameNumber; private readonly int m_nSize; private readonly Status m_Status; /// <summary> /// Gets the status. /// </summary> /// <value>The status.</value> public Status Status { get { return m_Status; } } /// <summary> /// Gets the size of the encoded frame. /// </summary> /// <value>The size.</value> public int Size { get { return m_nSize; } } /// <summary> /// Gets the frame number. /// </summary> /// <value>The frame number.</value> public int FrameNumber { get { return m_nFrameNumber; } } /// <summary> /// Initializes a new instance of the <see cref="FrameEventArgs"/> class. /// </summary> /// <param name="frameNumber">The frame number.</param> /// <param name="size">The size of the encoded frame.</param> /// <param name="status">The status.</param> public FrameEventArgs( int frameNumber, int size, Status status ) { m_nFrameNumber = frameNumber; m_nSize = size; m_Status = status; } } }
lgpl-2.1
C#
53df95d329bcf0175761de8b8492c88822feeda1
make Scope class extensible
maul-esel/CobaltAHK,maul-esel/CobaltAHK
CobaltAHK/ExpressionTree/Scope.cs
CobaltAHK/ExpressionTree/Scope.cs
using System; using System.Collections.Generic; using System.Linq; using System.Linq.Expressions; using System.Reflection; namespace CobaltAHK.ExpressionTree { public class Scope { public Scope() : this(null) { LoadBuiltinFunctions(); } public Scope(Scope parentScope) { parent = parentScope; } private void LoadBuiltinFunctions() { var flags = BindingFlags.Static | BindingFlags.Public | BindingFlags.DeclaredOnly; var methods = typeof(IronAHK.Rusty.Core).GetMethods(flags); foreach (var method in methods) { var paramList = method.GetParameters(); if (HasFunction(method.Name) || paramList.Any(p => p.ParameterType.IsByRef)) { continue; // skips byRef and overloads // todo: support overloads! } var prms = paramList.Select(p => Expression.Parameter(p.ParameterType, p.Name)).ToArray(); var types = paramList.Select(p => p.ParameterType).ToList(); types.Add(method.ReturnType); var lambda = Expression.Lambda(Expression.GetFuncType(types.ToArray()), Expression.Call(method, prms), prms); AddFunction(method.Name, lambda); } } protected readonly Scope parent; public bool IsRoot { get { return parent == null; } } protected readonly IDictionary<string, LambdaExpression> functions = new Dictionary<string, LambdaExpression>(); public virtual void AddFunction(string name, LambdaExpression func) { functions[name.ToLower()] = func; } protected virtual bool HasFunction(string name) { return functions.ContainsKey(name.ToLower()); } public virtual LambdaExpression ResolveFunction(string name) { if (HasFunction(name)) { return functions[name.ToLower()]; } else if (parent != null) { return parent.ResolveFunction(name); } throw new FunctionNotFoundException(name); } protected readonly IDictionary<string, ParameterExpression> variables = new Dictionary<string, ParameterExpression>(); public virtual void AddVariable(string name, ParameterExpression variable) { variables[name.ToLower()] = variable; } public virtual ParameterExpression ResolveVariable(string name) { if (!variables.ContainsKey(name.ToLower())) { AddVariable(name, Expression.Parameter(typeof(object), name)); } return variables[name.ToLower()]; } } public class FunctionNotFoundException : System.Exception { public FunctionNotFoundException(string func) : base("Function '" + func + "' was not found!") { } } }
using System; using System.Collections.Generic; using System.Linq; using System.Linq.Expressions; using System.Reflection; namespace CobaltAHK.ExpressionTree { public class Scope { public Scope() : this(null) { LoadBuiltinFunctions(); } public Scope(Scope parentScope) { parent = parentScope; } private void LoadBuiltinFunctions() { var flags = BindingFlags.Static | BindingFlags.Public | BindingFlags.DeclaredOnly; var methods = typeof(IronAHK.Rusty.Core).GetMethods(flags); foreach (var method in methods) { var paramList = method.GetParameters(); if (HasFunction(method.Name) || paramList.Any(p => p.ParameterType.IsByRef)) { continue; // skips byRef and overloads // todo: support overloads! } var prms = paramList.Select(p => Expression.Parameter(p.ParameterType, p.Name)).ToArray(); var types = paramList.Select(p => p.ParameterType).ToList(); types.Add(method.ReturnType); var lambda = Expression.Lambda(Expression.GetFuncType(types.ToArray()), Expression.Call(method, prms), prms); AddFunction(method.Name, lambda); } } private readonly Scope parent; public bool IsRoot { get { return parent == null; } } private readonly IDictionary<string, LambdaExpression> functions = new Dictionary<string, LambdaExpression>(); public void AddFunction(string name, LambdaExpression func) { functions[name.ToLower()] = func; } public bool HasFunction(string name) { return functions.ContainsKey(name.ToLower()); } public LambdaExpression ResolveFunction(string name) { if (functions.ContainsKey(name.ToLower())) { return functions[name.ToLower()]; } else if (parent != null) { return parent.ResolveFunction(name); } throw new FunctionNotFoundException(name); } private readonly IDictionary<string, ParameterExpression> variables = new Dictionary<string, ParameterExpression>(); public void AddVariable(string name, ParameterExpression variable) { variables[name.ToLower()] = variable; } public ParameterExpression ResolveVariable(string name) { if (!variables.ContainsKey(name.ToLower())) { AddVariable(name, Expression.Parameter(typeof(object), name)); } return variables[name.ToLower()]; } } public class FunctionNotFoundException : System.Exception { public FunctionNotFoundException(string func) : base("Function '" + func + "' was not found!") { } } }
mit
C#
95586bd5cbcc0f4ade9ea5c38220448a61bd6bec
Update version number.
Damnae/storybrew
editor/Properties/AssemblyInfo.cs
editor/Properties/AssemblyInfo.cs
using System.Reflection; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("storybrew editor")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("storybrew editor")] [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("ff59aeea-c133-4bf8-8a0b-620a3c99022b")] // 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.34.*")]
using System.Reflection; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("storybrew editor")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("storybrew editor")] [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("ff59aeea-c133-4bf8-8a0b-620a3c99022b")] // 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.33.*")]
mit
C#
e8d28c0262a0d20ce5cf636bc2f00aeb1ea29d6e
Update version number.
Damnae/storybrew
editor/Properties/AssemblyInfo.cs
editor/Properties/AssemblyInfo.cs
using System.Reflection; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("storybrew editor")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("storybrew editor")] [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("ff59aeea-c133-4bf8-8a0b-620a3c99022b")] // 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.16.*")]
using System.Reflection; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("storybrew editor")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("storybrew editor")] [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("ff59aeea-c133-4bf8-8a0b-620a3c99022b")] // 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.15.*")]
mit
C#
65e30fbaefabe2e2a81481ab3897e00e8cf56c8b
Add SendFlowResponse to ISurveyMonkeyApi
bcemmett/SurveyMonkeyApi
SurveyMonkey/ISurveyMonkeyApi.cs
SurveyMonkey/ISurveyMonkeyApi.cs
using System.Collections.Generic; namespace SurveyMonkey { public interface ISurveyMonkeyApi { int RequestsMade { get; } int QuotaAllotted { get; } int QuotaUsed { get; } //Endpoints List<Survey> GetSurveyList(); List<Survey> GetSurveyList(GetSurveyListSettings settings); List<Survey> GetSurveyList(int page); List<Survey> GetSurveyList(int page, GetSurveyListSettings settings); List<Survey> GetSurveyList(int page, int pageSize); List<Survey> GetSurveyList(int page, int pageSize, GetSurveyListSettings settings); Survey GetSurveyDetails(long surveyId); List<Collector> GetCollectorList(long surveyId); List<Collector> GetCollectorList(long surveyId, GetCollectorListSettings settings); List<Collector> GetCollectorList(long surveyId, int page); List<Collector> GetCollectorList(long surveyId, int page, GetCollectorListSettings settings); List<Collector> GetCollectorList(long surveyId, int page, int pageSize); List<Collector> GetCollectorList(long surveyId, int page, int pageSize, GetCollectorListSettings settings); List<Respondent> GetRespondentList(long surveyId); List<Respondent> GetRespondentList(long surveyId, GetRespondentListSettings settings); List<Respondent> GetRespondentList(long surveyId, int page); List<Respondent> GetRespondentList(long surveyId, int page, GetRespondentListSettings settings); List<Respondent> GetRespondentList(long surveyId, int page, int pageSize); List<Respondent> GetRespondentList(long surveyId, int page, int pageSize, GetRespondentListSettings settings); List<Response> GetResponses(long surveyId, List<long> respondents); Collector GetResponseCounts(long collectorId); UserDetails GetUserDetails(); CreateRecipientsResponse CreateRecipients(long collectorId, long emailMessageId, List<Recipient> recipients); SendFlowResponse SendFlow(long surveyId, SendFlowSettings settings); //Data processing void FillMissingSurveyInformation(List<Survey> surveys); void FillMissingSurveyInformation(Survey survey); } }
using System.Collections.Generic; namespace SurveyMonkey { public interface ISurveyMonkeyApi { int RequestsMade { get; } int QuotaAllotted { get; } int QuotaUsed { get; } //Endpoints List<Survey> GetSurveyList(); List<Survey> GetSurveyList(GetSurveyListSettings settings); List<Survey> GetSurveyList(int page); List<Survey> GetSurveyList(int page, GetSurveyListSettings settings); List<Survey> GetSurveyList(int page, int pageSize); List<Survey> GetSurveyList(int page, int pageSize, GetSurveyListSettings settings); Survey GetSurveyDetails(long surveyId); List<Collector> GetCollectorList(long surveyId); List<Collector> GetCollectorList(long surveyId, GetCollectorListSettings settings); List<Collector> GetCollectorList(long surveyId, int page); List<Collector> GetCollectorList(long surveyId, int page, GetCollectorListSettings settings); List<Collector> GetCollectorList(long surveyId, int page, int pageSize); List<Collector> GetCollectorList(long surveyId, int page, int pageSize, GetCollectorListSettings settings); List<Respondent> GetRespondentList(long surveyId); List<Respondent> GetRespondentList(long surveyId, GetRespondentListSettings settings); List<Respondent> GetRespondentList(long surveyId, int page); List<Respondent> GetRespondentList(long surveyId, int page, GetRespondentListSettings settings); List<Respondent> GetRespondentList(long surveyId, int page, int pageSize); List<Respondent> GetRespondentList(long surveyId, int page, int pageSize, GetRespondentListSettings settings); List<Response> GetResponses(long surveyId, List<long> respondents); Collector GetResponseCounts(long collectorId); UserDetails GetUserDetails(); CreateRecipientsResponse CreateRecipients(long collectorId, long emailMessageId, List<Recipient> recipients); //Data processing void FillMissingSurveyInformation(List<Survey> surveys); void FillMissingSurveyInformation(Survey survey); } }
mit
C#
175f241011b1082016d1b3b48ec53339cd49b940
Fix whitespace in tests
meshulam/tempoiq-net,mrgaaron/tempoiq-net,TempoIQ/tempoiq-net,TempoIQ/tempoiq-net,jcc333/tempoiq-net,selecsosi/tempoiq-net
TempoIQNUnit/AggregationTests.cs
TempoIQNUnit/AggregationTests.cs
using System; using System.Collections.Generic; using TempoIQ; using TempoIQ.Models; using TempoIQ.Queries; using NUnit.Framework; using NodaTime; namespace TempoIQNUnit { [TestFixture] public class AggregationTests { [Test] public void EqualsTest() { var max = new Aggregation(Fold.Max); var max2 = new Aggregation(Fold.Max); Assert.AreEqual(max, max2); } [Test] public void NotEqualsFoldTest() { var max = new Aggregation(Fold.Max); var min = new Aggregation(Fold.Min); Assert.AreNotEqual(max, min); } [Test] public void NotEqualsNullTest() { var agg = new Aggregation(Fold.Max); Assert.IsFalse(agg == null); } [Test] public void Equality() { var args = new List<string>(); var aggregation1 = new Aggregation(Fold.Sum); var aggregation2 = new Aggregation(Fold.Sum); Assert.AreEqual(aggregation1, aggregation2); } [Test] public void NotEquals() { var aggregation1 = new Aggregation(Fold.Sum); var aggregation2 = new Aggregation(Fold.Mean); Assert.AreNotEqual(aggregation1, aggregation2); } } [TestFixture] public class RollupTests { [Test] public void Equality() { var timestamp = DateTimeZone.Utc.AtStrictly(LocalDateTime.FromDateTime(DateTime.Now)); var rollup1 = new Rollup(Period.FromMinutes(1), Fold.Sum, timestamp); var rollup2 = new Rollup(Period.FromMinutes(1), Fold.Sum, timestamp); Assert.AreEqual(rollup1, rollup2); } } }
using System; using System.Collections.Generic; using TempoIQ; using TempoIQ.Models; using TempoIQ.Queries; using NUnit.Framework; using NodaTime; namespace TempoIQNUnit { [TestFixture] public class AggregationTests { [Test] public void EqualsTest() { var max = new Aggregation(Fold.Max); var max2 = new Aggregation(Fold.Max); Assert.AreEqual(max, max2); } [Test] public void NotEqualsFoldTest() { var max = new Aggregation(Fold.Max); var min = new Aggregation(Fold.Min); Assert.AreNotEqual(max, min); } [Test] public void NotEqualsNullTest() { var agg = new Aggregation(Fold.Max); Assert.IsFalse(agg == null); } [Test] public void Equality() { var args = new List<string>(); var aggregation1 = new Aggregation(Fold.Sum); var aggregation2 = new Aggregation(Fold.Sum); Assert.AreEqual(aggregation1, aggregation2); } [Test] public void NotEquals() { var aggregation1 = new Aggregation(Fold.Sum); var aggregation2 = new Aggregation(Fold.Mean); Assert.AreNotEqual(aggregation1, aggregation2); } } [TestFixture] public class RollupTests { [Test] public void Equality() { var timestamp = DateTimeZone.Utc.AtStrictly(LocalDateTime.FromDateTime(DateTime.Now)); var rollup1 = new Rollup(Period.FromMinutes(1), Fold.Sum, timestamp); var rollup2 = new Rollup(Period.FromMinutes(1), Fold.Sum, timestamp); Assert.AreEqual(rollup1, rollup2); } } }
mit
C#
f41ab37b6f81b11582aee65b883a0292cfff5f23
Set version 1.0.13 of MtApi (MT5)
vdemydiuk/mtapi,vdemydiuk/mtapi,vdemydiuk/mtapi
MtApi5/Properties/AssemblyInfo.cs
MtApi5/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("MtApi5")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("MtApi5")] [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("f3256daf-a5c0-422d-9d79-f7156cccb910")] // 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.13")] [assembly: AssemblyFileVersion("1.0.13")]
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("MtApi5")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("MtApi5")] [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("f3256daf-a5c0-422d-9d79-f7156cccb910")] // 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.12")] [assembly: AssemblyFileVersion("1.0.12")]
mit
C#
93e91f49b3bca8c9b4edbef6d312e597a7be4c11
Make MovementController a monobehavior
GaiaOnlineCommunity/GaiaOnline.Unity.Library,GaiaOnlineCommunity/GaiaOnline.Unity.Library
src/GaiaOnline.Game.Client/Controller/MovementController.cs
src/GaiaOnline.Game.Client/Controller/MovementController.cs
using System; using System.Collections.Generic; using System.Text; using UnityEngine; namespace GaiaOnline { public abstract class MovementController : MonoBehaviour { /// <summary> /// Returns the current input direction. /// </summary> /// <returns>The direction of the input.</returns> public abstract Vector2 GetInputDirection(); } }
using System; using System.Collections.Generic; using System.Text; using UnityEngine; namespace GaiaOnline { public abstract class MovementController { /// <summary> /// Returns the current input direction. /// </summary> /// <returns>The direction of the input.</returns> public abstract Vector2 GetInputDirection(); } }
agpl-3.0
C#
92dcb4272fe4f4769ebd69bc79c93a3202f04835
move code ILineSegmentList, ILineSegment,
LayoutFarm/PixelFarm
src/PixelFarm/PixelFarm.PrimitiveDrawing/TextMeasurement.cs
src/PixelFarm/PixelFarm.PrimitiveDrawing/TextMeasurement.cs
//MIT, 2020, WinterDev namespace PixelFarm.Drawing { public struct TextBufferSpan { public readonly int start; public readonly int len; char[] _rawString; public TextBufferSpan(char[] rawCharBuffer) { _rawString = rawCharBuffer; this.len = rawCharBuffer.Length; this.start = 0; } public TextBufferSpan(char[] rawCharBuffer, int start, int len) { this.start = start; this.len = len; _rawString = rawCharBuffer; } public override string ToString() { return start + ":" + len; } public char[] GetRawCharBuffer() => _rawString; } public struct TextSpanMeasureResult { public int[] outputXAdvances; public int outputTotalW; public ushort lineHeight; public bool hasSomeExtraOffsetY; public short minOffsetY; public short maxOffsetY; } public interface ITextService { float MeasureWhitespace(RequestFont f); float MeasureBlankLineHeight(RequestFont f); // // Size MeasureString(in TextBufferSpan textBufferSpan, RequestFont font); void MeasureString(in TextBufferSpan textBufferSpan, RequestFont font, int maxWidth, out int charFit, out int charFitWidth); } }
//MIT, 2020, WinterDev namespace PixelFarm.Drawing { public struct TextBufferSpan { public readonly int start; public readonly int len; char[] _rawString; public TextBufferSpan(char[] rawCharBuffer) { _rawString = rawCharBuffer; this.len = rawCharBuffer.Length; this.start = 0; } public TextBufferSpan(char[] rawCharBuffer, int start, int len) { this.start = start; this.len = len; _rawString = rawCharBuffer; } public override string ToString() { return start + ":" + len; } public char[] GetRawCharBuffer() => _rawString; } public struct TextSpanMeasureResult { public int[] outputXAdvances; public int outputTotalW; public ushort lineHeight; public bool hasSomeExtraOffsetY; public short minOffsetY; public short maxOffsetY; } public interface ILineSegmentList { int Count { get; } ILineSegment this[int index] { get; } } public interface ILineSegment { int StartAt { get; } ushort Length { get; } object SpanBreakInfo { get; } } public interface ITextService { float MeasureWhitespace(RequestFont f); float MeasureBlankLineHeight(RequestFont f); // // Size MeasureString(in TextBufferSpan textBufferSpan, RequestFont font); void MeasureString(in TextBufferSpan textBufferSpan, RequestFont font, int maxWidth, out int charFit, out int charFitWidth); } }
bsd-2-clause
C#
4582934f3c654fb9e74435baaadfd138ed9bbe02
Set default values to prevent designer code generation.
KN4CK3R/ReClass.NET,jesterret/ReClass.NET,jesterret/ReClass.NET,KN4CK3R/ReClass.NET,jesterret/ReClass.NET,KN4CK3R/ReClass.NET
ReClass.NET/UI/PlaceholderTextBox.cs
ReClass.NET/UI/PlaceholderTextBox.cs
using System; using System.ComponentModel; using System.Drawing; using System.Windows.Forms; namespace ReClassNET.UI { public class PlaceholderTextBox : TextBox { private Font fontBackup; private Color foreColorBackup; private Color backColorBackup; /// <summary> /// The color of the placeholder text. /// </summary> [DefaultValue(typeof(Color), "ControlDarkDark")] public Color PlaceholderColor { get; set; } = SystemColors.ControlDarkDark; /// <summary> /// The placeholder text. /// </summary> [DefaultValue("")] public string PlaceholderText { get; set; } public PlaceholderTextBox() { fontBackup = Font; foreColorBackup = ForeColor; backColorBackup = BackColor; SetStyle(ControlStyles.UserPaint, true); } protected override void OnTextChanged(EventArgs e) { base.OnTextChanged(e); if (string.IsNullOrEmpty(Text)) { if (!GetStyle(ControlStyles.UserPaint)) { fontBackup = Font; foreColorBackup = ForeColor; backColorBackup = BackColor; SetStyle(ControlStyles.UserPaint, true); } } else { if (GetStyle(ControlStyles.UserPaint)) { SetStyle(ControlStyles.UserPaint, false); Font = fontBackup; ForeColor = foreColorBackup; BackColor = backColorBackup; } } } protected override void OnPaint(PaintEventArgs e) { base.OnPaint(e); if (string.IsNullOrEmpty(Text) && Focused == false) { using (var brush = new SolidBrush(PlaceholderColor)) { e.Graphics.DrawString(PlaceholderText ?? string.Empty, Font, brush, new PointF(-1.0f, 1.0f)); } } } } }
using System; using System.Drawing; using System.Windows.Forms; namespace ReClassNET.UI { public class PlaceholderTextBox : TextBox { private Font fontBackup; private Color foreColorBackup; private Color backColorBackup; /// <summary> /// The color of the placeholder text. /// </summary> public Color PlaceholderColor { get; set; } = SystemColors.ControlDarkDark; /// <summary> /// The placeholder text. /// </summary> public string PlaceholderText { get; set; } public PlaceholderTextBox() { fontBackup = Font; foreColorBackup = ForeColor; backColorBackup = BackColor; SetStyle(ControlStyles.UserPaint, true); } protected override void OnTextChanged(EventArgs e) { base.OnTextChanged(e); if (string.IsNullOrEmpty(Text)) { if (!GetStyle(ControlStyles.UserPaint)) { fontBackup = Font; foreColorBackup = ForeColor; backColorBackup = BackColor; SetStyle(ControlStyles.UserPaint, true); } } else { if (GetStyle(ControlStyles.UserPaint)) { SetStyle(ControlStyles.UserPaint, false); Font = fontBackup; ForeColor = foreColorBackup; BackColor = backColorBackup; } } } protected override void OnPaint(PaintEventArgs e) { base.OnPaint(e); if (string.IsNullOrEmpty(Text) && Focused == false) { using (var brush = new SolidBrush(PlaceholderColor)) { e.Graphics.DrawString(PlaceholderText ?? string.Empty, Font, brush, new PointF(-1.0f, 1.0f)); } } } } }
mit
C#
e5f8628e792b3e32e265a3c9ce75bd3aab7c5923
Set default target path gizmo curve color
bartlomiejwolk/AnimationPathAnimator
TargetAnimationPath.cs
TargetAnimationPath.cs
using UnityEngine; namespace ATP.AnimationPathTools { public class TargetAnimationPath : AnimationPath { /// <summary> /// Color of the gizmo curve. /// </summary> private Color gizmoCurveColor = Color.magenta; } }
namespace ATP.AnimationPathTools { public class TargetAnimationPath : AnimationPath { } }
mit
C#
cd0c3ba22122b4083c8cc31b2c830db215eaa4fe
Convert Distance to Expression Bodied Member
BillWagner/TourOfCSharp6
TourOfCSharp6/Point.cs
TourOfCSharp6/Point.cs
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace TourOfCSharp6 { public class Point { public double X { get; set; } public double Y { get; set; } public double Distance => Math.Sqrt(X * X + Y * Y); } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace TourOfCSharp6 { public class Point { public double X { get; set; } public double Y { get; set; } public double Distance { get { return Math.Sqrt(X * X + Y * Y); } } } }
mit
C#
398c1ab5e071066e3e36605d85905eb4ed6c8913
Bump version to 0.7.3
ar3cka/Journalist
src/SolutionInfo.cs
src/SolutionInfo.cs
// <auto-generated/> using System.Reflection; [assembly: AssemblyProductAttribute("Journalist")] [assembly: AssemblyVersionAttribute("0.7.3")] [assembly: AssemblyInformationalVersionAttribute("0.7.3")] [assembly: AssemblyFileVersionAttribute("0.7.3")] [assembly: AssemblyCompanyAttribute("Anton Mednonogov")] namespace System { internal static class AssemblyVersionInformation { internal const string Version = "0.7.3"; } }
// <auto-generated/> using System.Reflection; [assembly: AssemblyProductAttribute("Journalist")] [assembly: AssemblyVersionAttribute("0.7.2")] [assembly: AssemblyInformationalVersionAttribute("0.7.2")] [assembly: AssemblyFileVersionAttribute("0.7.2")] [assembly: AssemblyCompanyAttribute("Anton Mednonogov")] namespace System { internal static class AssemblyVersionInformation { internal const string Version = "0.7.2"; } }
apache-2.0
C#
efd911290807692f4b3f8f433bf4c67d9d220825
modify adjustconverter
kyoryo/test
Grabacr07.KanColleViewer/Views/Converters/AdjustConverter.cs
Grabacr07.KanColleViewer/Views/Converters/AdjustConverter.cs
using System; using System.Collections.Generic; using System.Globalization; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Data; using System.Windows.Media; using Grabacr07.KanColleWrapper.Models; using Settings2 = Grabacr07.KanColleViewer.Models.Settings; namespace Grabacr07.KanColleViewer.Views.Converters { public class AdjustConverter : IValueConverter { public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { var number = Double.Parse(value.ToString()); var plus = Double.Parse(parameter.ToString()); if (Settings2.Current.OrientationMode == Models.OrientationType.Vertical) plus = plus - 54.00; return number + plus; } public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) { var number = Double.Parse(value.ToString()); var plus = Double.Parse(parameter.ToString()); if (Settings2.Current.OrientationMode == Models.OrientationType.Vertical) plus = plus - 54.00; return number - plus; } } }
using System; using System.Collections.Generic; using System.Globalization; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Data; using System.Windows.Media; using Grabacr07.KanColleWrapper.Models; namespace Grabacr07.KanColleViewer.Views.Converters { public class AdjustConverter : IValueConverter { public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { var number = Double.Parse(value.ToString()); var plus = Double.Parse(parameter.ToString()); return number + plus; } public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) { var number = Double.Parse(value.ToString()); var plus = Double.Parse(parameter.ToString()); return number - plus; } } }
mit
C#
8c19cec6da58985572ffb818dbe87abd8017c17e
Fix Referencing Values on Module Objects.
seaboy1234/PineTreeLanguage
PineTree.Interpreter/Runtime/Environment/ExecutionContext.cs
PineTree.Interpreter/Runtime/Environment/ExecutionContext.cs
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using PineTree.Interpreter.Native; using PineTree.Interpreter.Native.Function; namespace PineTree.Interpreter.Runtime.Environment { public class ExecutionContext : PineTreeEnvironment { private List<Module> _imported; private Module _module; public ExecutionContext(Module module) { _module = module; _imported = new List<Module>(); } public override PineTreeEnvironment Clone() { var context = new ExecutionContext(_module); foreach (var reference in GetReferences()) { context.SetLocal(reference.ReferenceName, reference.Value); } return context; } public override RuntimeValue GetLocal(string name) { return base.GetLocal(name).Or(() => _module.GetValue(name)).Or(() => new RuntimeValue(GetFromImported(name))); } public override ObjectReference GetReference(string name) { return base.GetReference(name) ?? _module.GetReference(name); } public override void SetLocal(string name, RuntimeValue value) { base.SetLocal(name, value); } internal void AddModule(Module module) { _imported.Add(module); } internal TypeMetadata FindType(string name) { return _module.FindType(name) ?? GetFromImported(g => g.FindType(name)); } private RuntimeObject GetFromImported(string name) { return GetFromImported(g => g.GetValue(name).Value); } private T GetFromImported<T>(Func<Module, T> func) { return _imported.Select(func).FirstOrDefault(g => g != null); } } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using PineTree.Interpreter.Native; using PineTree.Interpreter.Native.Function; namespace PineTree.Interpreter.Runtime.Environment { public class ExecutionContext : PineTreeEnvironment { private List<Module> _imported; private Module _module; public ExecutionContext(Module module) { _module = module; _imported = new List<Module>(); } public override PineTreeEnvironment Clone() { var context = new ExecutionContext(_module); foreach (var reference in GetReferences()) { context.SetLocal(reference.ReferenceName, reference.Value); } return context; } public override RuntimeValue GetLocal(string name) { return base.GetLocal(name).Or(() => _module.GetValue(name)).Or(() => GetFromImported(g => g.GetValue(name))); } public override ObjectReference GetReference(string name) { return base.GetReference(name) ?? _module.GetReference(name); } public override void SetLocal(string name, RuntimeValue value) { base.SetLocal(name, value); } internal void AddModule(Module module) { _imported.Add(module); } internal TypeMetadata FindType(string name) { return _module.FindType(name) ?? GetFromImported(g => g.FindType(name)); } private RuntimeObject GetFromImported(string name) { return GetFromImported(g => g.GetValue(name).Value); } private T GetFromImported<T>(Func<Module, T> func) { return _imported.Select(func).FirstOrDefault(g => g != null); } } }
mit
C#
08cfe16233f9ef04d0814e548ec2fc5105b4ab66
Update IExchangeRatesProvider.cs
tiksn/TIKSN-Framework
TIKSN.Core/Finance/ForeignExchange/IExchangeRatesProvider.cs
TIKSN.Core/Finance/ForeignExchange/IExchangeRatesProvider.cs
using System; using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; namespace TIKSN.Finance.ForeignExchange { public interface IExchangeRatesProvider { Task<IEnumerable<ExchangeRate>> GetExchangeRatesAsync(DateTimeOffset asOn, CancellationToken cancellationToken); } }
using System; using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; namespace TIKSN.Finance.ForeignExchange { public interface IExchangeRatesProvider { Task<IEnumerable<ExchangeRate>> GetExchangeRatesAsync(DateTimeOffset asOn, CancellationToken cancellationToken); } }
mit
C#
3fe20dc258c3c6ddc6a3cf9681ae8aa19b94c649
Update LanguageLocalizationParameters.cs
tiksn/TIKSN-Framework
TIKSN.LanguageLocalization/LanguageLocalizationParameters.cs
TIKSN.LanguageLocalization/LanguageLocalizationParameters.cs
using System.Reflection; namespace TIKSN.Localization { public static class LanguageLocalizationParameters { public static string GetDefaultCultureName() => typeof(LanguageLocalizationParameters).GetTypeInfo().Assembly.GetName().CultureName; } }
using System.Reflection; namespace TIKSN.Localization { public static class LanguageLocalizationParameters { public static string GetDefaultCultureName() { return typeof(LanguageLocalizationParameters).GetTypeInfo().Assembly.GetName().CultureName; } } }
mit
C#
7894b67794323e100db60ce9d49706add036ee10
Check with generated cause identifiers
MCGPPeters/Eru,MCGPPeters/Eru
src/Eru/Validation/Validation.cs
src/Eru/Validation/Validation.cs
namespace Eru.Validation { using System; using System.Collections.Generic; using System.Linq; public static class Validation { private static Either<TCauseIdentifier[], TRight> Assert<TRight, TCauseIdentifier>(TRight source, params Property<TCauseIdentifier, TRight>[] properties) { var propertiesThatDoNotHold = properties .Where(rule => !rule.Holds(source)) .Select(rule => rule.Identifier) .ToArray(); return propertiesThatDoNotHold.Any() ? Either<TCauseIdentifier[], TRight>.Create(propertiesThatDoNotHold) : Either<TCauseIdentifier[], TRight>.Create(source); } public static Either<TCauseIdentifier[], TRight> Check<TRight, TCauseIdentifier>( this Either<TCauseIdentifier[], TRight> source, params Property<TCauseIdentifier, TRight>[] properties) { return source.Bind(right => Assert(right, properties)); } public static Either<TCauseIdentifier[], TRight> Check<TRight, TCauseIdentifier>(this TRight source, params Property<TCauseIdentifier, TRight>[] properties) { return Check(source.Return<TCauseIdentifier[], TRight>(), properties); } public static Either<string[], TRight> Check<TRight>(this TRight source, string cause, params Predicate<TRight>[] rules) { return Check(source.Return<string[], TRight>(), rules.Select(predicate => new Property<string, TRight>(cause, predicate)).ToArray()); } public static Either<string[], TRight> Check<TRight>(this TRight source, params Predicate<TRight>[] rules) { return Check(source.Return<string[], TRight>(), rules.Select(predicate => new Property<string, TRight>(Guid.NewGuid().ToString(), predicate)).ToArray()); } public static Either<string[], TRight> Check<TRight>(this Either<string[], TRight> source, string cause, params Predicate<TRight>[] rules) { return Check(source, rules.Select(predicate => new Property<string, TRight>(cause, predicate)).ToArray()); } } }
namespace Eru.Validation { using System; using System.Collections.Generic; using System.Linq; public static class Validation { private static Either<TCauseIdentifier[], TRight> Assert<TRight, TCauseIdentifier>(TRight source, params Property<TCauseIdentifier, TRight>[] properties) { var propertiesThatDoNotHold = properties .Where(rule => !rule.Holds(source)) .Select(rule => rule.Identifier) .ToArray(); return propertiesThatDoNotHold.Any() ? Either<TCauseIdentifier[], TRight>.Create(propertiesThatDoNotHold) : Either<TCauseIdentifier[], TRight>.Create(source); } public static Either<TCauseIdentifier[], TRight> Check<TRight, TCauseIdentifier>( this Either<TCauseIdentifier[], TRight> source, params Property<TCauseIdentifier, TRight>[] properties) { return source.Bind(right => Assert(right, properties)); } public static Either<TCauseIdentifier[], TRight> Check<TRight, TCauseIdentifier>(this TRight source, params Property<TCauseIdentifier, TRight>[] properties) { return Check(source.Return<TCauseIdentifier[], TRight>(), properties); } public static Either<string[], TRight> Check<TRight>(this TRight source, string cause, params Predicate<TRight>[] rules) { return Check(source.Return<string[], TRight>(), rules.Select(predicate => new Property<string, TRight>(cause, predicate)).ToArray()); } public static Either<string[], TRight> Check<TRight>(this Either<string[], TRight> source, string cause, params Predicate<TRight>[] rules) { return Check(source, rules.Select(predicate => new Property<string, TRight>(cause, predicate)).ToArray()); } } }
mit
C#
e87b71d99e4c8d4063525428114848e9afe412a7
Revert "bump version again to 1.3.76.0"
agileharbor/shipStationAccess
src/Global/GlobalAssemblyInfo.cs
src/Global/GlobalAssemblyInfo.cs
using System; using System.Reflection; using System.Runtime.InteropServices; [ assembly : ComVisible( false ) ] [ assembly : AssemblyProduct( "ShipStationAccess" ) ] [ assembly : AssemblyCompany( "Agile Harbor, LLC" ) ] [ assembly : AssemblyCopyright( "Copyright (C) Agile Harbor, LLC" ) ] [ assembly : AssemblyDescription( "ShipStation webservices API wrapper." ) ] [ assembly : AssemblyTrademark( "" ) ] [ assembly : AssemblyCulture( "" ) ] [ assembly : CLSCompliant( false ) ] // 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.*")] // Keep in track with CA API version [ assembly : AssemblyVersion( "1.3.75.0" ) ]
using System; using System.Reflection; using System.Runtime.InteropServices; [ assembly : ComVisible( false ) ] [ assembly : AssemblyProduct( "ShipStationAccess" ) ] [ assembly : AssemblyCompany( "Agile Harbor, LLC" ) ] [ assembly : AssemblyCopyright( "Copyright (C) Agile Harbor, LLC" ) ] [ assembly : AssemblyDescription( "ShipStation webservices API wrapper." ) ] [ assembly : AssemblyTrademark( "" ) ] [ assembly : AssemblyCulture( "" ) ] [ assembly : CLSCompliant( false ) ] // 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.*")] // Keep in track with CA API version [ assembly : AssemblyVersion( "1.3.76.0" ) ]
bsd-3-clause
C#
cf787d1f8bcc259c121fceb6595a706aa959c64e
build 0.0.9
rachmann/qboAccess,rachmann/qboAccess,rachmann/qboAccess
src/Global/GlobalAssemblyInfo.cs
src/Global/GlobalAssemblyInfo.cs
using System; using System.Reflection; using System.Runtime.InteropServices; [ assembly : ComVisible( false ) ] [ assembly : AssemblyProduct( "QuickBooksOnlineAccess" ) ] [ assembly : AssemblyCompany( "Agile Harbor, LLC" ) ] [ assembly : AssemblyCopyright( "Copyright (C) 2014 Agile Harbor, LLC" ) ] [ assembly : AssemblyDescription( "QuickBooksOnline webservices API wrapper." ) ] [ assembly : AssemblyTrademark( "" ) ] [ assembly : AssemblyCulture( "" ) ] [ assembly : CLSCompliant( false ) ] // 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.*")] // Keep in track with CA API version [ assembly : AssemblyVersion( "0.0.9.0" ) ]
using System; using System.Reflection; using System.Runtime.InteropServices; [ assembly : ComVisible( false ) ] [ assembly : AssemblyProduct( "QuickBooksOnlineAccess" ) ] [ assembly : AssemblyCompany( "Agile Harbor, LLC" ) ] [ assembly : AssemblyCopyright( "Copyright (C) 2014 Agile Harbor, LLC" ) ] [ assembly : AssemblyDescription( "QuickBooksOnline webservices API wrapper." ) ] [ assembly : AssemblyTrademark( "" ) ] [ assembly : AssemblyCulture( "" ) ] [ assembly : CLSCompliant( false ) ] // 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.*")] // Keep in track with CA API version [ assembly : AssemblyVersion( "0.0.8.0" ) ]
bsd-3-clause
C#
826064eff4be84ca12bd53e51e2f7c1da66bec2b
test the levels.
isqo/3DFlappyBird
Assets/Camera/cMoveCamera.cs
Assets/Camera/cMoveCamera.cs
using Assets.Levels.Level2; using Assets.Levels.Level3; using System; using System.Collections.Generic; using System.Linq; using System.Text; using UnityEngine; namespace Assets { public class cMoveCamera : MonoBehaviour { public float lookSensitivity = 2.0f; public float BehindThePlayerZAxis = -2.0f; private float yRotation; private float xRotation; void Start() { level3 level3 = new level3(); level3.isActif = true; //level2 level2 = new level2(); //level2.isActif = true; } void Update() { if (Input.GetMouseButton(1)) { yRotation -= Input.GetAxis("Mouse Y") * lookSensitivity; xRotation += Input.GetAxis("Mouse X") * lookSensitivity; gameObject.transform.rotation = Quaternion.Euler(yRotation, xRotation, BehindThePlayerZAxis); } else if (Input.GetMouseButtonUp(1)) { gameObject.transform.rotation = Quaternion.Euler(0, 0, BehindThePlayerZAxis); } } } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using UnityEngine; namespace Assets { public class cMoveCamera : MonoBehaviour { public float lookSensitivity = 2.0f; public float BehindThePlayerZAxis = -2.0f; private float yRotation; private float xRotation; void Update() { if (Input.GetMouseButton(1)) { yRotation -= Input.GetAxis("Mouse Y") * lookSensitivity; xRotation += Input.GetAxis("Mouse X") * lookSensitivity; gameObject.transform.rotation = Quaternion.Euler(yRotation, xRotation, BehindThePlayerZAxis); } else if (Input.GetMouseButtonUp(1)) { gameObject.transform.rotation = Quaternion.Euler(0, 0, BehindThePlayerZAxis); } } } }
mit
C#
f55d21879878704fc9ce6f599fa7cf69eb57682a
Remove Handlers from IWebBrowserInternal (minor issue created when merging in master)
ruisebastiao/CefSharp,windygu/CefSharp,Haraguroicha/CefSharp,haozhouxu/CefSharp,wangzheng888520/CefSharp,VioletLife/CefSharp,gregmartinhtc/CefSharp,jamespearce2006/CefSharp,VioletLife/CefSharp,AJDev77/CefSharp,NumbersInternational/CefSharp,zhangjingpu/CefSharp,zhangjingpu/CefSharp,battewr/CefSharp,rover886/CefSharp,NumbersInternational/CefSharp,NumbersInternational/CefSharp,VioletLife/CefSharp,Livit/CefSharp,haozhouxu/CefSharp,jamespearce2006/CefSharp,jamespearce2006/CefSharp,twxstar/CefSharp,twxstar/CefSharp,Octopus-ITSM/CefSharp,twxstar/CefSharp,ITGlobal/CefSharp,battewr/CefSharp,jamespearce2006/CefSharp,illfang/CefSharp,rlmcneary2/CefSharp,wangzheng888520/CefSharp,gregmartinhtc/CefSharp,rover886/CefSharp,illfang/CefSharp,NumbersInternational/CefSharp,Livit/CefSharp,rover886/CefSharp,rover886/CefSharp,dga711/CefSharp,rlmcneary2/CefSharp,windygu/CefSharp,gregmartinhtc/CefSharp,illfang/CefSharp,gregmartinhtc/CefSharp,AJDev77/CefSharp,dga711/CefSharp,battewr/CefSharp,ITGlobal/CefSharp,joshvera/CefSharp,Haraguroicha/CefSharp,yoder/CefSharp,dga711/CefSharp,zhangjingpu/CefSharp,Octopus-ITSM/CefSharp,AJDev77/CefSharp,Octopus-ITSM/CefSharp,rlmcneary2/CefSharp,wangzheng888520/CefSharp,ITGlobal/CefSharp,joshvera/CefSharp,battewr/CefSharp,ruisebastiao/CefSharp,twxstar/CefSharp,AJDev77/CefSharp,yoder/CefSharp,windygu/CefSharp,zhangjingpu/CefSharp,wangzheng888520/CefSharp,VioletLife/CefSharp,rlmcneary2/CefSharp,Haraguroicha/CefSharp,ruisebastiao/CefSharp,haozhouxu/CefSharp,joshvera/CefSharp,haozhouxu/CefSharp,ITGlobal/CefSharp,Haraguroicha/CefSharp,Octopus-ITSM/CefSharp,jamespearce2006/CefSharp,ruisebastiao/CefSharp,joshvera/CefSharp,windygu/CefSharp,rover886/CefSharp,Haraguroicha/CefSharp,yoder/CefSharp,dga711/CefSharp,Livit/CefSharp,Livit/CefSharp,yoder/CefSharp,illfang/CefSharp
CefSharp/Internals/IWebBrowserInternal.cs
CefSharp/Internals/IWebBrowserInternal.cs
// Copyright © 2010-2014 The CefSharp Authors. All rights reserved. // // Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. using System.Collections.Generic; namespace CefSharp.Internals { public interface IWebBrowserInternal : IWebBrowser { IDictionary<string, object> BoundObjects { get; } void OnInitialized(); void SetAddress(string address); void SetIsLoading(bool isloading); void SetNavState(bool canGoBack, bool canGoForward, bool canReload); void SetTitle(string title); void SetTooltipText(string tooltipText); void ShowDevTools(); void CloseDevTools(); void OnFrameLoadStart(string url, bool isMainFrame); void OnFrameLoadEnd(string url, bool isMainFrame, int httpStatusCode); void OnTakeFocus(bool next); void OnConsoleMessage(string message, string source, int line); void OnLoadError(string url, CefErrorCode errorCode, string errorText); } }
// Copyright © 2010-2014 The CefSharp Authors. All rights reserved. // // Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. using System.Collections.Generic; namespace CefSharp.Internals { public interface IWebBrowserInternal : IWebBrowser { ILifeSpanHandler LifeSpanHandler { get; set; } IKeyboardHandler KeyboardHandler { get; set; } IJsDialogHandler JsDialogHandler { get; set; } IDictionary<string, object> BoundObjects { get; } void OnInitialized(); void SetAddress(string address); void SetIsLoading(bool isloading); void SetNavState(bool canGoBack, bool canGoForward, bool canReload); void SetTitle(string title); void SetTooltipText(string tooltipText); void ShowDevTools(); void CloseDevTools(); void OnFrameLoadStart(string url, bool isMainFrame); void OnFrameLoadEnd(string url, bool isMainFrame, int httpStatusCode); void OnTakeFocus(bool next); void OnConsoleMessage(string message, string source, int line); void OnLoadError(string url, CefErrorCode errorCode, string errorText); } }
bsd-3-clause
C#
51a63210ca1c927e1343178ca903e6231823f10e
Use StringEnumConvert for Approvals.VerifyJson / VerifyMe
mattgwagner/CertiPay.Common
CertiPay.Common.Testing/TestExtensions.cs
CertiPay.Common.Testing/TestExtensions.cs
namespace CertiPay.Common.Testing { using ApprovalTests; using Newtonsoft.Json; using Newtonsoft.Json.Converters; using Ploeh.AutoFixture; public static class TestExtensions { private static readonly Fixture _fixture = new Fixture { }; private static readonly JsonSerializerSettings _settings = new JsonSerializerSettings { Formatting = Formatting.Indented }; static TestExtensions() { _settings.Converters.Add(new StringEnumConverter { }); } /// <summary> /// Runs ApprovalTests's VerifyJson against a JSON.net serialized representation of the provided object /// </summary> public static void VerifyMe(this object obj) { var json = JsonConvert.SerializeObject(obj, _settings); Approvals.VerifyJson(json); } /// <summary> /// Returns an auto-initialized instance of the type T, filled via mock /// data via AutoFixture. /// /// This will not work for interfaces, only concrete types. /// </summary> public static T AutoGenerate<T>() { return _fixture.Create<T>(); } } }
namespace CertiPay.Common.Testing { using ApprovalTests; using Newtonsoft.Json; using Ploeh.AutoFixture; public static class TestExtensions { private static readonly Fixture _fixture = new Fixture { }; /// <summary> /// Runs ApprovalTests's VerifyJson against a JSON.net serialized representation of the provided object /// </summary> public static void VerifyMe(this object obj) { var json = JsonConvert.SerializeObject(obj); Approvals.VerifyJson(json); } /// <summary> /// Returns an auto-initialized instance of the type T, filled via mock /// data via AutoFixture. /// /// This will not work for interfaces, only concrete types. /// </summary> public static T AutoGenerate<T>() { return _fixture.Create<T>(); } } }
mit
C#
295d54b328b2945ae895ebc950d9579bef39f786
adjust code layout
devlights/MyHelloWorld
MyHelloWorld/HelloWorld.StdOut/Program.cs
MyHelloWorld/HelloWorld.StdOut/Program.cs
 namespace HelloWorld.StdOut { using System; using System.Collections.Generic; using System.Linq; using Ninject; using Ninject.Parameters; using HelloWorld.Core; using HelloWorld.Core.NinjectModules; class Program { static void Main() { var kernel = new StandardKernel(new HelloWorldModule()); var manager = kernel.Get<IMessageManager>(); Console.WriteLine(manager.GetMessage("devlights")); } } }
 namespace HelloWorld.StdOut { using System; using System.Collections.Generic; using System.Linq; using Ninject; using Ninject.Parameters; using HelloWorld.Core; using HelloWorld.Core.NinjectModules; class Program { static void Main() { var kernel = new StandardKernel(new HelloWorldModule()); var manager = kernel.Get<IMessageManager>(); Console.WriteLine(manager.GetMessage("devlights")); } } }
mit
C#
dd13bcb9fdf17b1196c0c7aed38da059e8986481
Add missing updated_at and created_at properties.
clement911/ShopifySharp,nozzlegear/ShopifySharp,addsb/ShopifySharp
ShopifySharp/Entities/ShopifyMetaField.cs
ShopifySharp/Entities/ShopifyMetaField.cs
using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace ShopifySharp { public class ShopifyMetaField : ShopifyObject { /// <summary> /// The date and time when the metafield was created. /// </summary> [JsonProperty("created_at")] public DateTime? CreatedAt { get; set; } /// <summary> /// The date and time when the metafield was last updated. /// </summary> [JsonProperty("updated_at")] public DateTime? UpdatedAt { get; set; } /// <summary> /// Identifier for the metafield (maximum of 30 characters). /// </summary> [JsonProperty("key")] public string Key { get; set; } /// <summary> /// Information to be stored as metadata. Must be either a string or an int. /// </summary> [JsonProperty("value")] public object Value { get; set; } /// <summary> /// States whether the information in the value is stored as a 'string' or 'integer.' /// </summary> [JsonProperty("value_type")] public string ValueType { get; set; } /// <summary> /// Container for a set of metadata. Namespaces help distinguish between metadata you created and metadata created by another individual with a similar namespace (maximum of 20 characters). /// </summary> [JsonProperty("namespace")] public object Namespace { get; set; } /// <summary> /// Additional information about the metafield. /// </summary> [JsonProperty("description")] public string Description { get; set; } /// <summary> /// The Id of the Shopify Resource that the metafield is associated with. This value could be the id of things like product, order, variant, collection. /// </summary> [JsonProperty("owner_id")] public long? OwnerId { get; set; } /// <summary> /// The name of the Shopify Resource that the metafield is associated with. This could be things like product, order, variant, collection. /// </summary> [JsonProperty("owner_resource")] public string OwnerResource { 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 ShopifyMetaField : ShopifyObject { /// <summary> /// Identifier for the metafield (maximum of 30 characters). /// </summary> [JsonProperty("key")] public string Key { get; set; } /// <summary> /// Information to be stored as metadata. Must be either a string or an int. /// </summary> [JsonProperty("value")] public object Value { get; set; } /// <summary> /// States whether the information in the value is stored as a 'string' or 'integer.' /// </summary> [JsonProperty("value_type")] public string ValueType { get; set; } /// <summary> /// Container for a set of metadata. Namespaces help distinguish between metadata you created and metadata created by another individual with a similar namespace (maximum of 20 characters). /// </summary> [JsonProperty("namespace")] public object Namespace { get; set; } /// <summary> /// Additional information about the metafield. /// </summary> [JsonProperty("description")] public string Description { get; set; } /// <summary> /// The Id of the Shopify Resource that the metafield is associated with. This value could be the id of things like product, order, variant, collection. /// </summary> [JsonProperty("owner_id")] public long? OwnerId { get; set; } /// <summary> /// The name of the Shopify Resource that the metafield is associated with. This could be things like product, order, variant, collection. /// </summary> [JsonProperty("owner_resource")] public string OwnerResource { get; set; } } }
mit
C#
8db44315204f31a29989ad09a2fd59fd49c93062
Fix bug in pinmode usage The device.PinMode was being set from internal members which had not been stored yet. Would result in Relay module not working as expected.
penoud/GrovePi,penoud/GrovePi,karan259/GrovePi,karan259/GrovePi,karan259/GrovePi,karan259/GrovePi,rpedersen/GrovePi,rpedersen/GrovePi,rpedersen/GrovePi,karan259/GrovePi,karan259/GrovePi,rpedersen/GrovePi,rpedersen/GrovePi,karan259/GrovePi,rpedersen/GrovePi,penoud/GrovePi,karan259/GrovePi,penoud/GrovePi,rpedersen/GrovePi,rpedersen/GrovePi,penoud/GrovePi,penoud/GrovePi,penoud/GrovePi,penoud/GrovePi,karan259/GrovePi
Software/CSharp/GrovePi/Sensors/Sensor.cs
Software/CSharp/GrovePi/Sensors/Sensor.cs
using System; namespace GrovePi.Sensors { public abstract class Sensor<TSensorType> where TSensorType : class { protected readonly IGrovePi Device; protected readonly Pin Pin; internal Sensor(IGrovePi device, Pin pin, PinMode pinMode) { if (device == null) throw new ArgumentNullException(nameof(device)); Device = device; Pin = pin; device.PinMode(Pin, pinMode); } internal Sensor(IGrovePi device, Pin pin) { if (device == null) throw new ArgumentNullException(nameof(device)); Device = device; Pin = pin; } public SensorStatus CurrentState => (SensorStatus) Device.DigitalRead(Pin); public TSensorType ChangeState(SensorStatus newState) { Device.DigitalWrite(Pin, (byte) newState); return this as TSensorType; } public void AnalogWrite(byte value) { Device.AnalogWrite(Pin,value); } } }
using System; namespace GrovePi.Sensors { public abstract class Sensor<TSensorType> where TSensorType : class { protected readonly IGrovePi Device; protected readonly Pin Pin; internal Sensor(IGrovePi device, Pin pin, PinMode pinMode) { if (device == null) throw new ArgumentNullException(nameof(device)); device.PinMode(Pin, pinMode); Device = device; Pin = pin; } internal Sensor(IGrovePi device, Pin pin) { if (device == null) throw new ArgumentNullException(nameof(device)); Device = device; Pin = pin; } public SensorStatus CurrentState => (SensorStatus) Device.DigitalRead(Pin); public TSensorType ChangeState(SensorStatus newState) { Device.DigitalWrite(Pin, (byte) newState); return this as TSensorType; } public void AnalogWrite(byte value) { Device.AnalogWrite(Pin,value); } } }
mit
C#
0ef136bf5782ade4fe55538af238d88ef26a63ff
Fix the startup process of the HelloWorld GettingStarted source.
xamarin/WebSharp,xamarin/WebSharp,xamarin/WebSharp,xamarin/WebSharp,xamarin/WebSharp,xamarin/WebSharp
GettingStarted/HelloWorld.cs
GettingStarted/HelloWorld.cs
using System; using PepperSharp; namespace GettingStarted { public class HelloWorld : Instance { public HelloWorld (IntPtr handle) : base(handle) { Initialize += OnInitialize; } private void OnInitialize(object sender, InitializeEventArgs args) { LogToConsoleWithSource(PPLogLevel.Log, "GettingStarted.HelloWorld", "HelloWorld from C#"); } } }
using System; using PepperSharp; namespace GettingStarted { public class HelloWorld : Instance { public override bool Init(int argc, string[] argn, string[] argv) { LogToConsoleWithSource(PPLogLevel.Log, "GettingStarted.HelloWorld", "HelloWorld from C#"); return true; } } }
mit
C#
e11d15257ded3b874e7afdf491ee51f917b22829
Update RelativePathAdapterTest.cs
farans/SquishIt,jetheredge/SquishIt,wolfgang42/SquishIt,AlexCuse/SquishIt,wolfgang42/SquishIt,Worthaboutapig/SquishIt,Worthaboutapig/AC-SquishIt,0liver/SquishIt,jetheredge/SquishIt,AlexCuse/SquishIt,0liver/SquishIt,wolfgang42/SquishIt,0liver/SquishIt,jetheredge/SquishIt,jetheredge/SquishIt,wolfgang42/SquishIt,Worthaboutapig/AC-SquishIt,farans/SquishIt,jetheredge/SquishIt,Worthaboutapig/AC-SquishIt,Worthaboutapig/SquishIt,Worthaboutapig/SquishIt,AlexCuse/SquishIt,Worthaboutapig/SquishIt,Worthaboutapig/SquishIt,0liver/SquishIt,0liver/SquishIt,jetheredge/SquishIt,farans/SquishIt,farans/SquishIt,AlexCuse/SquishIt,wolfgang42/SquishIt,AlexCuse/SquishIt,Worthaboutapig/AC-SquishIt,farans/SquishIt,AlexCuse/SquishIt,Worthaboutapig/AC-SquishIt
SquishIt.Tests/RelativePathAdapterTest.cs
SquishIt.Tests/RelativePathAdapterTest.cs
using System; using NUnit.Framework; using SquishIt.Framework.CSS; namespace SquishIt.Tests { [TestFixture] public class RelativePathAdapterTest { [Test] public void Between_Throws_If_No_Common_Root() { var from = "C:\\asdfasdfasdf\\asdfasdrqwettadsf"; var to = "D:\\asdfasdfasewtertwasdf\\eewtyeryredag"; var ex = Assert.Throws<InvalidOperationException>(() => RelativePathAdapter.Between(from, to)); Assert.NotNull(ex); Assert.AreEqual("Can't calculate relative distance between '" + from + "' and '" + to + "' because they do not have a shared base.", ex.Message); } [Test, Platform(Exclude = "Unix, Linux, Mono")] public void DoesNotErrorOnNetworkSharePath() { var from = @"\\network\website\assets\css\main\"; var to = @"\\network\website\Content\style.css"; var adapter = RelativePathAdapter.Between(from, to); Assert.IsNotNull(adapter); } } }
using System; using NUnit.Framework; using SquishIt.Framework.CSS; namespace SquishIt.Tests { [TestFixture] public class RelativePathAdapterTest { [Test] public void Between_Throws_If_No_Common_Root() { var from = "C:\\asdfasdfasdf\\asdfasdrqwettadsf"; var to = "D:\\asdfasdfasewtertwasdf\\eewtyeryredag"; var ex = Assert.Throws<InvalidOperationException>(() => RelativePathAdapter.Between(from, to)); Assert.NotNull(ex); Assert.AreEqual("Can't calculate relative distance between '" + from + "' and '" + to + "' because they do not have a shared base.", ex.Message); } [Test] public void DoesNotErrorOnNetworkSharePath() { var from = @"\\network\website\assets\css\main\"; var to = @"\\network\website\Content\style.css"; var adapter = RelativePathAdapter.Between(from, to); Assert.IsNotNull(adapter); } } }
mit
C#
da1cc19cd75c3fcbfa4e537f858bd89c524fa707
Test SIT jenkins build
emilti/TravelAlbum,emilti/TravelAlbum,emilti/TravelAlbum
TravelCatalog/Views/Shared/_Layout.cshtml
TravelCatalog/Views/Shared/_Layout.cshtml
<!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>@ViewBag.Title - My ASP.NET Application</title> @Styles.Render("~/Content/css") @Scripts.Render("~/bundles/modernizr") </head> <body> <div class="navbar navbar-inverse navbar-fixed-top"> <div class="container"> <div class="navbar-header"> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse"> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> @Html.ActionLink("Application name", "Index", "Home", new { area = "" }, new { @class = "navbar-brand" }) </div> <div class="navbar-collapse collapse"> <ul class="nav navbar-nav"> <li>@Html.ActionLink("Home", "Index", "Home")</li> <li>@Html.ActionLink("About", "About", "Home")</li> <li>@Html.ActionLink("Contact", "Contact", "Home")</li> </ul> @Html.Partial("_LoginPartial") </div> </div> </div> <div class="container body-content"> @RenderBody() TEST! <hr /> <footer> <p>&copy; @DateTime.Now.Year - My ASP.NET Application</p> </footer> </div> @Scripts.Render("~/bundles/jquery") @Scripts.Render("~/bundles/bootstrap") @RenderSection("scripts", required: false) </body> </html>
<!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>@ViewBag.Title - My ASP.NET Application</title> @Styles.Render("~/Content/css") @Scripts.Render("~/bundles/modernizr") </head> <body> <div class="navbar navbar-inverse navbar-fixed-top"> <div class="container"> <div class="navbar-header"> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse"> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> @Html.ActionLink("Application name", "Index", "Home", new { area = "" }, new { @class = "navbar-brand" }) </div> <div class="navbar-collapse collapse"> <ul class="nav navbar-nav"> <li>@Html.ActionLink("Home", "Index", "Home")</li> <li>@Html.ActionLink("About", "About", "Home")</li> <li>@Html.ActionLink("Contact", "Contact", "Home")</li> </ul> @Html.Partial("_LoginPartial") </div> </div> </div> <div class="container body-content"> @RenderBody() <hr /> <footer> <p>&copy; @DateTime.Now.Year - My ASP.NET Application</p> </footer> </div> @Scripts.Render("~/bundles/jquery") @Scripts.Render("~/bundles/bootstrap") @RenderSection("scripts", required: false) </body> </html>
mit
C#
912b3d15b5eadb5f1f8dc2781c60b31950888054
Revert "Now with "yield" in GetaNum()"
flodis/C-Sharp-Fragments
Enum/EnumListLambda.cs
Enum/EnumListLambda.cs
using System.Collections; class IENumDemo { /// <summary> /// Create a cosinus table enumerator with 0..360 deg values /// </summary> private IEnumerator costable = new Func<List<float>>(() => { List<float> nn = new List<float>(); for (int v = 0; v < 360; v++) { nn.Add((float)Math.Cos(v * Math.PI / 180)); } return nn; } )().GetEnumerator(); /// <summary> /// Demonstrates eternal fetch of next value from an IEnumerator /// At end of list the enumerator is reset to start of list /// </summary> /// <returns></returns> private float GetaNum() { //Advance to next item if (!costable.MoveNext()) { //End of list - reset and advance to first costable.Reset(); costable.MoveNext(); } //Return Enum current value return costable.Current; } }
using System.Collections; class IENumDemo { /// <summary> /// Create a cosinus table enumerator with 0..360 deg values /// </summary> private IEnumerator costable = new Func<List<float>>(() => { List<float> nn = new List<float>(); for (int v = 0; v < 360; v++) { nn.Add((float)Math.Cos(v * Math.PI / 180)); } return nn; } )().GetEnumerator(); /// <summary> /// Demonstrates eternal fetch of next value from an IEnumerator /// At end of list the enumerator is reset to start of list /// </summary> /// <returns></returns> private float GetaNum() { //Advance to next item if (!costable.MoveNext()) { //End of list - reset and advance to first costable.Reset(); costable.MoveNext(); } //Return Enum current value yield return costable.Current; } }
mit
C#
27e6a13fa6d278f53468087c8954328dec2e8937
Update Contact seed data per first/last name change
bradyholt/aspnet-core-react-template,bradyholt/aspnet-core-react-template,bradyholt/aspnet-core-react-template,bradyholt/aspnet-core-react-template,bradyholt/aspnet-core-react-template
api/Models/DefaultDbContextInitializer.cs
api/Models/DefaultDbContextInitializer.cs
using Microsoft.AspNetCore.Identity; using Microsoft.EntityFrameworkCore; using System.Linq; using System.Threading.Tasks; using Microsoft.AspNetCore.Identity.EntityFrameworkCore; namespace aspnetCoreReactTemplate.Models { public class DefaultDbContextInitializer : IDefaultDbContextInitializer { private readonly DefaultDbContext _context; private readonly UserManager<ApplicationUser> _userManager; private readonly RoleManager<IdentityRole> _roleManager; public DefaultDbContextInitializer(DefaultDbContext context, UserManager<ApplicationUser> userManager, RoleManager<IdentityRole> roleManager) { _userManager = userManager; _context = context; _roleManager = roleManager; } public bool EnsureCreated() { return _context.Database.EnsureCreated(); } public void Migrate() { _context.Database.Migrate(); } public async Task Seed() { var email = "user@test.com"; if (await _userManager.FindByEmailAsync(email) == null) { ApplicationUser user = new ApplicationUser { UserName = email, Email = email, EmailConfirmed = true, GivenName = "John Doe" }; await _userManager.CreateAsync(user, "P2ssw0rd!"); } if (_context.Contacts.Any()) { foreach (var u in _context.Contacts) { _context.Remove(u); } } _context.Contacts.Add(new Contact() { lastName = "Finkley", firstName = "Adam", phone = "555-555-5555", email = "adam@somewhere.com" }); _context.Contacts.Add(new Contact() { lastName = "Biles", firstName = "Steven", phone = "555-555-5555", email = "sbiles@somewhere.com" }); _context.SaveChanges(); } } public interface IDefaultDbContextInitializer { bool EnsureCreated(); void Migrate(); Task Seed(); } }
using Microsoft.AspNetCore.Identity; using Microsoft.EntityFrameworkCore; using System.Linq; using System.Threading.Tasks; using Microsoft.AspNetCore.Identity.EntityFrameworkCore; namespace aspnetCoreReactTemplate.Models { public class DefaultDbContextInitializer : IDefaultDbContextInitializer { private readonly DefaultDbContext _context; private readonly UserManager<ApplicationUser> _userManager; private readonly RoleManager<IdentityRole> _roleManager; public DefaultDbContextInitializer(DefaultDbContext context, UserManager<ApplicationUser> userManager, RoleManager<IdentityRole> roleManager) { _userManager = userManager; _context = context; _roleManager = roleManager; } public bool EnsureCreated() { return _context.Database.EnsureCreated(); } public void Migrate() { _context.Database.Migrate(); } public async Task Seed() { var email = "user@test.com"; if (await _userManager.FindByEmailAsync(email) == null) { ApplicationUser user = new ApplicationUser { UserName = email, Email = email, EmailConfirmed = true, GivenName = "John Doe" }; await _userManager.CreateAsync(user, "P2ssw0rd!"); } if (_context.Contacts.Any()) { foreach (var u in _context.Contacts) { _context.Remove(u); } } _context.Contacts.Add(new Contact() { name = "Adam Finkley", phone = "555-555-5555", email = "adam@somewhere.com" }); _context.Contacts.Add(new Contact() { name = "Steven Biles", phone = "555-555-5555", email = "sbiles@somewhere.com" }); _context.SaveChanges(); } } public interface IDefaultDbContextInitializer { bool EnsureCreated(); void Migrate(); Task Seed(); } }
mit
C#
1211a1926f5c0ed60ee1ea3cb92bf66778ce4e12
Add another hat
ArcticEcho/Hatman
Hatman/Commands/Hat.cs
Hatman/Commands/Hat.cs
using System; using System.Collections.Generic; using System.Net; using System.Text.RegularExpressions; using ChatExchangeDotNet; namespace Hatman.Commands { class Hat : ICommand { private readonly Regex ptn = new Regex(@"(?i)\bhats?\b", Extensions.RegOpts); private readonly HashSet<string> hats; public Regex CommandPattern => ptn; public string Description => "Hats, hats, hats, hats, more hats with a side order of hats."; public string Usage => "Hat"; public Hat() { hats = new GoogleImg("silly hats").GetPicUrls(); var moreHats = new GoogleImg("funny hats").GetPicUrls(); foreach (var hat in moreHats) { hats.Add(hat); } hats.Add("http://i.stack.imgur.com/I8zdQ.jpg"); } public void ProcessMessage(Message msg, ref Room rm) { var hat = ""; while (string.IsNullOrWhiteSpace(hat)) { try { var url = hats.PickRandom(); new WebClient().DownloadData(url); hat = url; } catch { hats.Remove(hat); hat = null; } } rm.PostReplyFast(msg, hat); } } }
using System; using System.Collections.Generic; using System.Net; using System.Text.RegularExpressions; using ChatExchangeDotNet; namespace Hatman.Commands { class Hat : ICommand { private readonly Regex ptn = new Regex(@"(?i)^hats?\b", Extensions.RegOpts); private readonly HashSet<string> hats; public Regex CommandPattern => ptn; public string Description => "Hats, hats, hats, hats, more hats with a side order of hats."; public string Usage => "Hat"; public Hat() { hats = new GoogleImg("silly hats").GetPicUrls(); var moreHats = new GoogleImg("funny hats").GetPicUrls(); foreach (var hat in moreHats) { hats.Add(hat); } } public void ProcessMessage(Message msg, ref Room rm) { var hat = ""; while (string.IsNullOrWhiteSpace(hat)) { try { var url = hats.PickRandom(); new WebClient().DownloadData(url); hat = url; } catch { hats.Remove(hat); hat = null; } } rm.PostReplyFast(msg, hat); } } }
isc
C#
ab8fa87fc0ea4596abafffb052d7a1896b8d5308
Update OMCode.cs
ADAPT/ADAPT
source/ADAPT/Documents/OMCode.cs
source/ADAPT/Documents/OMCode.cs
/******************************************************************************* * Copyright (C) 2019 AgGateway; PAIL and ADAPT Contributors * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html <http://www.eclipse.org/legal/epl-v10.html> * * Contributors: 20190430 R. Andres Ferreyra: Translate from PAIL Part 2 Schema * *******************************************************************************/ using System.Collections.Generic; using AgGateway.ADAPT.ApplicationDataModel.Common; namespace AgGateway.ADAPT.ApplicationDataModel.Documents { public class OMCode { public OMCode() { Id = CompoundIdentifierFactory.Instance.Create(); CodeComponentIds = new List<int>(); ContextItems = new List<ContextItem>(); } public CompoundIdentifier Id { get; private set; } public string Code { get; set; } public string PId { get; set; } public string Description { get; set; } public List<int> CodeComponentsIds { get; set; } public List<ContextItem> ContextItems { get; set; } } }
/******************************************************************************* * Copyright (C) 2019 AgGateway; PAIL and ADAPT Contributors * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html <http://www.eclipse.org/legal/epl-v10.html> * * Contributors: R. Andres Ferreyra: Translate from PAIL Part 2 Schema * *******************************************************************************/ namespace AgGateway.ADAPT.ApplicationDataModel.Documents { public class OMCode { public OMCode() { Id = CompoundIdentifierFactory.Instance.Create(); CodeComponentIds = new List<int>(); ContextItems = new List<ContextItem>(); } public CompoundIdentifier Id { get; private set; } public string Code { get; set; } public string PId { get; set; } public string Description { get; set; } public List<int> CodeComponentsIds { get; set; } public List<ContextItem> ContextItems { get; set; } } }
epl-1.0
C#
0c5c39758c1dae78955c76f9c8409863332007ed
Fix auth sample
alaatm/Sejil,alaatm/Sejil,alaatm/Sejil,alaatm/Sejil,alaatm/Sejil
sample/SampleBasicAuth/Startup.cs
sample/SampleBasicAuth/Startup.cs
// Copyright (C) 2017 Alaa Masoud // See the LICENSE file in the project root for more information. using Bazinga.AspNetCore.Authentication.Basic; using System.Threading.Tasks; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Hosting; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; using Sejil; namespace Sample { public class Startup { public IConfiguration Configuration { get; } public Startup(IConfiguration configuration) => Configuration = configuration; // This method gets called by the runtime. Use this method to add services to the container. public void ConfigureServices(IServiceCollection services) { services.AddControllersWithViews(); services.AddAuthentication(BasicAuthenticationDefaults.AuthenticationScheme) .AddBasicAuthentication(credentials => Task.FromResult(credentials.username == "myUsername" && credentials.password == "myPassword") ); services.ConfigureSejil(options => { options.AuthenticationScheme = BasicAuthenticationDefaults.AuthenticationScheme; }); } // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IWebHostEnvironment env) { if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); } else { app.UseExceptionHandler("/Home/Error"); // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts. app.UseHsts(); } app.UseHttpsRedirection(); app.UseStaticFiles(); app.UseRouting(); app.UseAuthentication(); app.UseAuthorization(); app.UseSejil(); app.UseEndpoints(endpoints => { endpoints.MapControllerRoute( name: "default", pattern: "{controller=Home}/{action=Index}/{id?}"); }); } } }
// Copyright (C) 2017 Alaa Masoud // See the LICENSE file in the project root for more information. using Bazinga.AspNetCore.Authentication.Basic; using System.Threading.Tasks; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Hosting; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; using Sejil; namespace Sample { public class Startup { public IConfiguration Configuration { get; } public Startup(IConfiguration configuration) => Configuration = configuration; // This method gets called by the runtime. Use this method to add services to the container. public void ConfigureServices(IServiceCollection services) { services.AddControllersWithViews(); services.AddAuthentication(BasicAuthenticationDefaults.AuthenticationScheme) .AddBasicAuthentication(credentials => Task.FromResult(credentials.username == "myUsername" && credentials.password == "myPassword") ); services.ConfigureSejil(options => { options.AuthenticationScheme = BasicAuthenticationDefaults.AuthenticationScheme; }); } // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IWebHostEnvironment env) { if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); } else { app.UseExceptionHandler("/Home/Error"); // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts. app.UseHsts(); } app.UseHttpsRedirection(); app.UseStaticFiles(); app.UseSejil(); app.UseRouting(); app.UseAuthorization(); app.UseEndpoints(endpoints => { endpoints.MapControllerRoute( name: "default", pattern: "{controller=Home}/{action=Index}/{id?}"); }); } } }
apache-2.0
C#
5ee6eb6141ff6c34697c8a14ce1cb39ddc12da0f
Add Transfer Funds
jzebedee/lcapi
LCAPI/LCAPI/Account.cs
LCAPI/LCAPI/Account.cs
using System.Threading.Tasks; using LendingClub.Models; namespace LendingClub { public class Account : ApiBase { public string InvestorId { get; } public string Url => $"{BaseUrl}/accounts/{InvestorId}"; public Account(string apiKey, string investorId) : base(apiKey) { InvestorId = investorId; } #region Summary protected string SummaryUrl => $"{Url}/summary"; public Task<AccountSummary> GetSummaryAsync() { return Client.GetAsync<AccountSummary>(SummaryUrl); } #endregion #region Available Cash protected string AvailableCashUrl => $"{Url}/availablecash"; public Task<AccountAvailableCash> GetAvailableCashAsync() { return Client.GetAsync<AccountAvailableCash>(AvailableCashUrl); } #endregion #region Transfer Funds protected string AddFundsUrl => $"{Url}/funds/add"; public Task<AccountAvailableCash> AddFundsAsync() { return Client.GetAsync<AccountAvailableCash>(AddFundsUrl); } protected string WithdrawFundsUrl => $"{Url}/funds/withdraw"; public Task<AccountAvailableCash> WithdrawFundsAsync() { return Client.GetAsync<AccountAvailableCash>(WithdrawFundsUrl); } #endregion } }
using System.Threading.Tasks; using LendingClub.Models; namespace LendingClub { public class Account : ApiBase { public string InvestorId { get; } public string Url => $"{BaseUrl}/accounts/{InvestorId}"; public Account(string apiKey, string investorId) : base(apiKey) { InvestorId = investorId; } #region Summary protected string SummaryUrl => $"{Url}/summary"; public Task<AccountSummary> GetSummaryAsync() { return Client.GetAsync<AccountSummary>(SummaryUrl); } #endregion #region AvailableCash protected string AvailableCashUrl => $"{Url}/availablecash"; public Task<AccountAvailableCash> GetAvailableCashAsync() { return Client.GetAsync<AccountAvailableCash>(AvailableCashUrl); } #endregion } }
agpl-3.0
C#
67ae7784cad8622afd5c599b99c353bafc1fdab1
Update IZoomService.cs
wieslawsoltes/Draw2D,wieslawsoltes/Draw2D,wieslawsoltes/Draw2D
src/Draw2D/Input/IZoomService.cs
src/Draw2D/Input/IZoomService.cs
// Copyright (c) Wiesław Šoltés. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. namespace Draw2D.Input { public interface IZoomService { IInputService InputService { get; set; } double ZoomSpeed { get; set; } double ZoomX { get; set; } double ZoomY { get; set; } double OffsetX { get; set; } double OffsetY { get; set; } bool IsPanning { get; set; } void Wheel(double delta, double x, double y); void Pressed(double x, double y); void Released(double x, double y); void Moved(double x, double y); void Invalidate(bool redraw); void ZoomTo(double zoom, double x, double y); void ZoomDeltaTo(double delta, double x, double y); void StartPan(double x, double y); void PanTo(double x, double y); void Reset(); void Center(double panelWidth, double panelHeight, double elementWidth, double elementHeight); void Fill(double panelWidth, double panelHeight, double elementWidth, double elementHeight); void Uniform(double panelWidth, double panelHeight, double elementWidth, double elementHeight); void UniformToFill(double panelWidth, double panelHeight, double elementWidth, double elementHeight); } }
// Copyright (c) Wiesław Šoltés. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. namespace Draw2D.Input { public interface IZoomService { double ZoomSpeed { get; set; } double ZoomX { get; set; } double ZoomY { get; set; } double OffsetX { get; set; } double OffsetY { get; set; } IInputService InputService { get; set; } bool IsPanning { get; set; } void Wheel(double delta, double x, double y); void Pressed(double x, double y); void Released(double x, double y); void Moved(double x, double y); void Invalidate(bool redraw); void ZoomTo(double zoom, double x, double y); void ZoomDeltaTo(double delta, double x, double y); void StartPan(double x, double y); void PanTo(double x, double y); void Reset(); void Center(double panelWidth, double panelHeight, double elementWidth, double elementHeight); void Fill(double panelWidth, double panelHeight, double elementWidth, double elementHeight); void Uniform(double panelWidth, double panelHeight, double elementWidth, double elementHeight); void UniformToFill(double panelWidth, double panelHeight, double elementWidth, double elementHeight); } }
mit
C#
4a4d9b0dc6ef79a48c5718ae6d3e211095f0aa02
Update description to match mania mirror implementation
NeoAdonis/osu,NeoAdonis/osu,peppy/osu,NeoAdonis/osu,peppy/osu,ppy/osu,smoogipoo/osu,smoogipoo/osu,peppy/osu-new,UselessToucan/osu,smoogipooo/osu,UselessToucan/osu,UselessToucan/osu,smoogipoo/osu,ppy/osu,peppy/osu,ppy/osu
osu.Game.Rulesets.Osu/Mods/OsuModMirror.cs
osu.Game.Rulesets.Osu/Mods/OsuModMirror.cs
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. using System; using osu.Framework.Bindables; using osu.Game.Configuration; using osu.Game.Rulesets.Mods; using osu.Game.Rulesets.Objects; using osu.Game.Rulesets.Osu.Objects; using osu.Game.Rulesets.Osu.Utils; namespace osu.Game.Rulesets.Osu.Mods { public class OsuModMirror : ModMirror, IApplicableToHitObject { public override string Description => "Flip objects on the chosen axes."; public override Type[] IncompatibleMods => new[] { typeof(ModHardRock) }; [SettingSource("Mirrored axes", "Choose which axes objects are mirrored over.")] public Bindable<MirrorType> Reflection { get; } = new Bindable<MirrorType>(); public void ApplyToHitObject(HitObject hitObject) { var osuObject = (OsuHitObject)hitObject; switch (Reflection.Value) { case MirrorType.Horizontal: OsuHitObjectGenerationUtils.ReflectHorizontally(osuObject); break; case MirrorType.Vertical: OsuHitObjectGenerationUtils.ReflectVertically(osuObject); break; case MirrorType.Both: OsuHitObjectGenerationUtils.ReflectHorizontally(osuObject); OsuHitObjectGenerationUtils.ReflectVertically(osuObject); break; } } public enum MirrorType { Horizontal, Vertical, Both } } }
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. using System; using osu.Framework.Bindables; using osu.Game.Configuration; using osu.Game.Rulesets.Mods; using osu.Game.Rulesets.Objects; using osu.Game.Rulesets.Osu.Objects; using osu.Game.Rulesets.Osu.Utils; namespace osu.Game.Rulesets.Osu.Mods { public class OsuModMirror : ModMirror, IApplicableToHitObject { public override string Description => "Reflect the playfield."; public override Type[] IncompatibleMods => new[] { typeof(ModHardRock) }; [SettingSource("Mirrored axes", "Choose which of the playfield's axes are mirrored.")] public Bindable<MirrorType> Reflection { get; } = new Bindable<MirrorType>(); public void ApplyToHitObject(HitObject hitObject) { var osuObject = (OsuHitObject)hitObject; switch (Reflection.Value) { case MirrorType.Horizontal: OsuHitObjectGenerationUtils.ReflectHorizontally(osuObject); break; case MirrorType.Vertical: OsuHitObjectGenerationUtils.ReflectVertically(osuObject); break; case MirrorType.Both: OsuHitObjectGenerationUtils.ReflectHorizontally(osuObject); OsuHitObjectGenerationUtils.ReflectVertically(osuObject); break; } } public enum MirrorType { Horizontal, Vertical, Both } } }
mit
C#
792f62229422ed5b15624fc83e66c24b00085765
Fix style
jagt/fullserializer,zodsoft/fullserializer,jagt/fullserializer,nuverian/fullserializer,Ksubaka/fullserializer,darress/fullserializer,Ksubaka/fullserializer,lazlo-bonin/fullserializer,shadowmint/fullserializer,jacobdufault/fullserializer,karlgluck/fullserializer,jacobdufault/fullserializer,caiguihou/myprj_02,shadowmint/fullserializer,shadowmint/fullserializer,Ksubaka/fullserializer,jacobdufault/fullserializer,jagt/fullserializer
Testing/Editor/PropertiesTests.cs
Testing/Editor/PropertiesTests.cs
using NUnit.Framework; namespace FullSerializer.Tests.PropertiesTests { public class Model { [fsProperty] public int Getter { get { return 3; } } [fsIgnore] public int _setValue; [fsProperty] public int Setter { set { _setValue = value; } } } public class MemberSerializationTests { [Test] public void TestSerializeReadOnlyProperty() { var model = new Model(); fsData data; var serializer = new fsSerializer(); Assert.IsTrue(serializer.TrySerialize(model, out data).Succeeded); var expected = fsData.CreateDictionary(); expected.AsDictionary["Getter"] = new fsData(model.Getter); Assert.AreEqual(expected, data); } [Test] public void TestDeserializeWriteOnlyProperty() { var data = fsData.CreateDictionary(); data.AsDictionary["Getter"] = new fsData(111); // not used, but somewhat verifies that we do not try to deserialize into a R/O property data.AsDictionary["Setter"] = new fsData(222); var model = default(Model); var serializer = new fsSerializer(); Assert.IsTrue(serializer.TryDeserialize(data, ref model).Succeeded); Assert.AreEqual(222, model._setValue); } } }
using NUnit.Framework; namespace FullSerializer.Tests.PropertiesTests { public class Model { [fsProperty] public int Getter { get { return 3; } } [fsIgnore] public int _setValue; [fsProperty] public int Setter { set { _setValue = value; } } } public class MemberSerializationTests { [Test] public void TestSerializeReadOnlyProperty() { var model = new Model(); fsData data; var serializer = new fsSerializer(); Assert.IsTrue(serializer.TrySerialize(model, out data).Succeeded); var expected = fsData.CreateDictionary(); expected.AsDictionary["Getter"] = new fsData(model.Getter); Assert.AreEqual(expected, data); } [Test] public void TestDeserializeWriteOnlyProperty() { var data = fsData.CreateDictionary(); data.AsDictionary["Getter"] = new fsData(111); // not used, but somewhat verifies that we do not try to deserialize into a R/O property data.AsDictionary["Setter"] = new fsData(222); var model = default(Model); var serializer = new fsSerializer(); Assert.IsTrue(serializer.TryDeserialize(data, ref model).Succeeded); Assert.AreEqual(222, model._setValue); } } }
mit
C#
85c0e02808a18de74fd1acb4f1b8b3cdd6ecbfd8
Add marker
mstrother/BmpListener
src/BmpListener/Bgp/BgpHeader.cs
src/BmpListener/Bgp/BgpHeader.cs
using System; using System.Linq; namespace BmpListener.Bgp { public class BgpHeader { public BgpHeader(byte[] data, int offset) { Decode(data, offset); } public byte[] Marker { get; } = new byte[16]; public int Length { get; private set; } public BgpMessageType Type { get; private set; } public void Decode(byte[] data, int offset) { Array.Copy(data, offset, Marker, 0, 16); Array.Reverse(data, offset + 16, 2); Length = BitConverter.ToInt16(data, offset + 16); Type = (BgpMessageType)data[offset + 18]; } } }
using System; namespace BmpListener.Bgp { public class BgpHeader { public BgpHeader(byte[] data, int offset) { Decode(data, offset); } public int Length { get; private set; } public BgpMessageType Type { get; private set; } public void Decode(byte[] data, int offset) { Array.Reverse(data, offset + 16, 2); Length = BitConverter.ToInt16(data, offset + 16); Type = (BgpMessageType)data[offset + 18]; } } }
mit
C#
589e987a52a04a0eeafa5337d888b7c66a9462ad
Update version to 2016.0.0 beta1.
Bloomcredit/SSH.NET,sshnet/SSH.NET,miniter/SSH.NET
src/Renci.SshNet/Properties/CommonAssemblyInfo.cs
src/Renci.SshNet/Properties/CommonAssemblyInfo.cs
using System; using System.Reflection; using System.Runtime.InteropServices; [assembly: AssemblyDescription("SSH.NET is a Secure Shell (SSH) library for .NET, optimized for parallelism.")] [assembly: AssemblyCompany("Renci")] [assembly: AssemblyProduct("SSH.NET")] [assembly: AssemblyCopyright("Copyright Renci 2010-2016")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] [assembly: AssemblyVersion("2016.0.0")] [assembly: AssemblyFileVersion("2016.0.0")] [assembly: AssemblyInformationalVersion("2016.0.0-beta1")] [assembly: CLSCompliant(false)] // 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)] #if DEBUG [assembly: AssemblyConfiguration("Debug")] #else [assembly: AssemblyConfiguration("Release")] #endif
using System; using System.Reflection; using System.Runtime.InteropServices; [assembly: AssemblyDescription("SSH.NET is a Secure Shell (SSH) library for .NET, optimized for parallelism.")] [assembly: AssemblyCompany("Renci")] [assembly: AssemblyProduct("SSH.NET")] [assembly: AssemblyCopyright("Copyright Renci 2010-2014")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] [assembly: AssemblyVersion("2014.4.6")] [assembly: AssemblyFileVersion("2014.4.6")] [assembly: AssemblyInformationalVersion("2014.4.6-beta2")] [assembly: CLSCompliant(false)] // 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)] #if DEBUG [assembly: AssemblyConfiguration("Debug")] #else [assembly: AssemblyConfiguration("Release")] #endif
mit
C#
bdf8106cd2f4d7cdb97dd12a3128002796f4e3fb
Improve test naming
tommarien/zenini
src/Zenini.Tests/Model/An_IniSettings_instance.cs
src/Zenini.Tests/Model/An_IniSettings_instance.cs
using System.Collections.Generic; using System.Linq; using NUnit.Framework; using Shouldly; using Zenini.Model; namespace Zenini.Tests.Model { [TestFixture] public class An_IniSettings_instance { [SetUp] public void Setup() { sectionOne = new Section("SectionOne", new Dictionary<string, string>()); sectionTwo = new Section("SectionTwo", new Dictionary<string, string>()); var dictionary = new Dictionary<string, ISection>(); dictionary.Add(sectionOne.Name, sectionOne); dictionary.Add(sectionTwo.Name, sectionTwo); settings = new IniSettings(dictionary); } private ISection sectionOne; private ISection sectionTwo; private IIniSettings settings; [Test] public void has_an_indexer_that_returns_a_section() { settings["SectionOne"].ShouldBeSameAs(sectionOne); } [Test] public void has_an_indexer_that_returns_an_empty_section_if_none_match() { settings["sectionthree"].ShouldBeSameAs(Section.Empty); } [Test] public void is_a_container_of_sections() { settings.Count().ShouldBe(2); } } }
using System.Collections.Generic; using System.Linq; using NUnit.Framework; using Shouldly; using Zenini.Model; namespace Zenini.Tests.Model { [TestFixture] public class An_IniSettings_instance { [SetUp] public void Setup() { sectionOne = new Section("SectionOne", new Dictionary<string, string>()); sectionTwo = new Section("SectionTwo", new Dictionary<string, string>()); var dictionary = new Dictionary<string, ISection>(); dictionary.Add(sectionOne.Name, sectionOne); dictionary.Add(sectionTwo.Name, sectionTwo); settings = new IniSettings(dictionary); } private ISection sectionOne; private ISection sectionTwo; private IIniSettings settings; [Test] public void has_an_indexer_that_returns_an_empty_section_if_none_match() { settings["sectionthree"].ShouldBeSameAs(Section.Empty); } [Test] public void has_an_indexer_to_return_a_section() { settings["SectionOne"].ShouldBeSameAs(sectionOne); } [Test] public void is_a_container_of_settings() { settings.Count().ShouldBe(2); } } }
mit
C#
5df5478eb5a6db3c48fdea0d1f1d7a41b05c87c5
Make ToBuffer internal, as was intended.
jskeet/edulinq,jskeet/edulinq,zhangz/edulinq,jskeet/edulinq,iainholder/edulinq,iainholder/edulinq,pyaria/edulinq,zhangz/edulinq,pyaria/edulinq
src/Edulinq/ToBuffer.cs
src/Edulinq/ToBuffer.cs
#region Copyright and license information // Copyright 2010-2011 Jon Skeet // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. #endregion using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace Edulinq { public static partial class Enumerable { internal static TSource[] ToBuffer<TSource>(this IEnumerable<TSource> source, out int count) { // Optimize for ICollection<T> ICollection<TSource> collection = source as ICollection<TSource>; if (collection != null) { count = collection.Count; TSource[] tmp = new TSource[count]; collection.CopyTo(tmp, 0); return tmp; } // We'll have to loop through, creating and copying arrays as we go TSource[] ret = new TSource[16]; int tmpCount = 0; foreach (TSource item in source) { // Need to expand... if (tmpCount == ret.Length) { Array.Resize(ref ret, ret.Length * 2); } ret[tmpCount++] = item; } count = tmpCount; return ret; } } }
#region Copyright and license information // Copyright 2010-2011 Jon Skeet // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. #endregion using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace Edulinq { public static partial class Enumerable { public static TSource[] ToBuffer<TSource>(this IEnumerable<TSource> source, out int count) { // Optimize for ICollection<T> ICollection<TSource> collection = source as ICollection<TSource>; if (collection != null) { count = collection.Count; TSource[] tmp = new TSource[count]; collection.CopyTo(tmp, 0); return tmp; } // We'll have to loop through, creating and copying arrays as we go TSource[] ret = new TSource[16]; int tmpCount = 0; foreach (TSource item in source) { // Need to expand... if (tmpCount == ret.Length) { Array.Resize(ref ret, ret.Length * 2); } ret[tmpCount++] = item; } count = tmpCount; return ret; } } }
apache-2.0
C#
b908e15c49728f788fa6da1907c443da2a98f16b
Update Sentry DSN
mattgwagner/Battery-Commander,mattgwagner/Battery-Commander,mattgwagner/Battery-Commander,mattgwagner/Battery-Commander
Battery-Commander.Web/Program.cs
Battery-Commander.Web/Program.cs
namespace BatteryCommander.Web { using Microsoft.AspNetCore.Hosting; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.Hosting; using Serilog; using Serilog.Core; public class Program { public static LoggingLevelSwitch LogLevel { get; } = new LoggingLevelSwitch(Serilog.Events.LogEventLevel.Information); public static void Main(string[] args) { CreateHostBuilder(args).Build().Run(); } private static IHostBuilder CreateHostBuilder(string[] args) => Host.CreateDefaultBuilder(args) .ConfigureWebHostDefaults(webBuilder => { webBuilder .UseSentry(dsn: "https://78e464f7456f49a98e500e78b0bb4b13@o255975.ingest.sentry.io/1447369") .UseStartup<Startup>(); }) .ConfigureLogging((context, builder) => { Log.Logger = new LoggerConfiguration() .Enrich.FromLogContext() .Enrich.WithProperty("Application", context.HostingEnvironment.ApplicationName) .Enrich.WithProperty("Environment", context.HostingEnvironment.EnvironmentName) .Enrich.WithProperty("Version", $"{typeof(Startup).Assembly.GetName().Version}") .WriteTo.Seq(serverUrl: "http://redlegdev-logs.eastus.azurecontainer.io", apiKey: context.Configuration.GetValue<string>("Seq:ApiKey"), compact: true, controlLevelSwitch: LogLevel) .MinimumLevel.ControlledBy(LogLevel) .CreateLogger(); builder.AddSerilog(); }); } }
namespace BatteryCommander.Web { using Microsoft.AspNetCore.Hosting; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.Hosting; using Serilog; using Serilog.Core; public class Program { public static LoggingLevelSwitch LogLevel { get; } = new LoggingLevelSwitch(Serilog.Events.LogEventLevel.Information); public static void Main(string[] args) { CreateHostBuilder(args).Build().Run(); } private static IHostBuilder CreateHostBuilder(string[] args) => Host.CreateDefaultBuilder(args) .ConfigureWebHostDefaults(webBuilder => { webBuilder .UseSentry(dsn: "https://78e464f7456f49a98e500e78b0bb4b13@sentry.io/1447369") .UseStartup<Startup>(); }) .ConfigureLogging((context, builder) => { Log.Logger = new LoggerConfiguration() .Enrich.FromLogContext() .Enrich.WithProperty("Application", context.HostingEnvironment.ApplicationName) .Enrich.WithProperty("Environment", context.HostingEnvironment.EnvironmentName) .Enrich.WithProperty("Version", $"{typeof(Startup).Assembly.GetName().Version}") .WriteTo.Seq(serverUrl: "http://redlegdev-logs.eastus.azurecontainer.io", apiKey: context.Configuration.GetValue<string>("Seq:ApiKey"), compact: true, controlLevelSwitch: LogLevel) .MinimumLevel.ControlledBy(LogLevel) .CreateLogger(); builder.AddSerilog(); }); } }
mit
C#
3d318cbfba9acd1704bd1dc1076e423144ddce9f
Bump 0.15.1
lstefano71/Nowin,pysco68/Nowin,Bobris/Nowin,pysco68/Nowin,et1975/Nowin,et1975/Nowin,modulexcite/Nowin,pysco68/Nowin,modulexcite/Nowin,lstefano71/Nowin,lstefano71/Nowin,Bobris/Nowin,et1975/Nowin,Bobris/Nowin,modulexcite/Nowin
Nowin/Properties/AssemblyInfo.cs
Nowin/Properties/AssemblyInfo.cs
using System.Reflection; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("Nowin")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Boris Letocha")] [assembly: AssemblyProduct("Nowin")] [assembly: AssemblyCopyright("Copyright © 2014")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("fd085b68-3766-42af-ab6d-351b7741c685")] // 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.15.1.0")] [assembly: AssemblyFileVersion("0.15.1.0")]
using System.Reflection; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("Nowin")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Boris Letocha")] [assembly: AssemblyProduct("Nowin")] [assembly: AssemblyCopyright("Copyright © 2014")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("fd085b68-3766-42af-ab6d-351b7741c685")] // 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.15.0.0")] [assembly: AssemblyFileVersion("0.15.0.0")]
mit
C#
7e4309e9df3155b7f72b6c5f07e44d6697fa3957
Add test for inherited ignores
ericsink/sqlite-net,praeclarum/sqlite-net,arlm/sqlite-net
tests/IgnoreTest.cs
tests/IgnoreTest.cs
using System; using System.Collections.Generic; using System.Linq; using SQLite; #if NETFX_CORE using Microsoft.VisualStudio.TestPlatform.UnitTestFramework; using SetUp = Microsoft.VisualStudio.TestPlatform.UnitTestFramework.TestInitializeAttribute; using TearDown = Microsoft.VisualStudio.TestPlatform.UnitTestFramework.TestCleanupAttribute; using TestFixture = Microsoft.VisualStudio.TestPlatform.UnitTestFramework.TestClassAttribute; using Test = Microsoft.VisualStudio.TestPlatform.UnitTestFramework.TestMethodAttribute; #else using NUnit.Framework; #endif namespace SQLite.Tests { [TestFixture] public class IgnoreTest { public class TestObj { [AutoIncrement, PrimaryKey] public int Id { get; set; } public string Text { get; set; } [SQLite.Ignore] public Dictionary<int, string> Edibles { get { return this._edibles; } set { this._edibles = value; } } protected Dictionary<int, string> _edibles = new Dictionary<int, string>(); [SQLite.Ignore] public string IgnoredText { get; set; } public override string ToString () { return string.Format("[TestObj: Id={0}]", Id); } } [Test] public void MappingIgnoreColumn () { var db = new TestDb (); var m = db.GetMapping<TestObj> (); Assert.AreEqual (2, m.Columns.Length); } [Test] public void CreateTableSucceeds () { var db = new TestDb (); db.CreateTable<TestObj> (); } [Test] public void InsertSucceeds () { var db = new TestDb (); db.CreateTable<TestObj> (); var o = new TestObj { Text = "Hello", IgnoredText = "World", }; db.Insert (o); Assert.AreEqual (1, o.Id); } [Test] public void GetDoesntHaveIgnores () { var db = new TestDb (); db.CreateTable<TestObj> (); var o = new TestObj { Text = "Hello", IgnoredText = "World", }; db.Insert (o); var oo = db.Get<TestObj> (o.Id); Assert.AreEqual ("Hello", oo.Text); Assert.AreEqual (null, oo.IgnoredText); } public class BaseClass { [Ignore] public string ToIgnore { get; set; } } public class TableClass : BaseClass { public string Name { get; set; } } [Test] public void BaseIgnores () { var db = new TestDb (); db.CreateTable<TableClass> (); var o = new TableClass { ToIgnore = "Hello", Name = "World", }; db.Insert (o); var oo = db.Table<TableClass> ().First (); Assert.AreEqual (null, oo.ToIgnore); Assert.AreEqual ("World", oo.Name); } } }
using System; using System.Collections.Generic; using System.Linq; using SQLite; #if NETFX_CORE using Microsoft.VisualStudio.TestPlatform.UnitTestFramework; using SetUp = Microsoft.VisualStudio.TestPlatform.UnitTestFramework.TestInitializeAttribute; using TearDown = Microsoft.VisualStudio.TestPlatform.UnitTestFramework.TestCleanupAttribute; using TestFixture = Microsoft.VisualStudio.TestPlatform.UnitTestFramework.TestClassAttribute; using Test = Microsoft.VisualStudio.TestPlatform.UnitTestFramework.TestMethodAttribute; #else using NUnit.Framework; #endif namespace SQLite.Tests { [TestFixture] public class IgnoreTest { public class TestObj { [AutoIncrement, PrimaryKey] public int Id { get; set; } public string Text { get; set; } [SQLite.Ignore] public Dictionary<int, string> Edibles { get { return this._edibles; } set { this._edibles = value; } } protected Dictionary<int, string> _edibles = new Dictionary<int, string>(); [SQLite.Ignore] public string IgnoredText { get; set; } public override string ToString () { return string.Format("[TestObj: Id={0}]", Id); } } [Test] public void MappingIgnoreColumn () { var db = new TestDb (); var m = db.GetMapping<TestObj> (); Assert.AreEqual (2, m.Columns.Length); } [Test] public void CreateTableSucceeds () { var db = new TestDb (); db.CreateTable<TestObj> (); } [Test] public void InsertSucceeds () { var db = new TestDb (); db.CreateTable<TestObj> (); var o = new TestObj { Text = "Hello", IgnoredText = "World", }; db.Insert (o); Assert.AreEqual (1, o.Id); } [Test] public void GetDoesntHaveIgnores () { var db = new TestDb (); db.CreateTable<TestObj> (); var o = new TestObj { Text = "Hello", IgnoredText = "World", }; db.Insert (o); var oo = db.Get<TestObj> (o.Id); Assert.AreEqual ("Hello", oo.Text); Assert.AreEqual (null, oo.IgnoredText); } } }
mit
C#
6b1b728c50087f8e0964941008392d9a25c4deac
Update AnalysisResults.cs
smith-chem-wisc/MetaMorpheus,rmillikin/MetaMorpheus,hoffmann4/MetaMorpheus,XRSHEERAN/MetaMorpheus,lonelu/MetaMorpheus,lschaffer2/MetaMorpheus,zrolfs/MetaMorpheus
InternalLogic/AnalysisResults.cs
InternalLogic/AnalysisResults.cs
using System.Collections.Generic; using System.Linq; using System.Text; namespace InternalLogicEngineLayer { public class AnalysisResults : MyResults { #region Public Constructors public AnalysisResults(AnalysisEngine s, List<NewPsmWithFdr>[] allResultingIdentifications, List<ProteinGroup> proteinGroups) : base(s) { this.AllResultingIdentifications = allResultingIdentifications; this.ProteinGroups = proteinGroups; } #endregion Public Constructors #region Public Properties public List<NewPsmWithFdr>[] AllResultingIdentifications { get; private set; } public List<ProteinGroup> ProteinGroups { get; private set; } #endregion Public Properties #region Protected Properties protected override string StringForOutput { get { var sb = new StringBuilder(); sb.Append("\t\tAll PSMS within 1% FDR: " + string.Join(", ", AllResultingIdentifications.Select(b => b.Count(c => c.qValue <= 0.01)))); if (ProteinGroups != null) sb.Append("\n\t\tAll proteins within 1% FDR: " + string.Join(", ", ProteinGroups.Count(c => c.QValue <= 0.01))); return sb.ToString(); } } #endregion Protected Properties } }
using System.Collections.Generic; using System.Linq; using System.Text; namespace InternalLogicEngineLayer { public class AnalysisResults : MyResults { #region Public Constructors public AnalysisResults(AnalysisEngine s, List<NewPsmWithFdr>[] allResultingIdentifications, List<ProteinGroup> proteinGroups) : base(s) { this.AllResultingIdentifications = allResultingIdentifications; this.ProteinGroups = proteinGroups; } #endregion Public Constructors #region Public Properties public List<NewPsmWithFdr>[] AllResultingIdentifications { get; private set; } public List<ProteinGroup> ProteinGroups { get; private set; } #endregion Public Properties #region Protected Properties protected override string StringForOutput { get { var sb = new StringBuilder(); sb.Append("\t\tAll PSMS within 1% FDR: " + string.Join(", ", AllResultingIdentifications.Select(b => b.Count(c => c.qValue <= 0.01)))); if (proteinGroups != null) sb.Append("\n\t\tAll proteins within 1% FDR: " + string.Join(", ", proteinGroups.Count(c => c.QValue <= 0.01))); return sb.ToString(); } } #endregion Protected Properties } }
mit
C#
4cbe71f4882cec9d87b1739bb7ed7c40c422c438
Fix formatting of table load errors
TheBerkin/Rant
Rant/Vocabulary/RantTableLoadException.cs
Rant/Vocabulary/RantTableLoadException.cs
using System; using Rant.Localization; namespace Rant.Vocabulary { /// <summary> /// Thrown when Rant encounters an error while loading a dictionary table. /// </summary> public sealed class RantTableLoadException : Exception { internal RantTableLoadException(string origin, int line, int col, string messageType, params object[] messageArgs) : base($"{Txtres.GetString("src-line-col", origin, line, col)} {Txtres.GetString(messageType, messageArgs)}") { Line = line; Column = col; Origin = origin; } /// <summary> /// Gets the line number on which the error occurred. /// </summary> public int Line { get; } /// <summary> /// Gets the column on which the error occurred. /// </summary> public int Column { get; } /// <summary> /// Gets a string describing where the table was loaded from. For tables loaded from disk, this will be the file path. /// </summary> public string Origin { get; } } }
using System; using Rant.Localization; namespace Rant.Vocabulary { /// <summary> /// Thrown when Rant encounters an error while loading a dictionary table. /// </summary> public sealed class RantTableLoadException : Exception { internal RantTableLoadException(string origin, int line, int col, string messageType, params object[] messageArgs) : base(Txtres.GetString("src-line-col", Txtres.GetString(messageType, messageArgs), line, col)) { Line = line; Column = col; Origin = origin; } /// <summary> /// Gets the line number on which the error occurred. /// </summary> public int Line { get; } /// <summary> /// Gets the column on which the error occurred. /// </summary> public int Column { get; } /// <summary> /// Gets a string describing where the table was loaded from. For tables loaded from disk, this will be the file path. /// </summary> public string Origin { get; } } }
mit
C#
e6f1114bc14301e3791b720ac1b540c17dce51c0
Add COTP.ReadTSDU test
killnine/s7netplus,daGnutt/s7netplus
S7.Net.UnitTest/ProtocolTests.cs
S7.Net.UnitTest/ProtocolTests.cs
using System; using System.Collections.Generic; using System.Linq; using System.Text; using Microsoft.VisualStudio.TestTools.UnitTesting; using S7.Net; using System.IO; using System.Threading.Tasks; namespace S7.Net.UnitTest { [TestClass] public class ProtocolUnitTest { [TestMethod] public void TPKT_Read() { var m = new MemoryStream(StringToByteArray("0300002902f0803203000000010002001400000401ff0400807710000100000103000000033f8ccccd")); var t = TPKT.Read(m); Assert.AreEqual(0x03, t.Version); Assert.AreEqual(0x29, t.Length); m.Position = 0; t = TPKT.ReadAsync(m).Result; Assert.AreEqual(0x03, t.Version); Assert.AreEqual(0x29, t.Length); } [TestMethod] [ExpectedException(typeof(TPKTInvalidException))] public void TPKT_ReadShort() { var m = new MemoryStream(StringToByteArray("0300002902f0803203000000010002001400000401ff040080")); var t = TPKT.Read(m); } [TestMethod] [ExpectedException(typeof(TPKTInvalidException))] public async Task TPKT_ReadShortAsync() { var m = new MemoryStream(StringToByteArray("0300002902f0803203000000010002001400000401ff040080")); var t = await TPKT.ReadAsync(m); } [TestMethod] public void COTP_ReadTSDU() { var expected = StringToByteArray("320700000400000800080001120411440100ff09000400000000"); var m = new MemoryStream(StringToByteArray("0300000702f0000300000702f0000300002102f080320700000400000800080001120411440100ff09000400000000")); var t = COTP.TSDU.Read(m); Assert.IsTrue(expected.SequenceEqual(t)); m.Position = 0; t = COTP.TSDU.ReadAsync(m).Result; Assert.IsTrue(expected.SequenceEqual(t)); } private static byte[] StringToByteArray(string hex) { return Enumerable.Range(0, hex.Length) .Where(x => x % 2 == 0) .Select(x => Convert.ToByte(hex.Substring(x, 2), 16)) .ToArray(); } } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using Microsoft.VisualStudio.TestTools.UnitTesting; using S7.Net; using System.IO; using System.Threading.Tasks; namespace S7.Net.UnitTest { [TestClass] public class ProtocolUnitTest { [TestMethod] public void TPKT_Read() { var m = new MemoryStream(StringToByteArray("0300002902f0803203000000010002001400000401ff0400807710000100000103000000033f8ccccd")); var t = TPKT.Read(m); Assert.AreEqual(0x03, t.Version); Assert.AreEqual(0x29, t.Length); m.Position = 0; t = TPKT.ReadAsync(m).Result; Assert.AreEqual(0x03, t.Version); Assert.AreEqual(0x29, t.Length); } [TestMethod] [ExpectedException(typeof(TPKTInvalidException))] public void TPKT_ReadShort() { var m = new MemoryStream(StringToByteArray("0300002902f0803203000000010002001400000401ff040080")); var t = TPKT.Read(m); } [TestMethod] [ExpectedException(typeof(TPKTInvalidException))] public async Task TPKT_ReadShortAsync() { var m = new MemoryStream(StringToByteArray("0300002902f0803203000000010002001400000401ff040080")); var t = await TPKT.ReadAsync(m); } private static byte[] StringToByteArray(string hex) { return Enumerable.Range(0, hex.Length) .Where(x => x % 2 == 0) .Select(x => Convert.ToByte(hex.Substring(x, 2), 16)) .ToArray(); } } }
mit
C#
54bb5ad7fa1f82e283bf1a0eeb8ffd86318087d9
remove old copied code
akatakritos/SassSharp
SassSharp/Ast/SassSyntaxTree2.cs
SassSharp/Ast/SassSyntaxTree2.cs
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace SassSharp.Ast { public class SassSyntaxTree2 { public RootNode Root { get; private set; } public SassSyntaxTree2(RootNode root) { this.Root = root; } } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace SassSharp.Ast { public class SassSyntaxTree2 { private IEnumerable<RuleNode> enumerable; public RootNode Root { get; private set; } public SassSyntaxTree2(RootNode root) { this.Root = root; } public SassSyntaxTree2(IEnumerable<RuleNode> enumerable) { // TODO: Complete member initialization this.enumerable = enumerable; } } }
mit
C#
b1ed51e72c313594fcfcb4a02cfe8d14d2f61ad0
Fix missing using directive
qianlifeng/Wox,Wox-launcher/Wox,Wox-launcher/Wox,lances101/Wox,qianlifeng/Wox,qianlifeng/Wox,lances101/Wox
Wox.Infrastructure/Logger/Log.cs
Wox.Infrastructure/Logger/Log.cs
using NLog; using Wox.Infrastructure.Exception; namespace Wox.Infrastructure.Logger { public class Log { private static NLog.Logger logger = LogManager.GetCurrentClassLogger(); public static void Error(System.Exception e) { #if DEBUG throw e; #else while (e.InnerException != null) { logger.Error(e.Message); logger.Error(e.StackTrace); e = e.InnerException; } #endif } public static void Debug(string msg) { System.Diagnostics.Debug.WriteLine($"DEBUG: {msg}"); logger.Debug(msg); } public static void Info(string msg) { System.Diagnostics.Debug.WriteLine($"INFO: {msg}"); logger.Info(msg); } public static void Warn(string msg) { System.Diagnostics.Debug.WriteLine($"WARN: {msg}"); logger.Warn(msg); } public static void Fatal(System.Exception e) { #if DEBUG throw e; #else logger.Fatal(ExceptionFormatter.FormatExcpetion(e)); #endif } } }
using NLog; namespace Wox.Infrastructure.Logger { public class Log { private static NLog.Logger logger = LogManager.GetCurrentClassLogger(); public static void Error(System.Exception e) { #if DEBUG throw e; #else while (e.InnerException != null) { logger.Error(e.Message); logger.Error(e.StackTrace); e = e.InnerException; } #endif } public static void Debug(string msg) { System.Diagnostics.Debug.WriteLine($"DEBUG: {msg}"); logger.Debug(msg); } public static void Info(string msg) { System.Diagnostics.Debug.WriteLine($"INFO: {msg}"); logger.Info(msg); } public static void Warn(string msg) { System.Diagnostics.Debug.WriteLine($"WARN: {msg}"); logger.Warn(msg); } public static void Fatal(System.Exception e) { #if DEBUG throw e; #else logger.Fatal(ExceptionFormatter.FormatExcpetion(e)); #endif } } }
mit
C#
e45fa431e957a64f7407a3a8a8958443bef80b1c
Fix updating screenshots for quicksave
jefftimlin/BetterLoadSaveGame
src/SaveWatcher.cs
src/SaveWatcher.cs
using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Text; namespace BetterLoadSaveGame { class SaveWatcher : IDisposable { private FileSystemWatcher _watcher; public event FileSystemEventHandler OnSave; public SaveWatcher() { _watcher = new FileSystemWatcher(Util.SaveDir); _watcher.Created += FileCreated; _watcher.Changed += FileCreated; _watcher.EnableRaisingEvents = true; } private void FileCreated(object sender, FileSystemEventArgs e) { if (OnSave != null) { OnSave(sender, e); } } public void Dispose() { _watcher.Dispose(); } } }
using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Text; namespace BetterLoadSaveGame { class SaveWatcher : IDisposable { private FileSystemWatcher _watcher; public event FileSystemEventHandler OnSave; public SaveWatcher() { _watcher = new FileSystemWatcher(Util.SaveDir); _watcher.Created += FileCreated; _watcher.EnableRaisingEvents = true; } private void FileCreated(object sender, FileSystemEventArgs e) { if (OnSave != null) { OnSave(sender, e); } } public void Dispose() { _watcher.Dispose(); } } }
mit
C#
a10a52b38693149c829b8035f23e60b4bd0b3cc7
make wallet an ITransactionMonitor
ArsenShnurkov/BitSharp
BitSharp.Core/Wallet/Wallet.cs
BitSharp.Core/Wallet/Wallet.cs
using BitSharp.Common; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace BitSharp.Core.Wallet { public class Wallet : ITransactionMonitor { // addresses private readonly List<WalletAddress> addresses; // current point in the blockchain // entries private readonly List<WalletEntry> entries; public void MintTxOutput(Domain.TxOutput txOutput) { throw new NotImplementedException(); } public void SpendTxOutput(Domain.TxOutput txOutput) { throw new NotImplementedException(); } } }
using BitSharp.Common; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace BitSharp.Core.Wallet { public class Wallet { // addresses private readonly List<WalletAddress> addresses; // current point in the blockchain // entries private readonly List<WalletEntry> entries; } }
unlicense
C#
5c55933dd9c2c3ab414c063976f9e666d9cb22ce
Add Image and description to Book model
msmilkoff/Bookman,msmilkoff/Bookman
Bookman/Bookman.Models/Book.cs
Bookman/Bookman.Models/Book.cs
namespace Bookman.Models { using System.Collections.Generic; using System.ComponentModel.DataAnnotations; public class Book { private ICollection<Review> reviews; public Book() { this.reviews = new HashSet<Review>(); } [Key] public int Id { get; set; } [Required] [StringLength(150)] public string Title { get; set; } [StringLength(200)] public string Description { get; set; } public BookRating Rating { get; set; } public byte[] CoverImage { get; set; } public int CategoryId { get; set; } public virtual Category Category { get; set; } public int AuthorId { get; set; } public virtual Author Author { get; set; } public virtual ICollection<Review> Reviews { get { return this.reviews; } set { this.reviews = value; } } } }
namespace Bookman.Models { using System.Collections.Generic; using System.ComponentModel.DataAnnotations; public class Book { private ICollection<Review> reviews; public Book() { this.reviews = new HashSet<Review>(); } [Key] public int Id { get; set; } [Required] [StringLength(150)] public string Title { get; set; } public BookRating Rating { get; set; } public int CategoryId { get; set; } public virtual Category Category { get; set; } public int AuthorId { get; set; } public virtual Author Author { get; set; } public virtual ICollection<Review> Reviews { get { return this.reviews; } set { this.reviews = value; } } } }
mit
C#
892482e94e165be8aea689b8d9b6573613c7b890
Update default publishing url to point to v2 feed.
chocolatey/nuget-chocolatey,GearedToWar/NuGet2,xoofx/NuGet,jholovacs/NuGet,xoofx/NuGet,xoofx/NuGet,antiufo/NuGet2,alluran/node.net,jholovacs/NuGet,jholovacs/NuGet,OneGet/nuget,antiufo/NuGet2,xoofx/NuGet,mrward/nuget,themotleyfool/NuGet,mrward/NuGet.V2,indsoft/NuGet2,OneGet/nuget,OneGet/nuget,ctaggart/nuget,antiufo/NuGet2,alluran/node.net,GearedToWar/NuGet2,alluran/node.net,zskullz/nuget,ctaggart/nuget,indsoft/NuGet2,chocolatey/nuget-chocolatey,mrward/nuget,mono/nuget,RichiCoder1/nuget-chocolatey,rikoe/nuget,dolkensp/node.net,mrward/nuget,RichiCoder1/nuget-chocolatey,GearedToWar/NuGet2,GearedToWar/NuGet2,atheken/nuget,oliver-feng/nuget,pratikkagda/nuget,RichiCoder1/nuget-chocolatey,pratikkagda/nuget,indsoft/NuGet2,oliver-feng/nuget,GearedToWar/NuGet2,mrward/nuget,jmezach/NuGet2,indsoft/NuGet2,rikoe/nuget,themotleyfool/NuGet,RichiCoder1/nuget-chocolatey,xoofx/NuGet,dolkensp/node.net,themotleyfool/NuGet,zskullz/nuget,chester89/nugetApi,mono/nuget,akrisiun/NuGet,oliver-feng/nuget,jmezach/NuGet2,mrward/NuGet.V2,jholovacs/NuGet,oliver-feng/nuget,RichiCoder1/nuget-chocolatey,chocolatey/nuget-chocolatey,antiufo/NuGet2,mrward/NuGet.V2,jmezach/NuGet2,xoofx/NuGet,jholovacs/NuGet,xero-github/Nuget,zskullz/nuget,mrward/NuGet.V2,kumavis/NuGet,atheken/nuget,chocolatey/nuget-chocolatey,oliver-feng/nuget,mrward/nuget,mono/nuget,ctaggart/nuget,ctaggart/nuget,chocolatey/nuget-chocolatey,OneGet/nuget,RichiCoder1/nuget-chocolatey,zskullz/nuget,antiufo/NuGet2,chocolatey/nuget-chocolatey,indsoft/NuGet2,pratikkagda/nuget,jmezach/NuGet2,mono/nuget,rikoe/nuget,mrward/nuget,mrward/NuGet.V2,GearedToWar/NuGet2,dolkensp/node.net,pratikkagda/nuget,anurse/NuGet,rikoe/nuget,pratikkagda/nuget,oliver-feng/nuget,dolkensp/node.net,jholovacs/NuGet,jmezach/NuGet2,pratikkagda/nuget,mrward/NuGet.V2,chester89/nugetApi,akrisiun/NuGet,antiufo/NuGet2,alluran/node.net,kumavis/NuGet,indsoft/NuGet2,jmezach/NuGet2,anurse/NuGet
Common/NuGetConstants.cs
Common/NuGetConstants.cs
using System; namespace NuGet { public static class NuGetConstants { public static readonly string DefaultFeedUrl = "https://go.microsoft.com/fwlink/?LinkID=230477"; public static readonly string V1FeedUrl = "https://go.microsoft.com/fwlink/?LinkID=206669"; public static readonly string DefaultGalleryServerUrl = "https://www.nuget.org"; public static readonly string DefaultSymbolServerUrl = "http://nuget.gw.symbolsource.org/Public/NuGet"; } }
using System; namespace NuGet { public static class NuGetConstants { public static readonly string DefaultFeedUrl = "https://go.microsoft.com/fwlink/?LinkID=230477"; public static readonly string V1FeedUrl = "https://go.microsoft.com/fwlink/?LinkID=206669"; public static readonly string DefaultGalleryServerUrl = "http://go.microsoft.com/fwlink/?LinkID=207106"; public static readonly string DefaultSymbolServerUrl = "http://nuget.gw.symbolsource.org/Public/NuGet"; } }
apache-2.0
C#
ffdc6c2d6a2f83420f9572b75c058c2babdcf500
bump version of the Granados assembly
poderosaproject/poderosa,ttdoda/poderosa,poderosaproject/poderosa,ttdoda/poderosa,ttdoda/poderosa,poderosaproject/poderosa,poderosaproject/poderosa,poderosaproject/poderosa,ttdoda/poderosa
Granados/AssemblyInfo.cs
Granados/AssemblyInfo.cs
/* Copyright (c) 2005 Poderosa Project, All Rights Reserved. This file is a part of the Granados SSH Client Library that is subject to the license included in the distributed package. You may not use this file except in compliance with the license. * $Id: AssemblyInfo.cs,v 1.6 2011/10/27 23:21:56 kzmi Exp $ */ using System; using System.Reflection; using System.Runtime.CompilerServices; [assembly: AssemblyTitle("Granados")] [assembly: AssemblyDescription("SSH Client Library")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyProduct("")] [assembly: AssemblyCopyright("")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] [assembly: AssemblyVersion("3.0.0")] [assembly: AssemblyDelaySign(false)] [assembly: CLSCompliant(false)]
/* Copyright (c) 2005 Poderosa Project, All Rights Reserved. This file is a part of the Granados SSH Client Library that is subject to the license included in the distributed package. You may not use this file except in compliance with the license. * $Id: AssemblyInfo.cs,v 1.6 2011/10/27 23:21:56 kzmi Exp $ */ using System; using System.Reflection; using System.Runtime.CompilerServices; [assembly: AssemblyTitle("Granados")] [assembly: AssemblyDescription("SSH Client Library")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyProduct("")] [assembly: AssemblyCopyright("")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] [assembly: AssemblyVersion("2.0.0")] [assembly: AssemblyDelaySign(false)] [assembly: CLSCompliant(false)]
apache-2.0
C#
8e9ccd22fd04e70ac282c49d8b49fe04a0bc98e1
Fix bookmark NullRef when loading for the first time
PlayScriptRedux/monomac,dlech/monomac
samples/macdoc/BookmarkManager.cs
samples/macdoc/BookmarkManager.cs
using System; using System.IO; using System.Collections.Generic; using System.Xml.Serialization; namespace macdoc { public enum BookmarkEventType { Added, Deleted, Modified } public class BookmarkManagerEventsArgs : EventArgs { public BookmarkManager.Entry Entry { get; set; } public BookmarkEventType EventType { get; set; } } public class BookmarkManager { public class Entry { public string Name { get; set; } public string Url { get; set; } public string Notes { get; set; } } readonly string storagePath; List<Entry> bookmarks; IList<Entry> readonlyVersion; XmlSerializer serializer = new XmlSerializer (typeof (List<Entry>)); public event EventHandler<BookmarkManagerEventsArgs> BookmarkListChanged; public BookmarkManager (string storagePath) { this.storagePath = storagePath; LoadBookmarks (); } public IList<Entry> GetAllBookmarks () { return readonlyVersion; } public void AddBookmark (Entry entry) { if (entry == null) throw new ArgumentNullException ("entry"); bookmarks.Add (entry); FireChangedEvent (entry, BookmarkEventType.Added); } public bool DeleteBookmark (Entry entry) { var result = bookmarks.Remove (entry); if (result) FireChangedEvent (entry, BookmarkEventType.Deleted); return result; } public bool LoadBookmarks () { var path = Path.Combine (storagePath, "bookmarks.xml"); if (!File.Exists (path)) { bookmarks = new List<Entry> (); readonlyVersion = bookmarks.AsReadOnly (); return false; } using (var file = File.OpenRead (path)) bookmarks = (List<Entry>)serializer.Deserialize (file); readonlyVersion = bookmarks.AsReadOnly (); return true; } public void SaveBookmarks () { if (!Directory.Exists (storagePath)) Directory.CreateDirectory (storagePath); var path = Path.Combine (storagePath, "bookmarks.xml"); using (var file = File.Create (path)) serializer.Serialize (file, bookmarks); } public void CommitBookmarkChange (Entry entry) { FireChangedEvent (entry, BookmarkEventType.Modified); } void FireChangedEvent (Entry entry, BookmarkEventType evtType) { var temp = BookmarkListChanged; if (temp != null) temp (this, new BookmarkManagerEventsArgs () { Entry = entry, EventType = evtType }); } } }
using System; using System.IO; using System.Collections.Generic; using System.Xml.Serialization; namespace macdoc { public enum BookmarkEventType { Added, Deleted, Modified } public class BookmarkManagerEventsArgs : EventArgs { public BookmarkManager.Entry Entry { get; set; } public BookmarkEventType EventType { get; set; } } public class BookmarkManager { public class Entry { public string Name { get; set; } public string Url { get; set; } public string Notes { get; set; } } readonly string storagePath; List<Entry> bookmarks; IList<Entry> readonlyVersion; XmlSerializer serializer = new XmlSerializer (typeof (List<Entry>)); public event EventHandler<BookmarkManagerEventsArgs> BookmarkListChanged; public BookmarkManager (string storagePath) { this.storagePath = storagePath; LoadBookmarks (); } public IList<Entry> GetAllBookmarks () { return readonlyVersion; } public void AddBookmark (Entry entry) { if (entry == null) throw new ArgumentNullException ("entry"); bookmarks.Add (entry); FireChangedEvent (entry, BookmarkEventType.Added); } public bool DeleteBookmark (Entry entry) { var result = bookmarks.Remove (entry); if (result) FireChangedEvent (entry, BookmarkEventType.Deleted); return result; } public bool LoadBookmarks () { var path = Path.Combine (storagePath, "bookmarks.xml"); if (!File.Exists (path)) { bookmarks = new List<Entry> (); return false; } using (var file = File.OpenRead (path)) bookmarks = (List<Entry>)serializer.Deserialize (file); readonlyVersion = bookmarks.AsReadOnly (); return true; } public void SaveBookmarks () { if (!Directory.Exists (storagePath)) Directory.CreateDirectory (storagePath); var path = Path.Combine (storagePath, "bookmarks.xml"); using (var file = File.Create (path)) serializer.Serialize (file, bookmarks); } public void CommitBookmarkChange (Entry entry) { FireChangedEvent (entry, BookmarkEventType.Modified); } void FireChangedEvent (Entry entry, BookmarkEventType evtType) { var temp = BookmarkListChanged; if (temp != null) temp (this, new BookmarkManagerEventsArgs () { Entry = entry, EventType = evtType }); } } }
apache-2.0
C#
771df86f66ae777b7e616c70f0fa15ebc77a18f3
Allow message TimeStamp to be set when deserializing
Intelliflo/JustSaying,eric-davis/JustSaying,Intelliflo/JustSaying
JustSaying.Models/Message.cs
JustSaying.Models/Message.cs
using System; namespace JustSaying.Models { public abstract class Message { protected Message() { TimeStamp = DateTime.UtcNow; Id = Guid.NewGuid(); } public Guid Id { get; set; } public DateTime TimeStamp { get; set; } public string RaisingComponent { get; set; } public string Version{ get; private set; } public string SourceIp { get; private set; } public string Tenant { get; set; } public string Conversation { get; set; } //footprint in order to avoid the same message being processed multiple times. public virtual string UniqueKey() { return Id.ToString(); } } }
using System; namespace JustSaying.Models { public abstract class Message { protected Message() { TimeStamp = DateTime.UtcNow; Id = Guid.NewGuid(); } public Guid Id { get; set; } public DateTime TimeStamp { get; private set; } public string RaisingComponent { get; set; } public string Version{ get; private set; } public string SourceIp { get; private set; } public string Tenant { get; set; } public string Conversation { get; set; } //footprint in order to avoid the same message being processed multiple times. public virtual string UniqueKey() { return Id.ToString(); } } }
apache-2.0
C#
c5a57de76391d05ec02d096d58d81aac9c75849a
Add UnionWith to Maps.
garbervetsky/analysis-net
Backend/Utils/Map.cs
Backend/Utils/Map.cs
// Copyright (c) Edgardo Zoppi. All Rights Reserved. Licensed under the MIT License. See License.txt in the project root for license information. using System; using System.Collections.Generic; using System.Linq; using System.Text; using Backend.Model; using Model; namespace Backend.Utils { public class Map<TKey, TValue, TCollection> : Dictionary<TKey, TCollection> where TCollection : ICollection<TValue>, new() { public void Add(TKey key) { this.AddKeyAndGetValues(key); } public void Add(TKey key, TValue value) { var collection = this.AddKeyAndGetValues(key); collection.Add(value); } public void AddRange(TKey key, IEnumerable<TValue> values) { var collection = this.AddKeyAndGetValues(key); collection.AddRange(values); } public void UnionWith(Map<TKey, TValue, TCollection> oth) { foreach (var entry in oth) { this.AddRange(entry.Key, entry.Value); } } private TCollection AddKeyAndGetValues(TKey key) { TCollection result; if (this.ContainsKey(key)) { result = this[key]; } else { result = new TCollection(); this.Add(key, result); } return result; } } public class MapSet<TKey, TValue> : Map<TKey, TValue, HashSet<TValue>> { public MapSet(): base() { } public MapSet(MapSet<TKey, TValue> map) { this.AddRange(map); } public bool MapEquals(MapSet<TKey, TValue> other) { Func<ISet<TValue>, ISet<TValue>, bool> setEquals = (a, b) => a.SetEquals(b); return this.DictionaryEquals(other, setEquals); } } public class MapList<TKey, TValue> : Map<TKey, TValue, List<TValue>> { public bool MapEquals(MapList<TKey, TValue> other) { Func<IList<TValue>, IList<TValue>, bool> listEquals = (a, b) => a.SequenceEqual(b); return this.DictionaryEquals(other, listEquals); } } }
// Copyright (c) Edgardo Zoppi. All Rights Reserved. Licensed under the MIT License. See License.txt in the project root for license information. using System; using System.Collections.Generic; using System.Linq; using System.Text; using Backend.Model; using Model; namespace Backend.Utils { public class Map<TKey, TValue, TCollection> : Dictionary<TKey, TCollection> where TCollection : ICollection<TValue>, new() { public void Add(TKey key) { this.AddKeyAndGetValues(key); } public void Add(TKey key, TValue value) { var collection = this.AddKeyAndGetValues(key); collection.Add(value); } public void AddRange(TKey key, IEnumerable<TValue> values) { var collection = this.AddKeyAndGetValues(key); collection.AddRange(values); } private TCollection AddKeyAndGetValues(TKey key) { TCollection result; if (this.ContainsKey(key)) { result = this[key]; } else { result = new TCollection(); this.Add(key, result); } return result; } } public class MapSet<TKey, TValue> : Map<TKey, TValue, HashSet<TValue>> { public MapSet(): base() { } public MapSet(MapSet<TKey, TValue> map) { this.AddRange(map); } public bool MapEquals(MapSet<TKey, TValue> other) { Func<ISet<TValue>, ISet<TValue>, bool> setEquals = (a, b) => a.SetEquals(b); return this.DictionaryEquals(other, setEquals); } } public class MapList<TKey, TValue> : Map<TKey, TValue, List<TValue>> { public bool MapEquals(MapList<TKey, TValue> other) { Func<IList<TValue>, IList<TValue>, bool> listEquals = (a, b) => a.SequenceEqual(b); return this.DictionaryEquals(other, listEquals); } } }
mit
C#
b133b90baf2ae6cf22298e8397f3620f04e8dac5
build 7.1.9.0
agileharbor/channelAdvisorAccess
src/Global/GlobalAssemblyInfo.cs
src/Global/GlobalAssemblyInfo.cs
using System; using System.Reflection; using System.Runtime.InteropServices; [ assembly : ComVisible( false ) ] [ assembly : AssemblyProduct( "ChannelAdvisorAccess" ) ] [ assembly : AssemblyCompany( "Agile Harbor, LLC" ) ] [ assembly : AssemblyCopyright( "Copyright (C) Agile Harbor, LLC" ) ] [ assembly : AssemblyDescription( "ChannelAdvisor webservices API wrapper." ) ] [ assembly : AssemblyTrademark( "" ) ] [ assembly : AssemblyCulture( "" ) ] [ assembly : CLSCompliant( false ) ] // 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.*")] // Keep in track with CA API version [ assembly : AssemblyVersion( "7.1.9.0" ) ]
using System; using System.Reflection; using System.Runtime.InteropServices; [ assembly : ComVisible( false ) ] [ assembly : AssemblyProduct( "ChannelAdvisorAccess" ) ] [ assembly : AssemblyCompany( "Agile Harbor, LLC" ) ] [ assembly : AssemblyCopyright( "Copyright (C) Agile Harbor, LLC" ) ] [ assembly : AssemblyDescription( "ChannelAdvisor webservices API wrapper." ) ] [ assembly : AssemblyTrademark( "" ) ] [ assembly : AssemblyCulture( "" ) ] [ assembly : CLSCompliant( false ) ] // 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.*")] // Keep in track with CA API version [ assembly : AssemblyVersion( "7.1.8.0" ) ]
bsd-3-clause
C#
2023f608bb90b76673d5419256d866842e99b332
Define icons for new task classes.
nuke-build/nuke,nuke-build/nuke,nuke-build/nuke,nuke-build/nuke
source/Nuke.Common/IconClasses.cs
source/Nuke.Common/IconClasses.cs
// Copyright Matthias Koch 2017. // Distributed under the MIT License. // https://github.com/nuke-build/nuke/blob/master/LICENSE using System; using System.Linq; using Nuke.Common; using Nuke.Common.ChangeLog; using Nuke.Common.Git; using Nuke.Common.Gitter; using Nuke.Common.IO; using Nuke.Common.Tools.CoverallsNet; using Nuke.Common.Tools.DocFx; using Nuke.Common.Tools.DotCover; using Nuke.Common.Tools.DotNet; using Nuke.Common.Tools.DupFinder; using Nuke.Common.Tools.Git; using Nuke.Common.Tools.GitLink; using Nuke.Common.Tools.GitReleaseManager; using Nuke.Common.Tools.GitVersion; using Nuke.Common.Tools.InspectCode; using Nuke.Common.Tools.MSBuild; using Nuke.Common.Tools.Npm; using Nuke.Common.Tools.NuGet; using Nuke.Common.Tools.Nunit; using Nuke.Common.Tools.Octopus; using Nuke.Common.Tools.OpenCover; using Nuke.Common.Tools.Paket; using Nuke.Common.Tools.ReportGenerator; using Nuke.Common.Tools.SignTool; using Nuke.Common.Tools.TestCloud; using Nuke.Common.Tools.VsTest; using Nuke.Common.Tools.WebConfigTransformRunner; using Nuke.Common.Tools.Xunit; using Nuke.Core.Execution; [assembly: IconClass(typeof(ChangelogTasks), "books")] [assembly: IconClass(typeof(CoverallsNetTasks), "pie-chart4")] [assembly: IconClass(typeof(DefaultSettings), "equalizer")] [assembly: IconClass(typeof(DocFxTasks), "books")] [assembly: IconClass(typeof(DotCoverTasks), "shield2")] [assembly: IconClass(typeof(DotNetTasks), "fire")] [assembly: IconClass(typeof(DupFinderTasks), "code")] [assembly: IconClass(typeof(GitTasks), "git")] [assembly: IconClass(typeof(GitLinkTasks), "link")] [assembly: IconClass(typeof(GitReleaseManagerTasks), "books")] [assembly: IconClass(typeof(GitRepository), "git")] [assembly: IconClass(typeof(GitterTasks), "bubbles")] [assembly: IconClass(typeof(GitVersionTasks), "podium")] [assembly: IconClass(typeof(InspectCodeTasks), "code")] [assembly: IconClass(typeof(MSBuildTasks), "sword")] [assembly: IconClass(typeof(NpmTasks), "box")] [assembly: IconClass(typeof(NuGetTasks), "box")] [assembly: IconClass(typeof(NunitTasks), "bug2")] [assembly: IconClass(typeof(OctopusTasks), "cloud-upload")] [assembly: IconClass(typeof(OpenCoverTasks), "shield2")] [assembly: IconClass(typeof(PaketTasks), "box")] [assembly: IconClass(typeof(ReportGeneratorTasks), "pie-chart4")] [assembly: IconClass(typeof(SerializationTasks), "transmission2")] [assembly: IconClass(typeof(SignToolTasks), "key")] [assembly: IconClass(typeof(TestCloudTasks), "bug2")] [assembly: IconClass(typeof(TextTasks), "file-text3")] [assembly: IconClass(typeof(VsTestTasks), "bug2")] [assembly: IconClass(typeof(WebConfigTransformRunnerTasks), "bug2")] [assembly: IconClass(typeof(XmlTasks), "file-empty2")] [assembly: IconClass(typeof(XunitTasks), "bug2")] #if !NETCORE [assembly: IconClass(typeof(FtpTasks), "sphere2")] [assembly: IconClass(typeof(HttpTasks), "sphere2")] #endif
// Copyright Matthias Koch 2017. // Distributed under the MIT License. // https://github.com/nuke-build/nuke/blob/master/LICENSE using System; using System.Linq; using Nuke.Common; using Nuke.Common.Git; using Nuke.Common.IO; using Nuke.Common.Tools.CoverallsNet; using Nuke.Common.Tools.DocFx; using Nuke.Common.Tools.DotCover; using Nuke.Common.Tools.DotNet; using Nuke.Common.Tools.DupFinder; using Nuke.Common.Tools.GitLink; using Nuke.Common.Tools.GitReleaseManager; using Nuke.Common.Tools.GitVersion; using Nuke.Common.Tools.InspectCode; using Nuke.Common.Tools.MSBuild; using Nuke.Common.Tools.Npm; using Nuke.Common.Tools.NuGet; using Nuke.Common.Tools.Nunit; using Nuke.Common.Tools.Octopus; using Nuke.Common.Tools.OpenCover; using Nuke.Common.Tools.Paket; using Nuke.Common.Tools.ReportGenerator; using Nuke.Common.Tools.SignTool; using Nuke.Common.Tools.TestCloud; using Nuke.Common.Tools.VsTest; using Nuke.Common.Tools.Xunit; using Nuke.Core.Execution; [assembly: IconClass(typeof(CoverallsNetTasks), "pie-chart4")] [assembly: IconClass(typeof(DefaultSettings), "equalizer")] [assembly: IconClass(typeof(DocFxTasks), "books")] [assembly: IconClass(typeof(DotCoverTasks), "shield2")] [assembly: IconClass(typeof(DotNetTasks), "fire")] [assembly: IconClass(typeof(DupFinderTasks), "code")] [assembly: IconClass(typeof(GitLinkTasks), "link")] [assembly: IconClass(typeof(GitReleaseManagerTasks), "books")] [assembly: IconClass(typeof(GitRepository), "git")] [assembly: IconClass(typeof(GitVersionTasks), "podium")] [assembly: IconClass(typeof(InspectCodeTasks), "code")] [assembly: IconClass(typeof(MSBuildTasks), "sword")] [assembly: IconClass(typeof(NpmTasks), "box")] [assembly: IconClass(typeof(NuGetTasks), "box")] [assembly: IconClass(typeof(NunitTasks), "bug2")] [assembly: IconClass(typeof(OctopusTasks), "cloud-upload")] [assembly: IconClass(typeof(OpenCoverTasks), "shield2")] [assembly: IconClass(typeof(PaketTasks), "box")] [assembly: IconClass(typeof(ReportGeneratorTasks), "pie-chart4")] [assembly: IconClass(typeof(SerializationTasks), "transmission2")] [assembly: IconClass(typeof(SignToolTasks), "key")] [assembly: IconClass(typeof(TestCloudTasks), "bug2")] [assembly: IconClass(typeof(TextTasks), "file-text3")] [assembly: IconClass(typeof(VsTestTasks), "bug2")] [assembly: IconClass(typeof(XmlTasks), "file-empty2")] [assembly: IconClass(typeof(XunitTasks), "bug2")] #if !NETCORE [assembly: IconClass(typeof(FtpTasks), "sphere2")] [assembly: IconClass(typeof(HttpTasks), "sphere2")] #endif
mit
C#
6165f6940ddbab7d320c88d008a58fedae491aed
fix tests mistake
raphaelheitor/calendary
src.test/DateTimeExtensionTest.cs
src.test/DateTimeExtensionTest.cs
using System; using NUnit.Framework; using ExtensionMethods; namespace src.test { [TestFixture] class DateTimeExtensionTest { [Test] public void GivenADateShouldReturnTomorrowDate() { var d1 = new DateTime(2016, 9, 5); Assert.AreEqual(new DateTime(2016, 9, 6).ToShortDateString(), d1.Tomorrow().ToShortDateString()); } [Test] public void GivenADateShouldReturnYesterdayDate() { var d1 = new DateTime(2016, 9, 5); Assert.AreEqual(new DateTime(2016, 9, 4).ToShortDateString(), d1.Yesterday().ToShortDateString()); } [Test] public void GivenADateShouldReturnTheAge() { var d1 = DateTime.Now.AddYears(-20).AddDays(5); Assert.AreEqual(19, d1.Age()); } [Test] public void GivenADateShouldReturnTheAgeInDays() { var d1 = DateTime.Now.AddDays(-15); Assert.AreEqual(15, d1.AgeInDays()); } } }
using System; using NUnit.Framework; using ExtensionMethods; namespace src.test { [TestFixture] class DateTimeExtensionTest { [Test] public void GivenADateShouldReturnTomorrowDate() { var d1 = new DateTime(2016, 9, 5); Assert.AreEqual(d1.Tomorrow().ToShortDateString(), new DateTime(2016, 9, 4).ToShortDateString()); } [Test] public void GivenADateShouldReturnYesterdayDate() { var d1 = new DateTime(2016, 9, 5); Assert.AreEqual(d1.Yesterday().ToShortDateString(), new DateTime(2016, 9, 6).ToShortDateString()); } [Test] public void GivenADateShouldReturnTheAge() { var d1 = DateTime.Now.AddYears(-20).AddDays(5); Assert.AreEqual(19, d1.Age()); } [Test] public void GivenADateShouldReturnTheAgeInDays() { var d1 = DateTime.Now.AddDays(-15); Assert.AreEqual(15, d1.AgeInDays()); } } }
apache-2.0
C#
01c86dcf5ae8a8e5e449850754eb86dda94512b1
Bump version to 0.6.3
ar3cka/Journalist
src/SolutionInfo.cs
src/SolutionInfo.cs
// <auto-generated/> using System.Reflection; [assembly: AssemblyProductAttribute("Journalist")] [assembly: AssemblyVersionAttribute("0.6.3")] [assembly: AssemblyInformationalVersionAttribute("0.6.3")] [assembly: AssemblyFileVersionAttribute("0.6.3")] [assembly: AssemblyCompanyAttribute("Anton Mednonogov")] namespace System { internal static class AssemblyVersionInformation { internal const string Version = "0.6.3"; } }
// <auto-generated/> using System.Reflection; [assembly: AssemblyProductAttribute("Journalist")] [assembly: AssemblyVersionAttribute("0.6.2")] [assembly: AssemblyInformationalVersionAttribute("0.6.2")] [assembly: AssemblyFileVersionAttribute("0.6.2")] [assembly: AssemblyCompanyAttribute("Anton Mednonogov")] namespace System { internal static class AssemblyVersionInformation { internal const string Version = "0.6.2"; } }
apache-2.0
C#
3382b24673a04bd5d3404a004cb5eb88f8e87d29
Remove duplicate OnClickHandler
iridinite/shiftdrive
Client/TextButton.cs
Client/TextButton.cs
/* ** Project ShiftDrive ** (C) Mika Molenkamp, 2016. */ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; namespace ShiftDrive { /// <summary> /// Represents an interactive text button. /// </summary> internal sealed class TextButton : Button { public string Caption { get; set; } public TextButton(int order, int x, int y, int width, int height, string caption) : base(order, x, y, width, height) { this.Caption = caption; } public override void Draw(SpriteBatch spriteBatch) { base.Draw(spriteBatch); if (expand < 1f) return; int textOffset = (state == 2) ? 7 : 4; Vector2 txtSize = Assets.fontDefault.MeasureString(Caption); spriteBatch.DrawString( Assets.fontDefault, Caption, new Vector2( (int)(x + width / 2 - txtSize.X / 2), (int)(y + height / 2 - txtSize.Y / 2 + textOffset)), Color.Black); } } }
/* ** Project ShiftDrive ** (C) Mika Molenkamp, 2016. */ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; namespace ShiftDrive { internal delegate void OnClickHandler(Control sender); /// <summary> /// Represents an interactive text button. /// </summary> internal sealed class TextButton : Button { public string Caption { get; set; } public TextButton(int order, int x, int y, int width, int height, string caption) : base(order, x, y, width, height) { this.Caption = caption; } public override void Draw(SpriteBatch spriteBatch) { base.Draw(spriteBatch); if (expand < 1f) return; int textOffset = (state == 2) ? 7 : 4; Vector2 txtSize = Assets.fontDefault.MeasureString(Caption); spriteBatch.DrawString( Assets.fontDefault, Caption, new Vector2( (int)(x + width / 2 - txtSize.X / 2), (int)(y + height / 2 - txtSize.Y / 2 + textOffset)), Color.Black); } } }
bsd-3-clause
C#
d833f5bfbb39e2a65f0825bf42d559faac3b0e10
Rename Load() to Instance for DependencyContext
rakeshsinghranchi/core-setup,janvorli/core-setup,weshaggard/core-setup,zamont/core-setup,ravimeda/core-setup,chcosta/core-setup,vivmishra/core-setup,schellap/core-setup,chcosta/core-setup,vivmishra/core-setup,janvorli/core-setup,ramarag/core-setup,karajas/core-setup,karajas/core-setup,joperezr/core-setup,ramarag/core-setup,ericstj/core-setup,wtgodbe/core-setup,joperezr/core-setup,crummel/dotnet_core-setup,wtgodbe/core-setup,ellismg/core-setup,zamont/core-setup,schellap/core-setup,zamont/core-setup,ericstj/core-setup,ellismg/core-setup,janvorli/core-setup,rakeshsinghranchi/core-setup,zamont/core-setup,vivmishra/core-setup,steveharter/core-setup,karajas/core-setup,rakeshsinghranchi/core-setup,cakine/core-setup,steveharter/core-setup,MichaelSimons/core-setup,gkhanna79/core-setup,crummel/dotnet_core-setup,cakine/core-setup,crummel/dotnet_core-setup,cakine/core-setup,wtgodbe/core-setup,ramarag/core-setup,cakine/core-setup,ericstj/core-setup,ellismg/core-setup,weshaggard/core-setup,karajas/core-setup,gkhanna79/core-setup,crummel/dotnet_core-setup,ravimeda/core-setup,chcosta/core-setup,zamont/core-setup,wtgodbe/core-setup,schellap/core-setup,crummel/dotnet_core-setup,ramarag/core-setup,karajas/core-setup,ravimeda/core-setup,steveharter/core-setup,crummel/dotnet_core-setup,chcosta/core-setup,ramarag/core-setup,rakeshsinghranchi/core-setup,rakeshsinghranchi/core-setup,ellismg/core-setup,joperezr/core-setup,wtgodbe/core-setup,chcosta/core-setup,gkhanna79/core-setup,ericstj/core-setup,MichaelSimons/core-setup,vivmishra/core-setup,steveharter/core-setup,vivmishra/core-setup,weshaggard/core-setup,weshaggard/core-setup,ericstj/core-setup,schellap/core-setup,MichaelSimons/core-setup,vivmishra/core-setup,ravimeda/core-setup,ravimeda/core-setup,joperezr/core-setup,schellap/core-setup,ravimeda/core-setup,karajas/core-setup,steveharter/core-setup,chcosta/core-setup,MichaelSimons/core-setup,ericstj/core-setup,ramarag/core-setup,joperezr/core-setup,wtgodbe/core-setup,janvorli/core-setup,cakine/core-setup,MichaelSimons/core-setup,gkhanna79/core-setup,janvorli/core-setup,joperezr/core-setup,steveharter/core-setup,zamont/core-setup,MichaelSimons/core-setup,cakine/core-setup,ellismg/core-setup,ellismg/core-setup,rakeshsinghranchi/core-setup,weshaggard/core-setup,gkhanna79/core-setup,gkhanna79/core-setup,janvorli/core-setup,schellap/core-setup,weshaggard/core-setup
DependencyContext.cs
DependencyContext.cs
// Copyright (c) .NET Foundation and contributors. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. using System; using System.IO; using System.Reflection; using System.Collections.Generic; namespace Microsoft.Extensions.DependencyModel { public class DependencyContext { private const string DepsResourceSufix = ".deps.json"; private static Lazy<DependencyContext> _defaultContext = new Lazy<DependencyContext>(LoadDefault); public DependencyContext(string target, string runtime, CompilationOptions compilationOptions, Library[] compileLibraries, Library[] runtimeLibraries) { Target = target; Runtime = runtime; CompilationOptions = compilationOptions; CompileLibraries = compileLibraries; RuntimeLibraries = runtimeLibraries; } public static DependencyContext Default => _defaultContext.Value; public string Target { get; } public string Runtime { get; } public CompilationOptions CompilationOptions { get; } public IReadOnlyList<Library> CompileLibraries { get; } public IReadOnlyList<Library> RuntimeLibraries { get; } private static DependencyContext LoadDefault() { var entryAssembly = (Assembly)typeof(Assembly).GetTypeInfo().GetDeclaredMethod("GetEntryAssembly").Invoke(null, null); var stream = entryAssembly.GetManifestResourceStream(entryAssembly.GetName().Name + DepsResourceSufix); if (stream == null) { throw new InvalidOperationException("Entry assembly was compiled without `preserveCompilationContext` enabled"); } using (stream) { return Load(stream); } } public static DependencyContext Load(Stream stream) { return new DependencyContextReader().Read(stream); } } }
// Copyright (c) .NET Foundation and contributors. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. using System; using System.IO; using System.Reflection; using System.Collections.Generic; namespace Microsoft.Extensions.DependencyModel { public class DependencyContext { private const string DepsResourceSufix = ".deps.json"; public DependencyContext(string target, string runtime, CompilationOptions compilationOptions, Library[] compileLibraries, Library[] runtimeLibraries) { Target = target; Runtime = runtime; CompilationOptions = compilationOptions; CompileLibraries = compileLibraries; RuntimeLibraries = runtimeLibraries; } public string Target { get; } public string Runtime { get; } public CompilationOptions CompilationOptions { get; } public IReadOnlyList<Library> CompileLibraries { get; } public IReadOnlyList<Library> RuntimeLibraries { get; } public static DependencyContext Load() { var entryAssembly = (Assembly)typeof(Assembly).GetTypeInfo().GetDeclaredMethod("GetEntryAssembly").Invoke(null, null); var stream = entryAssembly.GetManifestResourceStream(entryAssembly.GetName().Name + DepsResourceSufix); if (stream == null) { throw new InvalidOperationException("Entry assembly was compiled without `preserveCompilationContext` enabled"); } using (stream) { return Load(stream); } } public static DependencyContext Load(Stream stream) { return new DependencyContextReader().Read(stream); } } }
mit
C#
47eaf8ed9878a157298fee20c48d96f193308ae5
Check if preset specified by Config file exists first Whoops! Can't believe I forgot to check for this. Thanks, Sajid!
Radfordhound/HedgeLib,Radfordhound/HedgeLib
HedgeEdit/Config.cs
HedgeEdit/Config.cs
using System; using System.IO; using System.Windows.Forms; using System.Xml.Linq; using HedgeLib; namespace HedgeEdit { public static class Config { // Variables/Constants public static string InputPreset = DefaultInputPreset; public static readonly string ConfigDir = Path.Combine(Environment.GetFolderPath( Environment.SpecialFolder.ApplicationData), Program.Name); public static readonly string FilePath = Path.Combine(ConfigDir, FileName); public const string DefaultInputPreset = "Default"; public const string FileName = "Config.xml"; public const float Version = 1.0f; // Methods public static void Load() { if (!File.Exists(FilePath)) return; var xml = XDocument.Load(FilePath); float version = xml.Root.GetFloatAttr("Version"); // Input Preset var presetNameElem = xml.Root.Element("InputPreset"); if (!string.IsNullOrEmpty(presetNameElem?.Value)) { InputPreset = presetNameElem.Value; string pth = Path.Combine(Program.InputPresetsDirectory, $"{InputPreset}{Input.PresetExtension}"); if (File.Exists(pth)) Input.LoadPreset(pth); } } public static void Save() { var root = new XElement("Config"); root.AddAttr("Version", Version); // Input Preset root.Add(new XElement("InputPreset", InputPreset)); // Save the XML File var xml = new XDocument(root); Directory.CreateDirectory(ConfigDir); xml.Save(FilePath); } } }
using System; using System.IO; using System.Windows.Forms; using System.Xml.Linq; using HedgeLib; namespace HedgeEdit { public static class Config { // Variables/Constants public static string InputPreset = DefaultInputPreset; public static readonly string ConfigDir = Path.Combine(Environment.GetFolderPath( Environment.SpecialFolder.ApplicationData), Program.Name); public static readonly string FilePath = Path.Combine(ConfigDir, FileName); public const string DefaultInputPreset = "Default"; public const string FileName = "Config.xml"; public const float Version = 1.0f; // Methods public static void Load() { if (!File.Exists(FilePath)) return; var xml = XDocument.Load(FilePath); float version = xml.Root.GetFloatAttr("Version"); // Input Preset var presetNameElem = xml.Root.Element("InputPreset"); if (!string.IsNullOrEmpty(presetNameElem?.Value)) { InputPreset = presetNameElem.Value; Input.LoadPreset(Path.Combine(Program.InputPresetsDirectory, $"{InputPreset}{Input.PresetExtension}")); } } public static void Save() { var root = new XElement("Config"); root.AddAttr("Version", Version); // Input Preset root.Add(new XElement("InputPreset", InputPreset)); // Save the XML File var xml = new XDocument(root); Directory.CreateDirectory(ConfigDir); xml.Save(FilePath); } } }
mit
C#
216c705ecc344d9f386c811483f0da8b598ca7fe
Fix the PyGILState_STATE type
pythonnet/pythonnet,QuantConnect/pythonnet,pythonnet/pythonnet,pythonnet/pythonnet,QuantConnect/pythonnet,QuantConnect/pythonnet
src/runtime/native/PyGILState.cs
src/runtime/native/PyGILState.cs
namespace Python.Runtime.Native; /// <remarks><c>PyGILState_STATE</c></remarks> enum PyGILState { PyGILState_LOCKED, PyGILState_UNLOCKED }
using System; using System.Runtime.InteropServices; namespace Python.Runtime.Native; /// <remarks><c>PyGILState_STATE</c></remarks> [StructLayout(LayoutKind.Sequential)] struct PyGILState { IntPtr handle; }
mit
C#
7fd38d82ee5b1c65df102d0a81d3e508f2db1c41
Bump version to 0.22
mpOzelot/Unity,mpOzelot/Unity,github-for-unity/Unity,github-for-unity/Unity,github-for-unity/Unity
common/SolutionInfo.cs
common/SolutionInfo.cs
#pragma warning disable 436 using System.Reflection; using System.Resources; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; [assembly: AssemblyProduct("GitHub for Unity")] [assembly: AssemblyVersion(System.AssemblyVersionInformation.Version)] [assembly: AssemblyFileVersion(System.AssemblyVersionInformation.Version)] [assembly: AssemblyInformationalVersion(System.AssemblyVersionInformation.Version)] [assembly: ComVisible(false)] [assembly: AssemblyCompany("GitHub, Inc.")] [assembly: AssemblyCopyright("Copyright GitHub, Inc. 2017")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] [assembly: NeutralResourcesLanguage("en-US")] [assembly: InternalsVisibleTo("TestUtils", AllInternalsVisible = true)] [assembly: InternalsVisibleTo("UnitTests", AllInternalsVisible = true)] [assembly: InternalsVisibleTo("IntegrationTests", AllInternalsVisible = true)] [assembly: InternalsVisibleTo("TaskSystemIntegrationTests", AllInternalsVisible = true)] //Required for NSubstitute [assembly: InternalsVisibleTo("DynamicProxyGenAssembly2", AllInternalsVisible = true)] //Required for Unity compilation [assembly: InternalsVisibleTo("Assembly-CSharp-Editor", AllInternalsVisible = true)] namespace System { internal static class AssemblyVersionInformation { internal const string Version = "0.22.0"; } }
#pragma warning disable 436 using System.Reflection; using System.Resources; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; [assembly: AssemblyProduct("GitHub for Unity")] [assembly: AssemblyVersion(System.AssemblyVersionInformation.Version)] [assembly: AssemblyFileVersion(System.AssemblyVersionInformation.Version)] [assembly: AssemblyInformationalVersion(System.AssemblyVersionInformation.Version)] [assembly: ComVisible(false)] [assembly: AssemblyCompany("GitHub, Inc.")] [assembly: AssemblyCopyright("Copyright GitHub, Inc. 2017")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] [assembly: NeutralResourcesLanguage("en-US")] [assembly: InternalsVisibleTo("TestUtils", AllInternalsVisible = true)] [assembly: InternalsVisibleTo("UnitTests", AllInternalsVisible = true)] [assembly: InternalsVisibleTo("IntegrationTests", AllInternalsVisible = true)] [assembly: InternalsVisibleTo("TaskSystemIntegrationTests", AllInternalsVisible = true)] //Required for NSubstitute [assembly: InternalsVisibleTo("DynamicProxyGenAssembly2", AllInternalsVisible = true)] //Required for Unity compilation [assembly: InternalsVisibleTo("Assembly-CSharp-Editor", AllInternalsVisible = true)] namespace System { internal static class AssemblyVersionInformation { internal const string Version = "0.21.0"; } }
mit
C#
65fac8a2f6c1ed3a6548bad6c9e56e6b79b3351a
remove some text
BlairwareDevelopment/Kickball,BlairwareDevelopment/Kickball,BlairwareDevelopment/Kickball
Kickball/Views/Home/Index.cshtml
Kickball/Views/Home/Index.cshtml
@{ ViewBag.Title = "Home Page"; } <div class="jumbotron"> <h1>ASP.NET</h1> <p class="lead">ASP.NET is a free web framework for building great Web sites and Web appons using HTML, CSS and JavaScript.</p> <p><a href="http://asp.net" class="btn btn-primary btn-lg">Learn more &raquo;</a></p> </div> <div class="row"> <div class="col-md-4"> <h2>Getting started</h2> <p> ASP.NET MVC gives you a powerful, patterns-based way to build dynamic websites that enables a clean separation of concerns and gives you full control over markup for enjoyable, agile development. </p> <p><a class="btn btn-default" href="http://go.microsoft.com/fwlink/?LinkId=301865">Learn more &raquo;</a></p> </div> <div class="col-md-4"> <h2>Get more libraries</h2> <p>NuGet is a free Visual Studio extension that makes it easy to add, remove, and update libraries and tools in Visual Studio projects.</p> <p><a class="btn btn-default" href="http://go.microsoft.com/fwlink/?LinkId=301866">Learn more &raquo;</a></p> </div> <div class="col-md-4"> <h2>Web Hosting</h2> <p>You can easily find a web hosting company that offers the right mix of features and price for your applications.</p> <p><a class="btn btn-default" href="http://go.microsoft.com/fwlink/?LinkId=301867">Learn more &raquo;</a></p> </div> </div>
@{ ViewBag.Title = "Home Page"; } <div class="jumbotron"> <h1>ASP.NET</h1> <p class="lead">ASP.NET is a free web framework for building great Web sites and Web applications using HTML, CSS and JavaScript.</p> <p><a href="http://asp.net" class="btn btn-primary btn-lg">Learn more &raquo;</a></p> </div> <div class="row"> <div class="col-md-4"> <h2>Getting started</h2> <p> ASP.NET MVC gives you a powerful, patterns-based way to build dynamic websites that enables a clean separation of concerns and gives you full control over markup for enjoyable, agile development. </p> <p><a class="btn btn-default" href="http://go.microsoft.com/fwlink/?LinkId=301865">Learn more &raquo;</a></p> </div> <div class="col-md-4"> <h2>Get more libraries</h2> <p>NuGet is a free Visual Studio extension that makes it easy to add, remove, and update libraries and tools in Visual Studio projects.</p> <p><a class="btn btn-default" href="http://go.microsoft.com/fwlink/?LinkId=301866">Learn more &raquo;</a></p> </div> <div class="col-md-4"> <h2>Web Hosting</h2> <p>You can easily find a web hosting company that offers the right mix of features and price for your applications.</p> <p><a class="btn btn-default" href="http://go.microsoft.com/fwlink/?LinkId=301867">Learn more &raquo;</a></p> </div> </div>
mit
C#
671925413940c26c29d9de0b9e51b7bceac92114
Add content search paths to MacGameController in Mac Test project to fix issues with font assets not being found.
mono/CocosSharp,mono/CocosSharp
tests/tests/MacGameController.cs
tests/tests/MacGameController.cs
 using System; using System.Collections.Generic; using System.Linq; using MonoMac.Foundation; using MonoMac.AppKit; using MonoMac.OpenGL; using CGRect = System.Drawing.RectangleF; using CocosSharp; namespace tests { public partial class MacGameController : MonoMac.AppKit.NSWindowController { #region Constructors // Called when created from unmanaged code public MacGameController(IntPtr handle) : base(handle) { Initialize(); } // Called when created directly from a XIB file [Export("initWithCoder:")] public MacGameController(NSCoder coder) : base(coder) { Initialize(); } // Call to load from the XIB/NIB file public MacGameController() : base("MacGameWindow") { Initialize(); } public override void AwakeFromNib() { base.AwakeFromNib(); gameView.ViewCreated += LoadGame; AppDelegate.SharedWindow = gameView; } // Shared initialization code void Initialize() { } #endregion void LoadGame(object sender, EventArgs e) { CCGameView gameView = sender as CCGameView; if (gameView != null) { var contentSearchPaths = new List<string>() { "fonts", "sounds" }; gameView.DesignResolution = new CCSizeI (1024, 768); gameView.Stats.Enabled = true; gameView.ContentManager.SearchPaths = contentSearchPaths; CCScene gameScene = new CCScene (gameView); gameScene.AddLayer(new TestController()); gameView.RunWithScene (gameScene); } } //strongly typed window accessor public new MacGameWindow Window { get { return (MacGameWindow)base.Window; } } } }
 using System; using System.Collections.Generic; using System.Linq; using MonoMac.Foundation; using MonoMac.AppKit; using MonoMac.OpenGL; using CGRect = System.Drawing.RectangleF; using CocosSharp; namespace tests { public partial class MacGameController : MonoMac.AppKit.NSWindowController { #region Constructors // Called when created from unmanaged code public MacGameController(IntPtr handle) : base(handle) { Initialize(); } // Called when created directly from a XIB file [Export("initWithCoder:")] public MacGameController(NSCoder coder) : base(coder) { Initialize(); } // Call to load from the XIB/NIB file public MacGameController() : base("MacGameWindow") { Initialize(); } public override void AwakeFromNib() { base.AwakeFromNib(); gameView.ViewCreated += LoadGame; AppDelegate.SharedWindow = gameView; } // Shared initialization code void Initialize() { } #endregion void LoadGame(object sender, EventArgs e) { CCGameView gameView = sender as CCGameView; if (gameView != null) { gameView.DesignResolution = new CCSizeI (1024, 768); gameView.Stats.Enabled = true; CCScene gameScene = new CCScene (gameView); gameScene.AddLayer(new TestController()); gameView.RunWithScene (gameScene); } } //strongly typed window accessor public new MacGameWindow Window { get { return (MacGameWindow)base.Window; } } } }
mit
C#
8971240608d8bde1cee4b2abcb1460a6072746e7
Fix wrong percentages
Catel/Catel.Benchmarks
src/Catel.BenchmarkCombiner/Models/SlowerBenchmarkSummary.cs
src/Catel.BenchmarkCombiner/Models/SlowerBenchmarkSummary.cs
// -------------------------------------------------------------------------------------------------------------------- // <copyright file="FasterBenchmarkSummary.cs" company="Catel development team"> // Copyright (c) 2008 - 2017 Catel development team. All rights reserved. // </copyright> // -------------------------------------------------------------------------------------------------------------------- namespace Catel.BenchmarkCombiner.Models { public class SlowerBenchmarkSummary : BenchmarkSummaryBase { public SlowerBenchmarkSummary(string previousVersion, string currentVersion, double previousVersionInNanoSeconds, double currentVersionInNanoSeconds) { PreviousVersion = previousVersion; CurrentVersion = currentVersion; PreviousVersionInNanoSeconds = previousVersionInNanoSeconds; CurrentVersionInNanoSeconds = currentVersionInNanoSeconds; DeltaInNanoSeconds = currentVersionInNanoSeconds - previousVersionInNanoSeconds; Percentage = (previousVersionInNanoSeconds / 100) * currentVersionInNanoSeconds; } public string PreviousVersion { get; private set; } public double PreviousVersionInNanoSeconds { get; private set; } public string CurrentVersion { get; private set; } public double CurrentVersionInNanoSeconds { get; private set; } public double Percentage { get; private set; } public double DeltaInNanoSeconds { get; private set; } } }
// -------------------------------------------------------------------------------------------------------------------- // <copyright file="FasterBenchmarkSummary.cs" company="Catel development team"> // Copyright (c) 2008 - 2017 Catel development team. All rights reserved. // </copyright> // -------------------------------------------------------------------------------------------------------------------- namespace Catel.BenchmarkCombiner.Models { public class SlowerBenchmarkSummary : BenchmarkSummaryBase { public SlowerBenchmarkSummary(string previousVersion, string currentVersion, double previousVersionInNanoSeconds, double currentVersionInNanoSeconds) { PreviousVersion = previousVersion; CurrentVersion = currentVersion; PreviousVersionInNanoSeconds = previousVersionInNanoSeconds; CurrentVersionInNanoSeconds = currentVersionInNanoSeconds; DeltaInNanoSeconds = currentVersionInNanoSeconds - previousVersionInNanoSeconds; Percentage = (previousVersionInNanoSeconds / 100) * DeltaInNanoSeconds; } public string PreviousVersion { get; private set; } public double PreviousVersionInNanoSeconds { get; private set; } public string CurrentVersion { get; private set; } public double CurrentVersionInNanoSeconds { get; private set; } public double Percentage { get; private set; } public double DeltaInNanoSeconds { get; private set; } } }
mit
C#