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
26f8ab75a7a3d8a9b2dbc7f0efed1fe97ade1b0d
Add missing enums for File purpose
stripe/stripe-dotnet
src/Stripe.net/Constants/FilePurpose.cs
src/Stripe.net/Constants/FilePurpose.cs
namespace Stripe { public static class FilePurpose { public const string AccountRequirement = "account_requirement"; public const string AdditionalVerification = "additional_verification"; public const string BusinessIcon = "business_icon"; public const string BusinessLogo = "business_logo"; public const string CustomerSignature = "customer_signature"; public const string DisputeEvidence = "dispute_evidence"; public const string DocumentProviderIdentityDocument = "document_provider_identity_document"; public const string FinanceReportRun = "finance_report_run"; public const string IdentityDocument = "identity_document"; public const string IdentityDocumentDownloadable = "identity_document_downloadable"; public const string IncorporationArticle = "incorporation_article"; public const string IncorporationDocument = "incorporation_document"; public const string PaymentProviderTransfer = "payment_provider_transfer"; public const string PciDocument = "pci_document"; public const string Selfie = "selfie"; public const string ProductFeed = "product_feed"; public const string SigmaScheduledQuery = "sigma_scheduled_query"; public const string TaxDocumentUserUpload = "tax_document_user_upload"; } }
namespace Stripe { public static class FilePurpose { public const string AdditionalVerification = "additional_verification"; public const string BusinessIcon = "business_icon"; public const string BusinessLogo = "business_logo"; public const string CustomerSignature = "customer_signature"; public const string DisputeEvidence = "dispute_evidence"; public const string DocumentProviderIdentityDocument = "document_provider_identity_document"; public const string FinanceReportRun = "finance_report_run"; public const string IdentityDocument = "identity_document"; public const string IncorporationArticle = "incorporation_article"; public const string IncorporationDocument = "incorporation_document"; public const string PaymentProviderTransfer = "payment_provider_transfer"; public const string PciDocument = "pci_document"; public const string ProductFeed = "product_feed"; public const string SigmaScheduledQuery = "sigma_scheduled_query"; public const string TaxDocumentUserUpload = "tax_document_user_upload"; } }
apache-2.0
C#
597b74c73ce6456a3f95883e3da1c082605a1ae5
Add disableOnPlay option to changeOrderInLayer
NitorInc/NitoriWare,NitorInc/NitoriWare,Barleytree/NitoriWare,Barleytree/NitoriWare
Assets/Scripts/UI/ChangeOrderInLayer.cs
Assets/Scripts/UI/ChangeOrderInLayer.cs
using UnityEngine; using System.Collections; [ExecuteInEditMode] public class ChangeOrderInLayer : MonoBehaviour { [SerializeField] private Renderer _renderer; [SerializeField] private int orderInLayer; [SerializeField] private string sortingLayer = "Default"; [SerializeField] private bool disableOnPlay = true; private void Awake() { if (disableOnPlay && Application.isPlaying) enabled = false; } void Start() { if (_renderer == null) _renderer = GetComponent<Renderer>(); _renderer.sortingOrder = orderInLayer; } void Update () { if (orderInLayer != _renderer.sortingOrder) _renderer.sortingOrder = orderInLayer; if (!string.IsNullOrEmpty(sortingLayer)) _renderer.sortingLayerName = sortingLayer; } }
using UnityEngine; using System.Collections; [ExecuteInEditMode] public class ChangeOrderInLayer : MonoBehaviour { #pragma warning disable 0649 [SerializeField] private Renderer _renderer; [SerializeField] private int orderInLayer; #pragma warning restore 0649 void Start() { if (_renderer == null) _renderer = GetComponent<Renderer>(); _renderer.sortingOrder = orderInLayer; } void Update () { if (orderInLayer != _renderer.sortingOrder) _renderer.sortingOrder = orderInLayer; } }
mit
C#
05cbd13476edc7f4526f064365653001b1b06296
Remove unnecessary propchange hook.
nopara73/HiddenWallet,nopara73/HiddenWallet,nopara73/HiddenWallet,nopara73/HiddenWallet
WalletWasabi.Gui/ViewModels/ViewModelBase.cs
WalletWasabi.Gui/ViewModels/ViewModelBase.cs
using ReactiveUI; using System; using System.Collections; using System.Collections.Generic; using System.ComponentModel; using System.Linq; using System.Reflection; using WalletWasabi.Gui.ViewModels.Validation; using WalletWasabi.Models; namespace WalletWasabi.Gui.ViewModels { public class ViewModelBase : ReactiveObject, INotifyDataErrorInfo { private List<(string propertyName, MethodInfo mInfo)> ValidationMethodCache; public event EventHandler<DataErrorsChangedEventArgs> ErrorsChanged; public ViewModelBase() { var vmc = Validator.PropertiesWithValidation(this).ToList(); if (vmc.Count == 0) return; ValidationMethodCache = vmc; } public bool HasErrors => Validator.ValidateAllProperties(this, ValidationMethodCache).HasErrors; public IEnumerable GetErrors(string propertyName) { var error = Validator.ValidateProperty(this, propertyName, ValidationMethodCache); if (error.HasErrors) { return error.Select(p => p.Message); } return ErrorDescriptors.Empty; } protected void NotifyErrorsChanged(string propertyName) { ErrorsChanged?.Invoke(this, new DataErrorsChangedEventArgs(propertyName)); } } }
using ReactiveUI; using System; using System.Collections; using System.Collections.Generic; using System.ComponentModel; using System.Linq; using System.Reflection; using WalletWasabi.Gui.ViewModels.Validation; using WalletWasabi.Models; namespace WalletWasabi.Gui.ViewModels { public class ViewModelBase : ReactiveObject, INotifyDataErrorInfo { private List<(string propertyName, MethodInfo mInfo)> ValidationMethodCache; public event EventHandler<DataErrorsChangedEventArgs> ErrorsChanged; public ViewModelBase() { var vmc = Validator.PropertiesWithValidation(this).ToList(); if (vmc.Count == 0) return; ValidationMethodCache = vmc; this.PropertyChanged += ValidationHandler; } private void ValidationHandler(object sender, PropertyChangedEventArgs e) { if (ValidationMethodCache is null) return; foreach (var validationCache in ValidationMethodCache) { if (validationCache.propertyName != e.PropertyName) continue; NotifyErrorsChanged(e.PropertyName); } } public bool HasErrors => Validator.ValidateAllProperties(this, ValidationMethodCache).HasErrors; public IEnumerable GetErrors(string propertyName) { var error = Validator.ValidateProperty(this, propertyName, ValidationMethodCache); if (error.HasErrors) { return error.Select(p => p.Message); } return ErrorDescriptors.Empty; } protected void NotifyErrorsChanged(string propertyName) { ErrorsChanged?.Invoke(this, new DataErrorsChangedEventArgs(propertyName)); } } }
mit
C#
7380a4ac143d8859c26e6bea6929b43468935e29
update bisector and target vector
LanJian/stellar
Assets/Scripts/Ship/ShipMovement.cs
Assets/Scripts/Ship/ShipMovement.cs
using UnityEngine; using System.Collections; public class ShipMovement : MonoBehaviour { private Vector3 target; private Vector3 targetVector; private Vector3 bisector; private Rigidbody rb; private float dot; // Use this for initialization void Start () { rb = GetComponent<Rigidbody> (); } // Update is called once per frame void Update () { Plane groundPlane = new Plane(Vector3.up, Vector3.zero); //float translation = Time.deltaTime; //transform.Translate (new Vector3 (0, 0, translation)); if (Input.GetButtonDown("Fire1")) { Camera c = Camera.main; Vector3 p = Input.mousePosition; Ray r = c.ScreenPointToRay (p); rb.angularDrag = 0; float distance = 0; Vector3 worldP = Vector3.zero; // if the ray hits the plane... if (groundPlane.Raycast(r, out distance)){ // get the hit point: worldP = r.GetPoint(distance); } target = worldP; targetVector = (target - transform.position).normalized; bisector = (transform.forward + targetVector).normalized; //dot = Vector3.Dot (transform.forward, target); } TurnToFace (target); // move if far away enough // TODO: actually accelerate if (Vector3.Distance (transform.position, target) > 0.5) { transform.position += transform.forward * Time.deltaTime; } } void TurnToFace (Vector3 target) { if (target == Vector3.zero) { return; } targetVector = (target - transform.position).normalized; bisector = (transform.forward + targetVector).normalized; Debug.DrawRay (transform.position, target - transform.position); Debug.DrawRay (transform.position, bisector * 10, Color.blue); Debug.DrawRay (transform.position, transform.forward * 10, Color.red); Debug.DrawRay (transform.position, targetVector * 10, Color.green); if (Mathf.Abs (Vector3.Dot (bisector, targetVector) - 1) < 0.0001) { rb.angularDrag = 3; // transform.LookAt (target); //rb.angularVelocity = Vector3.zero; } // turn ship to face the target // TODO: actually turn //transform.LookAt(target); //if (Vector3.Dot (transform.forward, (target - transform.position).Normalize()) > 0) { if (Vector3.Dot(Vector3.Cross (transform.forward, bisector), Vector3.up) > 0) { rb.AddRelativeTorque (Vector3.up); } else { rb.AddRelativeTorque (Vector3.up * -1); } } }
using UnityEngine; using System.Collections; public class ShipMovement : MonoBehaviour { private Vector3 target; private Vector3 targetVector; private Vector3 bisector; private Rigidbody rb; private float dot; // Use this for initialization void Start () { rb = GetComponent<Rigidbody> (); } // Update is called once per frame void Update () { Plane groundPlane = new Plane(Vector3.up, Vector3.zero); //float translation = Time.deltaTime; //transform.Translate (new Vector3 (0, 0, translation)); if (Input.GetButtonDown("Fire1")) { Camera c = Camera.main; Vector3 p = Input.mousePosition; Ray r = c.ScreenPointToRay (p); rb.angularDrag = 0; float distance = 0; Vector3 worldP = Vector3.zero; // if the ray hits the plane... if (groundPlane.Raycast(r, out distance)){ // get the hit point: worldP = r.GetPoint(distance); } target = worldP; targetVector = (target - transform.position).normalized; bisector = (transform.forward + targetVector).normalized; //dot = Vector3.Dot (transform.forward, target); } TurnToFace (target); // move if far away enough // TODO: actually accelerate if (Vector3.Distance (transform.position, target) > 0.5) { transform.position += transform.forward * Time.deltaTime; } } void TurnToFace (Vector3 target) { if (target == Vector3.zero) { return; } targetVector = (target - transform.position).normalized; Debug.DrawRay (transform.position, target - transform.position); Debug.DrawRay (transform.position, bisector * 10); Debug.DrawRay (transform.position, transform.forward * 10); Debug.DrawRay (transform.position, targetVector * 10); if (Mathf.Abs (Vector3.Dot (transform.forward, targetVector) - 1) < 0.01 && rb.angularVelocity.magnitude < 0.01) { rb.angularDrag = 100; // transform.LookAt (target); //rb.angularVelocity = Vector3.zero; } // turn ship to face the target // TODO: actually turn //transform.LookAt(target); //if (Vector3.Dot (transform.forward, (target - transform.position).Normalize()) > 0) { if (Vector3.Dot(Vector3.Cross (transform.forward, bisector), Vector3.up) > 0) { rb.AddRelativeTorque (Vector3.up); } else { rb.AddRelativeTorque (Vector3.up * -1); } } }
mit
C#
3544d71b7ecaabdfb05becb5ad8d4ae4e846879d
Fix intermittent test failures.
punker76/Perspex,AvaloniaUI/Avalonia,AvaloniaUI/Avalonia,SuperJMN/Avalonia,wieslawsoltes/Perspex,Perspex/Perspex,kekekeks/Perspex,susloparovdenis/Avalonia,akrisiun/Perspex,SuperJMN/Avalonia,kekekeks/Perspex,tshcherban/Perspex,SuperJMN/Avalonia,SuperJMN/Avalonia,wieslawsoltes/Perspex,jkoritzinsky/Avalonia,wieslawsoltes/Perspex,susloparovdenis/Perspex,bbqchickenrobot/Perspex,SuperJMN/Avalonia,AvaloniaUI/Avalonia,AvaloniaUI/Avalonia,wieslawsoltes/Perspex,jkoritzinsky/Perspex,jkoritzinsky/Avalonia,AvaloniaUI/Avalonia,grokys/Perspex,AvaloniaUI/Avalonia,MrDaedra/Avalonia,danwalmsley/Perspex,AvaloniaUI/Avalonia,susloparovdenis/Perspex,OronDF343/Avalonia,susloparovdenis/Avalonia,SuperJMN/Avalonia,grokys/Perspex,jkoritzinsky/Avalonia,MrDaedra/Avalonia,wieslawsoltes/Perspex,SuperJMN/Avalonia,jkoritzinsky/Avalonia,wieslawsoltes/Perspex,jkoritzinsky/Avalonia,jkoritzinsky/Avalonia,jkoritzinsky/Avalonia,jazzay/Perspex,OronDF343/Avalonia,wieslawsoltes/Perspex,Perspex/Perspex,DavidKarlas/Perspex
tests/Perspex.SceneGraph.UnitTests/Properties/AssemblyInfo.cs
tests/Perspex.SceneGraph.UnitTests/Properties/AssemblyInfo.cs
// Copyright (c) The Perspex Project. All rights reserved. // Licensed under the MIT license. See licence.md file in the project root for full license information. using System.Reflection; using Xunit; [assembly: AssemblyTitle("Perspex.SceneGraph.UnitTests")] // Don't run tests in parallel. [assembly: CollectionBehavior(DisableTestParallelization = true)]
// Copyright (c) The Perspex Project. All rights reserved. // Licensed under the MIT license. See licence.md file in the project root for full license information. using System.Reflection; [assembly: AssemblyTitle("Perspex.SceneGraph.UnitTests")]
mit
C#
87bb26d99b883e5530af153f4bd8f9b2b29691c1
Add [Serializable] attribute
dnm240/NSubstitute,dnm240/NSubstitute,dnm240/NSubstitute,dnm240/NSubstitute,dnm240/NSubstitute
Source/NSubstitute/Exceptions/CallSequenceNotFoundException.cs
Source/NSubstitute/Exceptions/CallSequenceNotFoundException.cs
using System; using System.Runtime.Serialization; namespace NSubstitute.Exceptions { [Serializable] public class CallSequenceNotFoundException : SubstituteException { public CallSequenceNotFoundException(string message) : base(message) { } protected CallSequenceNotFoundException(SerializationInfo info, StreamingContext context) : base(info, context) { } } }
using System.Runtime.Serialization; namespace NSubstitute.Exceptions { [Serializable] public class CallSequenceNotFoundException : SubstituteException { public CallSequenceNotFoundException(string message) : base(message) { } protected CallSequenceNotFoundException(SerializationInfo info, StreamingContext context) : base(info, context) { } } }
bsd-3-clause
C#
ad204412f671bbd7075160a97e6f4b3b73dcdbd2
Update IOBuffer to latest API
analogdevicesinc/libiio,analogdevicesinc/libiio,Sunderfield/libiio,analogdevicesinc/libiio,Sunderfield/libiio,gburca/libiio,gburca/libiio,Sunderfield/libiio,sensarliar/libiio,sensarliar/libiio,gburca/libiio,sensarliar/libiio,analogdevicesinc/libiio
bindings/csharp/IOBuffer.cs
bindings/csharp/IOBuffer.cs
using System; using System.Collections.Generic; using System.Linq; using System.Runtime.InteropServices; using System.Text; using System.Threading.Tasks; namespace iio { class IOBuffer { public IntPtr buf; private uint samples_count; [DllImport("libiio.dll", CallingConvention = CallingConvention.Cdecl)] private static extern IntPtr iio_device_create_buffer(IntPtr dev, uint samples_count); [DllImport("libiio.dll", CallingConvention = CallingConvention.Cdecl)] private static extern void iio_buffer_destroy(IntPtr buf); [DllImport("libiio.dll", CallingConvention = CallingConvention.Cdecl)] private static extern int iio_buffer_refill(IntPtr buf); [DllImport("libiio.dll", CallingConvention = CallingConvention.Cdecl)] private static extern int iio_buffer_push(IntPtr buf); public IOBuffer(Device dev, uint samples_count) { this.samples_count = samples_count; buf = iio_device_create_buffer(dev.dev, samples_count); if (buf == null) throw new Exception("Unable to create buffer"); } ~IOBuffer() { iio_buffer_destroy(buf); } public void refill() { int err = iio_buffer_refill(this.buf); if (err < 0) throw new Exception("Unable to refill buffer: err=" + err); } public void push() { int err = iio_buffer_push(this.buf); if (err < 0) throw new Exception("Unable to push buffer: err=" + err); } public uint get_samples_count() { return samples_count; } } }
using System; using System.Collections.Generic; using System.Linq; using System.Runtime.InteropServices; using System.Text; using System.Threading.Tasks; namespace iio { class IOBuffer { public IntPtr buf; private bool is_output; private uint samples_count; [DllImport("libiio.dll", CallingConvention = CallingConvention.Cdecl)] private static extern IntPtr iio_device_create_buffer(IntPtr dev, uint samples_count, [MarshalAs(UnmanagedType.I1)] bool is_output); [DllImport("libiio.dll", CallingConvention = CallingConvention.Cdecl)] private static extern void iio_buffer_destroy(IntPtr buf); [DllImport("libiio.dll", CallingConvention = CallingConvention.Cdecl)] private static extern int iio_buffer_refill(IntPtr buf); [DllImport("libiio.dll", CallingConvention = CallingConvention.Cdecl)] private static extern int iio_buffer_push(IntPtr buf); public IOBuffer(Device dev, uint samples_count, bool is_output = false) { this.is_output = is_output; this.samples_count = samples_count; buf = iio_device_create_buffer(dev.dev, samples_count, is_output); if (buf == null) throw new Exception("Unable to create buffer"); } ~IOBuffer() { iio_buffer_destroy(buf); } public void refill() { if (this.is_output) throw new Exception("Impossible to refill an output buffer"); int err = iio_buffer_refill(this.buf); if (err < 0) throw new Exception("Unable to refill buffer: err=" + err); } public void push() { if (!this.is_output) throw new Exception("Impossible to push an input buffer"); int err = iio_buffer_push(this.buf); if (err < 0) throw new Exception("Unable to push buffer: err=" + err); } public uint get_samples_count() { return samples_count; } } }
lgpl-2.1
C#
44168b1654757b47aa80f997413ee1a5fcf2764b
Fix incorrect license
DrabWeb/osu,Nabile-Rahmani/osu,UselessToucan/osu,naoey/osu,ppy/osu,peppy/osu,ZLima12/osu,peppy/osu,UselessToucan/osu,ppy/osu,smoogipoo/osu,naoey/osu,2yangk23/osu,DrabWeb/osu,smoogipooo/osu,EVAST9919/osu,naoey/osu,Frontear/osuKyzer,NeoAdonis/osu,ppy/osu,DrabWeb/osu,2yangk23/osu,peppy/osu-new,smoogipoo/osu,UselessToucan/osu,EVAST9919/osu,peppy/osu,NeoAdonis/osu,johnneijzen/osu,smoogipoo/osu,ZLima12/osu,johnneijzen/osu,NeoAdonis/osu
osu.Game/Utils/ZipUtils.cs
osu.Game/Utils/ZipUtils.cs
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>. // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; using SharpCompress.Archives.Zip; namespace osu.Game.Utils { public static class ZipUtils { public static bool IsZipArchive(string path) { try { using (var arc = ZipArchive.Open(path)) { foreach (var entry in arc.Entries) { using (entry.OpenEntryStream()) { } } } return true; } catch (Exception) { return false; } } } }
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>. // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu-framework/master/LICENCE using System; using SharpCompress.Archives.Zip; namespace osu.Game.Utils { public static class ZipUtils { public static bool IsZipArchive(string path) { try { using (var arc = ZipArchive.Open(path)) { foreach (var entry in arc.Entries) { using (entry.OpenEntryStream()) { } } } return true; } catch (Exception) { return false; } } } }
mit
C#
4aa06b8eae5532ef7be345a9f9a1dcae005254af
Handle item expiration
mdavid/nuget,mdavid/nuget
src/Core/Utility/MemoryCache.cs
src/Core/Utility/MemoryCache.cs
using System; using System.Collections.Concurrent; using System.Threading.Tasks; using System.Threading; namespace NuGet { internal sealed class MemoryCache { private MemoryCache() { } internal static MemoryCache Default { get { return InternalMemoryCache.Instance; } } private ConcurrentDictionary<string, CacheItem> _cache = new ConcurrentDictionary<string, CacheItem>(); internal int Count { get { return _cache.Count; } } internal T GetOrAdd<T>(string cacheKey, Func<T> factory, TimeSpan slidingExpiration) where T : class { CacheItem result; if (!_cache.TryGetValue(cacheKey, out result)) { result = new CacheItem(this, cacheKey, factory(), slidingExpiration); _cache[cacheKey] = result; } return (T)result.Item; } internal void Remove(string cacheKey) { CacheItem item; _cache.TryRemove(cacheKey, out item); } private class CacheItem { public CacheItem(MemoryCache owner, string cacheKey, object item, TimeSpan expiry) { _item = item; Task.Factory.StartNew(() => { Thread.Sleep(expiry); owner.Remove(cacheKey); }); } private object _item; public object Item { get { return _item; } } } private class InternalMemoryCache { static InternalMemoryCache() { } internal static MemoryCache Instance = new MemoryCache(); } } }
using System; using System.Collections.Concurrent; namespace NuGet { internal sealed class MemoryCache { private MemoryCache() { } internal static MemoryCache Default { get { return InternalMemoryCache.Instance; } } private ConcurrentDictionary<string, CacheItem> _cache = new ConcurrentDictionary<string, CacheItem>(); internal T GetOrAdd<T>(string cacheKey, Func<T> factory, TimeSpan slidingExpiration) where T : class { CacheItem result; if (!_cache.TryGetValue(cacheKey, out result) || result.Expiry < DateTime.Now) { result = new CacheItem { Item = factory(), Expiry = DateTime.Now.Add(slidingExpiration) }; _cache[cacheKey] = result; } return (T)result.Item; } internal void Remove(string cacheKey) { CacheItem item; _cache.TryRemove(cacheKey, out item); } private class CacheItem { public object Item { get; set; } public DateTime Expiry { get; set; } } private class InternalMemoryCache { static InternalMemoryCache() { } internal static MemoryCache Instance = new MemoryCache(); } } }
apache-2.0
C#
d6ff615d6af80782630877b58a5d8486ca64feb9
Add silent Open override
allquixotic/banshee-gst-sharp-work,arfbtwn/banshee,Dynalon/banshee-osx,stsundermann/banshee,dufoli/banshee,babycaseny/banshee,mono-soc-2011/banshee,mono-soc-2011/banshee,directhex/banshee-hacks,petejohanson/banshee,directhex/banshee-hacks,lamalex/Banshee,dufoli/banshee,Dynalon/banshee-osx,petejohanson/banshee,lamalex/Banshee,ixfalia/banshee,dufoli/banshee,mono-soc-2011/banshee,dufoli/banshee,arfbtwn/banshee,babycaseny/banshee,babycaseny/banshee,stsundermann/banshee,lamalex/Banshee,stsundermann/banshee,Carbenium/banshee,petejohanson/banshee,ixfalia/banshee,GNOME/banshee,ixfalia/banshee,GNOME/banshee,babycaseny/banshee,dufoli/banshee,petejohanson/banshee,Dynalon/banshee-osx,Carbenium/banshee,stsundermann/banshee,lamalex/Banshee,GNOME/banshee,allquixotic/banshee-gst-sharp-work,Carbenium/banshee,mono-soc-2011/banshee,dufoli/banshee,GNOME/banshee,Dynalon/banshee-osx,Dynalon/banshee-osx,lamalex/Banshee,GNOME/banshee,mono-soc-2011/banshee,stsundermann/banshee,GNOME/banshee,Carbenium/banshee,GNOME/banshee,babycaseny/banshee,GNOME/banshee,petejohanson/banshee,dufoli/banshee,arfbtwn/banshee,Carbenium/banshee,directhex/banshee-hacks,allquixotic/banshee-gst-sharp-work,allquixotic/banshee-gst-sharp-work,babycaseny/banshee,Dynalon/banshee-osx,mono-soc-2011/banshee,Dynalon/banshee-osx,directhex/banshee-hacks,ixfalia/banshee,arfbtwn/banshee,arfbtwn/banshee,Carbenium/banshee,babycaseny/banshee,arfbtwn/banshee,dufoli/banshee,ixfalia/banshee,babycaseny/banshee,directhex/banshee-hacks,petejohanson/banshee,allquixotic/banshee-gst-sharp-work,ixfalia/banshee,ixfalia/banshee,ixfalia/banshee,Dynalon/banshee-osx,arfbtwn/banshee,stsundermann/banshee,stsundermann/banshee,stsundermann/banshee,lamalex/Banshee,allquixotic/banshee-gst-sharp-work,arfbtwn/banshee,mono-soc-2011/banshee,directhex/banshee-hacks
src/Core/Banshee.Services/Banshee.Web/Browser.cs
src/Core/Banshee.Services/Banshee.Web/Browser.cs
// // Browser.cs // // Author: // Aaron Bockover <abockover@novell.com> // Gabriel Burt <gburt@novell.com> // // Copyright (C) 2006-2008 Novell, 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 System.Diagnostics; using Mono.Unix; using Hyena; using Banshee.Base; using Banshee.ServiceStack; namespace Banshee.Web { public class Browser { public delegate bool OpenUrlHandler (string uri); private static OpenUrlHandler open_handler = null; public static OpenUrlHandler OpenHandler { get { return open_handler; } set { open_handler = value; } } public static bool Open (string url) { return Open (url, true); } public static bool Open (string url, bool showErrors) { try { url = Uri.EscapeUriString (url); if (open_handler != null) { return open_handler (url); } else { Process.Start (url); return true; } } catch(Exception e) { if (showErrors) { Log.Warning (Catalog.GetString ("Could not launch URL"), String.Format (Catalog.GetString ("{0} could not be opened: {1}\n\n " + "Check your 'Preferred Applications' settings."), url, e.Message), true); } return false; } } public static readonly string UserAgent = String.Format ("Banshee/{0} (http://banshee-project.org/)", Application.Version); } }
// // Browser.cs // // Author: // Aaron Bockover <abockover@novell.com> // Gabriel Burt <gburt@novell.com> // // Copyright (C) 2006-2008 Novell, 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 System.Diagnostics; using Mono.Unix; using Hyena; using Banshee.Base; using Banshee.ServiceStack; namespace Banshee.Web { public class Browser { public delegate bool OpenUrlHandler (string uri); private static OpenUrlHandler open_handler = null; public static OpenUrlHandler OpenHandler { get { return open_handler; } set { open_handler = value; } } public static bool Open (string url) { try { url = Uri.EscapeUriString (url); if (open_handler != null) { return open_handler (url); } else { Process.Start (url); return true; } } catch(Exception e) { Log.Warning (Catalog.GetString ("Could not launch URL"), String.Format (Catalog.GetString ("{0} could not be opened: {1}\n\n " + "Check your 'Preferred Applications' settings."), url, e.Message), true); return false; } } public static readonly string UserAgent = String.Format ("Banshee/{0} (http://banshee-project.org/)", Application.Version); } }
mit
C#
e22506afd3a3a1e9702d59afdc76f86812ed23a2
Refactor VSConstants, Nemerle constant goes up
mrward/NuGet.V2,RichiCoder1/nuget-chocolatey,oliver-feng/nuget,xoofx/NuGet,mrward/nuget,xoofx/NuGet,jmezach/NuGet2,ctaggart/nuget,mrward/NuGet.V2,mrward/nuget,themotleyfool/NuGet,dolkensp/node.net,ctaggart/nuget,antiufo/NuGet2,antiufo/NuGet2,mono/nuget,rikoe/nuget,jmezach/NuGet2,indsoft/NuGet2,GearedToWar/NuGet2,ctaggart/nuget,akrisiun/NuGet,pratikkagda/nuget,jholovacs/NuGet,pratikkagda/nuget,zskullz/nuget,antiufo/NuGet2,GearedToWar/NuGet2,jmezach/NuGet2,alluran/node.net,themotleyfool/NuGet,GearedToWar/NuGet2,chocolatey/nuget-chocolatey,GearedToWar/NuGet2,indsoft/NuGet2,chester89/nugetApi,jholovacs/NuGet,alluran/node.net,mono/nuget,RichiCoder1/nuget-chocolatey,rikoe/nuget,xoofx/NuGet,OneGet/nuget,kumavis/NuGet,chocolatey/nuget-chocolatey,indsoft/NuGet2,indsoft/NuGet2,indsoft/NuGet2,jmezach/NuGet2,xoofx/NuGet,chocolatey/nuget-chocolatey,chester89/nugetApi,chocolatey/nuget-chocolatey,mono/nuget,mrward/NuGet.V2,pratikkagda/nuget,mrward/nuget,chocolatey/nuget-chocolatey,antiufo/NuGet2,GearedToWar/NuGet2,atheken/nuget,mrward/NuGet.V2,dolkensp/node.net,jholovacs/NuGet,OneGet/nuget,ctaggart/nuget,zskullz/nuget,indsoft/NuGet2,mrward/NuGet.V2,xero-github/Nuget,RichiCoder1/nuget-chocolatey,jmezach/NuGet2,oliver-feng/nuget,atheken/nuget,antiufo/NuGet2,rikoe/nuget,RichiCoder1/nuget-chocolatey,OneGet/nuget,jmezach/NuGet2,mrward/nuget,xoofx/NuGet,alluran/node.net,dolkensp/node.net,themotleyfool/NuGet,jholovacs/NuGet,RichiCoder1/nuget-chocolatey,antiufo/NuGet2,GearedToWar/NuGet2,pratikkagda/nuget,dolkensp/node.net,oliver-feng/nuget,jholovacs/NuGet,akrisiun/NuGet,zskullz/nuget,oliver-feng/nuget,anurse/NuGet,mono/nuget,kumavis/NuGet,mrward/nuget,pratikkagda/nuget,OneGet/nuget,mrward/nuget,xoofx/NuGet,pratikkagda/nuget,rikoe/nuget,alluran/node.net,oliver-feng/nuget,oliver-feng/nuget,mrward/NuGet.V2,chocolatey/nuget-chocolatey,anurse/NuGet,jholovacs/NuGet,RichiCoder1/nuget-chocolatey,zskullz/nuget
src/VisualStudio/VSConstants.cs
src/VisualStudio/VSConstants.cs
namespace NuGet.VisualStudio { internal static class VsConstants { // Project type guids internal const string WebApplicationProjectTypeGuid = "{349C5851-65DF-11DA-9384-00065B846F21}"; internal const string WebSiteProjectTypeGuid = "{E24C65DC-7377-472B-9ABA-BC803B73C61A}"; internal const string CsharpProjectTypeGuid = "{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}"; internal const string VbProjectTypeGuid = "{F184B08F-C81C-45F6-A57F-5ABD9991F28F}"; internal const string FsharpProjectTypeGuid = "{F2A71F9B-5D33-465A-A702-920D77279786}"; internal const string JsProjectTypeGuid = "{262852C6-CD72-467D-83FE-5EEB1973A190}"; internal const string WixProjectTypeGuid = "{930C7802-8A8C-48F9-8165-68863BCCD9DD}"; internal const string LightSwitchProjectTypeGuid = "{ECD6D718-D1CF-4119-97F3-97C25A0DFBF9}"; internal const string NemerleProjectTypeGuid = "{edcc3b85-0bad-11db-bc1a-00112fde8b61}"; // Copied from EnvDTE.Constants since that type can't be embedded internal const string VsProjectItemKindPhysicalFile = "{6BB5F8EE-4483-11D3-8BCF-00C04F8EC28C}"; internal const string VsProjectItemKindPhysicalFolder = "{6BB5F8EF-4483-11D3-8BCF-00C04F8EC28C}"; internal const string VsProjectItemKindSolutionFolder = "{66A26720-8FB5-11D2-AA7E-00C04F688DDE}"; internal const string VsWindowKindSolutionExplorer = "{3AE79031-E1BC-11D0-8F78-00A0C9110057}"; // All unloaded projects have this Kind value internal const string UnloadedProjectTypeGuid = "{67294A52-A4F0-11D2-AA88-00C04F688DDE}"; internal const string NuGetSolutionSettingsFolder = ".nuget"; // HResults internal const int S_OK = 0; } }
namespace NuGet.VisualStudio { internal static class VsConstants { // Project type guids internal const string WebApplicationProjectTypeGuid = "{349C5851-65DF-11DA-9384-00065B846F21}"; internal const string WebSiteProjectTypeGuid = "{E24C65DC-7377-472B-9ABA-BC803B73C61A}"; internal const string CsharpProjectTypeGuid = "{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}"; internal const string VbProjectTypeGuid = "{F184B08F-C81C-45F6-A57F-5ABD9991F28F}"; internal const string FsharpProjectTypeGuid = "{F2A71F9B-5D33-465A-A702-920D77279786}"; internal const string JsProjectTypeGuid = "{262852C6-CD72-467D-83FE-5EEB1973A190}"; internal const string WixProjectTypeGuid = "{930C7802-8A8C-48F9-8165-68863BCCD9DD}"; internal const string LightSwitchProjectTypeGuid = "{ECD6D718-D1CF-4119-97F3-97C25A0DFBF9}"; // Copied from EnvDTE.Constants since that type can't be embedded internal const string VsProjectItemKindPhysicalFile = "{6BB5F8EE-4483-11D3-8BCF-00C04F8EC28C}"; internal const string VsProjectItemKindPhysicalFolder = "{6BB5F8EF-4483-11D3-8BCF-00C04F8EC28C}"; internal const string VsProjectItemKindSolutionFolder = "{66A26720-8FB5-11D2-AA7E-00C04F688DDE}"; internal const string VsWindowKindSolutionExplorer = "{3AE79031-E1BC-11D0-8F78-00A0C9110057}"; // All unloaded projects have this Kind value internal const string UnloadedProjectTypeGuid = "{67294A52-A4F0-11D2-AA88-00C04F688DDE}"; internal const string NemerleProjectTypeGuid = "{edcc3b85-0bad-11db-bc1a-00112fde8b61}"; internal const string NuGetSolutionSettingsFolder = ".nuget"; // HResults internal const int S_OK = 0; } }
apache-2.0
C#
52ecec3d69a4be33790030499a56c011f5bea80e
Update GameManager.cs
afroraydude/First_Unity_Game,afroraydude/First_Unity_Game,afroraydude/First_Unity_Game
Real_Game/Assets/Scripts/GameManager.cs
Real_Game/Assets/Scripts/GameManager.cs
using UnityEngine; using System.Collections; public class GameManager : MonoBehaviour { // Score based stuff public float highScore = 0f; //Level based stuff public int currentLevel = 0; public int unlockedLevel; // Things that deal with GUI or whatever public Rect stopwatchRect; public Rect stopwatchBoxRect; public Rect highScoreRect; public Rect highScoreBox; public GUISkin skin; // Stuff that deals with the ingame stopwatch, which is my answer to the score system. public float startTime; private string currentTime; public string highTime; // Once the level loads this happens void Start() { //DontDestroyOnLoad(gameObject); if (PlayerPrefs.GetInt("LevelsCompleted") > 0) { currentLevel = PlayerPrefs.GetInt("LevelsCompleted"); } else { currentLevel = 0; } } // This is ran every tick void Update() { //This records the time it took to complete the level startTime += Time.deltaTime; //This puts it into a string so that it can be viewed on the GUI currentTime = string.Format ("{0:0.0}", startTime); } // GUI goes here void OnGUI() { GUI.skin = skin; GUI.Box (stopwatchBoxRect, ""); GUI.Label(stopwatchRect, currentTime, skin.GetStyle ("Stopwatch")); GUI.Label (highScoreRect, PlayerPrefs.GetString("Level" + currentLevel.ToString() + "Score")); GUI.Box (highScoreBox, ""); } /** * So the main menu doesn't need to use another object in the scene to run, * Also so that there wont be a stopwatch calculationg time in the main menu. * The end screen doesn't need this because it is just a GUI. */ public void MainMenuToLevelOne() { currentLevel +=1; PlayerPrefs.SetInt("LevelsCompleted", currentLevel); PlayerPrefs.Save(); Application.LoadLevel(currentLevel); } public void BackToMainMenu() { currentLevel -=1; PlayerPrefs.SetInt("LevelsCompleted", currentLevel); PlayerPrefs.Save(); Application.LoadLevel(currentLevel); } // For when the player completes a level // TODO: Fix issue in flash were it does not care if the high score is > or < the startTime, it always overrides it. public void CompleteLevel() { if(highScore > startTime || highScore == 0) { highScore = startTime; highTime = string.Format ("{0:0.0}", highScore); PlayerPrefs.SetString("Level" + currentLevel.ToString() + "Score", highTime); } if (currentLevel < 5) { currentLevel +=1; PlayerPrefs.SetInt("LevelsCompleted", currentLevel); PlayerPrefs.GetInt("LevelsCompleted"); PlayerPrefs.Save(); Application.LoadLevel(currentLevel); } else { print ("Please increase level amount."); } } }
using UnityEngine; using System.Collections; public class GameManager : MonoBehaviour { // Score based stuff public float highScore = 0f; //Level based stuff public int currentLevel = 0; public int unlockedLevel; // Things that deal with GUI or whatever public Rect stopwatchRect; public Rect stopwatchBoxRect; public Rect highScoreRect; public Rect highScoreBox; public GUISkin skin; // Stuff that deals with the ingame stopwatch, which is my answer to the score system. public float startTime; private string currentTime; public string highTime; // Once the level loads this happens void Start() { //DontDestroyOnLoad(gameObject); if (PlayerPrefs.GetInt("LevelsCompleted") > 0) { currentLevel = PlayerPrefs.GetInt("LevelsCompleted"); } else { currentLevel = 0; } } // This is ran every tick void Update() { startTime += Time.deltaTime; currentTime = string.Format ("{0:0.0}", startTime); } // GUI goes here void OnGUI() { GUI.skin = skin; GUI.Box (stopwatchBoxRect, ""); GUI.Label(stopwatchRect, currentTime, skin.GetStyle ("Stopwatch")); GUI.Label (highScoreRect, PlayerPrefs.GetString("Level" + currentLevel.ToString() + "Score")); GUI.Box (highScoreBox, ""); } /** * So the main menu doesn't need to use another object in the scene to run, * Also so that there wont be a stopwatch calculationg time in the main menu. * The end screen doesn't need this because it is just a GUI. */ public void MainMenuToLevelOne() { currentLevel +=1; PlayerPrefs.SetInt("LevelsCompleted", currentLevel); PlayerPrefs.Save(); Application.LoadLevel(currentLevel); } public void BackToMainMenu() { currentLevel -=1; PlayerPrefs.SetInt("LevelsCompleted", currentLevel); PlayerPrefs.Save(); Application.LoadLevel(currentLevel); } // For when the player completes a level // TODO: Fix issue in flash were it does not care if the high score is > or < the startTime, it always overrides it. public void CompleteLevel() { if(highScore > startTime || highScore == 0) { highScore = startTime; highTime = string.Format ("{0:0.0}", highScore); PlayerPrefs.SetString("Level" + currentLevel.ToString() + "Score", highTime); } if (currentLevel < 5) { currentLevel +=1; PlayerPrefs.SetInt("LevelsCompleted", currentLevel); PlayerPrefs.GetInt("LevelsCompleted"); PlayerPrefs.Save(); Application.LoadLevel(currentLevel); } else { print ("YOU WIN!"); } } }
mit
C#
e874a49934b7858900c051064aa04f998da117d6
Build fix
mdileep/NFugue
tests/NFugue.Tests/Staccato/UnknownTokenTests.cs
tests/NFugue.Tests/Staccato/UnknownTokenTests.cs
using FluentAssertions; using NFugue.Parsing; using NFugue.Staccato; using System; using Xunit; namespace Staccato.Tests { public class UnknownTokenTests { private readonly StaccatoParser parser = new StaccatoParser(); [Fact] public void Should_ignore_unknown_token_by_default() { parser.Parse("UNKNOWN"); } [Fact] public void Should_throw_exception_if_flag_set() { parser.ThrowsExceptionOnUnknownToken = true; Action action = () => parser.Parse("UNKNOWN"); action.ShouldThrow<ParserException>(); } } }
using FluentAssertions; using NFugue.Parsing; using NFugue.Staccato; using System; using Xunit; namespace Staccato.Tests { public class UnknownTokenTests : IDisposable { private readonly StaccatoParser parser = new StaccatoParser(); [Fact] public void Should_ignore_unknown_token_by_default() { parser.Parse("UNKNOWN"); } [Fact] public void Should_throw_exception_if_flag_set() { parser.ThrowsExceptionOnUnknownToken = true; Action action = () => parser.Parse("UNKNOWN"); action.ShouldThrow<ParserException>(); } } }
apache-2.0
C#
7bbad86eb42f06de158806e63057aba7b9152dcc
Support CreateColumn<Guid>()
hhland/Orchard,jimasp/Orchard,emretiryaki/Orchard,cooclsee/Orchard,angelapper/Orchard,bedegaming-aleksej/Orchard,xiaobudian/Orchard,OrchardCMS/Orchard,enspiral-dev-academy/Orchard,escofieldnaxos/Orchard,li0803/Orchard,omidnasri/Orchard,yonglehou/Orchard,jerryshi2007/Orchard,dmitry-urenev/extended-orchard-cms-v10.1,alejandroaldana/Orchard,luchaoshuai/Orchard,mvarblow/Orchard,DonnotRain/Orchard,jchenga/Orchard,emretiryaki/Orchard,li0803/Orchard,SzymonSel/Orchard,andyshao/Orchard,Dolphinsimon/Orchard,qt1/Orchard,arminkarimi/Orchard,Codinlab/Orchard,m2cms/Orchard,Fogolan/OrchardForWork,MetSystem/Orchard,jagraz/Orchard,yersans/Orchard,Dolphinsimon/Orchard,jagraz/Orchard,vairam-svs/Orchard,sfmskywalker/Orchard,aaronamm/Orchard,hbulzy/Orchard,jchenga/Orchard,jtkech/Orchard,kgacova/Orchard,ehe888/Orchard,jersiovic/Orchard,grapto/Orchard.CloudBust,jerryshi2007/Orchard,alejandroaldana/Orchard,escofieldnaxos/Orchard,jagraz/Orchard,oxwanawxo/Orchard,Ermesx/Orchard,spraiin/Orchard,jersiovic/Orchard,marcoaoteixeira/Orchard,sfmskywalker/Orchard,gcsuk/Orchard,AdvantageCS/Orchard,Praggie/Orchard,geertdoornbos/Orchard,SzymonSel/Orchard,brownjordaninternational/OrchardCMS,brownjordaninternational/OrchardCMS,johnnyqian/Orchard,OrchardCMS/Orchard,jtkech/Orchard,Serlead/Orchard,openbizgit/Orchard,hannan-azam/Orchard,fortunearterial/Orchard,aaronamm/Orchard,cooclsee/Orchard,enspiral-dev-academy/Orchard,TalaveraTechnologySolutions/Orchard,SzymonSel/Orchard,xkproject/Orchard,rtpHarry/Orchard,Fogolan/OrchardForWork,DonnotRain/Orchard,jimasp/Orchard,Anton-Am/Orchard,johnnyqian/Orchard,planetClaire/Orchard-LETS,dburriss/Orchard,huoxudong125/Orchard,stormleoxia/Orchard,angelapper/Orchard,mvarblow/Orchard,mvarblow/Orchard,geertdoornbos/Orchard,emretiryaki/Orchard,spraiin/Orchard,RoyalVeterinaryCollege/Orchard,xiaobudian/Orchard,angelapper/Orchard,li0803/Orchard,tobydodds/folklife,AdvantageCS/Orchard,cooclsee/Orchard,luchaoshuai/Orchard,OrchardCMS/Orchard,brownjordaninternational/OrchardCMS,dozoft/Orchard,ehe888/Orchard,hbulzy/Orchard,TalaveraTechnologySolutions/Orchard,oxwanawxo/Orchard,geertdoornbos/Orchard,dcinzona/Orchard,jtkech/Orchard,phillipsj/Orchard,jimasp/Orchard,hbulzy/Orchard,IDeliverable/Orchard,oxwanawxo/Orchard,m2cms/Orchard,kouweizhong/Orchard,TalaveraTechnologySolutions/Orchard,Codinlab/Orchard,Anton-Am/Orchard,enspiral-dev-academy/Orchard,hhland/Orchard,angelapper/Orchard,jimasp/Orchard,fortunearterial/Orchard,IDeliverable/Orchard,yonglehou/Orchard,qt1/Orchard,jagraz/Orchard,marcoaoteixeira/Orchard,oxwanawxo/Orchard,neTp9c/Orchard,sfmskywalker/Orchard-Off-The-Grid-Sample-Code,bedegaming-aleksej/Orchard,johnnyqian/Orchard,mvarblow/Orchard,AndreVolksdorf/Orchard,luchaoshuai/Orchard,marcoaoteixeira/Orchard,SeyDutch/Airbrush,SeyDutch/Airbrush,infofromca/Orchard,Lombiq/Orchard,patricmutwiri/Orchard,johnnyqian/Orchard,aaronamm/Orchard,sfmskywalker/Orchard-Off-The-Grid-Sample-Code,planetClaire/Orchard-LETS,bedegaming-aleksej/Orchard,neTp9c/Orchard,DonnotRain/Orchard,qt1/Orchard,huoxudong125/Orchard,ehe888/Orchard,andyshao/Orchard,grapto/Orchard.CloudBust,SeyDutch/Airbrush,stormleoxia/Orchard,fassetar/Orchard,SouleDesigns/SouleDesigns.Orchard,yonglehou/Orchard,Praggie/Orchard,grapto/Orchard.CloudBust,fassetar/Orchard,patricmutwiri/Orchard,neTp9c/Orchard,arminkarimi/Orchard,ehe888/Orchard,tobydodds/folklife,jersiovic/Orchard,DonnotRain/Orchard,dburriss/Orchard,spraiin/Orchard,infofromca/Orchard,escofieldnaxos/Orchard,Lombiq/Orchard,Praggie/Orchard,infofromca/Orchard,Anton-Am/Orchard,kouweizhong/Orchard,Fogolan/OrchardForWork,TaiAivaras/Orchard,JRKelso/Orchard,alejandroaldana/Orchard,Ermesx/Orchard,vairam-svs/Orchard,dozoft/Orchard,JRKelso/Orchard,fassetar/Orchard,kgacova/Orchard,MetSystem/Orchard,aaronamm/Orchard,Sylapse/Orchard.HttpAuthSample,TalaveraTechnologySolutions/Orchard,tobydodds/folklife,Ermesx/Orchard,Lombiq/Orchard,marcoaoteixeira/Orchard,m2cms/Orchard,SzymonSel/Orchard,omidnasri/Orchard,tobydodds/folklife,enspiral-dev-academy/Orchard,jerryshi2007/Orchard,sfmskywalker/Orchard,TalaveraTechnologySolutions/Orchard,omidnasri/Orchard,jersiovic/Orchard,armanforghani/Orchard,jerryshi2007/Orchard,jerryshi2007/Orchard,Lombiq/Orchard,TaiAivaras/Orchard,Codinlab/Orchard,geertdoornbos/Orchard,Sylapse/Orchard.HttpAuthSample,jchenga/Orchard,dburriss/Orchard,li0803/Orchard,sfmskywalker/Orchard,TaiAivaras/Orchard,qt1/Orchard,emretiryaki/Orchard,xkproject/Orchard,hbulzy/Orchard,armanforghani/Orchard,gcsuk/Orchard,gcsuk/Orchard,tobydodds/folklife,jimasp/Orchard,omidnasri/Orchard,AdvantageCS/Orchard,dcinzona/Orchard,m2cms/Orchard,LaserSrl/Orchard,xiaobudian/Orchard,hbulzy/Orchard,oxwanawxo/Orchard,spraiin/Orchard,JRKelso/Orchard,omidnasri/Orchard,Serlead/Orchard,fortunearterial/Orchard,brownjordaninternational/OrchardCMS,johnnyqian/Orchard,hannan-azam/Orchard,geertdoornbos/Orchard,huoxudong125/Orchard,SouleDesigns/SouleDesigns.Orchard,omidnasri/Orchard,andyshao/Orchard,AdvantageCS/Orchard,fortunearterial/Orchard,yonglehou/Orchard,rtpHarry/Orchard,openbizgit/Orchard,LaserSrl/Orchard,aaronamm/Orchard,dcinzona/Orchard,neTp9c/Orchard,RoyalVeterinaryCollege/Orchard,Sylapse/Orchard.HttpAuthSample,dozoft/Orchard,hannan-azam/Orchard,sfmskywalker/Orchard-Off-The-Grid-Sample-Code,sfmskywalker/Orchard-Off-The-Grid-Sample-Code,phillipsj/Orchard,Lombiq/Orchard,TalaveraTechnologySolutions/Orchard,Serlead/Orchard,Codinlab/Orchard,SzymonSel/Orchard,rtpHarry/Orchard,patricmutwiri/Orchard,yersans/Orchard,harmony7/Orchard,TalaveraTechnologySolutions/Orchard,neTp9c/Orchard,planetClaire/Orchard-LETS,fassetar/Orchard,huoxudong125/Orchard,jchenga/Orchard,SouleDesigns/SouleDesigns.Orchard,li0803/Orchard,TaiAivaras/Orchard,andyshao/Orchard,yersans/Orchard,dcinzona/Orchard,m2cms/Orchard,arminkarimi/Orchard,jersiovic/Orchard,enspiral-dev-academy/Orchard,escofieldnaxos/Orchard,yersans/Orchard,harmony7/Orchard,kgacova/Orchard,AdvantageCS/Orchard,planetClaire/Orchard-LETS,cooclsee/Orchard,openbizgit/Orchard,yersans/Orchard,omidnasri/Orchard,vairam-svs/Orchard,kgacova/Orchard,MetSystem/Orchard,JRKelso/Orchard,harmony7/Orchard,OrchardCMS/Orchard,JRKelso/Orchard,arminkarimi/Orchard,harmony7/Orchard,ehe888/Orchard,infofromca/Orchard,stormleoxia/Orchard,SeyDutch/Airbrush,bedegaming-aleksej/Orchard,jchenga/Orchard,grapto/Orchard.CloudBust,AndreVolksdorf/Orchard,RoyalVeterinaryCollege/Orchard,gcsuk/Orchard,spraiin/Orchard,Anton-Am/Orchard,fortunearterial/Orchard,dburriss/Orchard,patricmutwiri/Orchard,Codinlab/Orchard,Dolphinsimon/Orchard,LaserSrl/Orchard,sfmskywalker/Orchard-Off-The-Grid-Sample-Code,armanforghani/Orchard,openbizgit/Orchard,hannan-azam/Orchard,armanforghani/Orchard,andyshao/Orchard,sfmskywalker/Orchard,MetSystem/Orchard,LaserSrl/Orchard,Praggie/Orchard,rtpHarry/Orchard,Sylapse/Orchard.HttpAuthSample,cooclsee/Orchard,hhland/Orchard,Dolphinsimon/Orchard,abhishekluv/Orchard,hhland/Orchard,LaserSrl/Orchard,sfmskywalker/Orchard,yonglehou/Orchard,SeyDutch/Airbrush,marcoaoteixeira/Orchard,MetSystem/Orchard,Praggie/Orchard,xkproject/Orchard,TaiAivaras/Orchard,huoxudong125/Orchard,DonnotRain/Orchard,Serlead/Orchard,TalaveraTechnologySolutions/Orchard,planetClaire/Orchard-LETS,dcinzona/Orchard,xkproject/Orchard,Fogolan/OrchardForWork,dmitry-urenev/extended-orchard-cms-v10.1,infofromca/Orchard,dmitry-urenev/extended-orchard-cms-v10.1,sfmskywalker/Orchard,harmony7/Orchard,kouweizhong/Orchard,patricmutwiri/Orchard,jtkech/Orchard,phillipsj/Orchard,alejandroaldana/Orchard,stormleoxia/Orchard,OrchardCMS/Orchard,AndreVolksdorf/Orchard,hannan-azam/Orchard,kgacova/Orchard,omidnasri/Orchard,dmitry-urenev/extended-orchard-cms-v10.1,abhishekluv/Orchard,RoyalVeterinaryCollege/Orchard,Fogolan/OrchardForWork,armanforghani/Orchard,xiaobudian/Orchard,abhishekluv/Orchard,jagraz/Orchard,tobydodds/folklife,jtkech/Orchard,arminkarimi/Orchard,angelapper/Orchard,SouleDesigns/SouleDesigns.Orchard,abhishekluv/Orchard,sfmskywalker/Orchard,brownjordaninternational/OrchardCMS,dozoft/Orchard,bedegaming-aleksej/Orchard,Anton-Am/Orchard,alejandroaldana/Orchard,omidnasri/Orchard,kouweizhong/Orchard,IDeliverable/Orchard,RoyalVeterinaryCollege/Orchard,Dolphinsimon/Orchard,fassetar/Orchard,abhishekluv/Orchard,hhland/Orchard,mvarblow/Orchard,IDeliverable/Orchard,grapto/Orchard.CloudBust,phillipsj/Orchard,escofieldnaxos/Orchard,Ermesx/Orchard,AndreVolksdorf/Orchard,xkproject/Orchard,dmitry-urenev/extended-orchard-cms-v10.1,Serlead/Orchard,gcsuk/Orchard,luchaoshuai/Orchard,IDeliverable/Orchard,kouweizhong/Orchard,Ermesx/Orchard,dozoft/Orchard,grapto/Orchard.CloudBust,rtpHarry/Orchard,openbizgit/Orchard,dburriss/Orchard,SouleDesigns/SouleDesigns.Orchard,phillipsj/Orchard,qt1/Orchard,vairam-svs/Orchard,Sylapse/Orchard.HttpAuthSample,stormleoxia/Orchard,luchaoshuai/Orchard,emretiryaki/Orchard,abhishekluv/Orchard,xiaobudian/Orchard,AndreVolksdorf/Orchard,vairam-svs/Orchard
src/Orchard/Data/Migration/Schema/SchemaUtils.cs
src/Orchard/Data/Migration/Schema/SchemaUtils.cs
using System; using System.Data; namespace Orchard.Data.Migration.Schema { public static class SchemaUtils { [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1806:DoNotIgnoreMethodResults", MessageId = "System.Enum.TryParse<System.Data.DbType>(System.String,System.Boolean,System.Data.DbType@)")] public static DbType ToDbType(Type type) { DbType dbType; switch ( Type.GetTypeCode(type) ) { case TypeCode.String: dbType = DbType.String; break; case TypeCode.Int32: dbType = DbType.Int32; break; case TypeCode.DateTime: dbType = DbType.DateTime; break; case TypeCode.Boolean: dbType = DbType.Boolean; break; default: if(type == typeof(Guid)) dbType = DbType.Guid; else Enum.TryParse(Type.GetTypeCode(type).ToString(), true, out dbType); break; } return dbType; } } }
using System; using System.Data; namespace Orchard.Data.Migration.Schema { public static class SchemaUtils { [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1806:DoNotIgnoreMethodResults", MessageId = "System.Enum.TryParse<System.Data.DbType>(System.String,System.Boolean,System.Data.DbType@)")] public static DbType ToDbType(Type type) { DbType dbType; switch ( Type.GetTypeCode(type) ) { case TypeCode.String: dbType = DbType.String; break; case TypeCode.Int32: dbType = DbType.Int32; break; case TypeCode.DateTime: dbType = DbType.DateTime; break; case TypeCode.Boolean: dbType = DbType.Boolean; break; default: Enum.TryParse(Type.GetTypeCode(type).ToString(), true, out dbType); break; } return dbType; } } }
bsd-3-clause
C#
26277f62f444f9c24a161a1d3fee2276b3f4b5ea
Update days to estimated_days in Rate object
goshippo/shippo-csharp-client
Shippo/Rate.cs
Shippo/Rate.cs
using System; using Newtonsoft.Json; namespace Shippo { [JsonObject(MemberSerialization.OptIn)] public class Rate : ShippoId { [JsonProperty(PropertyName = "object_created")] public object ObjectCreated { get; set; } [JsonProperty(PropertyName = "object_owner")] public object ObjectOwner { get; set; } [JsonProperty(PropertyName = "attributes")] public object Attributes { get; set; } [JsonProperty(PropertyName = "amount_local")] public object AmountLocal { get; set; } [JsonProperty(PropertyName = "currency_local")] public object CurrencyLocal { get; set; } [JsonProperty(PropertyName = "amount")] public object Amount { get; set; } [JsonProperty(PropertyName = "currency")] public object Currency { get; set; } [JsonProperty(PropertyName = "provider")] public object Provider { get; set; } [JsonProperty(PropertyName = "provider_image_75")] public object ProviderImage75 { get; set; } [JsonProperty(PropertyName = "provider_image_200")] public object ProviderImage200 { get; set; } [JsonProperty(PropertyName = "servicelevel")] public object Servicelevel { get; set; } [JsonProperty(PropertyName = "estimated_days")] public object EstimatedDays { get; set; } [JsonProperty(PropertyName = "duration_terms")] public object DurationTerms { get; set; } [JsonProperty(PropertyName = "messages")] public object Messages { get; set; } [JsonProperty(PropertyName = "zone")] public object Zone { get; set; } } }
using System; using Newtonsoft.Json; namespace Shippo { [JsonObject(MemberSerialization.OptIn)] public class Rate : ShippoId { [JsonProperty(PropertyName = "object_created")] public object ObjectCreated { get; set; } [JsonProperty(PropertyName = "object_owner")] public object ObjectOwner { get; set; } [JsonProperty(PropertyName = "attributes")] public object Attributes { get; set; } [JsonProperty(PropertyName = "amount_local")] public object AmountLocal { get; set; } [JsonProperty(PropertyName = "currency_local")] public object CurrencyLocal { get; set; } [JsonProperty(PropertyName = "amount")] public object Amount { get; set; } [JsonProperty(PropertyName = "currency")] public object Currency { get; set; } [JsonProperty(PropertyName = "provider")] public object Provider { get; set; } [JsonProperty(PropertyName = "provider_image_75")] public object ProviderImage75 { get; set; } [JsonProperty(PropertyName = "provider_image_200")] public object ProviderImage200 { get; set; } [JsonProperty(PropertyName = "servicelevel")] public object Servicelevel { get; set; } [JsonProperty(PropertyName = "days")] public object Days { get; set; } [JsonProperty(PropertyName = "duration_terms")] public object DurationTerms { get; set; } [JsonProperty(PropertyName = "messages")] public object Messages { get; set; } [JsonProperty(PropertyName = "zone")] public object Zone { get; set; } } }
apache-2.0
C#
cd3ac1982adc3ac023db3b505668b7aa39f4b5b9
fix some non-async in StarChart too
WorldWideTelescope/wwt-website,WorldWideTelescope/wwt-website,WorldWideTelescope/wwt-website
src/WWT.Providers/Providers/Starchartprovider.cs
src/WWT.Providers/Providers/Starchartprovider.cs
#nullable disable using System; using System.Drawing; using System.Drawing.Imaging; using System.Threading; using System.Threading.Tasks; namespace WWT.Providers { [RequestEndpoint("/wwtweb/StarChart.aspx")] public class StarChartProvider : StarChart { public override string ContentType => ContentTypes.Png; public override async Task RunAsync(IWwtContext context, CancellationToken token) { double lat = double.Parse(context.Request.Params["lat"]); double lng = double.Parse(context.Request.Params["lng"]); double ra = double.Parse(context.Request.Params["ra"]); double dec = double.Parse(context.Request.Params["dec"]); double time = 0; int width = int.Parse(context.Request.Params["width"]); int height = int.Parse(context.Request.Params["height"]); if (context.Request.Params["jtime"] != null) { time = double.Parse(context.Request.Params["jtime"]); } else { if (context.Request.Params["time"] != null) { time = Calc.ToJulian(DateTime.Parse(context.Request.Params["time"])); } else { time = Calc.ToJulian(DateTime.Now.ToUniversalTime()); } } Bitmap chart = GetChart(lat, lng, time, ra, dec, width, height); await chart.SaveAsync(context.Response, ImageFormat.Png, token); chart.Dispose(); } } }
#nullable disable using System; using System.Drawing; using System.Drawing.Imaging; using System.Threading; using System.Threading.Tasks; namespace WWT.Providers { [RequestEndpoint("/wwtweb/StarChart.aspx")] public class StarChartProvider : StarChart { public override string ContentType => ContentTypes.Png; public override Task RunAsync(IWwtContext context, CancellationToken token) { double lat = double.Parse(context.Request.Params["lat"]); double lng = double.Parse(context.Request.Params["lng"]); double ra = double.Parse(context.Request.Params["ra"]); double dec = double.Parse(context.Request.Params["dec"]); double time = 0; int width = int.Parse(context.Request.Params["width"]); int height = int.Parse(context.Request.Params["height"]); if (context.Request.Params["jtime"] != null) { time = double.Parse(context.Request.Params["jtime"]); } else { if (context.Request.Params["time"] != null) { time = Calc.ToJulian(DateTime.Parse(context.Request.Params["time"])); } else { time = Calc.ToJulian(DateTime.Now.ToUniversalTime()); } } Bitmap chart = GetChart(lat, lng, time, ra, dec, width, height); chart.Save(context.Response.OutputStream, ImageFormat.Png); chart.Dispose(); return Task.CompletedTask; } } }
mit
C#
871872772e788d1e21741c9e11afc31486860eeb
Revert "Changed Regex for owners to make sure the string is at the end of the task description"
jawsthegame/PivotalExtension,jawsthegame/PivotalExtension
PivotalTrackerDotNet/Domain/Task.cs
PivotalTrackerDotNet/Domain/Task.cs
using System.Collections.Generic; using System.Text.RegularExpressions; using System.Linq; namespace PivotalTrackerDotNet.Domain { public class Task { public int Id { get; set; } public string Description { get; set; } public bool Complete { get; set; } public int ParentStoryId { get; set; } public int ProjectId { get; set; } static readonly AuthenticationToken Token = AuthenticationService.Authenticate("v5core", "changeme"); protected static List<Person> Members; static Regex FullOwnerRegex = new Regex(@"([ ]?\-[ ]?)?(\()?[A-Z]{2,3}(\/[A-Z]{2,3})*(\))?", RegexOptions.Compiled); public string GetDescriptionWithoutOwners() { var descriptionWithoutOwners = FullOwnerRegex.Replace(Description, ""); return descriptionWithoutOwners.Length == 0 ? "(Placeholder)" : descriptionWithoutOwners.TrimEnd(); } public void SetOwners(List<Person> owners) { if (owners.Count == 0) return; var match = FullOwnerRegex.Match(Description); if (match != null) { Description = Description.Remove(match.Index); var initials = string.Join("/", owners.Select(o => o.Initials)); Description += " - " + initials; } } public List<Person> GetOwners() { if (Members == null) { Members = new MembershipService(Token).GetMembers(ProjectId); } var owners = new List<Person>(); var regex = new Regex(@"[A-Z]{2,3}(\/[A-Z]{2,3})+"); var matches = regex.Matches(Description); if (matches.Count > 0) { var membersLookup = Members.ToDictionary(m => m.Initials); var initials = matches[0].Value.Split('/'); foreach (var owner in initials) { if (membersLookup.ContainsKey(owner)) { owners.Add(membersLookup[owner]); } } } return owners; } public string GetStyle() { if (this.Complete) { return "task complete"; } else if (this.GetOwners().Any()) { return "task in-progress"; } else { return "task"; } } public string GetIdToken() { return string.Format("{0}:{1}:{2}", ProjectId, ParentStoryId, Id); } } // <?xml version="1.0" encoding="UTF-8"?> //<task> // <id type="integer">$TASK_ID</id> // <description>find shields</description> // <position>1</position> // <complete>false</complete> // <created_at type="datetime">2008/12/10 00:00:00 UTC</created_at> //</task> }
using System.Collections.Generic; using System.Text.RegularExpressions; using System.Linq; namespace PivotalTrackerDotNet.Domain { public class Task { public int Id { get; set; } public string Description { get; set; } public bool Complete { get; set; } public int ParentStoryId { get; set; } public int ProjectId { get; set; } static readonly AuthenticationToken Token = AuthenticationService.Authenticate("v5core", "changeme"); protected static List<Person> Members; static Regex FullOwnerRegex = new Regex(@"([ ]?\-[ ]?)?(\()?[A-Z]{2,3}(\/[A-Z]{2,3})*(\))?$", RegexOptions.Compiled); public string GetDescriptionWithoutOwners() { var descriptionWithoutOwners = FullOwnerRegex.Replace(Description, ""); return descriptionWithoutOwners.Length == 0 ? "(Placeholder)" : descriptionWithoutOwners.TrimEnd(); } public void SetOwners(List<Person> owners) { if (owners.Count == 0) return; var match = FullOwnerRegex.Match(Description); if (match != null) { Description = Description.Remove(match.Index); var initials = string.Join("/", owners.Select(o => o.Initials)); Description += " - " + initials; } } public List<Person> GetOwners() { if (Members == null) { Members = new MembershipService(Token).GetMembers(ProjectId); } var owners = new List<Person>(); var regex = new Regex(@"[A-Z]{2,3}(\/[A-Z]{2,3})+"); var matches = regex.Matches(Description); if (matches.Count > 0) { var membersLookup = Members.ToDictionary(m => m.Initials); var initials = matches[0].Value.Split('/'); foreach (var owner in initials) { if (membersLookup.ContainsKey(owner)) { owners.Add(membersLookup[owner]); } } } return owners; } public string GetStyle() { if (this.Complete) { return "task complete"; } else if (this.GetOwners().Any()) { return "task in-progress"; } else { return "task"; } } public string GetIdToken() { return string.Format("{0}:{1}:{2}", ProjectId, ParentStoryId, Id); } } // <?xml version="1.0" encoding="UTF-8"?> //<task> // <id type="integer">$TASK_ID</id> // <description>find shields</description> // <position>1</position> // <complete>false</complete> // <created_at type="datetime">2008/12/10 00:00:00 UTC</created_at> //</task> }
mit
C#
625827ee2c51d63125f79f0a0678d637e9538efa
Update BuildWebsite.cs
dotnetsheff/dotnetsheff-api,dotnetsheff/dotnetsheff-api
src/dotnetsheff.Api/BuildWebsite/BuildWebsite.cs
src/dotnetsheff.Api/BuildWebsite/BuildWebsite.cs
using System; using System.Net.Http; using System.Net.Http.Headers; using System.Threading.Tasks; using Microsoft.Azure.WebJobs; using Microsoft.Azure.WebJobs.Host; namespace dotnetsheff.Api.BuildWebsite { public static class BuildWebsite { private static readonly HttpClient HttpClient = new HttpClient() { BaseAddress = new Uri("https://ci.appveyor.com/"), DefaultRequestHeaders = { Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("AppVeyorApiKey")) } }; [FunctionName("BuildWebsite")] public static async Task Run([TimerTrigger("0 0 5 1 * *")]TimerInfo myTimer, TraceWriter log) { var value = new { accountName = "kevbite", projectSlug = "dotnetsheff", branch = "master" }; var responseMessage = await HttpClient.PostAsJsonAsync("api/builds", value); responseMessage.EnsureSuccessStatusCode(); log.Info($"AppVeyor {value.accountName}/{value.projectSlug} {value.branch} build triggered"); } } }
using System; using System.Net.Http; using System.Net.Http.Headers; using System.Threading.Tasks; using Microsoft.Azure.WebJobs; using Microsoft.Azure.WebJobs.Host; namespace dotnetsheff.Api.BuildWebsite { public static class BuildWebsite { private static readonly HttpClient HttpClient = new HttpClient() { BaseAddress = new Uri("https://ci.appveyor.com/"), DefaultRequestHeaders = { Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("AppVeyorApiKey")) } }; [FunctionName("BuildWebsite")] public static async Task Run([TimerTrigger("0 0 5 * * ?")]TimerInfo myTimer, TraceWriter log) { var value = new { accountName = "kevbite", projectSlug = "dotnetsheff", branch = "master" }; var responseMessage = await HttpClient.PostAsJsonAsync("api/builds", value); responseMessage.EnsureSuccessStatusCode(); log.Info($"AppVeyor {value.accountName}/{value.projectSlug} {value.branch} build triggered"); } } }
mit
C#
54f79ad5dff458eafd372c00524236134568e66f
Use pattern switch
physhi/roslyn,VSadov/roslyn,abock/roslyn,agocke/roslyn,wvdd007/roslyn,KevinRansom/roslyn,MattWindsor91/roslyn,swaroop-sridhar/roslyn,CyrusNajmabadi/roslyn,weltkante/roslyn,srivatsn/roslyn,OmarTawfik/roslyn,jcouv/roslyn,MichalStrehovsky/roslyn,AdamSpeight2008/roslyn-AdamSpeight2008,mmitche/roslyn,VSadov/roslyn,mattscheffer/roslyn,robinsedlaczek/roslyn,AnthonyDGreen/roslyn,jcouv/roslyn,aelij/roslyn,srivatsn/roslyn,mgoertz-msft/roslyn,mavasani/roslyn,tmat/roslyn,diryboy/roslyn,CyrusNajmabadi/roslyn,orthoxerox/roslyn,nguerrera/roslyn,MichalStrehovsky/roslyn,tvand7093/roslyn,jkotas/roslyn,heejaechang/roslyn,AlekseyTs/roslyn,jasonmalinowski/roslyn,OmarTawfik/roslyn,AdamSpeight2008/roslyn-AdamSpeight2008,ErikSchierboom/roslyn,tannergooding/roslyn,panopticoncentral/roslyn,panopticoncentral/roslyn,Giftednewt/roslyn,Hosch250/roslyn,bartdesmet/roslyn,jcouv/roslyn,wvdd007/roslyn,CaptainHayashi/roslyn,nguerrera/roslyn,bkoelman/roslyn,davkean/roslyn,brettfo/roslyn,OmarTawfik/roslyn,mattscheffer/roslyn,cston/roslyn,eriawan/roslyn,mattscheffer/roslyn,gafter/roslyn,heejaechang/roslyn,mgoertz-msft/roslyn,tannergooding/roslyn,AmadeusW/roslyn,pdelvo/roslyn,lorcanmooney/roslyn,mavasani/roslyn,swaroop-sridhar/roslyn,paulvanbrenk/roslyn,tmeschter/roslyn,AnthonyDGreen/roslyn,bartdesmet/roslyn,brettfo/roslyn,aelij/roslyn,Hosch250/roslyn,shyamnamboodiripad/roslyn,khyperia/roslyn,jamesqo/roslyn,dotnet/roslyn,tvand7093/roslyn,tmeschter/roslyn,mmitche/roslyn,Giftednewt/roslyn,DustinCampbell/roslyn,weltkante/roslyn,KevinRansom/roslyn,pdelvo/roslyn,CaptainHayashi/roslyn,orthoxerox/roslyn,mavasani/roslyn,sharwell/roslyn,AlekseyTs/roslyn,robinsedlaczek/roslyn,AmadeusW/roslyn,shyamnamboodiripad/roslyn,lorcanmooney/roslyn,MichalStrehovsky/roslyn,dpoeschl/roslyn,diryboy/roslyn,sharwell/roslyn,xasx/roslyn,agocke/roslyn,CyrusNajmabadi/roslyn,eriawan/roslyn,jkotas/roslyn,tmeschter/roslyn,tmat/roslyn,khyperia/roslyn,pdelvo/roslyn,panopticoncentral/roslyn,physhi/roslyn,physhi/roslyn,jmarolf/roslyn,TyOverby/roslyn,MattWindsor91/roslyn,brettfo/roslyn,robinsedlaczek/roslyn,VSadov/roslyn,genlu/roslyn,jasonmalinowski/roslyn,cston/roslyn,TyOverby/roslyn,gafter/roslyn,MattWindsor91/roslyn,stephentoub/roslyn,bkoelman/roslyn,abock/roslyn,paulvanbrenk/roslyn,sharwell/roslyn,cston/roslyn,mgoertz-msft/roslyn,TyOverby/roslyn,heejaechang/roslyn,reaction1989/roslyn,AnthonyDGreen/roslyn,agocke/roslyn,diryboy/roslyn,jmarolf/roslyn,xasx/roslyn,reaction1989/roslyn,dotnet/roslyn,genlu/roslyn,jamesqo/roslyn,weltkante/roslyn,KirillOsenkov/roslyn,DustinCampbell/roslyn,khyperia/roslyn,KirillOsenkov/roslyn,tmat/roslyn,KirillOsenkov/roslyn,srivatsn/roslyn,jamesqo/roslyn,bkoelman/roslyn,DustinCampbell/roslyn,gafter/roslyn,eriawan/roslyn,stephentoub/roslyn,tannergooding/roslyn,KevinRansom/roslyn,davkean/roslyn,MattWindsor91/roslyn,davkean/roslyn,Hosch250/roslyn,reaction1989/roslyn,AmadeusW/roslyn,lorcanmooney/roslyn,xasx/roslyn,tvand7093/roslyn,dpoeschl/roslyn,AdamSpeight2008/roslyn-AdamSpeight2008,orthoxerox/roslyn,mmitche/roslyn,AlekseyTs/roslyn,Giftednewt/roslyn,jmarolf/roslyn,stephentoub/roslyn,ErikSchierboom/roslyn,shyamnamboodiripad/roslyn,paulvanbrenk/roslyn,swaroop-sridhar/roslyn,dotnet/roslyn,ErikSchierboom/roslyn,CaptainHayashi/roslyn,jasonmalinowski/roslyn,bartdesmet/roslyn,dpoeschl/roslyn,aelij/roslyn,jkotas/roslyn,nguerrera/roslyn,abock/roslyn,wvdd007/roslyn,genlu/roslyn
src/Features/CSharp/Portable/DesignerAttributes/CSharpDesignerAttributeService.cs
src/Features/CSharp/Portable/DesignerAttributes/CSharpDesignerAttributeService.cs
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System.Collections.Generic; using System.Composition; using System.Linq; using Microsoft.CodeAnalysis.CSharp.Syntax; using Microsoft.CodeAnalysis.DesignerAttributes; using Microsoft.CodeAnalysis.Host.Mef; using Roslyn.Utilities; namespace Microsoft.CodeAnalysis.CSharp.DesignerAttributes { [ExportLanguageService(typeof(IDesignerAttributeService), LanguageNames.CSharp), Shared] internal class CSharpDesignerAttributeService : AbstractDesignerAttributeService { protected override IEnumerable<SyntaxNode> GetAllTopLevelTypeDefined(SyntaxNode node) { var compilationUnit = node as CompilationUnitSyntax; if (compilationUnit == null) { return SpecializedCollections.EmptyEnumerable<SyntaxNode>(); } return compilationUnit.Members.SelectMany(GetAllTopLevelTypeDefined); } private IEnumerable<SyntaxNode> GetAllTopLevelTypeDefined(MemberDeclarationSyntax member) { switch (member) { case NamespaceDeclarationSyntax namespaceMember: return namespaceMember.Members.SelectMany(GetAllTopLevelTypeDefined); case ClassDeclarationSyntax type: return SpecializedCollections.SingletonEnumerable<SyntaxNode>(type); } return SpecializedCollections.EmptyEnumerable<SyntaxNode>(); } protected override bool ProcessOnlyFirstTypeDefined() { return true; } protected override bool HasAttributesOrBaseTypeOrIsPartial(SyntaxNode typeNode) { if (typeNode is ClassDeclarationSyntax classNode) { return classNode.AttributeLists.Count > 0 || classNode.BaseList != null || classNode.Modifiers.Any(SyntaxKind.PartialKeyword); } return false; } } }
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System.Collections.Generic; using System.Composition; using System.Linq; using Microsoft.CodeAnalysis.CSharp.Syntax; using Microsoft.CodeAnalysis.DesignerAttributes; using Microsoft.CodeAnalysis.Host.Mef; using Roslyn.Utilities; namespace Microsoft.CodeAnalysis.CSharp.DesignerAttributes { [ExportLanguageService(typeof(IDesignerAttributeService), LanguageNames.CSharp), Shared] internal class CSharpDesignerAttributeService : AbstractDesignerAttributeService { protected override IEnumerable<SyntaxNode> GetAllTopLevelTypeDefined(SyntaxNode node) { var compilationUnit = node as CompilationUnitSyntax; if (compilationUnit == null) { return SpecializedCollections.EmptyEnumerable<SyntaxNode>(); } return compilationUnit.Members.SelectMany(GetAllTopLevelTypeDefined); } private IEnumerable<SyntaxNode> GetAllTopLevelTypeDefined(MemberDeclarationSyntax member) { if (member is NamespaceDeclarationSyntax namespaceMember) { return namespaceMember.Members.SelectMany(GetAllTopLevelTypeDefined); } if (member is ClassDeclarationSyntax type) { return SpecializedCollections.SingletonEnumerable<SyntaxNode>(type); } return SpecializedCollections.EmptyEnumerable<SyntaxNode>(); } protected override bool ProcessOnlyFirstTypeDefined() { return true; } protected override bool HasAttributesOrBaseTypeOrIsPartial(SyntaxNode typeNode) { if (typeNode is ClassDeclarationSyntax classNode) { return classNode.AttributeLists.Count > 0 || classNode.BaseList != null || classNode.Modifiers.Any(SyntaxKind.PartialKeyword); } return false; } } }
mit
C#
3e9259ab682d8638c906fd7320a4e440810e7d1c
Update DefaultLayerEvaluationService.cs
JRKelso/Orchard,jchenga/Orchard,omidnasri/Orchard,AdvantageCS/Orchard,johnnyqian/Orchard,Lombiq/Orchard,TalaveraTechnologySolutions/Orchard,Fogolan/OrchardForWork,hbulzy/Orchard,Dolphinsimon/Orchard,LaserSrl/Orchard,mvarblow/Orchard,OrchardCMS/Orchard,SzymonSel/Orchard,Praggie/Orchard,neTp9c/Orchard,neTp9c/Orchard,fassetar/Orchard,Praggie/Orchard,armanforghani/Orchard,Serlead/Orchard,Fogolan/OrchardForWork,hbulzy/Orchard,phillipsj/Orchard,jersiovic/Orchard,sfmskywalker/Orchard-Off-The-Grid-Sample-Code,Codinlab/Orchard,LaserSrl/Orchard,aaronamm/Orchard,Lombiq/Orchard,jchenga/Orchard,gcsuk/Orchard,Praggie/Orchard,Dolphinsimon/Orchard,aaronamm/Orchard,sfmskywalker/Orchard-Off-The-Grid-Sample-Code,OrchardCMS/Orchard,TalaveraTechnologySolutions/Orchard,rtpHarry/Orchard,dmitry-urenev/extended-orchard-cms-v10.1,SouleDesigns/SouleDesigns.Orchard,SzymonSel/Orchard,OrchardCMS/Orchard,grapto/Orchard.CloudBust,fassetar/Orchard,rtpHarry/Orchard,TalaveraTechnologySolutions/Orchard,LaserSrl/Orchard,armanforghani/Orchard,fassetar/Orchard,abhishekluv/Orchard,JRKelso/Orchard,sfmskywalker/Orchard,Dolphinsimon/Orchard,IDeliverable/Orchard,neTp9c/Orchard,dmitry-urenev/extended-orchard-cms-v10.1,jagraz/Orchard,Codinlab/Orchard,LaserSrl/Orchard,li0803/Orchard,SouleDesigns/SouleDesigns.Orchard,SzymonSel/Orchard,jchenga/Orchard,hannan-azam/Orchard,aaronamm/Orchard,sfmskywalker/Orchard-Off-The-Grid-Sample-Code,yersans/Orchard,jimasp/Orchard,dmitry-urenev/extended-orchard-cms-v10.1,jersiovic/Orchard,sfmskywalker/Orchard,phillipsj/Orchard,rtpHarry/Orchard,aaronamm/Orchard,fassetar/Orchard,vairam-svs/Orchard,jagraz/Orchard,hannan-azam/Orchard,brownjordaninternational/OrchardCMS,geertdoornbos/Orchard,grapto/Orchard.CloudBust,mvarblow/Orchard,Dolphinsimon/Orchard,li0803/Orchard,xkproject/Orchard,jersiovic/Orchard,Serlead/Orchard,sfmskywalker/Orchard,Fogolan/OrchardForWork,AdvantageCS/Orchard,brownjordaninternational/OrchardCMS,Lombiq/Orchard,OrchardCMS/Orchard,IDeliverable/Orchard,tobydodds/folklife,gcsuk/Orchard,omidnasri/Orchard,TalaveraTechnologySolutions/Orchard,TalaveraTechnologySolutions/Orchard,jersiovic/Orchard,Praggie/Orchard,sfmskywalker/Orchard-Off-The-Grid-Sample-Code,omidnasri/Orchard,OrchardCMS/Orchard,bedegaming-aleksej/Orchard,omidnasri/Orchard,abhishekluv/Orchard,jagraz/Orchard,gcsuk/Orchard,sfmskywalker/Orchard,bedegaming-aleksej/Orchard,JRKelso/Orchard,omidnasri/Orchard,hannan-azam/Orchard,geertdoornbos/Orchard,omidnasri/Orchard,LaserSrl/Orchard,geertdoornbos/Orchard,armanforghani/Orchard,grapto/Orchard.CloudBust,AdvantageCS/Orchard,sfmskywalker/Orchard-Off-The-Grid-Sample-Code,yersans/Orchard,tobydodds/folklife,xkproject/Orchard,gcsuk/Orchard,SzymonSel/Orchard,jchenga/Orchard,johnnyqian/Orchard,sfmskywalker/Orchard,jtkech/Orchard,Praggie/Orchard,omidnasri/Orchard,Codinlab/Orchard,abhishekluv/Orchard,sfmskywalker/Orchard,bedegaming-aleksej/Orchard,jimasp/Orchard,phillipsj/Orchard,dmitry-urenev/extended-orchard-cms-v10.1,JRKelso/Orchard,sfmskywalker/Orchard,ehe888/Orchard,yersans/Orchard,ehe888/Orchard,jtkech/Orchard,jimasp/Orchard,aaronamm/Orchard,mvarblow/Orchard,hbulzy/Orchard,johnnyqian/Orchard,brownjordaninternational/OrchardCMS,omidnasri/Orchard,phillipsj/Orchard,tobydodds/folklife,brownjordaninternational/OrchardCMS,Fogolan/OrchardForWork,IDeliverable/Orchard,geertdoornbos/Orchard,ehe888/Orchard,vairam-svs/Orchard,li0803/Orchard,ehe888/Orchard,jimasp/Orchard,Lombiq/Orchard,bedegaming-aleksej/Orchard,rtpHarry/Orchard,geertdoornbos/Orchard,JRKelso/Orchard,hbulzy/Orchard,li0803/Orchard,brownjordaninternational/OrchardCMS,Codinlab/Orchard,Codinlab/Orchard,IDeliverable/Orchard,ehe888/Orchard,Lombiq/Orchard,TalaveraTechnologySolutions/Orchard,mvarblow/Orchard,jagraz/Orchard,TalaveraTechnologySolutions/Orchard,SzymonSel/Orchard,neTp9c/Orchard,fassetar/Orchard,vairam-svs/Orchard,SouleDesigns/SouleDesigns.Orchard,neTp9c/Orchard,xkproject/Orchard,xkproject/Orchard,bedegaming-aleksej/Orchard,jtkech/Orchard,Serlead/Orchard,vairam-svs/Orchard,Fogolan/OrchardForWork,phillipsj/Orchard,Dolphinsimon/Orchard,jersiovic/Orchard,mvarblow/Orchard,li0803/Orchard,SouleDesigns/SouleDesigns.Orchard,abhishekluv/Orchard,grapto/Orchard.CloudBust,yersans/Orchard,jtkech/Orchard,tobydodds/folklife,Serlead/Orchard,gcsuk/Orchard,armanforghani/Orchard,rtpHarry/Orchard,sfmskywalker/Orchard,omidnasri/Orchard,jimasp/Orchard,jagraz/Orchard,jchenga/Orchard,johnnyqian/Orchard,grapto/Orchard.CloudBust,abhishekluv/Orchard,Serlead/Orchard,SouleDesigns/SouleDesigns.Orchard,AdvantageCS/Orchard,jtkech/Orchard,vairam-svs/Orchard,armanforghani/Orchard,tobydodds/folklife,tobydodds/folklife,AdvantageCS/Orchard,hannan-azam/Orchard,abhishekluv/Orchard,xkproject/Orchard,TalaveraTechnologySolutions/Orchard,dmitry-urenev/extended-orchard-cms-v10.1,grapto/Orchard.CloudBust,hbulzy/Orchard,yersans/Orchard,johnnyqian/Orchard,hannan-azam/Orchard,IDeliverable/Orchard
src/Orchard.Web/Modules/Orchard.Widgets/Services/DefaultLayerEvaluationService.cs
src/Orchard.Web/Modules/Orchard.Widgets/Services/DefaultLayerEvaluationService.cs
using System; using System.Collections.Generic; using Orchard.Conditions.Services; using Orchard.Localization; using Orchard.Logging; using Orchard.Widgets.Models; using Orchard.ContentManagement; using Orchard.ContentManagement.Utilities; namespace Orchard.Widgets.Services{ public class DefaultLayerEvaluationService : ILayerEvaluationService { private readonly IConditionManager _conditionManager; private readonly IOrchardServices _orchardServices; private readonly LazyField<int[]> _activeLayerIDs; public DefaultLayerEvaluationService(IConditionManager conditionManager, IOrchardServices orchardServices) { _conditionManager = conditionManager; _orchardServices = orchardServices; Logger = NullLogger.Instance; T = NullLocalizer.Instance; _activeLayerIDs = new LazyField<int[]>(); _activeLayerIDs.Loader(PopulateActiveLayers); } public ILogger Logger { get; set; } public Localizer T { get; set; } /// <summary> /// Retrieves every Layer from the Content Manager and evaluates each one. /// </summary> /// <returns> /// A collection of integers that represents the Ids of each active Layer /// </returns> public int[] GetActiveLayerIds() { return _activeLayerIDs.Value; } private int[] PopulateActiveLayers() { // Once the Condition Engine is done: // Get Layers and filter by zone and rule // NOTE: .ForType("Layer") is faster than .Query<LayerPart, LayerPartRecord>() var activeLayers = _orchardServices.ContentManager.Query<LayerPart>().ForType("Layer").List(); var activeLayerIds = new List<int>(); foreach (var activeLayer in activeLayers) { // ignore the rule if it fails to execute try { if (_conditionManager.Matches(activeLayer.LayerRule)) { activeLayerIds.Add(activeLayer.ContentItem.Id); } } catch (Exception e) { Logger.Warning(e, T("An error occurred during layer evaluation on: {0}", activeLayer.Name).Text); } } return activeLayerIds.ToArray(); } } }
using System; using System.Collections.Generic; using Orchard.Conditions.Services; using Orchard.Localization; using Orchard.Logging; using Orchard.Widgets.Models; using Orchard.ContentManagement; using Orchard.ContentManagement.Utilities; namespace Orchard.Widgets.Services{ public class DefaultLayerEvaluationService : ILayerEvaluationService { private readonly IConditionManager _conditionManager; private readonly IOrchardServices _orchardServices; private readonly LazyField<int[]> _activeLayerIDs; public DefaultLayerEvaluationService(IConditionManager conditionManager, IOrchardServices orchardServices) { _conditionManager = conditionManager; _orchardServices = orchardServices; Logger = NullLogger.Instance; T = NullLocalizer.Instance; _activeLayerIDs = new LazyField<int[]>(); _activeLayerIDs.Loader(PopulateActiveLayers); } public ILogger Logger { get; set; } public Localizer T { get; set; } /// <summary> /// Retrieves every Layer from the Content Manager and evaluates each one. /// </summary> /// <returns> /// A collection of integers that represents the Ids of each active Layer /// </returns> public int[] GetActiveLayerIds() { return _activeLayerIDs.Value; } private int[] PopulateActiveLayers() { // Once the Condition Engine is done: // Get Layers and filter by zone and rule // NOTE: .ForType("Layer") is faster than .Query<LayerPart, LayerPartRecord>() var activeLayers = _orchardServices.ContentManager.Query<LayerPart>().WithQueryHints(new QueryHints().ExpandParts<LayerPart>()).ForType("Layer").List(); var activeLayerIds = new List<int>(); foreach (var activeLayer in activeLayers) { // ignore the rule if it fails to execute try { if (_conditionManager.Matches(activeLayer.LayerRule)) { activeLayerIds.Add(activeLayer.ContentItem.Id); } } catch (Exception e) { Logger.Warning(e, T("An error occurred during layer evaluation on: {0}", activeLayer.Name).Text); } } return activeLayerIds.ToArray(); } } }
bsd-3-clause
C#
7985b9e5e44af192f6cb5f08be72d2986c1b6525
update assembly for release
zoosk/testrail-client
TestRail/Properties/AssemblyInfo.cs
TestRail/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("TestRail Client")] [assembly: AssemblyDescription("TestRail Client Library")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Zoosk")] [assembly: AssemblyProduct("TestRail Client Library for .NET")] [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(true)] // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("b91a1174-5709-412a-9e95-ccaad637454c")] // 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.10")] [assembly: AssemblyFileVersion("1.0.0.10")]
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("TestRail Client")] [assembly: AssemblyDescription("TestRail Client Library")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Zoosk")] [assembly: AssemblyProduct("TestRail Client Library for .NET")] [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(true)] // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("b91a1174-5709-412a-9e95-ccaad637454c")] // 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.9")] [assembly: AssemblyFileVersion("1.0.0.9")]
apache-2.0
C#
e4789add18bf42e05141db26e24b7c3186d817ec
Update ConvertingPieChartToImageFile.cs
asposecells/Aspose_Cells_NET,maria-shahid-aspose/Aspose.Cells-for-.NET,aspose-cells/Aspose.Cells-for-.NET,asposecells/Aspose_Cells_NET,maria-shahid-aspose/Aspose.Cells-for-.NET,maria-shahid-aspose/Aspose.Cells-for-.NET,aspose-cells/Aspose.Cells-for-.NET,maria-shahid-aspose/Aspose.Cells-for-.NET,asposecells/Aspose_Cells_NET,aspose-cells/Aspose.Cells-for-.NET,aspose-cells/Aspose.Cells-for-.NET,asposecells/Aspose_Cells_NET
Examples/CSharp/Articles/ConvertExcelChartToImage/ConvertingPieChartToImageFile.cs
Examples/CSharp/Articles/ConvertExcelChartToImage/ConvertingPieChartToImageFile.cs
using System.IO; using Aspose.Cells; namespace Aspose.Cells.Examples.Articles.ConvertExcelChartToImage { public class ConvertingPieChartToImageFile { public static void Main(string[] args) { //ExStart:1 // The path to the documents directory. string dataDir = Aspose.Cells.Examples.Utils.GetDataDir(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); //Create a new workbook. //Open the existing excel file which contains the pie chart. Workbook workbook = new Workbook(dataDir+ "PieChart.xls"); //Get the designer chart (first chart) in the first worksheet. //of the workbook. Aspose.Cells.Charts.Chart chart = workbook.Worksheets[0].Charts[0]; //Convert the chart to an image file. chart.ToImage(dataDir+ "PieChart.out.emf", System.Drawing.Imaging.ImageFormat.Emf); //ExEnd:1 } } }
using System.IO; using Aspose.Cells; namespace Aspose.Cells.Examples.Articles.ConvertExcelChartToImage { public class ConvertingPieChartToImageFile { public static void Main(string[] args) { // The path to the documents directory. string dataDir = Aspose.Cells.Examples.Utils.GetDataDir(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); //Create a new workbook. //Open the existing excel file which contains the pie chart. Workbook workbook = new Workbook(dataDir+ "PieChart.xls"); //Get the designer chart (first chart) in the first worksheet. //of the workbook. Aspose.Cells.Charts.Chart chart = workbook.Worksheets[0].Charts[0]; //Convert the chart to an image file. chart.ToImage(dataDir+ "PieChart.out.emf", System.Drawing.Imaging.ImageFormat.Emf); } } }
mit
C#
7e0c242e65d58a381f70383318fc841d406236a7
enable events on token client tests code path
roflkins/IdentityServer3,IdentityServer/IdentityServer3,johnkors/Thinktecture.IdentityServer.v3,johnkors/Thinktecture.IdentityServer.v3,roflkins/IdentityServer3,IdentityServer/IdentityServer3,IdentityServer/IdentityServer3,johnkors/Thinktecture.IdentityServer.v3,roflkins/IdentityServer3
source/Tests/UnitTests/TokenClients/Setup/Startup.cs
source/Tests/UnitTests/TokenClients/Setup/Startup.cs
using IdentityServer3.Core.Configuration; using IdentityServer3.Core.Services; using Microsoft.Owin.Builder; using Owin; namespace IdentityServer3.Tests.TokenClients { class TokenClientIdentityServer { public static AppBuilder Create() { AppBuilder app = new AppBuilder(); var factory = new IdentityServerServiceFactory() .UseInMemoryClients(Clients.Get()) .UseInMemoryScopes(Scopes.Get()) .UseInMemoryUsers(Users.Get()); factory.CustomGrantValidators.Add(new Registration<ICustomGrantValidator, CustomGrantValidator>()); factory.CustomGrantValidators.Add(new Registration<ICustomGrantValidator, CustomGrantValidator2>()); app.UseIdentityServer(new IdentityServerOptions { EventsOptions = new EventsOptions { RaiseErrorEvents = true, RaiseFailureEvents = true, RaiseInformationEvents = true, RaiseSuccessEvents = true }, IssuerUri = "https://idsrv3", SigningCertificate = TestCert.Load(), Factory = factory }); return app; } } }
using IdentityServer3.Core.Configuration; using IdentityServer3.Core.Services; using Microsoft.Owin.Builder; using Owin; namespace IdentityServer3.Tests.TokenClients { class TokenClientIdentityServer { public static AppBuilder Create() { AppBuilder app = new AppBuilder(); var factory = new IdentityServerServiceFactory() .UseInMemoryClients(Clients.Get()) .UseInMemoryScopes(Scopes.Get()) .UseInMemoryUsers(Users.Get()); factory.CustomGrantValidators.Add(new Registration<ICustomGrantValidator, CustomGrantValidator>()); factory.CustomGrantValidators.Add(new Registration<ICustomGrantValidator, CustomGrantValidator2>()); app.UseIdentityServer(new IdentityServerOptions { IssuerUri = "https://idsrv3", SigningCertificate = TestCert.Load(), Factory = factory }); return app; } } }
apache-2.0
C#
328e47834e3abbc9f89e8e4c04bdb55d283a8ce0
Add ASP.NET Core MapGet routing end point example.
github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql
csharp/ql/test/library-tests/dataflow/flowsources/aspremote/AspRemoteFlowSource.cs
csharp/ql/test/library-tests/dataflow/flowsources/aspremote/AspRemoteFlowSource.cs
using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Mvc; namespace Testing { public class ViewModel { public string RequestId { get; set; } // Considered tainted. public object RequestIdField; // Not considered tainted as it is a field. public string RequestIdOnlyGet { get; } // Not considered tainted as there is no setter. public string RequestIdPrivateSet { get; private set; } // Not considered tainted as it has a private setter. public static object RequestIdStatic { get; set; } // Not considered tainted as it is static. private string RequestIdPrivate { get; set; } // Not considered tainted as it is private. } public class TestController : Controller { public object MyAction(ViewModel viewModel) { throw null; } } public class AspRoutingEndpoints { public void M1(string[] args) { var builder = WebApplication.CreateBuilder(args); var app = builder.Build(); // The delegate parameters are considered flow sources. app.MapGet("/api/redirect/{newUrl}", (string newUrl) => { }); app.Run(); } } }
using Microsoft.AspNetCore.Mvc; namespace Testing { public class ViewModel { public string RequestId { get; set; } // Considered tainted. public object RequestIdField; // Not considered tainted as it is a field. public string RequestIdOnlyGet { get; } // Not considered tainted as there is no setter. public string RequestIdPrivateSet { get; private set; } // Not considered tainted as it has a private setter. public static object RequestIdStatic { get; set; } // Not considered tainted as it is static. private string RequestIdPrivate { get; set; } // Not considered tainted as it is private. } public class TestController : Controller { public object MyAction(ViewModel viewModel) { throw null; } } }
mit
C#
947de2a4d16d4fbcff647a23561cde6817550f7c
Update Program.cs
relianz/s2i-aspnet-example,relianz/s2i-aspnet-example,relianz/s2i-aspnet-example
app/Program.cs
app/Program.cs
// using System; // using System.Collections.Generic; // using System.IO; // using System.Linq; // using System.Threading.Tasks; using Microsoft.AspNetCore.Hosting; using Microsoft.Extensions.Configuration; namespace WebApplication { public class Program { public static void Main(string[] args) { var config = new ConfigurationBuilder() .AddEnvironmentVariables("") .Build(); var url = config["ASPNETCORE_URLS"] ?? "http://*:8080"; var host = new WebHostBuilder() .UseKestrel() .UseContentRoot(Directory.GetCurrentDirectory()) .UseIISIntegration() .UseStartup<Startup>() .UseUrls(url) .Build(); host.Run(); } } }
using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Threading.Tasks; using Microsoft.AspNetCore.Hosting; using Microsoft.Extensions.Configuration; namespace WebApplication { public class Program { public static void Main(string[] args) { var config = new ConfigurationBuilder() .AddEnvironmentVariables("") .Build(); var url = config["ASPNETCORE_URLS"] ?? "http://*:8080"; var host = new WebHostBuilder() .UseKestrel() .UseContentRoot(Directory.GetCurrentDirectory()) .UseIISIntegration() .UseStartup<Startup>() .UseUrls(url) .Build(); host.Run(); } } }
apache-2.0
C#
550e959d293821d5d89293e71db60d27c45cfa3c
Update API
numenta/htmresearch,ywcui1990/htmresearch,ywcui1990/nupic.research,numenta/htmresearch,ywcui1990/nupic.research,numenta/htmresearch,cogmission/nupic.research,neuroidss/nupic.research,mrcslws/htmresearch,marionleborgne/nupic.research,chanceraine/nupic.research,numenta/htmresearch,subutai/htmresearch,mrcslws/htmresearch,chanceraine/nupic.research,marionleborgne/nupic.research,BoltzmannBrain/nupic.research,cogmission/nupic.research,ThomasMiconi/nupic.research,ThomasMiconi/nupic.research,neuroidss/nupic.research,ywcui1990/htmresearch,chanceraine/nupic.research,neuroidss/nupic.research,ThomasMiconi/nupic.research,neuroidss/nupic.research,mrcslws/htmresearch,cogmission/nupic.research,ThomasMiconi/nupic.research,ywcui1990/nupic.research,marionleborgne/nupic.research,BoltzmannBrain/nupic.research,ThomasMiconi/htmresearch,chanceraine/nupic.research,BoltzmannBrain/nupic.research,mrcslws/htmresearch,marionleborgne/nupic.research,ywcui1990/htmresearch,chanceraine/nupic.research,ywcui1990/htmresearch,neuroidss/nupic.research,ywcui1990/nupic.research,mrcslws/htmresearch,ywcui1990/nupic.research,numenta/htmresearch,marionleborgne/nupic.research,ywcui1990/htmresearch,marionleborgne/nupic.research,numenta/htmresearch,BoltzmannBrain/nupic.research,ywcui1990/nupic.research,neuroidss/nupic.research,cogmission/nupic.research,BoltzmannBrain/nupic.research,ThomasMiconi/htmresearch,subutai/htmresearch,mrcslws/htmresearch,neuroidss/nupic.research,subutai/htmresearch,ywcui1990/htmresearch,ThomasMiconi/nupic.research,ThomasMiconi/nupic.research,cogmission/nupic.research,ThomasMiconi/htmresearch,ThomasMiconi/htmresearch,subutai/htmresearch,cogmission/nupic.research,BoltzmannBrain/nupic.research,subutai/htmresearch,ThomasMiconi/htmresearch,numenta/htmresearch,subutai/htmresearch,BoltzmannBrain/nupic.research,ThomasMiconi/htmresearch,ywcui1990/htmresearch,ywcui1990/nupic.research,marionleborgne/nupic.research,subutai/htmresearch,mrcslws/htmresearch,ThomasMiconi/nupic.research,subutai/htmresearch,ywcui1990/nupic.research,BoltzmannBrain/nupic.research,ThomasMiconi/nupic.research,cogmission/nupic.research,ThomasMiconi/htmresearch,mrcslws/htmresearch,marionleborgne/nupic.research,neuroidss/nupic.research,cogmission/nupic.research,ywcui1990/htmresearch,numenta/htmresearch,chanceraine/nupic.research,ThomasMiconi/htmresearch
vehicle-control/simulation/Assets/Scripts/API.cs
vehicle-control/simulation/Assets/Scripts/API.cs
using UnityEngine; using System.Collections; using System.Collections.Generic; using JsonFx; public class DataDefinition { public string name; public string type; } public class API : MonoBehaviour { public bool blockOnResponse = false; public float updateRate = 30; // hertz public float runSpeed = 1.0f; public string serverURL = "http://localhost:8080"; private bool _isWaitingForResponse; private float _lastSyncTime; private Dictionary<string, object> _outputData; private Dictionary<string, object> _inputData; public void SetOutput(string name, object data) { _outputData [name] = data; } public object GetInput(string name) { if (_inputData.ContainsKey (name)) { return _inputData [name]; } return null; } void ClearOutput() { _outputData = new Dictionary<string, object>(); } void ClearInput() { _inputData = new Dictionary<string, object>(); } void Clear() { ClearOutput(); ClearInput(); } /* Data transfer */ IEnumerator SendReset() { string pth = "/reset"; WWW www = new WWW(serverURL + pth); yield return www; } IEnumerator Sync() { WWWForm form = new WWWForm(); form.AddField ("outputData", JsonWriter.Serialize(_outputData)); string pth = "/sync"; WWW www = new WWW(serverURL + pth, form); yield return www; _isWaitingForResponse = false; if (blockOnResponse) { Time.timeScale = 1.0f; } if (www.error != null) return false; _inputData = JsonReader.Deserialize<Dictionary<string, object>>(www.text); ClearOutput(); } /* Events */ void Start() { Clear(); StartCoroutine("SendReset"); } void OnLevelWasLoaded(int level) { Clear(); StartCoroutine("SendReset"); } void Update() { Time.timeScale = runSpeed; } void LateUpdate () { if (Time.time - _lastSyncTime < 1 / updateRate) { return; } if (blockOnResponse && _isWaitingForResponse) { return; } _lastSyncTime = Time.time; StartCoroutine ("Sync"); _isWaitingForResponse = true; if (blockOnResponse) { Time.timeScale = 0.0f; } } /* Persistent Singleton */ private static API _instance; public static API instance { get { if (_instance == null) { _instance = GameObject.FindObjectOfType<API>(); DontDestroyOnLoad(_instance.gameObject); } return _instance; } } void Awake() { if (_instance == null) { _instance = this; DontDestroyOnLoad(this); } else { if(this != _instance) Destroy(this.gameObject); } } }
using UnityEngine; using System.Collections; using System.Collections.Generic; using JsonFx; public class DataDefinition { public string name; public string type; } public class API : MonoBehaviour { public bool blockOnResponse = false; public float updateRate = 30; // hertz public float runSpeed = 1.0f; public string serverURL = "http://localhost:8080"; private bool _isWaitingForResponse; private float _lastSyncTime; private Dictionary<string, object> _outputData; private Dictionary<string, object> _inputData; public void SetOutput(string name, object data) { _outputData [name] = data; } public object GetInput(string name) { if (_inputData.ContainsKey (name)) { return _inputData [name]; } return null; } void Clear() { _outputData = new Dictionary<string, object>(); _inputData = new Dictionary<string, object>(); } /* Data transfer */ IEnumerator SendReset() { string pth = "/reset"; WWW www = new WWW(serverURL + pth); yield return www; } IEnumerator Sync() { WWWForm form = new WWWForm(); form.AddField ("outputData", JsonWriter.Serialize(_outputData)); string pth = "/sync"; WWW www = new WWW(serverURL + pth, form); yield return www; _isWaitingForResponse = false; if (blockOnResponse) { Time.timeScale = 1.0f; } if (www.error != null) return false; _inputData = JsonReader.Deserialize<Dictionary<string, object>>(www.text); } /* Events */ void Start() { Clear(); StartCoroutine("SendReset"); } void OnLevelWasLoaded(int level) { Clear(); StartCoroutine("SendReset"); } void Update() { Time.timeScale = runSpeed; } void LateUpdate () { if (Time.time - _lastSyncTime < 1 / updateRate) { return; } if (blockOnResponse && _isWaitingForResponse) { return; } _lastSyncTime = Time.time; StartCoroutine ("Sync"); _isWaitingForResponse = true; if (blockOnResponse) { Time.timeScale = 0.0f; } } /* Persistent Singleton */ private static API _instance; public static API instance { get { if (_instance == null) { _instance = GameObject.FindObjectOfType<API>(); DontDestroyOnLoad(_instance.gameObject); } return _instance; } } void Awake() { if (_instance == null) { _instance = this; DontDestroyOnLoad(this); } else { if(this != _instance) Destroy(this.gameObject); } } }
agpl-3.0
C#
59b7de46883a5a1af40ef8f82aadd31f9b4fb3f4
Update PostType.cs
vknet/vk,vknet/vk
VkNet/Enums/SafetyEnums/PostType.cs
VkNet/Enums/SafetyEnums/PostType.cs
using System; namespace VkNet.Enums.SafetyEnums { /// <summary> /// Тип записи post, copy, reply, postpone, suggest /// </summary> [Serializable] public sealed class PostType : SafetyEnum<PostType> { /// <summary> /// Запись на стене (по умолчанию); /// v5.6+ - репосты имею тип "post" /// </summary> public static readonly PostType Post = RegisterPossibleValue(value: "post"); /// <summary> /// Репост до версии 5.6 (сейчас не описано) /// </summary> public static readonly PostType Copy = RegisterPossibleValue(value: "copy"); /// <summary> /// Ответ на запись с закрытыми комментариями (м.б. еще что-то) /// </summary> public static readonly PostType Reply = RegisterPossibleValue(value: "reply"); /// <summary> /// Закрепленная запись /// </summary> public static readonly PostType Postpone = RegisterPossibleValue(value: "postpone"); /// <summary> /// Предложенная запись /// </summary> public static readonly PostType Suggest = RegisterPossibleValue(value: "suggest"); } }
using System; namespace VkNet.Enums.SafetyEnums { /// <summary> /// Тип записи post, copy, reply, postpone, suggest /// </summary> [Serializable] public sealed class PostType : SafetyEnum<PostType> { /// <summary> /// Популярные за день (по умолчанию); /// </summary> public static readonly PostType Post = RegisterPossibleValue(value: "post"); /// <summary> /// По посещаемости /// </summary> public static readonly PostType Copy = RegisterPossibleValue(value: "copy"); /// <summary> /// По посещаемости /// </summary> public static readonly PostType Reply = RegisterPossibleValue(value: "reply"); /// <summary> /// По посещаемости /// </summary> public static readonly PostType Postpone = RegisterPossibleValue(value: "postpone"); /// <summary> /// По посещаемости /// </summary> public static readonly PostType Suggest = RegisterPossibleValue(value: "suggest"); } }
mit
C#
c707c7a4f6216c46518e5079658438e13fda9e02
Use Be instead of BeEquivalentTo
beardgame/utilities
Bearded.Utilities.Testing/Core/MaybeAssertions.cs
Bearded.Utilities.Testing/Core/MaybeAssertions.cs
using FluentAssertions; using FluentAssertions.Execution; namespace Bearded.Utilities.Testing { public sealed class MaybeAssertions<T> { private readonly Maybe<T> subject; public MaybeAssertions(Maybe<T> instance) => subject = instance; [CustomAssertion] public void BeJust(T value, string because = "", params object[] becauseArgs) { BeJust().Which.Should().Be(value, because, becauseArgs); } [CustomAssertion] public AndWhichConstraint<MaybeAssertions<T>, T> BeJust(string because = "", params object[] becauseArgs) { var onValueCalled = false; var matched = default(T); subject.Match( onValue: actual => { onValueCalled = true; matched = actual; }, onNothing: () => { }); Execute.Assertion .BecauseOf(because, becauseArgs) .ForCondition(onValueCalled) .FailWith("Expected maybe to have value, but had none."); return new AndWhichConstraint<MaybeAssertions<T>, T>(this, matched); } [CustomAssertion] public void BeNothing(string because = "", params object[] becauseArgs) { var onNothingCalled = false; subject.Match(onValue: _ => { }, onNothing: () => onNothingCalled = true); Execute.Assertion .BecauseOf(because, becauseArgs) .ForCondition(onNothingCalled) .FailWith("Expected maybe to be nothing, but had value."); } } }
using FluentAssertions; using FluentAssertions.Execution; namespace Bearded.Utilities.Testing { public sealed class MaybeAssertions<T> { private readonly Maybe<T> subject; public MaybeAssertions(Maybe<T> instance) => subject = instance; [CustomAssertion] public void BeJust(T value, string because = "", params object[] becauseArgs) { BeJust().Which.Should().BeEquivalentTo(value, because, becauseArgs); } [CustomAssertion] public AndWhichConstraint<MaybeAssertions<T>, T> BeJust(string because = "", params object[] becauseArgs) { var onValueCalled = false; var matched = default(T); subject.Match( onValue: actual => { onValueCalled = true; matched = actual; }, onNothing: () => { }); Execute.Assertion .BecauseOf(because, becauseArgs) .ForCondition(onValueCalled) .FailWith("Expected maybe to have value, but had none."); return new AndWhichConstraint<MaybeAssertions<T>, T>(this, matched); } [CustomAssertion] public void BeNothing(string because = "", params object[] becauseArgs) { var onNothingCalled = false; subject.Match(onValue: _ => { }, onNothing: () => onNothingCalled = true); Execute.Assertion .BecauseOf(because, becauseArgs) .ForCondition(onNothingCalled) .FailWith("Expected maybe to be nothing, but had value."); } } }
mit
C#
2f0f104ae259a17bf15a81f79eed2a1f24e2d772
Add the new scripts to each page
adrianbanks/BroadbandSpeedStats,adrianbanks/BroadbandSpeedStats,adrianbanks/BroadbandSpeedStats,adrianbanks/BroadbandSpeedStats
Website/Views/Shared/_Layout.cshtml
Website/Views/Shared/_Layout.cshtml
@model BroadbandSpeedStats.Models.SpeedTestResultRequest <!-- Template from http://getbootstrap.com/examples/dashboard/ --> <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="icon" href="/Images/favicon.ico"> <title>Broadband Speed Stats</title> <link href="/Content/bootstrap.min.css" rel="stylesheet"> <link href="/Content/dashboard.css" rel="stylesheet"> <!--[if lt IE 9]> <script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script> <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> <![endif]--> </head> <body> @Html.Partial("_NavBar") <div class="container-fluid"> <div class="row"> <div class="col-sm-3 col-md-2 sidebar"> <ul class="nav nav-sidebar"> <li class="active"><a href="#">Overview <span class="sr-only">(current)</span></a></li> <li><a href="#">second</a></li> </ul> <ul class="nav nav-sidebar"> <li><a href="">another</a></li> <li><a href="">another one</a></li> </ul> </div> <div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main"> @RenderBody() </div> </div> </div> <script src="/Scripts/jquery-1.9.1.min.js"></script> <script src="/Scripts/bootstrap.min.js"></script> <script src="/Scripts/Chart.bundle.min.js"></script> <script src="/Scripts/raphael-2.1.4.min.js"></script> <script src="/Scripts/justgage.js"></script> @RenderSection("pageScripts", required: false) </body> </html>
@model BroadbandSpeedStats.Models.SpeedTestResultRequest <!-- Template from http://getbootstrap.com/examples/dashboard/ --> <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="icon" href="/Images/favicon.ico"> <title>Broadband Speed Stats</title> <link href="/Content/bootstrap.min.css" rel="stylesheet"> <link href="/Content/dashboard.css" rel="stylesheet"> <!--[if lt IE 9]> <script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script> <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> <![endif]--> </head> <body> @Html.Partial("_NavBar") <div class="container-fluid"> <div class="row"> <div class="col-sm-3 col-md-2 sidebar"> <ul class="nav nav-sidebar"> <li class="active"><a href="#">Overview <span class="sr-only">(current)</span></a></li> <li><a href="#">second</a></li> </ul> <ul class="nav nav-sidebar"> <li><a href="">another</a></li> <li><a href="">another one</a></li> </ul> </div> <div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main"> @RenderBody() </div> </div> </div> <script src="/Scripts/jquery-1.9.1.min.js"></script> <script src="/Scripts/bootstrap.min.js"></script> </body> </html>
mit
C#
19c295525c19f0657587bf17524221b97490e890
Bump version
Coding-Enthusiast/BitcoinTransactionTool
BitcoinTransactionTool/Properties/AssemblyInfo.cs
BitcoinTransactionTool/Properties/AssemblyInfo.cs
using System.Reflection; using System.Resources; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Windows; // 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("BitcoinTransactionTool")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Coding Enthusiast")] [assembly: AssemblyProduct("BitcoinTransactionTool")] [assembly: AssemblyCopyright("Copyright © Coding Enthusiast 2017")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] //In order to begin building localizable applications, set //<UICulture>CultureYouAreCodingWith</UICulture> in your .csproj file //inside a <PropertyGroup>. For example, if you are using US english //in your source files, set the <UICulture> to en-US. Then uncomment //the NeutralResourceLanguage attribute below. Update the "en-US" in //the line below to match the UICulture setting in the project file. //[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)] [assembly: ThemeInfo( ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located //(used if a resource is not found in the page, // or application resource dictionaries) ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located //(used if a resource is not found in the page, // app, or any theme specific resource dictionaries) )] // 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.10.0.0")] [assembly: AssemblyFileVersion("0.10.0.0")]
using System.Reflection; using System.Resources; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Windows; // 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("BitcoinTransactionTool")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Coding Enthusiast")] [assembly: AssemblyProduct("BitcoinTransactionTool")] [assembly: AssemblyCopyright("Copyright © Coding Enthusiast 2017")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] //In order to begin building localizable applications, set //<UICulture>CultureYouAreCodingWith</UICulture> in your .csproj file //inside a <PropertyGroup>. For example, if you are using US english //in your source files, set the <UICulture> to en-US. Then uncomment //the NeutralResourceLanguage attribute below. Update the "en-US" in //the line below to match the UICulture setting in the project file. //[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)] [assembly: ThemeInfo( ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located //(used if a resource is not found in the page, // or application resource dictionaries) ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located //(used if a resource is not found in the page, // app, or any theme specific resource dictionaries) )] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("0.9.4.0")] [assembly: AssemblyFileVersion("0.9.4.0")]
mit
C#
faa991ce4d9540d42624416db97aed4431f8a539
remove libc function signature comment
NickStrupat/CacheLineSize.NET
OSX.cs
OSX.cs
using System; using System.Runtime.InteropServices; namespace NickStrupat { internal static class OSX { public static Int32 GetSize() { IntPtr lineSize; IntPtr sizeOfLineSize = (IntPtr) IntPtr.Size; sysctlbyname("hw.cachelinesize", out lineSize, ref sizeOfLineSize, IntPtr.Zero, IntPtr.Zero); return lineSize.ToInt32(); } [DllImport("libc")] private static extern int sysctlbyname(string name, out IntPtr oldp, ref IntPtr oldlenp, IntPtr newp, IntPtr newlen); } }
using System; using System.Runtime.InteropServices; namespace NickStrupat { internal static class OSX { public static Int32 GetSize() { IntPtr lineSize; IntPtr sizeOfLineSize = (IntPtr) IntPtr.Size; sysctlbyname("hw.cachelinesize", out lineSize, ref sizeOfLineSize, IntPtr.Zero, IntPtr.Zero); return lineSize.ToInt32(); } [DllImport("libc")] private static extern int sysctlbyname(string name, out IntPtr oldp, ref IntPtr oldlenp, IntPtr newp, IntPtr newlen); // int sysctlbyname(const char *name, void *oldp, size_t *oldlenp, void *newp, size_t newlen); } }
mit
C#
66672b3c0b2b10435b792823e2c03306da008561
fix incorrect link for glyph upload (#482)
neowutran/TeraDamageMeter,neowutran/ShinraMeter
Data/DpsServerData.cs
Data/DpsServerData.cs
using System; namespace Data { public class DpsServerData { public Uri UploadUrl { get; set; } public Uri AllowedAreaUrl { get; set; } public Uri GlyphUrl { get; set; } public string Username { get; set; } public string Token { get; set; } public bool Enabled { get; set; } public string HostName => UploadUrl?.Host; public DpsServerData(Uri uploadUrl, Uri allowedAreaUrl, Uri glyphUrl, string username, string token, bool enabled) { UploadUrl = uploadUrl; AllowedAreaUrl = allowedAreaUrl; GlyphUrl = glyphUrl; Username = username; Token = token; Enabled = enabled; } public DpsServerData(DpsServerData data) { UploadUrl = data.UploadUrl; AllowedAreaUrl = data.AllowedAreaUrl; GlyphUrl = data.GlyphUrl; Username = data.Username; Token = data.Token; Enabled = data.Enabled; } public static DpsServerData Neowutran = new DpsServerData(new Uri("https://neowutran.ovh:8083/store_stats"), new Uri("https://neowutran.ovh/whitelist"), null, null, null, true); public static DpsServerData Moongourd = new DpsServerData( new Uri("https://moongourd.com/api/shinra/upload"), new Uri("https://moongourd.com/api/shinra/whitelist"), new Uri("https://moongourd.com/api/shinra/upload_glyph"), null, null, false ); public static DpsServerData TeraLogs = new DpsServerData( new Uri("https://api.teralogs.com/v1/upload"), new Uri("https://api.teralogs.com/v1/whitelist"), null, null, null, false ); } }
using System; namespace Data { public class DpsServerData { public Uri UploadUrl { get; set; } public Uri AllowedAreaUrl { get; set; } public Uri GlyphUrl { get; set; } public string Username { get; set; } public string Token { get; set; } public bool Enabled { get; set; } public string HostName => UploadUrl?.Host; public DpsServerData(Uri uploadUrl, Uri allowedAreaUrl, Uri glyphUrl, string username, string token, bool enabled) { UploadUrl = uploadUrl; AllowedAreaUrl = allowedAreaUrl; GlyphUrl = glyphUrl; Username = username; Token = token; Enabled = enabled; } public DpsServerData(DpsServerData data) { UploadUrl = data.UploadUrl; AllowedAreaUrl = data.AllowedAreaUrl; GlyphUrl = data.GlyphUrl; Username = data.Username; Token = data.Token; Enabled = data.Enabled; } public static DpsServerData Neowutran = new DpsServerData(new Uri("https://neowutran.ovh:8083/store_stats"), new Uri("https://neowutran.ovh/whitelist"), null, null, null, true); public static DpsServerData Moongourd = new DpsServerData( new Uri("https://moongourd.com/api/shinra/upload"), new Uri("https://moongourd.com/api/shinra/whitelist"), new Uri("https://moongourd.com/api/shinra/glyph_upload"), null, null, false ); public static DpsServerData TeraLogs = new DpsServerData( new Uri("https://api.teralogs.com/v1/upload"), new Uri("https://api.teralogs.com/v1/whitelist"), null, null, null, false ); } }
mit
C#
326a2c05eaf7ed2125642509327165ecb0cb5296
Fix certificate generation not refreshing test
phogue/Potato,phogue/Potato,phogue/Potato
src/Procon.Setup.Test/Models/CertificateModelTest.cs
src/Procon.Setup.Test/Models/CertificateModelTest.cs
using System.Security.Cryptography.X509Certificates; using NUnit.Framework; using Procon.Service.Shared; using Procon.Setup.Models; namespace Procon.Setup.Test.Models { [TestFixture] public class CertificateModelTest { /// <summary> /// Tests a certificate will be generated and can be read by .NET /// </summary> [Test] public void TestGenerate() { CertificateModel model = new CertificateModel(); // Delete the certificate if it exists. Defines.CertificatesDirectoryCommandServerPfx.Delete(); // Create a new certificate model.Generate(); // Certificate exists Defines.CertificatesDirectoryCommandServerPfx.Refresh(); Assert.IsTrue(Defines.CertificatesDirectoryCommandServerPfx.Exists); // Loads the certificates var loadedCertificate = new X509Certificate2(Defines.CertificatesDirectoryCommandServerPfx.FullName, model.Password); // Certificate can be loaded. Assert.IsNotNull(loadedCertificate); Assert.IsNotNull(loadedCertificate.PrivateKey); } } }
using System.Security.Cryptography.X509Certificates; using NUnit.Framework; using Procon.Service.Shared; using Procon.Setup.Models; namespace Procon.Setup.Test.Models { [TestFixture] public class CertificateModelTest { /// <summary> /// Tests a certificate will be generated and can be read by .NET /// </summary> [Test] public void TestGenerate() { CertificateModel model = new CertificateModel(); // Delete the certificate if it exists. Defines.CertificatesDirectoryCommandServerPfx.Delete(); // Create a new certificate model.Generate(); // Certificate exists Assert.IsTrue(Defines.CertificatesDirectoryCommandServerPfx.Exists); // Loads the certificates var loadedCertificate = new X509Certificate2(Defines.CertificatesDirectoryCommandServerPfx.FullName, model.Password); // Certificate can be loaded. Assert.IsNotNull(loadedCertificate); Assert.IsNotNull(loadedCertificate.PrivateKey); } } }
apache-2.0
C#
4ff77e9d164a59b77889d2ba936818f452e0c4a7
Change "Countdown Clock" name
danielchalmers/DesktopWidgets
DesktopWidgets/Widgets/CountdownClock/Metadata.cs
DesktopWidgets/Widgets/CountdownClock/Metadata.cs
namespace DesktopWidgets.Widgets.CountdownClock { public static class Metadata { public const string FriendlyName = "Countdown"; } }
namespace DesktopWidgets.Widgets.CountdownClock { public static class Metadata { public const string FriendlyName = "Countdown Clock"; } }
apache-2.0
C#
368568adc6e3e98f8118ec1e61676bf88b4755c1
Fix copy/paste bug in RenderOffsetCalculator
ethanmoffat/EndlessClient
EndlessClient/Rendering/RenderOffsetCalculator.cs
EndlessClient/Rendering/RenderOffsetCalculator.cs
// Original Work Copyright (c) Ethan Moffat 2014-2016 // This file is subject to the GPL v2 License // For additional details, see the LICENSE file using EOLib; using EOLib.Domain.Character; using EOLib.Domain.Extensions; using EOLib.Domain.NPC; namespace EndlessClient.Rendering { public class RenderOffsetCalculator : IRenderOffsetCalculator { private const int WidthFactor = 32; private const int HeightFactor = 16; private const int WalkWidthFactor = WidthFactor/4; private const int WalkHeightFactor = HeightFactor/4; public int CalculateOffsetX(ICharacterRenderProperties properties) { var multiplier = properties.IsFacing(EODirection.Left, EODirection.Down) ? -1 : 1; var walkAdjust = properties.IsActing(CharacterActionState.Walking) ? WalkWidthFactor * properties.WalkFrame : 0; //walkAdjust * multiplier is the old ViewAdjustX return properties.MapX*WidthFactor - properties.MapY*WidthFactor + walkAdjust*multiplier; } public int CalculateOffsetY(ICharacterRenderProperties properties) { var multiplier = properties.IsFacing(EODirection.Left, EODirection.Up) ? -1 : 1; var walkAdjust = properties.IsActing(CharacterActionState.Walking) ? WalkHeightFactor * properties.WalkFrame : 0; //walkAdjust * multiplier is the old ViewAdjustY return properties.MapX*HeightFactor + properties.MapY*HeightFactor + walkAdjust*multiplier; } public int CalculateOffsetX(INPC npc) { var multiplier = npc.IsFacing(EODirection.Left, EODirection.Down) ? -1 : 1; var walkAdjust = npc.IsActing(NPCActionState.Walking) ? WalkWidthFactor * npc.GetWalkFrame() : 0; //walkAdjust * multiplier is the old ViewAdjustX return npc.X*WidthFactor - npc.Y*WidthFactor + walkAdjust*multiplier; } public int CalculateOffsetY(INPC npc) { var multiplier = npc.IsFacing(EODirection.Left, EODirection.Down) ? -1 : 1; var walkAdjust = npc.IsActing(NPCActionState.Walking) ? WalkHeightFactor * npc.GetWalkFrame() : 0; //walkAdjust * multiplier is the old ViewAdjustY return npc.X*HeightFactor + npc.Y*HeightFactor + walkAdjust*multiplier; } } public interface IRenderOffsetCalculator { int CalculateOffsetX(ICharacterRenderProperties properties); int CalculateOffsetY(ICharacterRenderProperties properties); int CalculateOffsetX(INPC npc); int CalculateOffsetY(INPC npc); } }
// Original Work Copyright (c) Ethan Moffat 2014-2016 // This file is subject to the GPL v2 License // For additional details, see the LICENSE file using EOLib; using EOLib.Domain.Character; using EOLib.Domain.Extensions; using EOLib.Domain.NPC; namespace EndlessClient.Rendering { public class RenderOffsetCalculator : IRenderOffsetCalculator { private const int WidthFactor = 32; private const int HeightFactor = 16; private const int WalkWidthFactor = WidthFactor/4; private const int WalkHeightFactor = HeightFactor/4; public int CalculateOffsetX(ICharacterRenderProperties properties) { var multiplier = properties.IsFacing(EODirection.Left, EODirection.Down) ? -1 : 1; var walkAdjust = properties.IsActing(CharacterActionState.Walking) ? WalkWidthFactor * properties.WalkFrame : 0; //walkAdjust * multiplier is the old ViewAdjustX return properties.MapX*WidthFactor - properties.MapY*WidthFactor + walkAdjust*multiplier; } public int CalculateOffsetY(ICharacterRenderProperties properties) { var multiplier = properties.IsFacing(EODirection.Left, EODirection.Up) ? -1 : 1; var walkAdjust = properties.IsActing(CharacterActionState.Walking) ? WalkHeightFactor * properties.WalkFrame : 0; //walkAdjust * multiplier is the old ViewAdjustY return properties.MapX*HeightFactor + properties.MapY*HeightFactor + walkAdjust*multiplier; } public int CalculateOffsetX(INPC npc) { var multiplier = npc.IsFacing(EODirection.Left, EODirection.Down) ? -1 : 1; var walkAdjust = npc.IsActing(NPCActionState.Walking) ? WalkWidthFactor * npc.GetWalkFrame() : 0; //walkAdjust * multiplier is the old ViewAdjustX return npc.X*WidthFactor - npc.Y*WidthFactor + walkAdjust*multiplier; } public int CalculateOffsetY(INPC npc) { var multiplier = npc.IsFacing(EODirection.Left, EODirection.Down) ? -1 : 1; var walkAdjust = npc.IsActing(NPCActionState.Walking) ? WalkHeightFactor * npc.GetWalkFrame() : 0; //walkAdjust * multiplier is the old ViewAdjustY return npc.X*HeightFactor - npc.Y*HeightFactor + walkAdjust*multiplier; } } public interface IRenderOffsetCalculator { int CalculateOffsetX(ICharacterRenderProperties properties); int CalculateOffsetY(ICharacterRenderProperties properties); int CalculateOffsetX(INPC npc); int CalculateOffsetY(INPC npc); } }
mit
C#
90a3abb6aa442779090799448a831ffd8ea5c8fc
Fix the help message of output_pattern
BigEggTools/JsonComparer
JsonComparer.Console/Parameters/SplitParameter.cs
JsonComparer.Console/Parameters/SplitParameter.cs
namespace BigEgg.Tools.JsonComparer.Parameters { using BigEgg.Tools.ConsoleExtension.Parameters; [Command("split", "Split the big JSON file to multiple small files.")] public class SplitParameter { [StringProperty("input", "i", "The path of JSON file to split.", Required = true)] public string FileName { get; set; } [StringProperty("output", "o", "The path to store the splited JSON files.", Required = true)] public string OutputPath { get; set; } [StringProperty("node_name", "n", "The name of node to split.", Required = true)] public string NodeName { get; set; } [StringProperty("output_pattern", "op", "The output file name pattern. Use '${name}' for node name, '${index}' for the child index.")] public string OutputFileNamePattern { get; set; } } }
namespace BigEgg.Tools.JsonComparer.Parameters { using BigEgg.Tools.ConsoleExtension.Parameters; [Command("split", "Split the big JSON file to multiple small files.")] public class SplitParameter { [StringProperty("input", "i", "The path of JSON file to split.", Required = true)] public string FileName { get; set; } [StringProperty("output", "o", "The path to store the splited JSON files.", Required = true)] public string OutputPath { get; set; } [StringProperty("node_name", "n", "The name of node to split.", Required = true)] public string NodeName { get; set; } [StringProperty("output_pattern", "op", "The output file name pattern. Use '${name}' for node name, ${index} for the child index.")] public string OutputFileNamePattern { get; set; } } }
mit
C#
cd11f17261b035bbe31fb10fcf88e968c1f73193
add constant fields
Appleseed/base,Appleseed/base
Applications/Appleseed.Base.Alerts.Console/Appleseed.Base.Alerts/Model/Constants.cs
Applications/Appleseed.Base.Alerts.Console/Appleseed.Base.Alerts/Model/Constants.cs
using System; using System.Collections.Generic; using System.Configuration; using System.Data; using System.Data.SqlClient; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Appleseed.Base.Alerts.Model { class Constants { #region App Config Values // Test Settings static string Mode = System.Configuration.ConfigurationManager.AppSettings["Mode"]; static string TestEmail = System.Configuration.ConfigurationManager.AppSettings["TestEmail"]; static string TestSearchQuery = System.Configuration.ConfigurationManager.AppSettings["TestSearchQuery"]; static string TestSearchLink = System.Configuration.ConfigurationManager.AppSettings["TestSearchLink"]; //SendGridAPI Key static string APIKey = System.Configuration.ConfigurationManager.AppSettings["SendGridAPIKey"]; //Mail Settings static string MailFrom = System.Configuration.ConfigurationManager.AppSettings["MailFrom"]; static string MailFromName = System.Configuration.ConfigurationManager.AppSettings["MailFromName"]; static string MailSubject = System.Configuration.ConfigurationManager.AppSettings["MailSubject"]; static string MailHeaderText = System.Configuration.ConfigurationManager.AppSettings["MailHeaderText"]; static string MailSchedule = System.Configuration.ConfigurationManager.AppSettings["MailSchedule"]; //Search Settings static string SiteSearchLink = System.Configuration.ConfigurationManager.AppSettings["SiteSearchLink"]; static string SolrURL = System.Configuration.ConfigurationManager.AppSettings["SolrURL"]; static string RefreshQuery = System.Configuration.ConfigurationManager.AppSettings["RefreshQuery"]; //Data Settings static IDbConnection db = new SqlConnection(ConfigurationManager.ConnectionStrings["DefaultConnection"].ConnectionString); #endregion } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Appleseed.Base.Alerts.Model { class Constants { } }
apache-2.0
C#
fe947c2337990fb639e638e4357afa1654f92ee7
Improve how much space we reserve for tag changes
haefele/SpotifyRecorder
SpotifyRecorder/Core/SpotifyRecorder.Core.Implementations/Services/ID3TagService.cs
SpotifyRecorder/Core/SpotifyRecorder.Core.Implementations/Services/ID3TagService.cs
using System.IO; using System.Linq; using SpotifyRecorder.Core.Abstractions.Entities; using SpotifyRecorder.Core.Abstractions.Services; using TagLib; using TagLib.Id3v2; using File = TagLib.File; namespace SpotifyRecorder.Core.Implementations.Services { public class ID3TagService : IID3TagService { public ID3Tags GetTags(RecordedSong song) { var tagFile = File.Create(new MemoryFileAbstraction(new MemoryStream(song.Data))); return new ID3Tags { Title = tagFile.Tag.Title, Artists = tagFile.Tag.Performers, Picture = tagFile.Tag.Pictures.FirstOrDefault()?.Data.Data }; } public void UpdateTags(ID3Tags tags, RecordedSong song) { using (var stream = new MemoryStream(song.Data.Length * 2)) { stream.Write(song.Data, 0, song.Data.Length); stream.Position = 0; var tagFile = File.Create(new MemoryFileAbstraction(stream)); tagFile.Tag.Title = tags.Title; tagFile.Tag.Performers = tags.Artists; if (tags.Picture != null) { tagFile.Tag.Pictures = new IPicture[] { new Picture(new ByteVector(tags.Picture, tags.Picture.Length)), }; } tagFile.Save(); song.Data = stream.ToArray(); } } } }
using System.IO; using System.Linq; using SpotifyRecorder.Core.Abstractions.Entities; using SpotifyRecorder.Core.Abstractions.Services; using TagLib; using TagLib.Id3v2; using File = TagLib.File; namespace SpotifyRecorder.Core.Implementations.Services { public class ID3TagService : IID3TagService { public ID3Tags GetTags(RecordedSong song) { var tagFile = File.Create(new MemoryFileAbstraction(new MemoryStream(song.Data))); return new ID3Tags { Title = tagFile.Tag.Title, Artists = tagFile.Tag.Performers, Picture = tagFile.Tag.Pictures.FirstOrDefault()?.Data.Data }; } public void UpdateTags(ID3Tags tags, RecordedSong song) { using (var stream = new MemoryStream(song.Data.Length + 1000)) { stream.Write(song.Data, 0, song.Data.Length); stream.Position = 0; var tagFile = File.Create(new MemoryFileAbstraction(stream)); tagFile.Tag.Title = tags.Title; tagFile.Tag.Performers = tags.Artists; if (tags.Picture != null) { tagFile.Tag.Pictures = new IPicture[] { new Picture(new ByteVector(tags.Picture, tags.Picture.Length)), }; } tagFile.Save(); song.Data = stream.ToArray(); } } } }
mit
C#
d698defdadae6485730cb573ea6fe3eb9de36dff
Test visual studio push
tpaananen/SeeSharpHttpLiveStreaming
SeeSharpLiveStreaming.Tests/Utils/RequireTests.cs
SeeSharpLiveStreaming.Tests/Utils/RequireTests.cs
using System; using System.Collections.Generic; using System.Collections.ObjectModel; using NUnit.Framework; using SeeSharpHttpLiveStreaming.Utils; namespace SeeSharpHttpLiveStreaming.Tests.Utils { [TestFixture] public class RequireTests { [Test] public void TestRequireThrowsArgumentNullExceptionForNullParameter() { object nullable = null; var exception = Assert.Throws<ArgumentNullException>(() => nullable.RequireNotNull("nullable")); Assert.AreEqual("nullable", exception.ParamName); } [Test] public void TestRequireDoesNotThrowExceptionForNonNullParameter() { object notNull = new object(); notNull.RequireNotNull("notNull"); } [Test] public void TestRequireCollectionNotNullThrowsArgumentNullExceptionForNullParameter() { IReadOnlyCollection<object> nullable = null; var exception = Assert.Throws<ArgumentNullException>(() => nullable.RequireNotNull("nullable")); Assert.AreEqual("nullable", exception.ParamName); } [Test] public void TestRequireCollectionDoesNotThrowExceptionForNonNullParameter() { IReadOnlyCollection<object> notNull = new ReadOnlyCollection<object>(new List<object>()); notNull.RequireNotNull("notNull"); } [Test] public void TestRequireCollectionNotEmptyThrowsArgumentExceptionForEmptyParameter() { IReadOnlyCollection<object> empty = new ReadOnlyCollection<object>(new List<object>()); Assert.Throws<ArgumentException>(() => empty.RequireNotEmpty("notEmpty")); } [Test] public void TestRequireCollectionNotEmptyDoesNotThrow() { IReadOnlyCollection<object> notEmpty = new ReadOnlyCollection<object>(new List<object> { new object()}); notEmpty.RequireNotEmpty("notEmpty"); } [Test] public void TestRequireStringNotEmptyThrowsArgumentExceptionForEmptyParameter() { string empty = string.Empty; Assert.Throws<ArgumentException>(() => empty.RequireNotEmpty("empty")); } [Test] public void TestRequireStringNotEmptyDoesNotThrow() { const string notEmpty = "121"; notEmpty.RequireNotEmpty("notEmpty"); } } }
using System; using System.Collections.Generic; using System.Collections.ObjectModel; using NUnit.Framework; using SeeSharpHttpLiveStreaming.Utils; namespace SeeSharpHttpLiveStreaming.Tests.Utils { [TestFixture] public class RequireTests { [Test] public void TestRequireThrowsArgumentNullExceptionForNullParameter() { object nullable = null; var exception = Assert.Throws<ArgumentNullException>(() => nullable.RequireNotNull("nullable")); Assert.AreEqual("nullable", exception.ParamName); } [Test] public void TestRequireDoesNotThrowExceptionForNonNullParameter() { object notNull = new object(); notNull.RequireNotNull("notNull"); } [Test] public void TestRequireCollectionNotNullThrowsArgumentNullExceptionForNullParameter() { IReadOnlyCollection<object> nullable = null; var exception = Assert.Throws<ArgumentNullException>(() => nullable.RequireNotNull("nullable")); Assert.AreEqual("nullable", exception.ParamName); } [Test] public void TestRequireCollectionDoesNotThrowExceptionForNonNullParameter() { IReadOnlyCollection<object> notNull = new ReadOnlyCollection<object>(new List<object>()); notNull.RequireNotNull("notNull"); } [Test] public void TestRequireCollectionNotEmptyThrowsArgumentExceptionForEmptyParameter() { IReadOnlyCollection<object> empty = new ReadOnlyCollection<object>(new List<object>()); Assert.Throws<ArgumentException>(() => empty.RequireNotEmpty("notEmpty")); } [Test] public void TestRequireCollectionNotEmptyDoesNotThrow() { IReadOnlyCollection<object> notEmpty = new ReadOnlyCollection<object>(new List<object> { new object()}); notEmpty.RequireNotEmpty("notEmpty"); } [Test] public void TestRequireStringNotEmptyThrowsArgumentExceptionForEmptyParameter() { string empty = string.Empty; Assert.Throws<ArgumentException>(() => empty.RequireNotEmpty("empty")); } [Test] public void TestRequireStringNotEmptyDoesNotThrow() { const string notEmpty = "121"; notEmpty.RequireNotEmpty("notEmpty"); } } }
mit
C#
3daede6cdff88b52fa54f75832455663e9f3490a
remove 'b' suffix from the version number.
poderosaproject/poderosa,poderosaproject/poderosa,Chandu/poderosa,ArsenShnurkov/poderosa,ttdoda/poderosa,poderosaproject/poderosa,ttdoda/poderosa,poderosaproject/poderosa,Chandu/poderosa,ttdoda/poderosa,poderosaproject/poderosa,Chandu/poderosa,ttdoda/poderosa,ArsenShnurkov/poderosa,ArsenShnurkov/poderosa
Plugin/VersionInfo.cs
Plugin/VersionInfo.cs
/* * Copyright 2004,2006 The Poderosa Project. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * * $Id: VersionInfo.cs,v 1.13 2012/06/09 15:06:58 kzmi Exp $ */ using System; using System.Collections.Generic; using System.Text; namespace Poderosa { /// <summary> /// <ja> /// バージョン情報を返します。 /// </ja> /// <en> /// Return the version information. /// </en> /// </summary> /// <exclude/> public class VersionInfo { /// <summary> /// <ja> /// バージョン番号です。 /// </ja> /// <en> /// Version number. /// </en> /// </summary> public const string PODEROSA_VERSION = "4.3.15"; /// <summary> /// <ja> /// プロジェクト名です。 /// </ja> /// <en> /// Project name. /// </en> /// </summary> public const string PROJECT_NAME = "Poderosa Project"; } }
/* * Copyright 2004,2006 The Poderosa Project. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * * $Id: VersionInfo.cs,v 1.13 2012/06/09 15:06:58 kzmi Exp $ */ using System; using System.Collections.Generic; using System.Text; namespace Poderosa { /// <summary> /// <ja> /// バージョン情報を返します。 /// </ja> /// <en> /// Return the version information. /// </en> /// </summary> /// <exclude/> public class VersionInfo { /// <summary> /// <ja> /// バージョン番号です。 /// </ja> /// <en> /// Version number. /// </en> /// </summary> public const string PODEROSA_VERSION = "4.3.15b"; /// <summary> /// <ja> /// プロジェクト名です。 /// </ja> /// <en> /// Project name. /// </en> /// </summary> public const string PROJECT_NAME = "Poderosa Project"; } }
apache-2.0
C#
dabdc72da0bda47a45a7c4571db2400aedf0b42e
Set default TextureUpload format to Rgba.
NeoAdonis/osu-framework,EVAST9919/osu-framework,DrabWeb/osu-framework,Tom94/osu-framework,ZLima12/osu-framework,EVAST9919/osu-framework,EVAST9919/osu-framework,default0/osu-framework,paparony03/osu-framework,Tom94/osu-framework,NeoAdonis/osu-framework,ppy/osu-framework,default0/osu-framework,peppy/osu-framework,naoey/osu-framework,ppy/osu-framework,EVAST9919/osu-framework,ZLima12/osu-framework,naoey/osu-framework,RedNesto/osu-framework,peppy/osu-framework,peppy/osu-framework,Nabile-Rahmani/osu-framework,smoogipooo/osu-framework,ppy/osu-framework,RedNesto/osu-framework,DrabWeb/osu-framework,Nabile-Rahmani/osu-framework,smoogipooo/osu-framework,paparony03/osu-framework,DrabWeb/osu-framework
osu.Framework/Graphics/OpenGL/Textures/TextureUpload.cs
osu.Framework/Graphics/OpenGL/Textures/TextureUpload.cs
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>. //Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu-framework/master/LICENCE using System; using System.Drawing; using OpenTK.Graphics.ES20; namespace osu.Framework.Graphics.OpenGL.Textures { public class TextureUpload : IDisposable { private static TextureBufferStack TextureBufferStack = new TextureBufferStack(10); public int Level; public PixelFormat Format = PixelFormat.Rgba; public Rectangle Bounds; public readonly byte[] Data; private bool shouldFreeBuffer; public TextureUpload(int size) { Data = TextureBufferStack.ReserveBuffer(size); shouldFreeBuffer = true; } public TextureUpload(byte[] data) { Data = data; } #region IDisposable Support private bool disposedValue = false; // To detect redundant calls protected virtual void Dispose(bool disposing) { if (!disposedValue) { if (shouldFreeBuffer) { TextureBufferStack.FreeBuffer(Data); } disposedValue = true; } } ~TextureUpload() { Dispose(false); } public void Dispose() { Dispose(true); GC.SuppressFinalize(this); } #endregion } }
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>. //Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu-framework/master/LICENCE using System; using System.Drawing; using OpenTK.Graphics.ES20; namespace osu.Framework.Graphics.OpenGL.Textures { public class TextureUpload : IDisposable { private static TextureBufferStack TextureBufferStack = new TextureBufferStack(10); public int Level; public PixelFormat Format; public Rectangle Bounds; public readonly byte[] Data; private bool shouldFreeBuffer; public TextureUpload(int size) { Data = TextureBufferStack.ReserveBuffer(size); shouldFreeBuffer = true; } public TextureUpload(byte[] data) { Data = data; } #region IDisposable Support private bool disposedValue = false; // To detect redundant calls protected virtual void Dispose(bool disposing) { if (!disposedValue) { if (shouldFreeBuffer) { TextureBufferStack.FreeBuffer(Data); } disposedValue = true; } } ~TextureUpload() { Dispose(false); } public void Dispose() { Dispose(true); GC.SuppressFinalize(this); } #endregion } }
mit
C#
4ee6762ee57b0e746d96779f10fe2a5ccc1459e9
Fix incorrect XML comment
martincostello/api,martincostello/api,martincostello/api
src/API/Models/TimeResponse.cs
src/API/Models/TimeResponse.cs
// Copyright (c) Martin Costello, 2016. All rights reserved. // Licensed under the MIT license. See the LICENSE file in the project root for full license information. namespace MartinCostello.Api.Models { using System; using System.ComponentModel.DataAnnotations; using Newtonsoft.Json; /// <summary> /// A class representing the response from the <c>/time</c> API resource. This class cannot be inherited. /// </summary> public sealed class TimeResponse { /// <summary> /// Gets or sets the timestamp for the response for which the times are generated. /// </summary> [JsonProperty("timestamp")] [Required] public DateTimeOffset Timestamp { get; set; } /// <summary> /// Gets or sets the current UTC date and time in RFC1123 format. /// </summary> [JsonProperty("rfc1123")] [Required] public string Rfc1123 { get; set; } /// <summary> /// Gets or sets the number of seconds since the UNIX epoch. /// </summary> [JsonProperty("unix")] [Required] public long Unix { get; set; } /// <summary> /// Gets or sets the current UTC date and time in universal sortable format. /// </summary> [JsonProperty("universalSortable")] [Required] public string UniversalSortable { get; set; } /// <summary> /// Gets or sets the current UTC date and time in universal full format. /// </summary> [JsonProperty("universalFull")] [Required] public string UniversalFull { get; set; } } }
// Copyright (c) Martin Costello, 2016. All rights reserved. // Licensed under the MIT license. See the LICENSE file in the project root for full license information. namespace MartinCostello.Api.Models { using System; using System.ComponentModel.DataAnnotations; using Newtonsoft.Json; /// <summary> /// A class representing the response from the <c>/api/time</c> API resource. This class cannot be inherited. /// </summary> public sealed class TimeResponse { /// <summary> /// Gets or sets the timestamp for the response for which the times are generated. /// </summary> [JsonProperty("timestamp")] [Required] public DateTimeOffset Timestamp { get; set; } /// <summary> /// Gets or sets the current UTC date and time in RFC1123 format. /// </summary> [JsonProperty("rfc1123")] [Required] public string Rfc1123 { get; set; } /// <summary> /// Gets or sets the number of seconds since the UNIX epoch. /// </summary> [JsonProperty("unix")] [Required] public long Unix { get; set; } /// <summary> /// Gets or sets the current UTC date and time in universal sortable format. /// </summary> [JsonProperty("universalSortable")] [Required] public string UniversalSortable { get; set; } /// <summary> /// Gets or sets the current UTC date and time in universal full format. /// </summary> [JsonProperty("universalFull")] [Required] public string UniversalFull { get; set; } } }
mit
C#
5449ef951e2bad06a80aa15a492fdfcbceb28bc6
Remove extra char that sneaked onto XML comment
autofac/Autofac
src/Autofac/ResolveRequest.cs
src/Autofac/ResolveRequest.cs
using System.Collections.Generic; using Autofac.Core; namespace Autofac { /// <summary> /// The details of an individual request to resolve a service. /// </summary> public class ResolveRequest { /// <summary> /// Initializes a new instance of the <see cref="ResolveRequest"/> class. /// </summary> /// <param name="service">The service being resolved.</param> /// <param name="registration">The component registration for the service.</param> /// <param name="parameters">The parameters used when resolving the service.</param> /// <param name="decoratorTarget">The target component to be decorated.</param> public ResolveRequest(Service service, IComponentRegistration registration, IEnumerable<Parameter> parameters, IComponentRegistration? decoratorTarget = null) { Service = service; Registration = registration; Parameters = parameters; DecoratorTarget = decoratorTarget; } /// <summary> /// Gets the service being resolved. /// </summary> public Service Service { get; } /// <summary> /// Gets the component registration for the service being resolved. /// </summary> public IComponentRegistration Registration { get; } /// <summary> /// Gets the parameters used when resolving the service. /// </summary> public IEnumerable<Parameter> Parameters { get; } /// <summary> /// Gets the component registration for the decorator target if configured. /// </summary> public IComponentRegistration? DecoratorTarget { get; } } }
using System.Collections.Generic; using Autofac.Core; namespace Autofac { /// <summary> /// The details of an individual request to resolve a service. /// </summary> public class ResolveRequest { /// <summary> /// Initializes a new instance of the <see cref="ResolveRequest"/> class. /// </summary> /// <param name="service">The service being resolved.</param> /// <param name="registration">The component registration for the service.</param> /// <param name="parameters">The parameters used when resolving the service.</param> /// <param name="decoratorTarget">The target component to be decorated.</param> public ResolveRequest(Service service, IComponentRegistration registration, IEnumerable<Parameter> parameters, IComponentRegistration? decoratorTarget = null) { Service = service; Registration = registration; Parameters = parameters; DecoratorTarget = decoratorTarget; } /// <summary> /// Gets the service being resolved. /// </summary> public Service Service { get; } /// <summary> /// Gets the component registration for the service being resolved. /// </summary> public IComponentRegistration Registration { get; } /// <summary> /// Gets the parameters used when resolving the service. /// </summary> public IEnumerable<Parameter> Parameters { get; } /// <summary> /// Gets the component registration for the decorator target if configured. /// </summary>2 public IComponentRegistration? DecoratorTarget { get; } } }
mit
C#
eb6752e85ff8e6b0b599fd4584f4534a7e717c7b
Test Refactor, let tests
ajlopez/ClojSharp
Src/ClojSharp.Core.Tests/SpecialForms/LetTests.cs
Src/ClojSharp.Core.Tests/SpecialForms/LetTests.cs
namespace ClojSharp.Core.Tests.SpecialForms { using System; using System.Collections.Generic; using System.Linq; using System.Text; using ClojSharp.Core.Compiler; using ClojSharp.Core.Language; using ClojSharp.Core.SpecialForms; using Microsoft.VisualStudio.TestTools.UnitTesting; [TestClass] public class LetTests { private Context context; [TestInitialize] public void Setup() { this.context = new Context(); this.context.SetValue("let", new Let()); } [TestMethod] public void LetOneVariable() { var result = this.EvaluateList("(let [x 1] x)"); Assert.IsNotNull(result); Assert.AreEqual(1, result); } [TestMethod] public void LetTwoVariables() { var result = this.EvaluateList("(let [x 1 y x] x)"); Assert.IsNotNull(result); Assert.AreEqual(1, result); } [TestMethod] public void LetTwoVariables() { var result = this.EvaluateList("(let [x 1 y x] x)"); Assert.IsNotNull(result); Assert.AreEqual(1, result); } private object EvaluateList(string text) { Parser parser = new Parser(text); var list = (List)parser.ParseExpression(); return list.Evaluate(this.context); } } }
namespace ClojSharp.Core.Tests.SpecialForms { using System; using System.Collections.Generic; using System.Linq; using System.Text; using ClojSharp.Core.Compiler; using ClojSharp.Core.Language; using ClojSharp.Core.SpecialForms; using Microsoft.VisualStudio.TestTools.UnitTesting; [TestClass] public class LetTests { [TestMethod] public void LetOneVariable() { Parser parser = new Parser("(let [x 1] x)"); Context context = new Context(); context.SetValue("let", new Let()); var list = (List)parser.ParseExpression(); var result = list.Evaluate(context); Assert.IsNotNull(result); Assert.AreEqual(1, result); } [TestMethod] public void LetTwoVariables() { Parser parser = new Parser("(let [x 1 y x] y)"); Context context = new Context(); context.SetValue("let", new Let()); var list = (List)parser.ParseExpression(); var result = list.Evaluate(context); Assert.IsNotNull(result); Assert.AreEqual(1, result); } } }
mit
C#
0c6e2e6f1eb4430616fc86bebd20a35ee002af79
Add default_card parameter to update customer request.
ChadBurggraf/stripe-dotnet
src/StripeClient.Customers.cs
src/StripeClient.Customers.cs
using System; using System.Linq; using RestSharp; using RestSharp.Validation; namespace Stripe { public partial class StripeClient { public StripeObject CreateCustomer(ICreditCard card = null, string coupon = null, string email = null, string description = null, string plan = null, DateTimeOffset? trialEnd = null) { if (card != null) card.Validate(); var request = new RestRequest(); request.Method = Method.POST; request.Resource = "customers"; if (card != null) card.AddParametersToRequest(request); if (coupon.HasValue()) request.AddParameter("coupon", coupon); if (email.HasValue()) request.AddParameter("email", email); if (description.HasValue()) request.AddParameter("description", description); if (plan.HasValue()) request.AddParameter("plan", plan); if (trialEnd.HasValue) request.AddParameter("trial_end", trialEnd.Value.ToUnixEpoch()); return ExecuteObject(request); } public StripeObject RetrieveCustomer(string customerId) { Require.Argument("customerId", customerId); var request = new RestRequest(); request.Resource = "customers/{customerId}"; request.AddUrlSegment("customerId", customerId); return ExecuteObject(request); } public StripeObject UpdateCustomer(string customerId, ICreditCard card = null, string coupon = null, string email = null, string description = null, int? accountBalance = null, string defaultCard = null) { if (card != null) card.Validate(); var request = new RestRequest(); request.Method = Method.POST; request.Resource = "customers/{customerId}"; request.AddUrlSegment("customerId", customerId); if (card != null) card.AddParametersToRequest(request); if (coupon.HasValue()) request.AddParameter("coupon", coupon); if (email.HasValue()) request.AddParameter("email", email); if (description.HasValue()) request.AddParameter("description", description); if (accountBalance.HasValue) request.AddParameter("account_balance", accountBalance.Value); if (defaultCard.HasValue()) request.AddParameter("default_card", defaultCard); return ExecuteObject(request); } public StripeObject DeleteCustomer(string customerId) { Require.Argument("customerId", customerId); var request = new RestRequest(); request.Method = Method.DELETE; request.Resource = "customers/{customerId}"; request.AddUrlSegment("customerId", customerId); return ExecuteObject(request); } public StripeArray ListCustomers(int? count = null, int? offset = null) { var request = new RestRequest(); request.Resource = "customers"; if (count.HasValue) request.AddParameter("count", count.Value); if (offset.HasValue) request.AddParameter("offset", offset.Value); return ExecuteArray(request); } } }
using System; using System.Linq; using RestSharp; using RestSharp.Validation; namespace Stripe { public partial class StripeClient { public StripeObject CreateCustomer(ICreditCard card = null, string coupon = null, string email = null, string description = null, string plan = null, DateTimeOffset? trialEnd = null) { if (card != null) card.Validate(); var request = new RestRequest(); request.Method = Method.POST; request.Resource = "customers"; if (card != null) card.AddParametersToRequest(request); if (coupon.HasValue()) request.AddParameter("coupon", coupon); if (email.HasValue()) request.AddParameter("email", email); if (description.HasValue()) request.AddParameter("description", description); if (plan.HasValue()) request.AddParameter("plan", plan); if (trialEnd.HasValue) request.AddParameter("trial_end", trialEnd.Value.ToUnixEpoch()); return ExecuteObject(request); } public StripeObject RetrieveCustomer(string customerId) { Require.Argument("customerId", customerId); var request = new RestRequest(); request.Resource = "customers/{customerId}"; request.AddUrlSegment("customerId", customerId); return ExecuteObject(request); } public StripeObject UpdateCustomer(string customerId, ICreditCard card = null, string coupon = null, string email = null, string description = null, int? accountBalance = null) { if (card != null) card.Validate(); var request = new RestRequest(); request.Method = Method.POST; request.Resource = "customers/{customerId}"; request.AddUrlSegment("customerId", customerId); if (card != null) card.AddParametersToRequest(request); if (coupon.HasValue()) request.AddParameter("coupon", coupon); if (email.HasValue()) request.AddParameter("email", email); if (description.HasValue()) request.AddParameter("description", description); if (accountBalance.HasValue) request.AddParameter("account_balance", accountBalance.Value); return ExecuteObject(request); } public StripeObject DeleteCustomer(string customerId) { Require.Argument("customerId", customerId); var request = new RestRequest(); request.Method = Method.DELETE; request.Resource = "customers/{customerId}"; request.AddUrlSegment("customerId", customerId); return ExecuteObject(request); } public StripeArray ListCustomers(int? count = null, int? offset = null) { var request = new RestRequest(); request.Resource = "customers"; if (count.HasValue) request.AddParameter("count", count.Value); if (offset.HasValue) request.AddParameter("offset", offset.Value); return ExecuteArray(request); } } }
mit
C#
792319dfe99c0d4d0468f1f92b0e4c12c122b692
Load TodoTxt files
ChrisWay/TodoTxt.Sharp
src/TodoTxt.Sharp/TaskFile.cs
src/TodoTxt.Sharp/TaskFile.cs
using System; using System.Collections.Generic; using System.IO; using System.Linq; namespace TodoTxt.Sharp { public class TaskFile { private readonly string _path; private bool _endsWithNewLine; private DateTime _fileLastWriteTime; public TaskFile(string path) { _path = path; LoadFromFile(); } public List<Task> Tasks { get; private set; } /// <summary> /// Loads the tasks from a file. /// If the file does not exist it is created. /// </summary> public async void LoadFromFile(bool ignoreLastWriteTime = false) { if (!ignoreLastWriteTime && File.GetLastWriteTimeUtc(_path) <= _fileLastWriteTime) return; Tasks = new List<Task>(); if (!File.Exists(_path)) { File.Create(_path); return; } using (var file = File.OpenRead(_path)) using (var stream = new StreamReader(file)) { string line; while ((line = await stream.ReadLineAsync()) != null) { if (!string.IsNullOrWhiteSpace(line)) { Tasks.Add(new Task(line)); _endsWithNewLine = line.EndsWith(Environment.NewLine); } } } _fileLastWriteTime = File.GetLastWriteTimeUtc(_path); } public void AddTask(Task task) { LoadFromFile(); var rawWithNewLine = task.Raw + Environment.NewLine; var toWrite = _endsWithNewLine ? rawWithNewLine : Environment.NewLine + rawWithNewLine; File.AppendAllText(_path, toWrite); Tasks.Add(task); } public void DeleteTask(Task task) { LoadFromFile(); File.WriteAllLines(_path, File.ReadLines(_path).Where(l => l != task.Raw).ToList()); Tasks.Remove(task); } public void UpdateTask(Task originalTask, Task newTask) { throw new NotImplementedException(); } } }
using System; namespace TodoTxt.Sharp { public class TaskFile { private string _path; public TaskFile(string path) { _path = path; } public void Save() { } public void SaveAs(string path) { _path = path; } } }
mit
C#
4156aadb5d02f52d155761894de2cb5d2c4afdc3
Prepare for December master merge
rajashekarusa/PnP-Sites-Core,Oaden/PnP-Sites-Core,Oaden/PnP-Sites-Core,comblox/PnP-Sites-Core,phillipharding/PnP-Sites-Core,OfficeDev/PnP-Sites-Core,rajashekarusa/PnP-Sites-Core,OfficeDev/PnP-Sites-Core,m-carter1/PnP-Sites-Core,Puzzlepart/PnP-Sites-Core,m-carter1/PnP-Sites-Core,PieterVeenstra/PnP-Sites-Core,phillipharding/PnP-Sites-Core,BobGerman/PnP-Sites-Core,Puzzlepart/PnP-Sites-Core,PieterVeenstra/PnP-Sites-Core,rajashekarusa/PnP-Sites-Core,BobGerman/PnP-Sites-Core,OfficeDev/PnP-Sites-Core,comblox/PnP-Sites-Core
Core/OfficeDevPnP.Core/Properties/AssemblyInfo.cs
Core/OfficeDevPnP.Core/Properties/AssemblyInfo.cs
using System.Reflection; using System.Resources; 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("OfficeDevPnP.Core")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("OfficeDevPnP.Core")] [assembly: AssemblyCopyright("Copyright © Microsoft 2015")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] [assembly: NeutralResourcesLanguage("en-US")] // 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("065331b6-0540-44e1-84d5-d38f09f17f9e")] // 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: // Convention: // Major version = current version 1 // Minor version = Sequence...version 0 was with March release...so 1=April, 2=May, 3=June, 4=August, 6=September, 7=October, 8=November, 9=December // Third part = version indenpendant showing the release month in MMYY // Fourth part = 0 normally or a sequence number when we do an emergency release [assembly: AssemblyVersion("1.9.1215.0")] [assembly: AssemblyFileVersion("1.9.1215.0")] [assembly: InternalsVisibleTo("OfficeDevPnP.Core.Tests")]
using System.Reflection; using System.Resources; 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("OfficeDevPnP.Core")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("OfficeDevPnP.Core")] [assembly: AssemblyCopyright("Copyright © Microsoft 2015")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] [assembly: NeutralResourcesLanguage("en-US")] // 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("065331b6-0540-44e1-84d5-d38f09f17f9e")] // 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: // Convention: // Major version = current version 1 // Minor version = Sequence...version 0 was with March release...so 1=April, 2=May, 3=June, 4=August, 6=September, 7=October, 8=November, 9=December // Third part = version indenpendant showing the release month in MMYY // Fourth part = 0 normally or a sequence number when we do an emergency release [assembly: AssemblyVersion("1.8.1115.0")] [assembly: AssemblyFileVersion("1.8.1115.0")] [assembly: InternalsVisibleTo("OfficeDevPnP.Core.Tests")]
mit
C#
d847f8f3a0db0b561058f3738ff3d0f92ed734de
Fix compiler errors
red-gate/RedGate.AppHost,nycdotnet/RedGate.AppHost
RedGate.AppHost.Example.Server/MainWindow.xaml.cs
RedGate.AppHost.Example.Server/MainWindow.xaml.cs
using System; using System.AddIn.Pipeline; using System.Windows; using System.Windows.Controls; using System.Windows.Documents; using RedGate.AppHost.Interfaces; using RedGate.AppHost.Server; namespace RedGate.AppHost.Example.Server { public class ServiceLocator : MarshalByRefObject, IAppHostServices { public T GetService<T>() where T : MarshalByRefObject { return null; } } public partial class MainWindow : Window { public MainWindow() { InitializeComponent(); try { var safeAppHostChildHandle = new ChildProcessFactory().Create("RedGate.AppHost.Example.Client.dll", "RedGate.AppHost.Example.Client.UserControl1"); var nativeHandleContractWithoutIntPtr = safeAppHostChildHandle.Initialize(new ServiceLocator()); var contractToViewAdapter = FrameworkElementAdapters.ContractToViewAdapter(nativeHandleContractWithoutIntPtr); Content = contractToViewAdapter; } catch (Exception e) { Content = new TextBlock() { Text = e.ToString() }; } } } }
using System; using System.AddIn.Pipeline; using System.Windows; using RedGate.AppHost.Interfaces; using RedGate.AppHost.Server; namespace RedGate.AppHost.Example.Server { public class ServiceLocator : MarshalByRefObject, IAppHostServices { public T GetService<T>() where T : MarshalByRefObject { return null; } } public partial class MainWindow : Window { public MainWindow() { InitializeComponent(); try { var safeAppHostChildHandle = new ChildProcessFactory().Create("RedGate.AppHost.Example.Client.dll", "RedGate.AppHost.Example.Client.UserControl1"); var nativeHandleContractWithoutIntPtr = safeAppHostChildHandle.Initialize(new ServiceLocator()); var contractToViewAdapter = FrameworkElementAdapters.ContractToViewAdapter(nativeHandleContractWithoutIntPtr); Content = contractToViewAdapter; } catch (Exception e) { } } } }
apache-2.0
C#
17f5bd733f67b0aa0ca321aeaccbbe5e6b444db0
Update Mobile.cs
jkanchelov/Telerik-OOP-Team-StarFruit
TeamworkStarFruit/CatalogueLib/Products/Mobile.cs
TeamworkStarFruit/CatalogueLib/Products/Mobile.cs
namespace CatalogueLib { using CatalogueLib.Products.Enumerations; using CatalogueLib.Products.Struct; using System.Text; public abstract class Mobile : Product { public Mobile() { } public Mobile(int ID, decimal price, bool isAvailable, Brand brand, int Memory, string CPU, int RAM, string Model, string battery, string connectivity, bool ExpandableMemory, double ScreenSize) : base(ID, price, isAvailable, brand) { this.Memory = Memory; this.CPU = CPU; this.RAM = RAM; this.Model = Model; this.battery = battery; this.Connectivity = Connectivity; this.ExpandableMemory = ExpandableMemory; this.ScreenSize = ScreenSize; } public int Memory { get; private set; } public string CPU { get; private set; } public int RAM { get; private set; } public string Model { get; private set; } public string battery { get; private set; } public string Connectivity { get; private set; } public bool ExpandableMemory { get; private set; } public double ScreenSize { get; private set; } public override string ToString() { StringBuilder outline = new StringBuilder(); outline = outline.Append(string.Format("{0}", base.ToString())); outline = outline.Append(string.Format(" Model: {0}",this.Model)); outline = outline.AppendLine(); outline = outline.Append(string.Format(" Screen size: {0}",this.ScreenSize)); outline = outline.AppendLine(); outline = outline.Append(string.Format(" Memory: {0}",this.Memory)); outline = outline.AppendLine(); outline = outline.Append(string.Format(" CPU: {0}",this.CPU)); outline = outline.AppendLine(); outline = outline.Append(string.Format(" RAM: {0}",this.RAM)); outline = outline.AppendLine(); outline = outline.Append(string.Format(" Expandable memory: {0}",this.Memory)); outline = outline.AppendLine(); outline = outline.Append(string.Format(" Battery: {0}",this.battery)); return outline.AppendLine().ToString(); } } }
namespace CatalogueLib { using CatalogueLib.Products.Enumerations; using CatalogueLib.Products.Struct; using System.Text; public abstract class Mobile : Product { public Mobile() { } public Mobile(int ID, decimal price, bool isAvailable, Brand brand, int Memory, string CPU, int RAM, string Model, string battery, string connectivity, bool ExpandableMemory, double ScreenSize) : base(ID, price, isAvailable, brand) { this.Memory = Memory; this.CPU = CPU; this.RAM = RAM; this.Model = Model; this.battery = battery; this.Connectivity = Connectivity; this.ExpandableMemory = ExpandableMemory; this.ScreenSize = ScreenSize; } public int Memory { get; private set; } public string CPU { get; private set; } public int RAM { get; private set; } public string Model { get; private set; } public string battery { get; private set; } public string Connectivity { get; private set; } public bool ExpandableMemory { get; private set; } public double ScreenSize { get; private set; } public override string ToString() {StringBuilder outline = new StringBuilder(); outline = outline.Append(string.Format("{0}", base.ToString())); outline = outline.Append(string.Format(" Model: {0}",this.Model)); outline = outline.AppendLine(); outline = outline.Append(string.Format(" Screen size: {0}",this.ScreenSize)); outline = outline.AppendLine(); outline = outline.Append(string.Format(" Memory: {0}",this.Memory)); outline = outline.AppendLine(); outline = outline.Append(string.Format(" CPU: {0}",this.CPU)); outline = outline.AppendLine(); outline = outline.Append(string.Format(" RAM: {0}",this.RAM)); outline = outline.AppendLine(); outline = outline.Append(string.Format(" Expandable memory: {0}",this.Memory)); outline = outline.AppendLine(); outline = outline.Append(string.Format(" Battery: {0}",this.battery)); return outline.AppendLine().ToString(); } } }
mit
C#
27dd5104a40ebf2fb249278f2a5dc5730ae422ba
use IIS on azure
Sphiecoh/MusicStore,Sphiecoh/MusicStore
src/NancyMusicStore/Program.cs
src/NancyMusicStore/Program.cs
using System.IO; using Microsoft.AspNetCore; using Microsoft.AspNetCore.Hosting; using Microsoft.Extensions.Configuration; namespace NancyMusicStore { public class Program { static void Main(string[] args) { BuildWebHost(args).Run(); } public static IWebHost BuildWebHost(string[] args) => WebHost.CreateDefaultBuilder(args) .UseStartup<Startup>() .UseIISIntegration() .Build(); } }
using System.IO; using Microsoft.AspNetCore; using Microsoft.AspNetCore.Hosting; using Microsoft.Extensions.Configuration; namespace NancyMusicStore { public class Program { static void Main(string[] args) { BuildWebHost(args).Run(); } public static IWebHost BuildWebHost(string[] args) => WebHost.CreateDefaultBuilder(args) .UseStartup<Startup>() .Build(); } }
mit
C#
c72596c3b1831e6708956e9286124c740df0272d
Extend IResolver with new Resolver Methods
Domysee/Pather.CSharp
src/Pather.CSharp/IResolver.cs
src/Pather.CSharp/IResolver.cs
using System.Collections.Generic; using Pather.CSharp.PathElements; namespace Pather.CSharp { public interface IResolver { IList<IPathElementFactory> PathElementFactories { get; set; } IList<IPathElement> CreatePath(string path); object Resolve(object target, IList<IPathElement> pathElements); object Resolve(object target, string path); } }
using System.Collections.Generic; using Pather.CSharp.PathElements; namespace Pather.CSharp { public interface IResolver { IList<IPathElementFactory> PathElementFactories { get; set; } object Resolve(object target, string path); } }
mit
C#
38ec2184d94f7be9b6dbab78e563804433c13919
Update changeculture on master
adraut/code-cracker,ElemarJR/code-cracker,carloscds/code-cracker,jwooley/code-cracker,carloscds/code-cracker,AlbertoMonteiro/code-cracker,kindermannhubert/code-cracker,giggio/code-cracker,thomaslevesque/code-cracker,akamud/code-cracker,eriawan/code-cracker,code-cracker/code-cracker,thorgeirk11/code-cracker,code-cracker/code-cracker,jhancock93/code-cracker
test/Common/CodeCracker.Test.Common/ChangeCulture.cs
test/Common/CodeCracker.Test.Common/ChangeCulture.cs
using System; using System.Globalization; using System.Threading; namespace CodeCracker.Test { public class ChangeCulture : IDisposable { private readonly CultureInfo originalCulture; private readonly CultureInfo originalUICulture; private readonly CultureInfo originalDefaultCulture; private readonly CultureInfo originalDefaultUICulture; public ChangeCulture(string cultureName) { originalCulture = Thread.CurrentThread.CurrentCulture; originalUICulture = Thread.CurrentThread.CurrentUICulture; originalDefaultCulture = CultureInfo.DefaultThreadCurrentCulture; originalDefaultUICulture = CultureInfo.DefaultThreadCurrentUICulture; Thread.CurrentThread.CurrentCulture = Thread.CurrentThread.CurrentUICulture = CultureInfo.DefaultThreadCurrentCulture = CultureInfo.DefaultThreadCurrentUICulture = CultureInfo.GetCultureInfo(cultureName); } public void Dispose() { Thread.CurrentThread.CurrentCulture = originalCulture; Thread.CurrentThread.CurrentUICulture = originalUICulture; CultureInfo.DefaultThreadCurrentCulture = originalDefaultCulture; CultureInfo.DefaultThreadCurrentUICulture = originalDefaultUICulture; GC.SuppressFinalize(this); } } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace CodeCracker.Test { public class ChangeCulture : IDisposable { public ChangeCulture(string cultureName) { System.Threading.Thread.CurrentThread.CurrentCulture = System.Globalization.CultureInfo.GetCultureInfo(cultureName); System.Threading.Thread.CurrentThread.CurrentUICulture = System.Globalization.CultureInfo.GetCultureInfo(cultureName); } public void Dispose() { System.Threading.Thread.CurrentThread.CurrentCulture = System.Globalization.CultureInfo.InvariantCulture; System.Threading.Thread.CurrentThread.CurrentUICulture = System.Globalization.CultureInfo.InvariantCulture; GC.SuppressFinalize(this); } } }
apache-2.0
C#
c01b18f02fb617f3e31004775500080d9243d9c1
Adjust expected testcase value
NeoAdonis/osu,peppy/osu,NeoAdonis/osu,ppy/osu,smoogipoo/osu,NeoAdonis/osu,2yangk23/osu,peppy/osu,EVAST9919/osu,naoey/osu,johnneijzen/osu,UselessToucan/osu,ppy/osu,smoogipoo/osu,2yangk23/osu,smoogipooo/osu,DrabWeb/osu,DrabWeb/osu,johnneijzen/osu,peppy/osu-new,DrabWeb/osu,naoey/osu,ZLima12/osu,UselessToucan/osu,ppy/osu,ZLima12/osu,EVAST9919/osu,peppy/osu,UselessToucan/osu,smoogipoo/osu,naoey/osu
osu.Game.Rulesets.Catch.Tests/CatchDifficultyCalculatorTest.cs
osu.Game.Rulesets.Catch.Tests/CatchDifficultyCalculatorTest.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 NUnit.Framework; using osu.Game.Beatmaps; using osu.Game.Rulesets.Catch.Difficulty; using osu.Game.Rulesets.Difficulty; using osu.Game.Tests.Beatmaps; namespace osu.Game.Rulesets.Catch.Tests { public class CatchDifficultyCalculatorTest : DifficultyCalculatorTest { protected override string ResourceAssembly => "osu.Game.Rulesets.Catch"; [TestCase(4.2038001515546597d, "diffcalc-test")] public void Test(double expected, string name) => base.Test(expected, name); protected override LegacyDifficultyCalculator CreateDifficultyCalculator(WorkingBeatmap beatmap) => new CatchDifficultyCalculator(new CatchRuleset(), beatmap); protected override Ruleset CreateRuleset() => new CatchRuleset(); } }
// 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 NUnit.Framework; using osu.Game.Beatmaps; using osu.Game.Rulesets.Catch.Difficulty; using osu.Game.Rulesets.Difficulty; using osu.Game.Tests.Beatmaps; namespace osu.Game.Rulesets.Catch.Tests { public class CatchDifficultyCalculatorTest : DifficultyCalculatorTest { protected override string ResourceAssembly => "osu.Game.Rulesets.Catch"; [TestCase(3.8701758020428221d, "diffcalc-test")] public void Test(double expected, string name) => base.Test(expected, name); protected override LegacyDifficultyCalculator CreateDifficultyCalculator(WorkingBeatmap beatmap) => new CatchDifficultyCalculator(new CatchRuleset(), beatmap); protected override Ruleset CreateRuleset() => new CatchRuleset(); } }
mit
C#
ddc1ad848e3334f68d0d56ae2ffc0234f75d15b2
Fix failing test
ZLima12/osu,2yangk23/osu,UselessToucan/osu,peppy/osu,DrabWeb/osu,johnneijzen/osu,naoey/osu,EVAST9919/osu,smoogipooo/osu,2yangk23/osu,EVAST9919/osu,ZLima12/osu,peppy/osu,smoogipoo/osu,DrabWeb/osu,NeoAdonis/osu,johnneijzen/osu,smoogipoo/osu,UselessToucan/osu,ppy/osu,ppy/osu,DrabWeb/osu,ppy/osu,naoey/osu,NeoAdonis/osu,smoogipoo/osu,peppy/osu,peppy/osu-new,NeoAdonis/osu,UselessToucan/osu,naoey/osu
osu.Game.Rulesets.Taiko.Tests/TaikoDifficultyCalculatorTest.cs
osu.Game.Rulesets.Taiko.Tests/TaikoDifficultyCalculatorTest.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 NUnit.Framework; using osu.Game.Beatmaps; using osu.Game.Rulesets.Difficulty; using osu.Game.Rulesets.Taiko.Difficulty; using osu.Game.Tests.Beatmaps; namespace osu.Game.Rulesets.Taiko.Tests { public class TaikoDifficultyCalculatorTest : DifficultyCalculatorTest { protected override string ResourceAssembly => "osu.Game.Rulesets.Taiko"; [TestCase(2.9811338051242915d, "diffcalc-test")] [TestCase(2.9811338051242915d, "diffcalc-test-strong")] public void Test(double expected, string name) => base.Test(expected, name); protected override LegacyDifficultyCalculator CreateDifficultyCalculator(WorkingBeatmap beatmap) => new TaikoDifficultyCalculator(new TaikoRuleset(), beatmap); protected override Ruleset CreateRuleset() => new TaikoRuleset(); } }
// 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 NUnit.Framework; using osu.Game.Beatmaps; using osu.Game.Rulesets.Difficulty; using osu.Game.Rulesets.Taiko.Difficulty; using osu.Game.Tests.Beatmaps; namespace osu.Game.Rulesets.Taiko.Tests { public class TaikoDifficultyCalculatorTest : DifficultyCalculatorTest { protected override string ResourceAssembly => "osu.Game.Rulesets.Taiko"; [TestCase(2.9811336589467095, "diffcalc-test")] [TestCase(2.9811336589467095, "diffcalc-test-strong")] public void Test(double expected, string name) => base.Test(expected, name); protected override LegacyDifficultyCalculator CreateDifficultyCalculator(WorkingBeatmap beatmap) => new TaikoDifficultyCalculator(new TaikoRuleset(), beatmap); protected override Ruleset CreateRuleset() => new TaikoRuleset(); } }
mit
C#
8cec81a5e7db13a89fee88d94f1a0a9da36b0d4f
add logging _AssetPath at ResourceLoadSpreadSheet
NDark/ndinfrastructure,NDark/ndinfrastructure
Unity/SpreadSheetLoader/SpreadSheetUnityLoader.cs
Unity/SpreadSheetLoader/SpreadSheetUnityLoader.cs
/** MIT License Copyright (c) 2017 NDark Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /** @file SpreadSheetUnityLoader.cs @author NDark @date 20170424 by NDark */ using System.Collections; using System.Collections.Generic; using UnityEngine; public static class SpreadSheetUnityLoader { public static bool ResourceLoadSpreadSheet( string _AssetPath , ref List< string [] > _Result , bool _WithFirstLow , ref string [] _FirstRow ) { TextAsset ta = Resources.Load ( _AssetPath ) as TextAsset ; if (null == ta) { Debug.LogError("ResourceLoadSpreadSheet() null == ta _AssetPath=" + _AssetPath ); return false ; } return SpreadSheetLoader.ParseSpreadSheet( ta.text , ref _Result , _WithFirstLow , ref _FirstRow ) ; } }
/** MIT License Copyright (c) 2017 NDark Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /** @file SpreadSheetUnityLoader.cs @author NDark @date 20170424 by NDark */ using System.Collections; using System.Collections.Generic; using UnityEngine; public static class SpreadSheetUnityLoader { public static bool ResourceLoadSpreadSheet( string _AssetPath , ref List< string [] > _Result , bool _WithFirstLow , ref string [] _FirstRow ) { TextAsset ta = Resources.Load ( _AssetPath ) as TextAsset ; if (null == ta) { Debug.LogError("ResourceLoadSpreadSheet() null == ta"); return false ; } return SpreadSheetLoader.ParseSpreadSheet( ta.text , ref _Result , _WithFirstLow , ref _FirstRow ) ; } }
mit
C#
cbc74e3963c35e717cbc429ebc8a3fb7a56ee691
Reformat code.
nopara73/HiddenWallet,nopara73/HiddenWallet,nopara73/HiddenWallet,nopara73/HiddenWallet
WalletWasabi.Tests/UnitTests/TestBlockProvider.cs
WalletWasabi.Tests/UnitTests/TestBlockProvider.cs
using NBitcoin; using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; using WalletWasabi.Wallets; namespace WalletWasabi.Tests.UnitTests { public class TestBlockProvider : IBlockProvider { public TestBlockProvider(Dictionary<uint256, Block> blocks) { Blocks = blocks; } private Dictionary<uint256, Block> Blocks { get; } public Task<Block> GetBlockAsync(uint256 hash, CancellationToken cancel) { return Task.FromResult(Blocks[hash]); } } }
using NBitcoin; using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; using WalletWasabi.Wallets; namespace WalletWasabi.Tests.UnitTests { public class TestBlockProvider : IBlockProvider { private Dictionary<uint256, Block> Blocks { get; } public TestBlockProvider(Dictionary<uint256, Block> blocks) { Blocks = blocks; } public Task<Block> GetBlockAsync(uint256 hash, CancellationToken cancel) { return Task.FromResult(Blocks[hash]); } } }
mit
C#
a90681a22da8bdf06d85de0b6fce9c52327c8a47
Add contains function to RectD class
brnkhy/MapzenGo,brnkhy/MapzenGo
Assets/MapzenGo/Helpers/VectorD/RectD.cs
Assets/MapzenGo/Helpers/VectorD/RectD.cs
using UnityEngine; using System.Collections; public class RectD { public Vector2d Min { get; private set; } public Vector2d Size { get; private set; } public Vector2d Center { get { return new Vector2d(Min.x + Size.x / 2, Min.y + Size.y / 2); } set { Min = new Vector2d(value.x - Size.x / 2, value.x - Size.y / 2); } } public double Height { get { return Size.y; } } public double Width { get { return Size.x; } } public RectD(Vector2d min, Vector2d size) { Min = min; Size = size; } public bool Contains(Vector2d point) { bool flag = Width < 0.0 && point.x <= Min.x && point.x > (Min.x + Size.x) || Width >= 0.0 && point.x >= Min.x && point.x < (Min.x + Size.x); return flag && (Height < 0.0 && point.y <= Min.y && point.y > (Min.y + Size.y) || Height >= 0.0 && point.y >= Min.y && point.y < (Min.y + Size.y)); } }
using UnityEngine; using System.Collections; public class RectD { public Vector2d Min { get; private set; } public Vector2d Size { get; private set; } public Vector2d Center { get { return new Vector2d(Min.x + Size.x / 2, Min.y + Size.y / 2); } set { Min = new Vector2d(value.x - Size.x / 2, value.x - Size.y / 2); } } public double Height { get { return Size.y; } } public double Width { get { return Size.x; } } public RectD(Vector2d min, Vector2d size) { Min = min; Size = size; } }
mit
C#
c101d629be13cc47a81b9d5776254cb140a6f812
Set RenderProcessMessageHandler and LoadHandler to null on Dispose Reoder so they match the order in IWebBrowser so they're easier to compare
jamespearce2006/CefSharp,jamespearce2006/CefSharp,wangzheng888520/CefSharp,dga711/CefSharp,dga711/CefSharp,dga711/CefSharp,VioletLife/CefSharp,jamespearce2006/CefSharp,Livit/CefSharp,jamespearce2006/CefSharp,wangzheng888520/CefSharp,dga711/CefSharp,Livit/CefSharp,VioletLife/CefSharp,Livit/CefSharp,VioletLife/CefSharp,wangzheng888520/CefSharp,Livit/CefSharp,jamespearce2006/CefSharp,VioletLife/CefSharp,wangzheng888520/CefSharp
CefSharp/InternalWebBrowserExtensions.cs
CefSharp/InternalWebBrowserExtensions.cs
// Copyright © 2010-2015 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 CefSharp.Internals; namespace CefSharp { internal static class InternalWebBrowserExtensions { internal static void SetHandlersToNull(this IWebBrowserInternal browser) { browser.DialogHandler = null; browser.RequestHandler = null; browser.DisplayHandler = null; browser.LoadHandler = null; browser.LifeSpanHandler = null; browser.KeyboardHandler = null; browser.JsDialogHandler = null; browser.DragHandler = null; browser.DownloadHandler = null; browser.MenuHandler = null; browser.FocusHandler = null; browser.ResourceHandlerFactory = null; browser.GeolocationHandler = null; browser.RenderProcessMessageHandler = null; } } }
// Copyright © 2010-2015 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 CefSharp.Internals; namespace CefSharp { internal static class InternalWebBrowserExtensions { internal static void SetHandlersToNull(this IWebBrowserInternal browser) { browser.ResourceHandlerFactory = null; browser.JsDialogHandler = null; browser.DialogHandler = null; browser.DownloadHandler = null; browser.KeyboardHandler = null; browser.LifeSpanHandler = null; browser.MenuHandler = null; browser.FocusHandler = null; browser.RequestHandler = null; browser.DragHandler = null; browser.GeolocationHandler = null; } } }
bsd-3-clause
C#
10b9a5d86eaa731ca4c4111550cb4188931cf018
Update names of tests
Azure-Samples/MyDriving,Azure-Samples/MyDriving,Azure-Samples/MyDriving
src/MobileApps/MyDriving/MyDriving.UITests/Tests/LoginTests.cs
src/MobileApps/MyDriving/MyDriving.UITests/Tests/LoginTests.cs
// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for details. using NUnit.Framework; using Xamarin.UITest; namespace MyDriving.UITests { public class LoginTests : AbstractSetup { public LoginTests(Platform platform) : base(platform) { } [Test] public void SkipAuthenticationTest() { ClearKeychain(); new LoginPage() .SkipAuthentication(); new CurrentTripPage() .AssertOnPage(); } [Test] public void LoginWithFacebookTest() { ClearKeychain(); new LoginPage() .LoginWithFacebook(); new FacebookLoginPage() .Login(); new CurrentTripPage() .AssertOnPage(); } } }
// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for details. using NUnit.Framework; using Xamarin.UITest; namespace MyDriving.UITests { public class LoginTests : AbstractSetup { public LoginTests(Platform platform) : base(platform) { } [Test] public void LoginWithFacebookTest() { ClearKeychain(); new LoginPage() .SkipAuthentication(); new CurrentTripPage() .AssertOnPage(); } [Test] public void SkipAuthenticationTest() { ClearKeychain(); new LoginPage() .LoginWithFacebook(); new FacebookLoginPage() .Login(); new CurrentTripPage() .AssertOnPage(); } } }
mit
C#
eff1346f4fe23d03fc21a3c091bd9ce0b8612e3d
Use synchronous socket method if data is available. Fixes #164
mysql-net/MySqlConnector,mysql-net/MySqlConnector
src/MySqlConnector/Protocol/Serialization/SocketByteHandler.cs
src/MySqlConnector/Protocol/Serialization/SocketByteHandler.cs
using System; using System.Net.Sockets; using System.Threading.Tasks; namespace MySql.Data.Protocol.Serialization { internal sealed class SocketByteHandler : IByteHandler { public SocketByteHandler(Socket socket) { m_socket = socket; var socketEventArgs = new SocketAsyncEventArgs(); m_socketAwaitable = new SocketAwaitable(socketEventArgs); m_buffer = new byte[16384]; } public ValueTask<ArraySegment<byte>> ReadBytesAsync(int count, IOBehavior ioBehavior) { var buffer = count < m_buffer.Length ? m_buffer : new byte[count]; if (ioBehavior == IOBehavior.Asynchronous && m_socket.Available < count) { return new ValueTask<ArraySegment<byte>>(DoReadBytesAsync(buffer, 0, count)); } else { var bytesRead = m_socket.Receive(buffer, 0, count, SocketFlags.None); return new ValueTask<ArraySegment<byte>>(new ArraySegment<byte>(buffer, 0, bytesRead)); } } public ValueTask<int> WriteBytesAsync(ArraySegment<byte> data, IOBehavior ioBehavior) { if (ioBehavior == IOBehavior.Asynchronous) { return new ValueTask<int>(DoWriteBytesAsync(data)); } else { m_socket.Send(data.Array, data.Offset, data.Count, SocketFlags.None); return default(ValueTask<int>); } } private async Task<ArraySegment<byte>> DoReadBytesAsync(byte[] buffer, int offset, int count) { m_socketAwaitable.EventArgs.SetBuffer(buffer, offset, count); await m_socket.ReceiveAsync(m_socketAwaitable); return new ArraySegment<byte>(buffer, 0, m_socketAwaitable.EventArgs.BytesTransferred); } private async Task<int> DoWriteBytesAsync(ArraySegment<byte> payload) { if (payload.Count <= m_buffer.Length) { Buffer.BlockCopy(payload.Array, payload.Offset, m_buffer, 0, payload.Count); m_socketAwaitable.EventArgs.SetBuffer(m_buffer, 0, payload.Count); } else { m_socketAwaitable.EventArgs.SetBuffer(payload.Array, payload.Offset, payload.Count); } await m_socket.SendAsync(m_socketAwaitable); return 0; } readonly Socket m_socket; readonly SocketAwaitable m_socketAwaitable; readonly byte[] m_buffer; } }
using System; using System.Net.Sockets; using System.Threading.Tasks; namespace MySql.Data.Protocol.Serialization { internal sealed class SocketByteHandler : IByteHandler { public SocketByteHandler(Socket socket) { m_socket = socket; var socketEventArgs = new SocketAsyncEventArgs(); m_socketAwaitable = new SocketAwaitable(socketEventArgs); m_buffer = new byte[16384]; } public ValueTask<ArraySegment<byte>> ReadBytesAsync(int count, IOBehavior ioBehavior) { var buffer = count < m_buffer.Length ? m_buffer : new byte[count]; if (ioBehavior == IOBehavior.Asynchronous) { return new ValueTask<ArraySegment<byte>>(DoReadBytesAsync(buffer, 0, count)); } else { var bytesRead = m_socket.Receive(buffer, 0, count, SocketFlags.None); return new ValueTask<ArraySegment<byte>>(new ArraySegment<byte>(buffer, 0, bytesRead)); } } public ValueTask<int> WriteBytesAsync(ArraySegment<byte> data, IOBehavior ioBehavior) { if (ioBehavior == IOBehavior.Asynchronous) { return new ValueTask<int>(DoWriteBytesAsync(data)); } else { m_socket.Send(data.Array, data.Offset, data.Count, SocketFlags.None); return default(ValueTask<int>); } } private async Task<ArraySegment<byte>> DoReadBytesAsync(byte[] buffer, int offset, int count) { m_socketAwaitable.EventArgs.SetBuffer(buffer, offset, count); await m_socket.ReceiveAsync(m_socketAwaitable); return new ArraySegment<byte>(buffer, 0, m_socketAwaitable.EventArgs.BytesTransferred); } private async Task<int> DoWriteBytesAsync(ArraySegment<byte> payload) { if (payload.Count <= m_buffer.Length) { Buffer.BlockCopy(payload.Array, payload.Offset, m_buffer, 0, payload.Count); m_socketAwaitable.EventArgs.SetBuffer(m_buffer, 0, payload.Count); } else { m_socketAwaitable.EventArgs.SetBuffer(payload.Array, payload.Offset, payload.Count); } await m_socket.SendAsync(m_socketAwaitable); return 0; } readonly Socket m_socket; readonly SocketAwaitable m_socketAwaitable; readonly byte[] m_buffer; } }
mit
C#
ece1aef4dd140b603e9037852e273595e6c4e18c
Fix failing get alias tests
CSGOpenSource/elasticsearch-net,CSGOpenSource/elasticsearch-net,CSGOpenSource/elasticsearch-net,elastic/elasticsearch-net,adam-mccoy/elasticsearch-net,adam-mccoy/elasticsearch-net,elastic/elasticsearch-net,adam-mccoy/elasticsearch-net
src/Tests/Indices/AliasManagement/GetAlias/GetAliasApiTests.cs
src/Tests/Indices/AliasManagement/GetAlias/GetAliasApiTests.cs
using System; using System.Collections.Generic; using System.Threading.Tasks; using Elasticsearch.Net; using FluentAssertions; using Nest; using Tests.Framework; using Tests.Framework.Integration; using Xunit; namespace Tests.Indices.AliasManagement.GetAlias { public class GetAliasApiTests : ApiIntegrationTestBase<ReadOnlyCluster, IGetAliasResponse, IGetAliasRequest, GetAliasDescriptor, GetAliasRequest> { private static readonly Names Names = Infer.Names("alias, x", "y"); public GetAliasApiTests(ReadOnlyCluster cluster, EndpointUsage usage) : base(cluster, usage) { } protected override LazyResponses ClientUsage() => Calls( fluent: (client, f) => client.GetAlias(f), fluentAsync: (client, f) => client.GetAliasAsync(f), request: (client, r) => client.GetAlias(r), requestAsync: (client, r) => client.GetAliasAsync(r) ); protected override bool ExpectIsValid => true; protected override int ExpectStatusCode => 200; protected override HttpMethod HttpMethod => HttpMethod.GET; protected override string UrlPath => $"/_alias/alias%2Cx%2Cy"; protected override void ExpectResponse(IGetAliasResponse response) { response.Indices.Should().NotBeNull(); } protected override bool SupportsDeserialization => false; protected override Func<GetAliasDescriptor, IGetAliasRequest> Fluent => d=>d .Name(Names) ; protected override GetAliasRequest Initializer => new GetAliasRequest(Names); } public class GetAliasNotFoundApiTests : ApiIntegrationTestBase<ReadOnlyCluster, IGetAliasResponse, IGetAliasRequest, GetAliasDescriptor, GetAliasRequest> { private static readonly Names Names = Infer.Names("bad-alias"); public GetAliasNotFoundApiTests(ReadOnlyCluster cluster, EndpointUsage usage) : base(cluster, usage) { } protected override LazyResponses ClientUsage() => Calls( fluent: (client, f) => client.GetAlias(f), fluentAsync: (client, f) => client.GetAliasAsync(f), request: (client, r) => client.GetAlias(r), requestAsync: (client, r) => client.GetAliasAsync(r) ); protected override bool ExpectIsValid => false; protected override int ExpectStatusCode => 200; protected override HttpMethod HttpMethod => HttpMethod.GET; protected override string UrlPath => $"/_alias/bad-alias"; protected override bool SupportsDeserialization => false; protected override Func<GetAliasDescriptor, IGetAliasRequest> Fluent => d=>d .Name(Names) ; protected override GetAliasRequest Initializer => new GetAliasRequest(Names); protected override void ExpectResponse(IGetAliasResponse response) { response.ServerError.Should().NotBeNull(); response.ServerError.Error.Reason.Should().Contain("missing"); response.Indices.Should().NotBeNull(); } } }
using System; using System.Collections.Generic; using System.Threading.Tasks; using Elasticsearch.Net; using FluentAssertions; using Nest; using Tests.Framework; using Tests.Framework.Integration; using Xunit; namespace Tests.Indices.AliasManagement.GetAlias { public class GetAliasApiTests : ApiIntegrationTestBase<ReadOnlyCluster, IGetAliasResponse, IGetAliasRequest, GetAliasDescriptor, GetAliasRequest> { private static readonly Names Names = Infer.Names("alias, x", "y"); public GetAliasApiTests(ReadOnlyCluster cluster, EndpointUsage usage) : base(cluster, usage) { } protected override LazyResponses ClientUsage() => Calls( fluent: (client, f) => client.GetAlias(f), fluentAsync: (client, f) => client.GetAliasAsync(f), request: (client, r) => client.GetAlias(r), requestAsync: (client, r) => client.GetAliasAsync(r) ); protected override bool ExpectIsValid => true; protected override int ExpectStatusCode => 200; protected override HttpMethod HttpMethod => HttpMethod.GET; protected override string UrlPath => $"/_all/_alias/alias%2Cx%2Cy"; protected override void ExpectResponse(IGetAliasResponse response) { response.Indices.Should().NotBeNull(); } protected override bool SupportsDeserialization => false; protected override Func<GetAliasDescriptor, IGetAliasRequest> Fluent => d=>d .Name(Names) ; protected override GetAliasRequest Initializer => new GetAliasRequest(Infer.AllIndices, Names); } public class GetAliasNotFoundApiTests : ApiIntegrationTestBase<ReadOnlyCluster, IGetAliasResponse, IGetAliasRequest, GetAliasDescriptor, GetAliasRequest> { private static readonly Names Names = Infer.Names("bad-alias"); public GetAliasNotFoundApiTests(ReadOnlyCluster cluster, EndpointUsage usage) : base(cluster, usage) { } protected override LazyResponses ClientUsage() => Calls( fluent: (client, f) => client.GetAlias(f), fluentAsync: (client, f) => client.GetAliasAsync(f), request: (client, r) => client.GetAlias(r), requestAsync: (client, r) => client.GetAliasAsync(r) ); protected override bool ExpectIsValid => false; protected override int ExpectStatusCode => 200; protected override HttpMethod HttpMethod => HttpMethod.GET; protected override string UrlPath => $"/_all/_alias/alias%2Cx%2Cy"; protected override bool SupportsDeserialization => false; protected override Func<GetAliasDescriptor, IGetAliasRequest> Fluent => d=>d .Name(Names) ; protected override GetAliasRequest Initializer => new GetAliasRequest(Names); protected override void ExpectResponse(IGetAliasResponse response) { response.ServerError.Should().NotBeNull(); response.ServerError.Error.Reason.Should().Contain("missing"); response.Indices.Should().NotBeNull(); } } }
apache-2.0
C#
6e2b3ae1d16f45ec025ceb012cfb25046d68b51c
move config loading to after logging config in ConfigR.Tests.Smoke.Service
config-r/config-r
tests/ConfigR.Tests.Smoke.Service/Program.cs
tests/ConfigR.Tests.Smoke.Service/Program.cs
// <copyright file="Program.cs" company="ConfigR contributors"> // Copyright (c) ConfigR contributors. (configr.net@gmail.com) // </copyright> namespace ConfigR.Tests.Smoke.Service { using System; using System.Threading.Tasks; using ConfigR; using ConfigR.Tests.Smoke.Service.Logging; using NLog; using NLog.Config; using NLog.Targets; using Topshelf; public static class Program { public static void Main() { MainAsync().GetAwaiter().GetResult(); } public static async Task MainAsync() { using (var target = new ColoredConsoleTarget()) { var loggingConfig = new LoggingConfiguration(); loggingConfig.AddTarget("console", target); loggingConfig.LoggingRules.Add(new LoggingRule("*", NLog.LogLevel.Trace, target)); LogManager.Configuration = loggingConfig; var config = await new Config().UseRoslynCSharpLoader().Load(); var log = LogProvider.GetCurrentClassLogger(); AppDomain.CurrentDomain.UnhandledException += (sender, e) => log.FatalException("Unhandled exception.", (Exception)e.ExceptionObject); HostFactory.Run(x => x.Service<string>(o => { o.ConstructUsing(n => n); o.WhenStarted(n => log.Info((string)config.Settings<Settings>().Greeting)); o.WhenStopped(n => log.Info((string)config.Settings<Settings>().Valediction)); })); } } } }
// <copyright file="Program.cs" company="ConfigR contributors"> // Copyright (c) ConfigR contributors. (configr.net@gmail.com) // </copyright> namespace ConfigR.Tests.Smoke.Service { using System; using System.Threading.Tasks; using ConfigR; using ConfigR.Tests.Smoke.Service.Logging; using NLog; using NLog.Config; using NLog.Targets; using Topshelf; public static class Program { public static void Main() { MainAsync().GetAwaiter().GetResult(); } public static async Task MainAsync() { var config = await new Config().UseRoslynCSharpLoader().Load(); using (var target = new ColoredConsoleTarget()) { var loggingConfig = new LoggingConfiguration(); loggingConfig.AddTarget("console", target); loggingConfig.LoggingRules.Add(new LoggingRule("*", NLog.LogLevel.Trace, target)); LogManager.Configuration = loggingConfig; var log = LogProvider.GetCurrentClassLogger(); AppDomain.CurrentDomain.UnhandledException += (sender, e) => log.FatalException("Unhandled exception.", (Exception)e.ExceptionObject); HostFactory.Run(x => x.Service<string>(o => { o.ConstructUsing(n => n); o.WhenStarted(n => log.Info((string)config.Settings<Settings>().Greeting)); o.WhenStopped(n => log.Info((string)config.Settings<Settings>().Valediction)); })); } } } }
mit
C#
0850b533d8d4016b7200f84c491d5cfb407c5106
Fix revision number of support libraries to 0
jskeet/google-api-dotnet-client,chrisdunelm/google-api-dotnet-client,Duikmeester/google-api-dotnet-client,ivannaranjo/google-api-dotnet-client,ivannaranjo/google-api-dotnet-client,chrisdunelm/google-api-dotnet-client,ivannaranjo/google-api-dotnet-client,jskeet/google-api-dotnet-client,Duikmeester/google-api-dotnet-client,ivannaranjo/google-api-dotnet-client,jskeet/google-api-dotnet-client,googleapis/google-api-dotnet-client,Duikmeester/google-api-dotnet-client,googleapis/google-api-dotnet-client,googleapis/google-api-dotnet-client,chrisdunelm/google-api-dotnet-client,Duikmeester/google-api-dotnet-client,chrisdunelm/google-api-dotnet-client
Src/Support/CommonAssemblyInfo.cs
Src/Support/CommonAssemblyInfo.cs
/* Copyright 2015 Google Inc Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ using System.Reflection; // Attributes common to all assemblies. [assembly: AssemblyCompany("Google Inc")] [assembly: AssemblyCopyright("Copyright 2016 Google Inc")] [assembly: AssemblyVersion("1.11.0.0")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyProduct("")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")]
/* Copyright 2015 Google Inc Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ using System.Reflection; // Attributes common to all assemblies. [assembly: AssemblyCompany("Google Inc")] [assembly: AssemblyCopyright("Copyright 2016 Google Inc")] [assembly: AssemblyVersion("1.11.0.*")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyProduct("")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")]
apache-2.0
C#
d9116a7184a7ab89d2eb4969c2316ea4a889598e
Disable parallelization
rmandvikar/csharp-trie,rmandvikar/csharp-trie
tests/rm.TrieTest/Properties/AssemblyInfo.cs
tests/rm.TrieTest/Properties/AssemblyInfo.cs
using NUnit.Framework; [assembly: Parallelizable(ParallelScope.None)]
using NUnit.Framework; [assembly: Parallelizable(ParallelScope.All)]
mit
C#
7b7c631244de8430b92a31bb2ece3439e041a08d
Stop filtering out stop words in package ids and titles.
KuduApps/NuGetGallery,KuduApps/NuGetGallery,KuduApps/NuGetGallery,mtian/SiteExtensionGallery,ScottShingler/NuGetGallery,projectkudu/SiteExtensionGallery,JetBrains/ReSharperGallery,ScottShingler/NuGetGallery,grenade/NuGetGallery_download-count-patch,ScottShingler/NuGetGallery,grenade/NuGetGallery_download-count-patch,projectkudu/SiteExtensionGallery,grenade/NuGetGallery_download-count-patch,JetBrains/ReSharperGallery,KuduApps/NuGetGallery,skbkontur/NuGetGallery,skbkontur/NuGetGallery,mtian/SiteExtensionGallery,JetBrains/ReSharperGallery,skbkontur/NuGetGallery,mtian/SiteExtensionGallery,projectkudu/SiteExtensionGallery,KuduApps/NuGetGallery
Website/Infrastructure/Lucene/PerFieldAnalyzer.cs
Website/Infrastructure/Lucene/PerFieldAnalyzer.cs
using System; using System.Collections; using System.Collections.Generic; using System.IO; using Lucene.Net.Analysis; using Lucene.Net.Analysis.Standard; namespace NuGetGallery { public class PerFieldAnalyzer : PerFieldAnalyzerWrapper { public PerFieldAnalyzer() : base(new StandardAnalyzer(LuceneCommon.LuceneVersion), CreateFieldAnalyzers()) { } private static IDictionary CreateFieldAnalyzers() { // For idAnalyzer we use the 'standard analyzer' but with no stop words (In, Of, The, etc are indexed). var stopWords = new Hashtable(); StandardAnalyzer idAnalyzer = new StandardAnalyzer(LuceneCommon.LuceneVersion, stopWords); return new Dictionary<string, Analyzer>(StringComparer.OrdinalIgnoreCase) { { "Id", idAnalyzer }, { "Title", new TitleAnalyzer() }, }; } class TitleAnalyzer : Analyzer { private readonly StandardAnalyzer innerAnalyzer; public TitleAnalyzer() { // For innerAnalyzer we use the 'standard analyzer' but with no stop words (In, Of, The, etc are indexed). var stopWords = new Hashtable(); innerAnalyzer = new StandardAnalyzer(LuceneCommon.LuceneVersion, stopWords); } public override TokenStream TokenStream(string fieldName, TextReader reader) { // Split the title based on IdSeparators, then run it through the innerAnalyzer string title = reader.ReadToEnd(); string partiallyTokenized = String.Join(" ", title.Split(LuceneIndexingService.IdSeparators, StringSplitOptions.RemoveEmptyEntries)); return innerAnalyzer.TokenStream(fieldName, new StringReader(partiallyTokenized)); } } } }
using System; using System.Collections; using System.Collections.Generic; using System.IO; using Lucene.Net.Analysis; using Lucene.Net.Analysis.Standard; namespace NuGetGallery { public class PerFieldAnalyzer : PerFieldAnalyzerWrapper { public PerFieldAnalyzer() : base(new StandardAnalyzer(LuceneCommon.LuceneVersion), CreateFieldAnalyzers()) { } private static IDictionary CreateFieldAnalyzers() { return new Dictionary<string, Analyzer>(StringComparer.OrdinalIgnoreCase) { { "Title", new TitleAnalyzer() } }; } class TitleAnalyzer : Analyzer { private readonly Analyzer innerAnalyzer = new StandardAnalyzer(LuceneCommon.LuceneVersion); public override TokenStream TokenStream(string fieldName, TextReader reader) { // Split the title based on IdSeparators, then run it through the standardAnalyzer string title = reader.ReadToEnd(); string partiallyTokenized = String.Join(" ", title.Split(LuceneIndexingService.IdSeparators, StringSplitOptions.RemoveEmptyEntries)); return innerAnalyzer.TokenStream(fieldName, new StringReader(partiallyTokenized)); } } } }
apache-2.0
C#
c09346080f492714f850aac2f004553e24c76d27
Remove the unused desktop project variable
naoey/osu,ZLima12/osu,peppy/osu,peppy/osu,UselessToucan/osu,johnneijzen/osu,naoey/osu,DrabWeb/osu,2yangk23/osu,smoogipoo/osu,smoogipooo/osu,NeoAdonis/osu,peppy/osu,naoey/osu,NeoAdonis/osu,DrabWeb/osu,johnneijzen/osu,ZLima12/osu,peppy/osu-new,EVAST9919/osu,ppy/osu,DrabWeb/osu,UselessToucan/osu,ppy/osu,NeoAdonis/osu,EVAST9919/osu,ppy/osu,2yangk23/osu,UselessToucan/osu,smoogipoo/osu,smoogipoo/osu
build/build.cake
build/build.cake
#addin "nuget:?package=CodeFileSanity&version=0.0.21" #addin "nuget:?package=JetBrains.ReSharper.CommandLineTools&version=2018.2.2" #tool "nuget:?package=NVika.MSBuild&version=1.0.1" var nVikaToolPath = GetFiles("./tools/NVika.MSBuild.*/tools/NVika.exe").First(); /////////////////////////////////////////////////////////////////////////////// // ARGUMENTS /////////////////////////////////////////////////////////////////////////////// var target = Argument("target", "Build"); var configuration = Argument("configuration", "Release"); var rootDirectory = new DirectoryPath(".."); var solution = rootDirectory.CombineWithFilePath("osu.sln"); /////////////////////////////////////////////////////////////////////////////// // TASKS /////////////////////////////////////////////////////////////////////////////// Task("Compile") .Does(() => { DotNetCoreBuild(solution.FullPath, new DotNetCoreBuildSettings { Configuration = configuration, }); }); Task("Test") .IsDependentOn("Compile") .Does(() => { var testAssemblies = GetFiles(rootDirectory + "/**/*.Tests/bin/**/*.Tests.dll"); DotNetCoreVSTest(testAssemblies, new DotNetCoreVSTestSettings { Logger = AppVeyor.IsRunningOnAppVeyor ? "Appveyor" : $"trx", Parallel = true, ToolTimeout = TimeSpan.FromMinutes(10), }); }); // windows only because both inspectcore and nvika depend on net45 Task("InspectCode") .WithCriteria(IsRunningOnWindows()) .IsDependentOn("Compile") .Does(() => { InspectCode(solution, new InspectCodeSettings { CachesHome = "inspectcode", OutputFile = "inspectcodereport.xml", }); StartProcess(nVikaToolPath, @"parsereport ""inspectcodereport.xml"" --treatwarningsaserrors"); }); Task("CodeFileSanity") .Does(() => { ValidateCodeSanity(new ValidateCodeSanitySettings { RootDirectory = rootDirectory.FullPath, IsAppveyorBuild = AppVeyor.IsRunningOnAppVeyor }); }); Task("Build") .IsDependentOn("CodeFileSanity") .IsDependentOn("InspectCode") .IsDependentOn("Test"); RunTarget(target);
#addin "nuget:?package=CodeFileSanity&version=0.0.21" #addin "nuget:?package=JetBrains.ReSharper.CommandLineTools&version=2018.2.2" #tool "nuget:?package=NVika.MSBuild&version=1.0.1" var nVikaToolPath = GetFiles("./tools/NVika.MSBuild.*/tools/NVika.exe").First(); /////////////////////////////////////////////////////////////////////////////// // ARGUMENTS /////////////////////////////////////////////////////////////////////////////// var target = Argument("target", "Build"); var configuration = Argument("configuration", "Release"); var rootDirectory = new DirectoryPath(".."); var desktopProject = rootDirectory.CombineWithFilePath("osu.Desktop/osu.Desktop.csproj"); var solution = rootDirectory.CombineWithFilePath("osu.sln"); /////////////////////////////////////////////////////////////////////////////// // TASKS /////////////////////////////////////////////////////////////////////////////// Task("Compile") .Does(() => { DotNetCoreBuild(solution.FullPath, new DotNetCoreBuildSettings { Configuration = configuration, }); }); Task("Test") .IsDependentOn("Compile") .Does(() => { var testAssemblies = GetFiles(rootDirectory + "/**/*.Tests/bin/**/*.Tests.dll"); DotNetCoreVSTest(testAssemblies, new DotNetCoreVSTestSettings { Logger = AppVeyor.IsRunningOnAppVeyor ? "Appveyor" : $"trx", Parallel = true, ToolTimeout = TimeSpan.FromMinutes(10), }); }); // windows only because both inspectcore and nvika depend on net45 Task("InspectCode") .WithCriteria(IsRunningOnWindows()) .IsDependentOn("Compile") .Does(() => { InspectCode(solution, new InspectCodeSettings { CachesHome = "inspectcode", OutputFile = "inspectcodereport.xml", }); StartProcess(nVikaToolPath, @"parsereport ""inspectcodereport.xml"" --treatwarningsaserrors"); }); Task("CodeFileSanity") .Does(() => { ValidateCodeSanity(new ValidateCodeSanitySettings { RootDirectory = rootDirectory.FullPath, IsAppveyorBuild = AppVeyor.IsRunningOnAppVeyor }); }); Task("Build") .IsDependentOn("CodeFileSanity") .IsDependentOn("InspectCode") .IsDependentOn("Test"); RunTarget(target);
mit
C#
f343edf6822de6ac77480944ff77e7428a15b4fe
update structure to allow score difference calc
agrc/api.mapserv.utah.gov,agrc/api.mapserv.utah.gov,agrc/api.mapserv.utah.gov,agrc/api.mapserv.utah.gov
WebAPI.API/DataStructures/TopAddressCandidates.cs
WebAPI.API/DataStructures/TopAddressCandidates.cs
using System.Collections.Generic; using WebAPI.Common.DataStructures; using WebAPI.Domain.ArcServerResponse.Geolocator; namespace WebAPI.API.DataStructures { public class TopAddressCandidates : TopNList<Candidate> { public TopAddressCandidates(int size, IComparer<Candidate> comparer) : base(ChooseSize(size), comparer) {} private static int ChooseSize(int size) { // allow score difference calculation for when no suggestion is selected if (size == 0) { return 2; } // otherwise suggestion size + 1 since one is the top candidate return size + 1; } } }
using System.Collections.Generic; using WebAPI.Common.DataStructures; using WebAPI.Domain.ArcServerResponse.Geolocator; namespace WebAPI.API.DataStructures { public class TopAddressCandidates : TopNList<Candidate> { public TopAddressCandidates(int size, IComparer<Candidate> comparer) : base(size + 1, comparer) {} } }
mit
C#
99df6b620c0c87be8b1fabadc461cdbe3d6e348f
fix timespan const
AdmiralPotato/ggj2013,AdmiralPotato/ggj2013,AdmiralPotato/ggj2013
Server/Web/Enemy.cs
Server/Web/Enemy.cs
using System; using System.Collections.Generic; using System.Linq; using System.Web; namespace WebGame { public class Enemy : Ship { public override string Type { get { return "Enemy"; } } private static TimeSpan reFireTime = TimeSpan.FromSeconds(15); private TimeSpan timeSinceLastFire = TimeSpan.Zero; public override void Update(TimeSpan elapsed) { if (timeSinceLastFire > reFireTime) { foreach (var ship in this.StarSystem.Ships) { if (!(ship is Enemy)) { this.LaunchProjectile(ship); this.LoadProjectile(); } } timeSinceLastFire = TimeSpan.Zero; } else { timeSinceLastFire += elapsed; } base.Update(elapsed); } } }
using System; using System.Collections.Generic; using System.Linq; using System.Web; namespace WebGame { public class Enemy : Ship { public override string Type { get { return "Enemy"; } } private const TimeSpan reFireTime = TimeSpan.FromSeconds(15); private TimeSpan timeSinceLastFire = TimeSpan.Zero; public override void Update(TimeSpan elapsed) { if (timeSinceLastFire > reFireTime) { foreach (var ship in this.StarSystem.Ships) { if (!(ship is Enemy)) { this.LaunchProjectile(ship); this.LoadProjectile(); } } timeSinceLastFire = TimeSpan.Zero; } else { timeSinceLastFire += elapsed; } base.Update(elapsed); } } }
mit
C#
b61d8563c19f0d0e45ebc3ae6435598d5fd0bfd0
Implement transform to tree for option as skeleton only
jagrem/slang,jagrem/slang,jagrem/slang
slang/Lexing/Trees/Transformers/OptionRuleExtensions.cs
slang/Lexing/Trees/Transformers/OptionRuleExtensions.cs
using slang.Lexing.Rules.Extensions; using slang.Lexing.Trees.Nodes; namespace slang.Lexing.Trees.Transformers { public static class OptionRuleExtensions { public static Tree Transform (this Option rule, Node parent) { return new Tree (); } } }
using slang.Lexing.Rules.Extensions; using slang.Lexing.Trees.Nodes; namespace slang.Lexing.Trees.Transformers { public static class OptionRuleExtensions { public static Node Transform (this Option rule, Node parent) { var option = rule.Value.Transform (parent); return option; } } }
mit
C#
e300072cf744119647e24c9760cd13ed19d03724
Update run.csx
he3/afunc
a/run.csx
a/run.csx
using System.Net; public static string Run(HttpRequestMessage req, TraceWriter log) { //log.Info($"C# Timer trigger function executed at: {DateTime.Now}"); string data; try { using (var client = new WebClient()) { // test comment.4 data = client.DownloadString("https://api.ipify.org?format=json"); } } catch (Exception ex) { data = ex.ToString(); } return data; }
using System.Net; public static string Run(HttpRequestMessage req, TraceWriter log) { //log.Info($"C# Timer trigger function executed at: {DateTime.Now}"); string data; try { using (var client = new WebClient()) { // test comment.3 data = client.DownloadString("https://api.ipify.org?format=json"); } } catch (Exception ex) { data = ex.ToString(); } return data; }
mit
C#
ca13c37a90e03f9ba53f064920879f89d424ec24
update version
jefking/King.Service.ServiceFabric
King.Service.ServiceFabric/Properties/AssemblyInfo.cs
King.Service.ServiceFabric/Properties/AssemblyInfo.cs
using System.Reflection; using System.Runtime.InteropServices; [assembly: AssemblyTitle("King.Service.ServiceFabric")] [assembly: AssemblyDescription("Task scheduling for Service Fabric.")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("King.Service.ServiceFabric")] [assembly: AssemblyCopyright("Copyright © Jef King 2016")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] [assembly: ComVisible(false)] [assembly: Guid("e8fb7b7e-b404-4bf3-981f-2d7398d22059")] [assembly: AssemblyVersion("1.0.1.1")] [assembly: AssemblyFileVersion("1.0.1.1")]
using System.Reflection; using System.Runtime.InteropServices; [assembly: AssemblyTitle("King.Service.ServiceFabric")] [assembly: AssemblyDescription("Task scheduling for Service Fabric.")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("King.Service.ServiceFabric")] [assembly: AssemblyCopyright("Copyright © Jef King 2016")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] [assembly: ComVisible(false)] [assembly: Guid("e8fb7b7e-b404-4bf3-981f-2d7398d22059")] [assembly: AssemblyVersion("1.0.1.0")] [assembly: AssemblyFileVersion("1.0.1.0")]
mit
C#
eecabebf18222c06c487e1d6093939e210c72a27
Update AssemblyVersion
hotelde/regtesting
RegTesting.Tests.Framework/Properties/AssemblyInfo.cs
RegTesting.Tests.Framework/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("RegTesting.Tests.Framework")] [assembly: AssemblyDescription("A test framework for tests with selenium.")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("HOTELDE AG")] [assembly: AssemblyProduct("")] [assembly: AssemblyCopyright("2012-2015 HOTELDE AG, Apache License, Version 2.0")] [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("a7e6a771-5f9d-425a-a401-3a5f4c71b270")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision [assembly: AssemblyFileVersion("1.3.1.0")] [assembly: AssemblyInformationalVersion("1.3.1.0")] // Change AssemblyVersion for breaking api changes // http://stackoverflow.com/questions/64602/what-are-differences-between-assemblyversion-assemblyfileversion-and-assemblyin [assembly: AssemblyVersion("1.2.0.0")]
using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("RegTesting.Tests.Framework")] [assembly: AssemblyDescription("A test framework for tests with selenium.")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("HOTELDE AG")] [assembly: AssemblyProduct("")] [assembly: AssemblyCopyright("2012-2015 HOTELDE AG, Apache License, Version 2.0")] [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("a7e6a771-5f9d-425a-a401-3a5f4c71b270")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision [assembly: AssemblyFileVersion("1.3.0.0")] [assembly: AssemblyInformationalVersion("1.3.0.0")] // Change AssemblyVersion for breaking api changes // http://stackoverflow.com/questions/64602/what-are-differences-between-assemblyversion-assemblyfileversion-and-assemblyin [assembly: AssemblyVersion("1.3.0.0")]
apache-2.0
C#
4e7995c5afc6c2b0a96d7f430714c34faa6f9127
Update framework version
hotelde/regtesting
RegTesting.Tests.Framework/Properties/AssemblyInfo.cs
RegTesting.Tests.Framework/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("RegTesting.Tests.Framework")] [assembly: AssemblyDescription("A test framework for tests with selenium.")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("HOTELDE AG")] [assembly: AssemblyProduct("")] [assembly: AssemblyCopyright("2012-2015 HOTELDE AG, Apache License, Version 2.0")] [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("a7e6a771-5f9d-425a-a401-3a5f4c71b270")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision [assembly: AssemblyFileVersion("1.2.2.0")] [assembly: AssemblyInformationalVersion("1.2.2.0")] // Change AssemblyVersion for breaking api changes // http://stackoverflow.com/questions/64602/what-are-differences-between-assemblyversion-assemblyfileversion-and-assemblyin [assembly: AssemblyVersion("1.2.0.0")]
using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("RegTesting.Tests.Framework")] [assembly: AssemblyDescription("A test framework for tests with selenium.")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("HOTELDE AG")] [assembly: AssemblyProduct("")] [assembly: AssemblyCopyright("2012-2015 HOTELDE AG, Apache License, Version 2.0")] [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("a7e6a771-5f9d-425a-a401-3a5f4c71b270")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision [assembly: AssemblyFileVersion("1.2.1.0")] [assembly: AssemblyInformationalVersion("1.2.1.0")] // Change AssemblyVersion for breaking api changes // http://stackoverflow.com/questions/64602/what-are-differences-between-assemblyversion-assemblyfileversion-and-assemblyin [assembly: AssemblyVersion("1.2.0.0")]
apache-2.0
C#
301de2a0417edca781aacb7c8a5dd4feafec9cb7
Remove unused fields
Ackara/Daterpillar
src/Daterpillar.Core/Index.cs
src/Daterpillar.Core/Index.cs
using System.Collections.Generic; using System.Xml.Serialization; namespace Gigobyte.Daterpillar { /// <summary> /// Represents a database index. /// </summary> public class Index { public Index() { Columns = new List<IndexColumn>(); } public Table TableRef; /// <summary> /// Gets or sets a value indicating whether this <see cref="Index" /> is unique. /// </summary> /// <value><c>true</c> if unique; otherwise, <c>false</c>.</value> [XmlAttribute("unique")] public bool Unique { get; set; } /// <summary> /// Gets or sets the type of the index. /// </summary> /// <value>The type of the index.</value> [XmlAttribute("type")] public IndexType Type { get; set; } /// <summary> /// Gets or sets the name. /// </summary> /// <value>The name.</value> [XmlAttribute("name")] public string Name { get; set; } /// <summary> /// Gets or sets the name table of the associated table. /// </summary> /// <value>The table.</value> [XmlAttribute("table")] public string Table { get; set; } /// <summary> /// Gets or sets the associated columns. /// </summary> /// <value>The columns.</value> [XmlElement("columnName")] public List<IndexColumn> Columns { get; set; } } }
using System.Collections.Generic; using System.Xml.Serialization; namespace Gigobyte.Daterpillar { /// <summary> /// Represents a database index. /// </summary> public class Index { public Index() { Columns = new List<IndexColumn>(); } public Table TableRef; /// <summary> /// Gets or sets a value indicating whether this <see cref="Index" /> is unique. /// </summary> /// <value><c>true</c> if unique; otherwise, <c>false</c>.</value> [XmlAttribute("unique")] public bool Unique { get; set; } /// <summary> /// Gets or sets the type of the index. /// </summary> /// <value>The type of the index.</value> [XmlAttribute("type")] public IndexType Type { get; set; } /// <summary> /// Gets or sets the name. /// </summary> /// <value>The name.</value> [XmlAttribute("name")] public string Name { get; set; } /// <summary> /// Gets or sets the name table of the associated table. /// </summary> /// <value>The table.</value> [XmlAttribute("table")] public string Table { get; set; } /// <summary> /// Gets or sets the associated columns. /// </summary> /// <value>The columns.</value> [XmlElement("columnName")] public List<IndexColumn> Columns { get; set; } #region Private Members private readonly string _primaryKey = "primaryKey", _index = "index"; #endregion Private Members } }
mit
C#
2f35cd90d2011191e8801f17736fa9b83711c24c
Add Reopened state
Secullum/GitLabApi
src/GitLabApi/Models/Issue.cs
src/GitLabApi/Models/Issue.cs
using Newtonsoft.Json; using System; using System.Collections.Generic; namespace GitLabApi.Models { public class Issue { public enum IssueState { [JsonProperty("opened")] Opened, [JsonProperty("closed")] Closed, [JsonProperty("reopened")] Reopened } [JsonProperty("id")] public int GlobalId { get; set; } [JsonProperty("iid")] public int LocalId { get; set; } [JsonProperty("project_id")] public int ProjectId { get; set; } [JsonProperty("title")] public string Title { get; set; } [JsonProperty("description")] public string Description { get; set; } [JsonProperty("state")] public IssueState State { get; set; } [JsonProperty("author")] public User Author { get; set; } [JsonProperty("milestone")] public Milestone Milestone { get; set; } [JsonProperty("assignees")] public IEnumerable<User> Assignees { get; set; } [JsonProperty("labels")] public IEnumerable<string> Labels { get; set; } [JsonProperty("due_date")] public DateTime? DueDate { get; set; } [JsonProperty("user_notes_count")] public int UserNotesCount { get; set; } [JsonProperty("weight")] public int? Weight { get; set; } [JsonProperty("confidential")] public bool Confidential { get; set; } [JsonProperty("created_at")] public DateTime CreatedAt { get; set; } [JsonProperty("updated_at")] public DateTime UpdatedAt { get; set; } [JsonProperty("web_url")] public string WebUrl { get; set; } } }
using Newtonsoft.Json; using System; using System.Collections.Generic; namespace GitLabApi.Models { public class Issue { public enum IssueState { [JsonProperty("opened")] Opened, [JsonProperty("closed")] Closed } [JsonProperty("id")] public int GlobalId { get; set; } [JsonProperty("iid")] public int LocalId { get; set; } [JsonProperty("project_id")] public int ProjectId { get; set; } [JsonProperty("title")] public string Title { get; set; } [JsonProperty("description")] public string Description { get; set; } [JsonProperty("state")] public IssueState State { get; set; } [JsonProperty("author")] public User Author { get; set; } [JsonProperty("milestone")] public Milestone Milestone { get; set; } [JsonProperty("assignees")] public IEnumerable<User> Assignees { get; set; } [JsonProperty("labels")] public IEnumerable<string> Labels { get; set; } [JsonProperty("due_date")] public DateTime? DueDate { get; set; } [JsonProperty("user_notes_count")] public int UserNotesCount { get; set; } [JsonProperty("weight")] public int? Weight { get; set; } [JsonProperty("confidential")] public bool Confidential { get; set; } [JsonProperty("created_at")] public DateTime CreatedAt { get; set; } [JsonProperty("updated_at")] public DateTime UpdatedAt { get; set; } [JsonProperty("web_url")] public string WebUrl { get; set; } } }
mit
C#
b9a5e984f1b5cbc13ce7266bd17f908ea924315d
Test that finds members with "admin" in username now works when there's more than one.
versionone/VersionOne.SDK.NET.APIClient,versionone/VersionOne.SDK.NET.APIClient
APIClient.Tests/QueryTests/QueryFindTester.cs
APIClient.Tests/QueryTests/QueryFindTester.cs
using NUnit.Framework; namespace VersionOne.SDK.APIClient.Tests.QueryTests { [TestFixture] public class QueryFindTester { private EnvironmentContext _context; [TestFixtureSetUp] public void TestFixtureSetup() { _context = new EnvironmentContext(); } [TestFixtureTearDown] public void TestFixtureTearDown() { _context = null; } [Test] public void FindMemberTest() { var memberType = _context.MetaModel.GetAssetType("Member"); var memberQuery = new Query(memberType); var userNameAttr = memberType.GetAttributeDefinition("Username"); memberQuery.Selection.Add(userNameAttr); memberQuery.Find = new QueryFind("admin", new AttributeSelection("Username", memberType)); QueryResult result = _context.Services.Retrieve(memberQuery); foreach (var member in result.Assets) { var name = member.GetAttribute(userNameAttr).Value as string; Assert.IsNotNullOrEmpty(name); if (name != null) Assert.That(name.IndexOf("admin") > -1); } } } }
using NUnit.Framework; namespace VersionOne.SDK.APIClient.Tests.QueryTests { [TestFixture] public class QueryFindTester { private EnvironmentContext _context; [TestFixtureSetUp] public void TestFixtureSetup() { _context = new EnvironmentContext(); } [TestFixtureTearDown] public void TestFixtureTearDown() { _context = null; } [Test] public void FindMemberTest() { var assetType = _context.MetaModel.GetAssetType("Member"); var query = new Query(assetType); var nameAttribute = assetType.GetAttributeDefinition("Username"); query.Selection.Add(nameAttribute); query.Find = new QueryFind("admin", new AttributeSelection("Username", assetType)); QueryResult result = _context.Services.Retrieve(query); Assert.AreEqual(1, result.TotalAvaliable); } } }
bsd-3-clause
C#
738e06ae1d025ccc197702c8d29de35f318eb887
Use tracker1 & tracker2
JohanLarsson/Gu.State,JohanLarsson/Gu.State,JohanLarsson/Gu.ChangeTracking
Gu.State.Tests/Internals/Collections/RefCountCollectionTests.cs
Gu.State.Tests/Internals/Collections/RefCountCollectionTests.cs
namespace Gu.State.Tests.Internals.Collections { using System; using Moq; using NUnit.Framework; public class RefCountCollectionTests { [Test] public void GetOrAddSameReturnsSame() { var collection = new RefCountCollection<IDisposable>(); var s1 = new object(); var tracker1 = collection.GetOrAdd(s1, () => new Mock<IDisposable>().Object); var tracker2 = collection.GetOrAdd(s1, () => new Mock<IDisposable>().Object); Assert.AreSame(tracker1, tracker2); } [Test] public void GetOrAddDifferentReturnsDifferent() { var collection = new RefCountCollection<IDisposable>(); var s1 = new object(); var tracker1 = collection.GetOrAdd(s1, () => new Mock<IDisposable>().Object); var s2 = new object(); var tracker2 = collection.GetOrAdd(s2, () => new Mock<IDisposable>().Object); Assert.AreNotSame(tracker1, tracker2); } [Test] public void Dispose() { var collection = new RefCountCollection<IDisposable>(); var trackers = new[] { new Mock<IDisposable>(), new Mock<IDisposable>() }; var s1 = new object(); var tracker1 = collection.GetOrAdd(s1, () => trackers[0].Object); var s2 = new object(); var tracker2 = collection.GetOrAdd(s2, () => trackers[1].Object); Assert.AreNotSame(tracker1, tracker2); collection.Dispose(); trackers[0].Verify(x => x.Dispose(), Times.Once); trackers[1].Verify(x => x.Dispose(), Times.Once); } [Test] public void DisposeItem() { var collection = new RefCountCollection<IDisposable>(); var s1 = new object(); var tracker1 = collection.GetOrAdd(s1, () => new Mock<IDisposable>().Object); tracker1.Dispose(); var tracker2 = collection.GetOrAdd(s1, () => new Mock<IDisposable>().Object); Assert.AreNotSame(tracker1, tracker2); } } }
namespace Gu.State.Tests.Internals.Collections { using System; using Moq; using NUnit.Framework; public class RefCountCollectionTests { [Test] public void GetOrAddSameReturnsSame() { var collection = new RefCountCollection<IDisposable>(); var s1 = new object(); var tracker1 = collection.GetOrAdd(s1, () => new Mock<IDisposable>().Object); var tracker2 = collection.GetOrAdd(s1, () => new Mock<IDisposable>().Object); Assert.AreSame(tracker1, tracker2); } [Test] public void GetOrAddDifferentReturnsDifferent() { var collection = new RefCountCollection<IDisposable>(); var s1 = new object(); var tracker1 = collection.GetOrAdd(s1, () => new Mock<IDisposable>().Object); var s2 = new object(); var tracker2 = collection.GetOrAdd(s2, () => new Mock<IDisposable>().Object); Assert.AreNotSame(tracker1, tracker2); } [Test] public void Dispose() { var collection = new RefCountCollection<IDisposable>(); var trackers = new[] { new Mock<IDisposable>(), new Mock<IDisposable>() }; var s1 = new object(); var tracker1 = collection.GetOrAdd(s1, () => trackers[0].Object); var s2 = new object(); var tracker2 = collection.GetOrAdd(s2, () => trackers[1].Object); collection.Dispose(); trackers[0].Verify(x => x.Dispose(), Times.Once); trackers[1].Verify(x => x.Dispose(), Times.Once); } [Test] public void DisposeItem() { var collection = new RefCountCollection<IDisposable>(); var s1 = new object(); var tracker1 = collection.GetOrAdd(s1, () => new Mock<IDisposable>().Object); tracker1.Dispose(); var tracker2 = collection.GetOrAdd(s1, () => new Mock<IDisposable>().Object); Assert.AreNotSame(tracker1, tracker2); } } }
mit
C#
3c3948bf8d0e26ef54de76165aeb67f80a8920f1
Mark field as const instead of static readonly
Kingloo/Pingy
src/Gui/App.xaml.cs
src/Gui/App.xaml.cs
using System; using System.IO; using System.Windows; using System.Windows.Threading; using Pingy.Common; namespace Pingy.Gui { public partial class App : Application { private static readonly string defaultDirectory = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments); private const string defaultFileName = "Pingy.txt"; private readonly static string defaultFilePath = Path.Combine(defaultDirectory, defaultFileName); public App() : this(defaultFilePath) { } public App(string path) { if (String.IsNullOrWhiteSpace(path)) { throw new ArgumentNullException(nameof(path)); } InitializeComponent(); MainWindowViewModel viewModel = new MainWindowViewModel(path); MainWindow = new MainWindow(viewModel); MainWindow.Show(); } private void Application_DispatcherUnhandledException(object sender, DispatcherUnhandledExceptionEventArgs e) { if (e.Exception is Exception ex) { Log.Exception(ex, true); } else { Log.Message("an empty unhandled exception occurred"); } } } }
using System; using System.IO; using System.Windows; using System.Windows.Threading; using Pingy.Common; namespace Pingy.Gui { public partial class App : Application { private readonly static string defaultDirectory = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments); private readonly static string defaultFileName = "Pingy.txt"; private readonly static string defaultFilePath = Path.Combine(defaultDirectory, defaultFileName); public App() : this(defaultFilePath) { } public App(string path) { if (String.IsNullOrWhiteSpace(path)) { throw new ArgumentNullException(nameof(path)); } InitializeComponent(); MainWindowViewModel viewModel = new MainWindowViewModel(path); MainWindow = new MainWindow(viewModel); MainWindow.Show(); } private void Application_DispatcherUnhandledException(object sender, DispatcherUnhandledExceptionEventArgs e) { if (e.Exception is Exception ex) { Log.Exception(ex, true); } else { Log.Message("an empty unhandled exception occurred"); } } } }
unlicense
C#
5f7e000f2fd22e35349da464fa2c1583c4dd8c14
Update sample to use AggregateAB
haithemaraissia/Xamarin.Mobile,xamarin/Xamarin.Mobile,orand/Xamarin.Mobile,xamarin/Xamarin.Mobile,moljac/Xamarin.Mobile,nexussays/Xamarin.Mobile
MonoDroid/Samples/ContactsSample/Activity1.cs
MonoDroid/Samples/ContactsSample/Activity1.cs
using System.Text; using Android.App; using Android.Database; using Android.Net; using Android.OS; using Android.Provider; using Android.Widget; using Xamarin.Contacts; using System.Linq; namespace ContactsSample { [Activity(Label = "ContactsSample", MainLauncher = true, Icon = "@drawable/icon")] public class Activity1 : Activity { int count = 1; protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); // Set our view from the "main" layout resource SetContentView(Resource.Layout.Main); var book = new AggregateAddressBook (this); StringBuilder builder = new StringBuilder(); foreach (Contact contact in book.Where (c => c.Phones.Any() || c.Emails.Any()).OrderBy (c => c.LastName)) { builder.AppendLine ("Display name: " + contact.DisplayName); builder.AppendLine ("Nickname: " + contact.Nickname); builder.AppendLine ("Prefix: " + contact.Prefix); builder.AppendLine ("First name: " + contact.FirstName); builder.AppendLine ("Middle name: " + contact.MiddleName); builder.AppendLine ("Last name: " + contact.LastName); builder.AppendLine ("Suffix:" + contact.Suffix); builder.AppendLine(); builder.AppendLine ("Phones:"); foreach (Phone p in contact.Phones) builder.AppendLine (p.Label + ": " + p.Number); builder.AppendLine(); builder.AppendLine ("Emails:"); foreach (Email e in contact.Emails) builder.AppendLine (e.Label + ": " + e.Address); builder.AppendLine(); builder.AppendLine ("Notes:"); foreach (string n in contact.Notes) builder.AppendLine (" - " + n); builder.AppendLine(); } FindViewById<TextView> (Resource.Id.contacts).Text = builder.ToString(); } } }
using System.Text; using Android.App; using Android.Database; using Android.Net; using Android.OS; using Android.Provider; using Android.Widget; using Xamarin.Contacts; using System.Linq; namespace ContactsSample { [Activity(Label = "ContactsSample", MainLauncher = true, Icon = "@drawable/icon")] public class Activity1 : Activity { int count = 1; protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); // Set our view from the "main" layout resource SetContentView(Resource.Layout.Main); var book = new AddressBook (this); StringBuilder builder = new StringBuilder(); foreach (Contact contact in book.Where (c => c.Phones.Any() || c.Emails.Any()).OrderBy (c => c.LastName)) { builder.AppendLine ("Display name: " + contact.DisplayName); builder.AppendLine ("Nickname: " + contact.Nickname); builder.AppendLine ("Prefix: " + contact.Prefix); builder.AppendLine ("First name: " + contact.FirstName); builder.AppendLine ("Middle name: " + contact.MiddleName); builder.AppendLine ("Last name: " + contact.LastName); builder.AppendLine ("Suffix:" + contact.Suffix); builder.AppendLine(); builder.AppendLine ("Phones:"); foreach (Phone p in contact.Phones) builder.AppendLine (p.Label + ": " + p.Number); builder.AppendLine(); builder.AppendLine ("Emails:"); foreach (Email e in contact.Emails) builder.AppendLine (e.Label + ": " + e.Address); builder.AppendLine(); builder.AppendLine ("Notes:"); foreach (string n in contact.Notes) builder.AppendLine (" - " + n); builder.AppendLine(); } FindViewById<TextView> (Resource.Id.contacts).Text = builder.ToString(); } } }
apache-2.0
C#
144863efd1c5d94a75a9834ea3dc9ffc72cffdec
Remove TextEdit type's dependency on IScriptExtent
dlwyatt/PSScriptAnalyzer,daviwil/PSScriptAnalyzer,PowerShell/PSScriptAnalyzer
Engine/TextEdit.cs
Engine/TextEdit.cs
namespace Microsoft.Windows.PowerShell.ScriptAnalyzer { /// <summary> /// Class to provide information about an edit /// </summary> public class TextEdit { /// <summary> /// 1-based line number on which the text, which needs to be replaced, starts. /// </summary> public int StartLineNumber { get; } /// <summary> /// 1-based offset on start line at which the text, which needs to be replaced, starts. /// This includes the first character of the text. /// </summary> public int StartColumnNumber { get ; } /// <summary> /// 1-based line number on which the text, which needs to be replace, ends. /// </summary> public int EndLineNumber { get ; } /// <summary> /// 1-based offset on end line at which the text, which needs to be replaced, ends. /// This offset value is 1 more than the offset of the last character of the text. /// </summary> public int EndColumnNumber { get ; } /// <summary> /// The text that will replace the text bounded by the Line/Column number properties. /// </summary> public string Text { get; } /// <summary> /// Constructs a TextEdit object. /// </summary> /// <param name="startLineNumber">1-based line number on which the text, which needs to be replaced, starts. </param> /// <param name="startColumnNumber">1-based offset on start line at which the text, which needs to be replaced, starts. This includes the first character of the text. </param> /// <param name="endLineNumber">1-based line number on which the text, which needs to be replace, ends. </param> /// <param name="endColumnNumber">1-based offset on end line at which the text, which needs to be replaced, ends. This offset value is 1 more than the offset of the last character of the text. </param> /// <param name="newText">The text that will replace the text bounded by the Line/Column number properties. </param> public TextEdit( int startLineNumber, int startColumnNumber, int endLineNumber, int endColumnNumber, string newText) { StartLineNumber = startLineNumber; StartColumnNumber = startColumnNumber; EndLineNumber = endLineNumber; EndColumnNumber = endColumnNumber; Text = newText; } } }
using System; using System.Management.Automation.Language; namespace Microsoft.Windows.PowerShell.ScriptAnalyzer { /// <summary> /// Class to provide information about an edit /// </summary> public class TextEdit { public IScriptExtent ScriptExtent { get; private set; } public int StartLineNumber { get { return ScriptExtent.StartLineNumber; } } public int StartColumnNumber { get { return ScriptExtent.StartColumnNumber; } } public int EndLineNumber { get { return ScriptExtent.EndLineNumber; } } public int EndColumnNumber { get { return ScriptExtent.EndColumnNumber; } } public string NewText { get; private set; } /// <summary> /// Creates an object of TextEdit. /// </summary> /// <param name="scriptExtent">Extent of script that needs to be replaced.</param> /// <param name="newText">Text that will replace the region covered by scriptExtent.</param> public TextEdit(IScriptExtent scriptExtent, string newText) { if (scriptExtent == null) { throw new ArgumentNullException(nameof(scriptExtent)); } if (newText == null) { throw new ArgumentNullException(nameof(newText)); } ScriptExtent = scriptExtent; NewText = newText; } public TextEdit( int startLineNumber, int startColumnNumber, int endLineNumber, int endColumnNumber, string newText) : this(new ScriptExtent( new ScriptPosition(null, startLineNumber, startColumnNumber, null), new ScriptPosition(null, endLineNumber, endColumnNumber, null)), newText) { } } }
mit
C#
79402c50fa02faa9bd192eac1348217adc6b677f
Use NavigateAndReset
nopara73/HiddenWallet,nopara73/HiddenWallet,nopara73/HiddenWallet,nopara73/HiddenWallet
WalletWasabi.Fluent/ViewModels/NavBarItemViewModel.cs
WalletWasabi.Fluent/ViewModels/NavBarItemViewModel.cs
using ReactiveUI; using System; using System.Reactive; using WalletWasabi.Gui.ViewModels; namespace WalletWasabi.Fluent.ViewModels { public abstract class NavBarItemViewModel : ViewModelBase, IRoutableViewModel { private NavigationStateViewModel _navigationState; private NavigationTarget _navigationTarget; private bool _isSelected; private bool _isExpanded; private string _title; public NavBarItemViewModel(NavigationStateViewModel navigationState, NavigationTarget navigationTarget) { _navigationState = navigationState; _navigationTarget = navigationTarget; OpenCommand = ReactiveCommand.Create(() => Navigate()); } public NavBarItemViewModel Parent { get; set; } public abstract string IconName { get; } public string UrlPathSegment { get; } = Guid.NewGuid().ToString().Substring(0, 5); public IScreen HostScreen => _navigationState.HomeScreen(); public bool IsExpanded { get => _isExpanded; set { this.RaiseAndSetIfChanged(ref _isExpanded, value); if (Parent != null) { Parent.IsExpanded = value; } } } public string Title { get => _title; set => this.RaiseAndSetIfChanged(ref _title, value); } public bool IsSelected { get => _isSelected; set => this.RaiseAndSetIfChanged(ref _isSelected, value); } public ReactiveCommand<Unit, Unit> OpenCommand { get; } public void Navigate() { switch (_navigationTarget) { case NavigationTarget.Default: case NavigationTarget.Home: _navigationState.HomeScreen().Router.Navigate.Execute(this); break; case NavigationTarget.Dialog: _navigationState.DialogScreen().Router.Navigate.Execute(this); break; } } public void NavigateAndReset() { switch (_navigationTarget) { case NavigationTarget.Default: case NavigationTarget.Home: _navigationState.HomeScreen().Router.NavigateAndReset.Execute(this); break; case NavigationTarget.Dialog: _navigationState.DialogScreen().Router.NavigateAndReset.Execute(this); break; } } } }
using ReactiveUI; using System; using System.Reactive; using WalletWasabi.Gui.ViewModels; namespace WalletWasabi.Fluent.ViewModels { public abstract class NavBarItemViewModel : ViewModelBase, IRoutableViewModel { private NavigationStateViewModel _navigationState; private NavigationTarget _navigationTarget; private bool _isSelected; private bool _isExpanded; private string _title; public NavBarItemViewModel(NavigationStateViewModel navigationState, NavigationTarget navigationTarget) { _navigationState = navigationState; _navigationTarget = navigationTarget; OpenCommand = ReactiveCommand.Create(() => Navigate()); } public NavBarItemViewModel Parent { get; set; } public abstract string IconName { get; } public string UrlPathSegment { get; } = Guid.NewGuid().ToString().Substring(0, 5); public IScreen HostScreen => _navigationState.HomeScreen(); public bool IsExpanded { get => _isExpanded; set { this.RaiseAndSetIfChanged(ref _isExpanded, value); if (Parent != null) { Parent.IsExpanded = value; } } } public string Title { get => _title; set => this.RaiseAndSetIfChanged(ref _title, value); } public bool IsSelected { get => _isSelected; set => this.RaiseAndSetIfChanged(ref _isSelected, value); } public ReactiveCommand<Unit, Unit> OpenCommand { get; } public void Navigate() { switch (_navigationTarget) { case NavigationTarget.Default: case NavigationTarget.Home: _navigationState.HomeScreen().Router.Navigate.Execute(this); break; case NavigationTarget.Dialog: _navigationState.DialogScreen().Router.Navigate.Execute(this); break; } } public void NavigateAndReset() { switch (_navigationTarget) { case NavigationTarget.Default: case NavigationTarget.Home: _navigationState.HomeScreen().Router.Navigate.Execute(this); break; case NavigationTarget.Dialog: _navigationState.DialogScreen().Router.Navigate.Execute(this); break; } } } }
mit
C#
c04f2b0840ded76704dc37210273285d2bf8200a
Reposition taiko playfield to be closer to the top of the screen
UselessToucan/osu,NeoAdonis/osu,peppy/osu,ppy/osu,smoogipoo/osu,smoogipoo/osu,UselessToucan/osu,NeoAdonis/osu,ppy/osu,UselessToucan/osu,peppy/osu,NeoAdonis/osu,peppy/osu,smoogipooo/osu,smoogipoo/osu,peppy/osu-new,ppy/osu
osu.Game.Rulesets.Taiko/UI/TaikoPlayfieldAdjustmentContainer.cs
osu.Game.Rulesets.Taiko/UI/TaikoPlayfieldAdjustmentContainer.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.Graphics; using osu.Game.Rulesets.UI; using osuTK; namespace osu.Game.Rulesets.Taiko.UI { public class TaikoPlayfieldAdjustmentContainer : PlayfieldAdjustmentContainer { private const float default_relative_height = TaikoPlayfield.DEFAULT_HEIGHT / 768; private const float default_aspect = 16f / 9f; protected override void Update() { base.Update(); float aspectAdjust = Math.Clamp(Parent.ChildSize.X / Parent.ChildSize.Y, 0.4f, 4) / default_aspect; Size = new Vector2(1, default_relative_height * aspectAdjust); // Position the taiko playfield exactly one playfield from the top of the screen. RelativePositionAxes = Axes.Y; Y = Size.Y; } } }
// 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.Graphics; using osu.Game.Rulesets.UI; using osuTK; namespace osu.Game.Rulesets.Taiko.UI { public class TaikoPlayfieldAdjustmentContainer : PlayfieldAdjustmentContainer { private const float default_relative_height = TaikoPlayfield.DEFAULT_HEIGHT / 768; private const float default_aspect = 16f / 9f; public TaikoPlayfieldAdjustmentContainer() { Anchor = Anchor.CentreLeft; Origin = Anchor.CentreLeft; } protected override void Update() { base.Update(); float aspectAdjust = Math.Clamp(Parent.ChildSize.X / Parent.ChildSize.Y, 0.4f, 4) / default_aspect; Size = new Vector2(1, default_relative_height * aspectAdjust); } } }
mit
C#
f11bca733aa0b8b85ec9cdecb59b2c2d371e8e12
Make the green slightly darker, so that the text is readable.
ThomasArdal/NuGetPackageVisualizer
DgmlColorConfiguration.cs
DgmlColorConfiguration.cs
namespace NuGetPackageVisualizer { public class DgmlColorConfiguration : IColorConfiguration { public string VersionMismatchPackageColor { get { return "#FF0000"; } } public string PackageHasDifferentVersionsColor { get { return "#FCE428"; } } public string DefaultColor { get { return "#339933"; } } } }
namespace NuGetPackageVisualizer { public class DgmlColorConfiguration : IColorConfiguration { public string VersionMismatchPackageColor { get { return "#FF0000"; } } public string PackageHasDifferentVersionsColor { get { return "#FCE428"; } } public string DefaultColor { get { return "#15FF00"; } } } }
apache-2.0
C#
5c51d95bedc2664e48d839c29b08d5e049e7f910
Make Actions direct property
XamlBehaviors/XamlBehaviors,wieslawsoltes/AvaloniaBehaviors,XamlBehaviors/XamlBehaviors,wieslawsoltes/AvaloniaBehaviors
src/Avalonia.Xaml.Interactivity/Trigger.cs
src/Avalonia.Xaml.Interactivity/Trigger.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 Avalonia.Metadata; namespace Avalonia.Xaml.Interactivity { /// <summary> /// A base class for behaviors, implementing the basic plumbing of <seealso cref="ITrigger"/>. /// </summary> public abstract class Trigger : Behavior, ITrigger { /// <summary> /// Identifies the <seealso cref="Actions"/> avalonia property. /// </summary> public static readonly DirectProperty<Trigger, ActionCollection> ActionsProperty = AvaloniaProperty.RegisterDirect<Trigger, ActionCollection>(nameof(Actions), o => o.Actions); /// <summary> /// Gets the collection of actions associated with the behavior. This is a avalonia property. /// </summary> [Content] public ActionCollection Actions { get { ActionCollection actionCollection = GetValue(ActionsProperty); if (actionCollection == null) { actionCollection = new ActionCollection(); SetValue(ActionsProperty, actionCollection); } return actionCollection; } } } }
// 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 Avalonia.Metadata; namespace Avalonia.Xaml.Interactivity { /// <summary> /// A base class for behaviors, implementing the basic plumbing of <seealso cref="ITrigger"/>. /// </summary> public abstract class Trigger : Behavior, ITrigger { /// <summary> /// Identifies the <seealso cref="Actions"/> avalonia property. /// </summary> public static readonly AvaloniaProperty<ActionCollection> ActionsProperty = AvaloniaProperty.Register<Trigger, ActionCollection>(nameof(Actions)); /// <summary> /// Gets the collection of actions associated with the behavior. This is a avalonia property. /// </summary> [Content] public ActionCollection Actions { get { ActionCollection actionCollection = GetValue(ActionsProperty); if (actionCollection == null) { actionCollection = new ActionCollection(); SetValue(ActionsProperty, actionCollection); } return actionCollection; } } } }
mit
C#
512cc835a4919fe0cac9676c2b5c048ec10c48c7
Disable logging so the performance profiling is more accurate.
mchaloupka/DotNetR2RMLStore,mchaloupka/EVI
src/Slp.Evi.Storage/Slp.Evi.Test.System/Sparql/SparqlFixture.cs
src/Slp.Evi.Storage/Slp.Evi.Test.System/Sparql/SparqlFixture.cs
using System; using System.Collections.Concurrent; using System.Collections.Generic; using System.Linq; using Microsoft.Extensions.Logging; using Slp.Evi.Storage; using Slp.Evi.Storage.Bootstrap; using Slp.Evi.Storage.Database; namespace Slp.Evi.Test.System.Sparql { public abstract class SparqlFixture { private readonly ConcurrentDictionary<string, EviQueryableStorage> _storages = new ConcurrentDictionary<string, EviQueryableStorage>(); private IEviQueryableStorageFactory GetStorageFactory() { var loggerFactory = new LoggerFactory(); //if (Environment.GetEnvironmentVariable("APPVEYOR") != "True") //{ // loggerFactory.AddConsole(LogLevel.Trace); //} return new DefaultEviQueryableStorageFactory(loggerFactory); } public EviQueryableStorage GetStorage(string storageName) { return _storages.GetOrAdd(storageName, CreateStorage); } private EviQueryableStorage CreateStorage(string storageName) { return SparqlTestHelpers.InitializeDataset(storageName, GetSqlDb(), GetStorageFactory()); } protected abstract ISqlDatabase GetSqlDb(); } }
using System; using System.Collections.Concurrent; using System.Collections.Generic; using System.Linq; using Microsoft.Extensions.Logging; using Slp.Evi.Storage; using Slp.Evi.Storage.Bootstrap; using Slp.Evi.Storage.Database; namespace Slp.Evi.Test.System.Sparql { public abstract class SparqlFixture { private readonly ConcurrentDictionary<string, EviQueryableStorage> _storages = new ConcurrentDictionary<string, EviQueryableStorage>(); private IEviQueryableStorageFactory GetStorageFactory() { var loggerFactory = new LoggerFactory(); if (Environment.GetEnvironmentVariable("APPVEYOR") != "True") { loggerFactory.AddConsole(LogLevel.Trace); } return new DefaultEviQueryableStorageFactory(loggerFactory); } public EviQueryableStorage GetStorage(string storageName) { return _storages.GetOrAdd(storageName, CreateStorage); } private EviQueryableStorage CreateStorage(string storageName) { return SparqlTestHelpers.InitializeDataset(storageName, GetSqlDb(), GetStorageFactory()); } protected abstract ISqlDatabase GetSqlDb(); } }
mit
C#
73e5e0c58b3031d43fe4384c10e10e32e28fdf3c
Update ClientContext.cs
hprose/hprose-dotnet
src/Hprose.RPC/ClientContext.cs
src/Hprose.RPC/ClientContext.cs
/*--------------------------------------------------------*\ | | | hprose | | | | Official WebSite: https://hprose.com | | | | ClientContext.cs | | | | ClientContext class for C#. | | | | LastModified: Feb 4, 2019 | | Author: Ma Bingyao <andot@hprose.com> | | | \*________________________________________________________*/ using Hprose.IO; using System; using System.Collections.Generic; namespace Hprose.RPC { public class ClientContext : Context { public Client Client { get; private set; } public string Uri { get; set; } public Type Type { get; set; } public ClientContext(Client client, string fullname, Type type, Settings settings = null) { Client = client; Uri = (client.Uris.Count > 0) ? client.Uris[0] : ""; Type = settings?.Type; if (type != null && !type.IsAssignableFrom(Type)) Type = type; Copy(client.RequestHeaders, RequestHeaders); Copy(settings?.RequestHeaders, RequestHeaders); Copy(settings?.Context, Items); } } }
/*--------------------------------------------------------*\ | | | hprose | | | | Official WebSite: https://hprose.com | | | | ClientContext.cs | | | | ClientContext class for C#. | | | | LastModified: Jan 27, 2019 | | Author: Ma Bingyao <andot@hprose.com> | | | \*________________________________________________________*/ using Hprose.IO; using System; using System.Collections.Generic; namespace Hprose.RPC { public class ClientContext : Context { public Client Client { get; private set; } public string Uri { get; set; } public Type Type { get; set; } public ClientContext(Client client, string fullname, Type type, Settings settings = null) { Client = client; Uri = (client.Uris.Count > 0) ? client.Uris[0] : ""; Type = settings?.Type; if (type != null && !type.IsAssignableFrom(Type)) Type = type; Copy(client.RequestHeaders, RequestHeaders); Copy(settings?.RequestHeaders, RequestHeaders); Copy(settings?.Context, items); } } }
mit
C#
113d7815c2133dcea906ceab59d74dd50a6da369
Make internals visible to UnitTests
nats-io/csnats
src/NATS.Client/Properties/AssemblyInfo.cs
src/NATS.Client/Properties/AssemblyInfo.cs
using System.Runtime.CompilerServices; // Since NATS.Client is signed, friends must be signed too. // We use the same SNK for simplicity. // https://docs.microsoft.com/en-us/dotnet/standard/assembly/create-signed-friend #if DEBUG [assembly: InternalsVisibleTo("UnitTests")] [assembly: InternalsVisibleTo("MicroBenchmarks")] #else [assembly: InternalsVisibleTo("UnitTests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100db7da1f2f89089327b47d26d69666fad20861f24e9acdb13965fb6c64dfee8da589b495df37a75e934ddbacb0752a42c40f3dbc79614eec9bb2a0b6741f9e2ad2876f95e74d54c23eef0063eb4efb1e7d824ee8a695b647c113c92834f04a3a83fb60f435814ddf5c4e5f66a168139c4c1b1a50a3e60c164d180e265b1f000cd")] [assembly: InternalsVisibleTo("MicroBenchmarks, PublicKey=0024000004800000940000000602000000240000525341310004000001000100db7da1f2f89089327b47d26d69666fad20861f24e9acdb13965fb6c64dfee8da589b495df37a75e934ddbacb0752a42c40f3dbc79614eec9bb2a0b6741f9e2ad2876f95e74d54c23eef0063eb4efb1e7d824ee8a695b647c113c92834f04a3a83fb60f435814ddf5c4e5f66a168139c4c1b1a50a3e60c164d180e265b1f000cd")] #endif
using System.Runtime.CompilerServices; // Since NATS.Client is signed, friends must be signed too. // We use the same SNK for simplicity. // https://docs.microsoft.com/en-us/dotnet/standard/assembly/create-signed-friend #if DEBUG [assembly: InternalsVisibleTo("UnitTests")] [assembly: InternalsVisibleTo("MicroBenchmarks")] #else [assembly: InternalsVisibleTo("UnitTests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100db7da1f2f89089327b47d26d69666fad20861f24e9acdb13965fb6c64dfee8da589b495df37a75e934ddbacb0752a42c40f3dbc79614eec9bb2a0b6741f9e2ad2876f95e74d54c23eef0063eb4efb1e7d824ee8a695b647c113c92834f04a3a83fb60f435814ddf5c4e5f66a168139c4c1b1a50a3e60c164d180e265b1f000cd")] [assembly: InternalsVisibleTo("MicroBenchmarks, PublicKey=0024000004800000940000000602000000240000525341310004000001000100db7da1f2f89089327b47d26d69666fad20861f24e9acdb13965fb6c64dfee8da589b495df37a75e934ddbacb0752a42c40f3dbc79614eec9bb2a0b6741f9e2ad2876f95e74d54c23eef0063eb4efb1e7d824ee8a695b647c113c92834f04a3a83fb60f435814ddf5c4e5f66a168139c4c1b1a50a3e60c164d180e265b1f000cd")] #endif
mit
C#
1a3583aca887e81e6aa8d6919c027685f60d0d14
Add some basic doco to ICompletionCallback
rlmcneary2/CefSharp,AJDev77/CefSharp,wangzheng888520/CefSharp,ITGlobal/CefSharp,illfang/CefSharp,dga711/CefSharp,haozhouxu/CefSharp,haozhouxu/CefSharp,twxstar/CefSharp,twxstar/CefSharp,Haraguroicha/CefSharp,AJDev77/CefSharp,Livit/CefSharp,illfang/CefSharp,VioletLife/CefSharp,wangzheng888520/CefSharp,dga711/CefSharp,Livit/CefSharp,jamespearce2006/CefSharp,gregmartinhtc/CefSharp,jamespearce2006/CefSharp,Haraguroicha/CefSharp,jamespearce2006/CefSharp,gregmartinhtc/CefSharp,twxstar/CefSharp,Livit/CefSharp,haozhouxu/CefSharp,wangzheng888520/CefSharp,jamespearce2006/CefSharp,AJDev77/CefSharp,twxstar/CefSharp,wangzheng888520/CefSharp,Haraguroicha/CefSharp,dga711/CefSharp,gregmartinhtc/CefSharp,Haraguroicha/CefSharp,ITGlobal/CefSharp,AJDev77/CefSharp,Livit/CefSharp,Haraguroicha/CefSharp,dga711/CefSharp,haozhouxu/CefSharp,ITGlobal/CefSharp,VioletLife/CefSharp,rlmcneary2/CefSharp,ITGlobal/CefSharp,gregmartinhtc/CefSharp,jamespearce2006/CefSharp,illfang/CefSharp,rlmcneary2/CefSharp,illfang/CefSharp,rlmcneary2/CefSharp,VioletLife/CefSharp,VioletLife/CefSharp
CefSharp/ICompletionCallback.cs
CefSharp/ICompletionCallback.cs
// Copyright © 2010-2015 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. namespace CefSharp { /// <summary> /// Generic callback interface used for asynchronous completion. /// </summary> public interface ICompletionCallback { /// <summary> /// Method that will be called once the task is complete. /// </summary> void OnComplete(); } }
// Copyright © 2010-2015 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. namespace CefSharp { public interface ICompletionCallback { void OnComplete(); } }
bsd-3-clause
C#
80412ba14dc9a300400f9b62a48e6bc81db94c14
Update version
gigya/microdot
SolutionVersion.cs
SolutionVersion.cs
#region Copyright // Copyright 2017 Gigya Inc. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS" // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. #endregion using System; using System.Reflection; using System.Runtime.InteropServices; [assembly: AssemblyCompany("Gigya Inc.")] [assembly: AssemblyCopyright("© 2018 Gigya Inc.")] [assembly: AssemblyDescription("Microdot Framework")] [assembly: AssemblyVersion("1.11.3.0")] [assembly: AssemblyFileVersion("1.11.3.0")] [assembly: AssemblyInformationalVersion("1.11.3.0")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] [assembly: CLSCompliant(false)]
#region Copyright // Copyright 2017 Gigya Inc. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS" // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. #endregion using System; using System.Reflection; using System.Runtime.InteropServices; [assembly: AssemblyCompany("Gigya Inc.")] [assembly: AssemblyCopyright("© 2018 Gigya Inc.")] [assembly: AssemblyDescription("Microdot Framework")] [assembly: AssemblyVersion("1.11.2.0")] [assembly: AssemblyFileVersion("1.11.2.0")] [assembly: AssemblyInformationalVersion("1.11.2.0")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] [assembly: CLSCompliant(false)]
apache-2.0
C#
e2fe1c82608244e3bb77596079f7884bff8beaaf
Refactor IValueConnector for Deploy
dawoe/Umbraco-CMS,JimBobSquarePants/Umbraco-CMS,mattbrailsford/Umbraco-CMS,robertjf/Umbraco-CMS,KevinJump/Umbraco-CMS,JimBobSquarePants/Umbraco-CMS,dawoe/Umbraco-CMS,hfloyd/Umbraco-CMS,abryukhov/Umbraco-CMS,madsoulswe/Umbraco-CMS,arknu/Umbraco-CMS,tcmorris/Umbraco-CMS,KevinJump/Umbraco-CMS,mattbrailsford/Umbraco-CMS,hfloyd/Umbraco-CMS,tcmorris/Umbraco-CMS,leekelleher/Umbraco-CMS,NikRimington/Umbraco-CMS,marcemarc/Umbraco-CMS,abjerner/Umbraco-CMS,bjarnef/Umbraco-CMS,dawoe/Umbraco-CMS,umbraco/Umbraco-CMS,arknu/Umbraco-CMS,abryukhov/Umbraco-CMS,madsoulswe/Umbraco-CMS,hfloyd/Umbraco-CMS,JimBobSquarePants/Umbraco-CMS,abjerner/Umbraco-CMS,JimBobSquarePants/Umbraco-CMS,hfloyd/Umbraco-CMS,NikRimington/Umbraco-CMS,robertjf/Umbraco-CMS,JimBobSquarePants/Umbraco-CMS,abjerner/Umbraco-CMS,tcmorris/Umbraco-CMS,KevinJump/Umbraco-CMS,rasmuseeg/Umbraco-CMS,bjarnef/Umbraco-CMS,arknu/Umbraco-CMS,rasmuseeg/Umbraco-CMS,tcmorris/Umbraco-CMS,marcemarc/Umbraco-CMS,robertjf/Umbraco-CMS,marcemarc/Umbraco-CMS,arknu/Umbraco-CMS,leekelleher/Umbraco-CMS,hfloyd/Umbraco-CMS,tcmorris/Umbraco-CMS,KevinJump/Umbraco-CMS,abryukhov/Umbraco-CMS,dawoe/Umbraco-CMS,tcmorris/Umbraco-CMS,umbraco/Umbraco-CMS,bjarnef/Umbraco-CMS,robertjf/Umbraco-CMS,bjarnef/Umbraco-CMS,madsoulswe/Umbraco-CMS,mattbrailsford/Umbraco-CMS,leekelleher/Umbraco-CMS,umbraco/Umbraco-CMS,umbraco/Umbraco-CMS,marcemarc/Umbraco-CMS,NikRimington/Umbraco-CMS,abryukhov/Umbraco-CMS,leekelleher/Umbraco-CMS,dawoe/Umbraco-CMS,KevinJump/Umbraco-CMS,robertjf/Umbraco-CMS,marcemarc/Umbraco-CMS,rasmuseeg/Umbraco-CMS,abjerner/Umbraco-CMS,mattbrailsford/Umbraco-CMS,leekelleher/Umbraco-CMS
src/Umbraco.Core/Deploy/IValueConnector.cs
src/Umbraco.Core/Deploy/IValueConnector.cs
using System.Collections.Generic; using Umbraco.Core.Models; namespace Umbraco.Core.Deploy { /// <summary> /// Defines methods that can convert a property value to / from an environment-agnostic string. /// </summary> /// <remarks>Property values may contain values such as content identifiers, that would be local /// to one environment, and need to be converted in order to be deployed. Connectors also deal /// with serializing to / from string.</remarks> public interface IValueConnector { /// <summary> /// Gets the property editor aliases that the value converter supports by default. /// </summary> IEnumerable<string> PropertyEditorAliases { get; } /// <summary> /// Gets the deploy property value corresponding to a content property value, and gather dependencies. /// </summary> /// <param name="value">The content property value.</param> /// <param name="dependencies">The content dependencies.</param> /// <returns>The deploy property value.</returns> string ToArtifact(object value, ICollection<ArtifactDependency> dependencies); /// <summary> /// Gets the content property value corresponding to a deploy property value. /// </summary> /// <param name="value">The deploy property value.</param> /// <param name="currentValue">The current content property value.</param> /// <returns>The content property value.</returns> object FromArtifact(string value, object currentValue); } }
using System.Collections.Generic; using Umbraco.Core.Models; namespace Umbraco.Core.Deploy { /// <summary> /// Defines methods that can convert a property value to / from an environment-agnostic string. /// </summary> /// <remarks>Property values may contain values such as content identifiers, that would be local /// to one environment, and need to be converted in order to be deployed. Connectors also deal /// with serializing to / from string.</remarks> public interface IValueConnector { /// <summary> /// Gets the property editor aliases that the value converter supports by default. /// </summary> IEnumerable<string> PropertyEditorAliases { get; } /// <summary> /// Gets the deploy property corresponding to a content property. /// </summary> /// <param name="property">The content property.</param> /// <param name="dependencies">The content dependencies.</param> /// <returns>The deploy property value.</returns> string GetValue(Property property, ICollection<ArtifactDependency> dependencies); /// <summary> /// Sets a content property value using a deploy property. /// </summary> /// <param name="content">The content item.</param> /// <param name="alias">The property alias.</param> /// <param name="value">The deploy property value.</param> void SetValue(IContentBase content, string alias, string value); } }
mit
C#
3c074f5436598cbbf1a4eeb2ff48b68d455a937d
Update DBInitializer.cs
tiagocesar/sharp-blog,tiagocesar/sharp-blog,tiagocesar/sharp-blog
Entities/DBInitializer.cs
Entities/DBInitializer.cs
using System.Data.Entity; using Entities.Models; namespace Entities { public class DBInitializer : CreateDatabaseIfNotExists<BlogContext> { protected override void Seed(BlogContext context) { context.Users.Add(new UsersEntity { Name = "Default user", Email = "me@someone.com", Password = "12345", Avatar = "" }); context.Categories.Add(new CategoriesEntity { Name = "General" }); base.Seed(context); } } }
using System.Data.Entity; using Entities.Models; namespace Entities { public class DBInitializer : CreateDatabaseIfNotExists<BlogContext> { protected override void Seed(BlogContext context) { context.Users.Add(new UsersEntity { Name = "Default user", Email = "me@someone.com", Password = "12345" }); context.Categories.Add(new CategoriesEntity { Name = "General" }); base.Seed(context); } } }
mit
C#
64c4239b31ce5a203e3d5bd87178e7ce39995e22
Replace FullName with Name on ModelTypeInfo.
toddams/RazorLight,toddams/RazorLight
src/RazorLight/ModelTypeInfo.cs
src/RazorLight/ModelTypeInfo.cs
using System; using System.Dynamic; using RazorLight.Extensions; namespace RazorLight { /// <summary> /// Stores information about model of the template page /// </summary> public class ModelTypeInfo { /// <summary> /// Indicates whether given model is not a dynamic or anonymous object /// </summary> public bool IsStrongType { get; private set; } /// <summary> /// Real type of the model /// </summary> public Type Type { get; private set; } /// <summary> /// Type that will be used on compilation of the template. /// If <see cref="Type"/> is anonymous or dynamic - <see cref="TemplateType"/> becomes <see cref="ExpandoObject"/> /// </summary> public Type TemplateType { get; private set; } /// <summary> /// Name of the type that will be used on compilation of the template /// </summary> public string TemplateTypeName { get; private set; } /// <summary> /// Transforms object into template type /// </summary> /// <param name="model"></param> /// <returns></returns> public object CreateTemplateModel(object model) { return this.IsStrongType ? model : model.ToExpando(); } public ModelTypeInfo(Type type) { if (type == null) { throw new ArgumentNullException(nameof(type)); } this.Type = type; this.IsStrongType = type != typeof(ExpandoObject) && !Type.IsAnonymousType(); this.TemplateType = IsStrongType ? Type : typeof(ExpandoObject); this.TemplateTypeName = IsStrongType ? Type.Name : "dynamic"; } } }
using System; using System.Dynamic; using RazorLight.Extensions; namespace RazorLight { /// <summary> /// Stores information about model of the template page /// </summary> public class ModelTypeInfo { /// <summary> /// Indicates whether given model is not a dynamic or anonymous object /// </summary> public bool IsStrongType { get; private set; } /// <summary> /// Real type of the model /// </summary> public Type Type { get; private set; } /// <summary> /// Type that will be used on compilation of the template. /// If <see cref="Type"/> is anonymous or dynamic - <see cref="TemplateType"/> becomes <see cref="ExpandoObject"/> /// </summary> public Type TemplateType { get; private set; } /// <summary> /// Name of the type that will be used on compilation of the template /// </summary> public string TemplateTypeName { get; private set; } /// <summary> /// Transforms object into template type /// </summary> /// <param name="model"></param> /// <returns></returns> public object CreateTemplateModel(object model) { return this.IsStrongType ? model : model.ToExpando(); } public ModelTypeInfo(Type type) { if (type == null) { throw new ArgumentNullException(nameof(type)); } this.Type = type; this.IsStrongType = type != typeof(ExpandoObject) && !Type.IsAnonymousType(); this.TemplateType = IsStrongType ? Type : typeof(ExpandoObject); this.TemplateTypeName = IsStrongType ? Type.FullName : "dynamic"; } } }
apache-2.0
C#
219e696ef701090df2e88a1435b1c13ce9a45940
Test can get by LINQ statement
TheEadie/LazyLibrary,TheEadie/LazyStorage,TheEadie/LazyStorage
LazyLibraryTests/Storage/Memory/MemoryRepositoryTests.cs
LazyLibraryTests/Storage/Memory/MemoryRepositoryTests.cs
using LazyLibrary.Storage; using LazyLibrary.Storage.Memory; using Microsoft.VisualStudio.TestTools.UnitTesting; using System; using System.Linq; namespace LazyLibrary.Tests.Storage.Memory { [TestClass] public class MemoryRepositoryTests { [TestMethod] public void CanAdd() { var repo = new MemoryRepository<TestObject>(); var obj = new TestObject(); repo.Upsert(obj); Assert.IsTrue(repo.Get().Any(), "The object could not be added to the repository"); } [TestMethod] public void CanGetById() { var repo = new MemoryRepository<TestObject>(); var obj = new TestObject(); repo.Upsert(obj); Assert.IsNotNull(repo.GetById(1), "The object could not be retrieved from the repository"); } [TestMethod] public void CanGetByLINQ() { var repo = new MemoryRepository<TestObject>(); var objOne = new TestObject() { Name = "one" }; var objTwo = new TestObject() { Name = "two" }; repo.Upsert(objOne); repo.Upsert(objTwo); var result = repo.Get(x => x.Name == "one").SingleOrDefault(); Assert.IsNotNull(result, "The object could not be retrieved from the repository"); Assert.IsTrue(result.Equals(objOne), "The object could not be retrieved from the repository"); } } }
using LazyLibrary.Storage; using LazyLibrary.Storage.Memory; using Microsoft.VisualStudio.TestTools.UnitTesting; using System; using System.Linq; namespace LazyLibrary.Tests.Storage.Memory { [TestClass] public class MemoryRepositoryTests { [TestMethod] public void CanAdd() { var repo = new MemoryRepository<TestObject>(); var obj = new TestObject(); repo.Upsert(obj); Assert.IsTrue(repo.Get().Any(), "The object could not be added to the repository"); } [TestMethod] public void CanGetById() { var repo = new MemoryRepository<TestObject>(); var obj = new TestObject(); repo.Upsert(obj); Assert.IsNotNull(repo.GetById(1), "The object could not be retrieved from the repository"); } } }
mit
C#
ba41e77ddc49cbc6601f9dbc3966685023df6392
Update DownloadInfo
witoong623/TirkxDownloader,witoong623/TirkxDownloader
Framework/DownloadInfo.cs
Framework/DownloadInfo.cs
using System; using System.Collections.Generic; using System.IO; using Caliburn.Micro; namespace TirkxDownloader.Framework { public enum DownloadStatus { Queue, Complete, Downloading, Error, Preparing, Stop } public class DownloadInfo : PropertyChangedBase { private string fileName; private DateTime? completeDate; private LoadingDetail downloadDetail; public string DownloadLink { get; set; } public string SaveLocation { get; set; } public DateTime AddDate { get; set; } public IEventAggregator EventAggretagor { get; set; } public string FileName { get { return fileName; } set { fileName = value; NotifyOfPropertyChange(() => FileName); } } public string FullName { get { return Path.Combine(SaveLocation, FileName); } } public DateTime? CompleteDate { get { return completeDate; } set { completeDate = value; NotifyOfPropertyChange(() => CompleteDate); } } public DownloadStatus Status { get { if (DownloadDetail == null) { return DownloadStatus.Queue; } else { return DownloadDetail.LoadingStatus; } } } public LoadingDetail DownloadDetail { get { return downloadDetail; } set { downloadDetail = value; NotifyOfPropertyChange(() => downloadDetail); } } } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace TirkxDownloader.Framework { public enum DownloadStatus { Queue, Complete, Downloading, Error } public class DownloadInfo { public string FileName { get; set; } public string DownloadLink { get; set; } public string SaveLocation { get; set; } public DateTime AddDate { get; set; } public DateTime? CompleteDate { get; set; } public DownloadStatus Status { get; set; } } }
mit
C#
0fa5640e2c174b47b1994fbc73e2be029ad4b7e2
Add apply command.
mminns/xwt,TheBrainTech/xwt,akrisiun/xwt,hwthomas/xwt,sevoku/xwt,mono/xwt,steffenWi/xwt,mminns/xwt,directhex/xwt,antmicro/xwt,hamekoz/xwt,lytico/xwt,cra0zy/xwt,iainx/xwt,residuum/xwt
Xwt/Xwt/Command.cs
Xwt/Xwt/Command.cs
// // Command.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; namespace Xwt { public class Command { public Command (string id) { Id = id; Label = Id; } public string Id { get; private set; } public string Label { get; private set; } public string Icon { get; private set; } public bool IsStockButton { get; private set; } public static Command Ok = new Command ("Ok"); public static Command Cancel = new Command ("Cancel"); public static Command Yes = new Command ("Yes"); public static Command No = new Command ("No"); public static Command Close = new Command ("Close"); public static Command Delete = new Command ("Delete"); public static Command Add = new Command ("Add"); public static Command Remove = new Command ("Remove"); public static Command Clear = new Command ("Clear"); public static Command Copy = new Command ("Copy"); public static Command Cut = new Command ("Cut"); public static Command Paste = new Command ("Paste"); public static Command Save = new Command ("Save"); public static Command SaveAs = new Command ("SaveAs"); public static Command Stop = new Command ("Stop"); public static Command Apply = new Command ("Apply"); } }
// // Command.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; namespace Xwt { public class Command { public Command (string id) { Id = id; Label = Id; } public string Id { get; private set; } public string Label { get; private set; } public string Icon { get; private set; } public bool IsStockButton { get; private set; } public static Command Ok = new Command ("Ok"); public static Command Cancel = new Command ("Cancel"); public static Command Yes = new Command ("Yes"); public static Command No = new Command ("No"); public static Command Close = new Command ("Close"); public static Command Delete = new Command ("Delete"); public static Command Add = new Command ("Add"); public static Command Remove = new Command ("Remove"); public static Command Clear = new Command ("Clear"); public static Command Copy = new Command ("Copy"); public static Command Cut = new Command ("Cut"); public static Command Paste = new Command ("Paste"); public static Command Save = new Command ("Save"); public static Command SaveAs = new Command ("SaveAs"); public static Command Stop = new Command ("Stop"); } }
mit
C#
16ed9b2bac5ef06b170b2894b29a5bccb94df9b9
set WebTest to be using a stronger object type
Nibons/OperationsDashboard,Nibons/OperationsDashboard,Nibons/OperationsDashboard,Nibons/OperationsDashboard
HostConnection/WebTest.cs
HostConnection/WebTest.cs
using System; using System.Net; namespace OperationsDashboard.Common { public class WebTest { public WebClient WebClient { get; private set; } public IPAddress IpAddress; public string Hostname; public Uri url; public WebTest(string url, IPAddress IpAddress) { //set the objects properties this.url = new Uri(url); this.Hostname = this.url.Host; this.IpAddress = IpAddress; //invoke the download this.StartDownload(); } private void StartDownload() { string ipUrl = this.url.OriginalString.Replace(this.Hostname, this.IpAddress.ToString()); this.WebClient = new WebClient(); WebClient.Headers[HttpRequestHeader.Host] = this.Hostname; WebClient.DownloadDataAsync(new Uri(ipUrl)); } public delegate void OnCompleteEventHandler(object obj, EventArgs e); public event OnCompleteEventHandler<EventArgs> OnComplete; //void HandleDownloadComplete( object sender, EventArgs e) //{ // ResponseData responseData = new ResponseData(); // responseData.IpAddress = //} } }
using System; using System.Net; namespace OperationsDashboard.Common { public class WebTest { public WebClient WebClient { get; private set; } private string IpAddress; private string Hostname; private string url; public WebTest(string url,string originalHostname,string IpAddress) { //set the objects properties this.url = url; this.Hostname = originalHostname; this.IpAddress = IpAddress; //invoke the download this.StartDownload(); } private void StartDownload() { this.WebClient = new WebClient(); string newURL = url.Replace(this.Hostname, this.IpAddress); WebClient.Headers[HttpRequestHeader.Host] = this.Hostname; WebClient.DownloadDataAsync(new Uri(newURL)); } public void CompleteEventSubscription() { this.WebClient.DownloadDataCompleted += HandleDownloadComplete; } void HandleDownloadComplete( object sender, EventArgs e) { ResponseData responseData = new ResponseData(); responseData.IpAddress = } } }
mit
C#
d610cb98fac40a711ab0957dcceffcf3fea65617
fix GenderUtils
petrovich/petrovich-net
NPetrovich/Utils/GenderUtils.cs
NPetrovich/Utils/GenderUtils.cs
using System.Globalization; namespace NPetrovich.Utils { public static class GenderUtils { private const string ExceptionMessage = "You must specify middle name to detect gender"; private const string ParameterName = "middleName"; public static Gender Detect(string middleName) { Guard.IfArgumentNullOrWhitespace(middleName, ParameterName, ExceptionMessage); if (middleName.EndsWith("ич", true, CultureInfo.InvariantCulture)) return Gender.Male; if (middleName.EndsWith("на", true, CultureInfo.InvariantCulture)) return Gender.Female; return Gender.Androgynous; } public static Gender DetectGender(string middleName) { Guard.IfArgumentNullOrWhitespace(middleName, ParameterName, ExceptionMessage); return Detect(middleName); } } }
using System.Globalization; namespace NPetrovich.Utils { public static class GenderUtils { private const string ExceptionMessage = "You must specify middle name to detect gender"; private const string ParameterName = "middleName"; public static Gender Detect(string middleName) { Guard.IfArgumentNullOrWhitespace(middleName, ParameterName, ExceptionMessage); if (middleName.EndsWith("ич", true, CultureInfo.InvariantCulture)) return Gender.Male; if (middleName.EndsWith("на", true, CultureInfo.InvariantCulture)) return Gender.Female; return Gender.Androgynous; } public static Gender DetectGender(this Petrovich petrovich) { Guard.IfArgumentNullOrWhitespace(petrovich.MiddleName, ParameterName, ExceptionMessage); return Detect(petrovich.MiddleName); } } }
mit
C#
0b8fa336372968362c4b7017f696078312fe0107
remove errors from MD console while executing. Fix bug #1396
sakthivelnagarajan/monotouch-samples,iFreedive/monotouch-samples,xamarin/monotouch-samples,haithemaraissia/monotouch-samples,sakthivelnagarajan/monotouch-samples,kingyond/monotouch-samples,labdogg1003/monotouch-samples,W3SS/monotouch-samples,hongnguyenpro/monotouch-samples,nelzomal/monotouch-samples,hongnguyenpro/monotouch-samples,labdogg1003/monotouch-samples,haithemaraissia/monotouch-samples,iFreedive/monotouch-samples,andypaul/monotouch-samples,nervevau2/monotouch-samples,YOTOV-LIMITED/monotouch-samples,sakthivelnagarajan/monotouch-samples,robinlaide/monotouch-samples,hongnguyenpro/monotouch-samples,nelzomal/monotouch-samples,a9upam/monotouch-samples,a9upam/monotouch-samples,kingyond/monotouch-samples,markradacz/monotouch-samples,labdogg1003/monotouch-samples,robinlaide/monotouch-samples,xamarin/monotouch-samples,andypaul/monotouch-samples,W3SS/monotouch-samples,peteryule/monotouch-samples,peteryule/monotouch-samples,haithemaraissia/monotouch-samples,peteryule/monotouch-samples,haithemaraissia/monotouch-samples,davidrynn/monotouch-samples,robinlaide/monotouch-samples,nervevau2/monotouch-samples,YOTOV-LIMITED/monotouch-samples,peteryule/monotouch-samples,labdogg1003/monotouch-samples,a9upam/monotouch-samples,andypaul/monotouch-samples,iFreedive/monotouch-samples,W3SS/monotouch-samples,YOTOV-LIMITED/monotouch-samples,bratsche/monotouch-samples,kingyond/monotouch-samples,a9upam/monotouch-samples,nervevau2/monotouch-samples,nervevau2/monotouch-samples,nelzomal/monotouch-samples,hongnguyenpro/monotouch-samples,albertoms/monotouch-samples,xamarin/monotouch-samples,sakthivelnagarajan/monotouch-samples,albertoms/monotouch-samples,bratsche/monotouch-samples,albertoms/monotouch-samples,robinlaide/monotouch-samples,markradacz/monotouch-samples,YOTOV-LIMITED/monotouch-samples,andypaul/monotouch-samples,davidrynn/monotouch-samples,davidrynn/monotouch-samples,davidrynn/monotouch-samples,nelzomal/monotouch-samples,markradacz/monotouch-samples
Keychain/Keychain/Main.cs
Keychain/Keychain/Main.cs
// // Shows how to use the MonoTouch.Security stack on iOS5 to // securely store a password on the KeyChain. // // This API is not particularly user-friendly // using System; using System.Collections.Generic; using System.Linq; using System.Threading; using MonoTouch.Foundation; using MonoTouch.UIKit; using MonoTouch.Security; namespace Keychain { public class Application { static void Main (string[] args) { UIApplication.Main (args); } } // The name AppDelegate is referenced in the MainWindow.xib file. public partial class AppDelegate : UIApplicationDelegate { UIViewController viewController; // This method is invoked when the application has loaded its UI and its ready to run public override bool FinishedLaunching (UIApplication app, NSDictionary options) { ThreadPool.QueueUserWorkItem (delegate { window.BeginInvokeOnMainThread (delegate { var rec = new SecRecord (SecKind.GenericPassword){ Generic = NSData.FromString ("foo") }; SecStatusCode res; var match = SecKeyChain.QueryAsRecord (rec, out res); if (res == SecStatusCode.Success) DisplayMessage ("Key found, password is: {0}", match.ValueData); else DisplayMessage ("Key not found: {0}", res); var s = new SecRecord (SecKind.GenericPassword) { Label = "Item Label", Description = "Item description", Account = "Account", Service = "Service", Comment = "Your comment here", ValueData = NSData.FromString ("my-secret-password"), Generic = NSData.FromString ("foo") }; var err = SecKeyChain.Add (s); if (err != SecStatusCode.Success && err != SecStatusCode.DuplicateItem) DisplayMessage ("Error adding record: {0}", err); }); }); viewController = new UIViewController (); window.RootViewController = viewController; window.MakeKeyAndVisible (); return true; } // This method is required in iPhoneOS 3.0 public override void OnActivated (UIApplication application) { } void DisplayMessage (string message, params object[] format) { new UIAlertView ("Keychain", string.Format (message, format), null, "OK", null).Show (); } } }
// // Shows how to use the MonoTouch.Security stack on iOS5 to // securely store a password on the KeyChain. // // This API is not particularly user-friendly // using System; using System.Collections.Generic; using System.Linq; using MonoTouch.Foundation; using MonoTouch.UIKit; using MonoTouch.Security; namespace Keychain { public class Application { static void Main (string[] args) { UIApplication.Main (args); } } // The name AppDelegate is referenced in the MainWindow.xib file. public partial class AppDelegate : UIApplicationDelegate { // This method is invoked when the application has loaded its UI and its ready to run public override bool FinishedLaunching (UIApplication app, NSDictionary options) { var rec = new SecRecord (SecKind.GenericPassword){ Generic = NSData.FromString ("foo") }; SecStatusCode res; var match = SecKeyChain.QueryAsRecord (rec, out res); if (res == SecStatusCode.Success) DisplayMessage ("Key found, password is: {0}", match.ValueData); else DisplayMessage ("Key not found: {0}", res); var s = new SecRecord (SecKind.GenericPassword) { Label = "Item Label", Description = "Item description", Account = "Account", Service = "Service", Comment = "Your comment here", ValueData = NSData.FromString ("my-secret-password"), Generic = NSData.FromString ("foo") }; var err = SecKeyChain.Add (s); if (err != SecStatusCode.Success && err != SecStatusCode.DuplicateItem) DisplayMessage ("Error adding record: {0}", err); window.MakeKeyAndVisible (); return true; } // This method is required in iPhoneOS 3.0 public override void OnActivated (UIApplication application) { } void DisplayMessage (string message, params object[] format) { new UIAlertView ("Keychain", string.Format (message, format), null, "OK", null).Show (); } } }
mit
C#
062067163a2242a47853c478bef21b03463f3981
Add Basic auth parser test
stormpath/stormpath-dotnet-owin-middleware
test/Stormpath.Owin.UnitTest/BasicAuthenticationParserShould.cs
test/Stormpath.Owin.UnitTest/BasicAuthenticationParserShould.cs
using System.Threading; using FluentAssertions; using Stormpath.Owin.Middleware; using Xunit; namespace Stormpath.Owin.UnitTest { public class BasicAuthenticationParserShould { [Fact] public void ReportNullHeaderInvalid() { var parser = new BasicAuthenticationParser(null, null); parser.IsValid.Should().BeFalse(); parser.Username.Should().BeNullOrEmpty(); } [Fact] public void ReportEmptyHeaderInvalid() { var parser = new BasicAuthenticationParser(string.Empty, null); parser.IsValid.Should().BeFalse(); parser.Username.Should().BeNullOrEmpty(); } [Fact] public void ReportNonBasicHeaderInvalid() { var parser = new BasicAuthenticationParser("Bearer foobar", null); parser.IsValid.Should().BeFalse(); parser.Username.Should().BeNullOrEmpty(); } [Fact] public void ReportEmptyPayloadInvalid() { var parser = new BasicAuthenticationParser("Basic ", null); parser.IsValid.Should().BeFalse(); parser.Username.Should().BeNullOrEmpty(); } [Fact] public void ReportBadPayloadInvalid() { var parser = new BasicAuthenticationParser("Basic foobar", null); parser.IsValid.Should().BeFalse(); parser.Username.Should().BeNullOrEmpty(); } [Theory] [InlineData("Basic Zm9vOmJhcg==", "foo", "bar")] [InlineData("Basic NVhHR1I4SVFJVkhKSlBOS0VaUjkzNktYUjo1WFU3Yy9YM0lKRkRtUit6U1pINzdqMVdRdHlKQWtGL0I3N3AwVUN3MEZr", "5XGGR8IQIVHJJPNKEZR936KXR", "5XU7c/X3IJFDmR+zSZH77j1WQtyJAkF/B77p0UCw0Fk")] public void ParseValidPayload(string header, string username, string password) { var parser = new BasicAuthenticationParser(header, null); parser.IsValid.Should().BeTrue(); parser.Username.Should().Be(username); parser.Password.Should().Be(password); } } }
using FluentAssertions; using Stormpath.Owin.Middleware; using Xunit; namespace Stormpath.Owin.UnitTest { public class BasicAuthenticationParserShould { [Fact] public void ReportNullHeaderInvalid() { var parser = new BasicAuthenticationParser(null, null); parser.IsValid.Should().BeFalse(); parser.Username.Should().BeNullOrEmpty(); } [Fact] public void ReportEmptyHeaderInvalid() { var parser = new BasicAuthenticationParser(string.Empty, null); parser.IsValid.Should().BeFalse(); parser.Username.Should().BeNullOrEmpty(); } [Fact] public void ReportNonBasicHeaderInvalid() { var parser = new BasicAuthenticationParser("Bearer foobar", null); parser.IsValid.Should().BeFalse(); parser.Username.Should().BeNullOrEmpty(); } [Fact] public void ReportEmptyPayloadInvalid() { var parser = new BasicAuthenticationParser("Basic ", null); parser.IsValid.Should().BeFalse(); parser.Username.Should().BeNullOrEmpty(); } [Fact] public void ReportBadPayloadInvalid() { var parser = new BasicAuthenticationParser("Basic foobar", null); parser.IsValid.Should().BeFalse(); parser.Username.Should().BeNullOrEmpty(); } [Fact] public void ParseValidPayload() { var parser = new BasicAuthenticationParser("Basic Zm9vOmJhcg==", null); parser.IsValid.Should().BeTrue(); parser.Username.Should().Be("foo"); parser.Password.Should().Be("bar"); } } }
apache-2.0
C#
cc9a24fdfe1613dddd7f5e75c3bc4ba665993fa3
PUT => POST (incorrect docs?)
simontaylor81/Syrup,simontaylor81/Syrup
SRPTests/Util/CIHelper.cs
SRPTests/Util/CIHelper.cs
using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using System.Net; using System.Net.Http; using System.Text; using System.Threading.Tasks; namespace SRPTests.Util { // Continuous integration helper functionality. // Currently supports Appveyor static class CIHelper { public static bool IsAppveyor { get { return !string.IsNullOrEmpty(Environment.GetEnvironmentVariable("APPVEYOR")); } } public static async Task PublishArtefact(string path) { Console.WriteLine("Publishing artefact {0}", path); if (IsAppveyor) { // Running under Appveyor, so publish artefact using REST api. await PublishArtefact_Appveyor(path); } else { // Running locally, so just ShellExecute the file. Process.Start(path); } } private static async Task PublishArtefact_Appveyor(string path) { try { var appveyorApiUrl = Environment.GetEnvironmentVariable("APPVEYOR_API_URL"); var jsonRequest = JsonConvert.SerializeObject(new { path = Path.GetFullPath(path), fileName = Path.GetFileName(path), name = (string)null, type = "html" }); Console.WriteLine("APPVEYOR_API_URL = {0}", appveyorApiUrl); Console.WriteLine("jsonRequest = {0}", jsonRequest); // PUT data to api URL to get where to upload the file to. var httpClient = new HttpClient(); var response = await httpClient.PostAsync(appveyorApiUrl + "api/artifacts", new StringContent(jsonRequest, Encoding.UTF8, "application/json")).ConfigureAwait(false); response.EnsureSuccessStatusCode(); var responseString = await response.Content.ReadAsStringAsync().ConfigureAwait(false); var uploadUrl = JsonConvert.DeserializeObject<string>(responseString); Console.WriteLine("responseString = {0}", responseString); Console.WriteLine("uploadUrl = {0}", uploadUrl); // Upload the file to the returned URL. using (var wc = new WebClient()) { await wc.UploadFileTaskAsync(new Uri(uploadUrl), path).ConfigureAwait(false); } } catch (Exception ex) { Console.WriteLine(ex.Message); throw; } } } }
using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using System.Net; using System.Net.Http; using System.Text; using System.Threading.Tasks; namespace SRPTests.Util { // Continuous integration helper functionality. // Currently supports Appveyor static class CIHelper { public static bool IsAppveyor { get { return !string.IsNullOrEmpty(Environment.GetEnvironmentVariable("APPVEYOR")); } } public static async Task PublishArtefact(string path) { Console.WriteLine("Publishing artefact {0}", path); if (IsAppveyor) { // Running under Appveyor, so publish artefact using REST api. await PublishArtefact_Appveyor(path); } else { // Running locally, so just ShellExecute the file. Process.Start(path); } } private static async Task PublishArtefact_Appveyor(string path) { try { var appveyorApiUrl = Environment.GetEnvironmentVariable("APPVEYOR_API_URL"); var jsonRequest = JsonConvert.SerializeObject(new { path = Path.GetFullPath(path), fileName = Path.GetFileName(path), name = (string)null, type = "html" }); Console.WriteLine("APPVEYOR_API_URL = {0}", appveyorApiUrl); Console.WriteLine("jsonRequest = {0}", jsonRequest); // PUT data to api URL to get where to upload the file to. var httpClient = new HttpClient(); var response = await httpClient.PutAsync(appveyorApiUrl + "api/artifacts", new StringContent(jsonRequest, Encoding.UTF8, "application/json")).ConfigureAwait(false); response.EnsureSuccessStatusCode(); var responseString = await response.Content.ReadAsStringAsync().ConfigureAwait(false); var uploadUrl = JsonConvert.DeserializeObject<string>(responseString); Console.WriteLine("responseString = {0}", responseString); Console.WriteLine("uploadUrl = {0}", uploadUrl); // Upload the file to the returned URL. await new WebClient().UploadFileTaskAsync(new Uri(uploadUrl), path).ConfigureAwait(false); } catch (Exception ex) { Console.WriteLine(ex.Message); throw; } } } }
mit
C#