commit
stringlengths 40
40
| old_file
stringlengths 4
237
| new_file
stringlengths 4
237
| old_contents
stringlengths 1
4.24k
| new_contents
stringlengths 1
4.87k
| subject
stringlengths 15
778
| message
stringlengths 15
8.75k
| lang
stringclasses 266
values | license
stringclasses 13
values | repos
stringlengths 5
127k
|
|---|---|---|---|---|---|---|---|---|---|
5f52fe11a7380d28187c57232a93b24af146788a
|
GitTfs/Core/TfsChangesetInfo.cs
|
GitTfs/Core/TfsChangesetInfo.cs
|
using System.Collections.Generic;
namespace Sep.Git.Tfs.Core
{
public class TfsChangesetInfo
{
public IGitTfsRemote Remote { get; set; }
public long ChangesetId { get; set; }
public string GitCommit { get; set; }
public IEnumerable<ITfsWorkitem> Workitems { get; set; }
}
}
|
using System.Collections.Generic;
using System.Linq;
namespace Sep.Git.Tfs.Core
{
public class TfsChangesetInfo
{
public IGitTfsRemote Remote { get; set; }
public long ChangesetId { get; set; }
public string GitCommit { get; set; }
public IEnumerable<ITfsWorkitem> Workitems { get; set; }
public TfsChangesetInfo()
{
Workitems = Enumerable.Empty<ITfsWorkitem>();
}
}
}
|
Add a default value for changeset.workitems.
|
Add a default value for changeset.workitems.
|
C#
|
apache-2.0
|
guyboltonking/git-tfs,guyboltonking/git-tfs,adbre/git-tfs,PKRoma/git-tfs,irontoby/git-tfs,TheoAndersen/git-tfs,steveandpeggyb/Public,allansson/git-tfs,jeremy-sylvis-tmg/git-tfs,WolfVR/git-tfs,allansson/git-tfs,NathanLBCooper/git-tfs,bleissem/git-tfs,jeremy-sylvis-tmg/git-tfs,codemerlin/git-tfs,hazzik/git-tfs,jeremy-sylvis-tmg/git-tfs,WolfVR/git-tfs,steveandpeggyb/Public,adbre/git-tfs,pmiossec/git-tfs,irontoby/git-tfs,vzabavnov/git-tfs,TheoAndersen/git-tfs,steveandpeggyb/Public,hazzik/git-tfs,NathanLBCooper/git-tfs,adbre/git-tfs,allansson/git-tfs,andyrooger/git-tfs,codemerlin/git-tfs,TheoAndersen/git-tfs,spraints/git-tfs,WolfVR/git-tfs,modulexcite/git-tfs,bleissem/git-tfs,NathanLBCooper/git-tfs,git-tfs/git-tfs,codemerlin/git-tfs,bleissem/git-tfs,kgybels/git-tfs,modulexcite/git-tfs,spraints/git-tfs,kgybels/git-tfs,kgybels/git-tfs,spraints/git-tfs,hazzik/git-tfs,TheoAndersen/git-tfs,allansson/git-tfs,guyboltonking/git-tfs,hazzik/git-tfs,irontoby/git-tfs,modulexcite/git-tfs
|
726322c523653ce2670a65834c76dfea9ee5bea9
|
NBi.Core/Calculation/Predicate/Numeric/NumericWithinRange.cs
|
NBi.Core/Calculation/Predicate/Numeric/NumericWithinRange.cs
|
using NBi.Core.ResultSet;
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using NBi.Core.Scalar.Interval;
using NBi.Core.Scalar.Caster;
namespace NBi.Core.Calculation.Predicate.Numeric
{
class NumericWithinRange : AbstractPredicateReference
{
public NumericWithinRange(bool not, object reference) : base(not, reference)
{ }
protected override bool Apply(object x)
{
var builder = new NumericIntervalBuilder(Reference);
builder.Build();
var interval = builder.GetInterval();
var caster = new NumericCaster();
var numX = caster.Execute(x);
return interval.Contains(numX);
}
public override string ToString() => $"is within the interval {Reference}";
}
}
|
using NBi.Core.ResultSet;
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using NBi.Core.Scalar.Interval;
using NBi.Core.Scalar.Caster;
namespace NBi.Core.Calculation.Predicate.Numeric
{
class NumericWithinRange : AbstractPredicateReference
{
public NumericWithinRange(bool not, object reference) : base(not, reference)
{ }
protected override bool Apply(object x)
{
var builder = new NumericIntervalBuilder(Reference);
builder.Build();
if (!builder.IsValid())
throw builder.GetException();
var interval = builder.GetInterval();
var caster = new NumericCaster();
var numX = caster.Execute(x);
return interval.Contains(numX);
}
public override string ToString() => $"is within the interval {Reference}";
}
}
|
Improve handling of bad format for intervals
|
Improve handling of bad format for intervals
|
C#
|
apache-2.0
|
Seddryck/NBi,Seddryck/NBi
|
27043bec591e481c712e4ed7bac1906122f7d33b
|
src/Umbraco.Core/Extensions/ConfigConnectionStringExtensions.cs
|
src/Umbraco.Core/Extensions/ConfigConnectionStringExtensions.cs
|
// Copyright (c) Umbraco.
// See LICENSE for more details.
using System;
using System.IO;
using System.Linq;
using Umbraco.Cms.Core;
using Umbraco.Cms.Core.Configuration;
namespace Umbraco.Extensions
{
public static class ConfigConnectionStringExtensions
{
public static bool IsConnectionStringConfigured(this ConfigConnectionString databaseSettings)
{
var dbIsSqlCe = false;
if (databaseSettings?.ProviderName != null)
{
dbIsSqlCe = databaseSettings.ProviderName == Constants.DbProviderNames.SqlCe;
}
var sqlCeDatabaseExists = false;
if (dbIsSqlCe)
{
var parts = databaseSettings.ConnectionString.Split(new[] { ';' }, StringSplitOptions.RemoveEmptyEntries);
var dataSourcePart = parts.FirstOrDefault(x => x.InvariantStartsWith("Data Source="));
if (dataSourcePart != null)
{
var datasource = dataSourcePart.Replace("|DataDirectory|", AppDomain.CurrentDomain.GetData("DataDirectory").ToString());
var filePath = datasource.Replace("Data Source=", string.Empty);
sqlCeDatabaseExists = File.Exists(filePath);
}
}
// Either the connection details are not fully specified or it's a SQL CE database that doesn't exist yet
if (databaseSettings == null
|| string.IsNullOrWhiteSpace(databaseSettings.ConnectionString) || string.IsNullOrWhiteSpace(databaseSettings.ProviderName)
|| (dbIsSqlCe && sqlCeDatabaseExists == false))
{
return false;
}
return true;
}
}
}
|
// Copyright (c) Umbraco.
// See LICENSE for more details.
using Umbraco.Cms.Core.Configuration;
namespace Umbraco.Extensions
{
public static class ConfigConnectionStringExtensions
{
public static bool IsConnectionStringConfigured(this ConfigConnectionString databaseSettings)
=> databaseSettings != null &&
!string.IsNullOrWhiteSpace(databaseSettings.ConnectionString) &&
!string.IsNullOrWhiteSpace(databaseSettings.ProviderName);
}
}
|
Remove custom SQL CE checks from IsConnectionStringConfigured
|
Remove custom SQL CE checks from IsConnectionStringConfigured
|
C#
|
mit
|
KevinJump/Umbraco-CMS,dawoe/Umbraco-CMS,abjerner/Umbraco-CMS,JimBobSquarePants/Umbraco-CMS,JimBobSquarePants/Umbraco-CMS,dawoe/Umbraco-CMS,robertjf/Umbraco-CMS,robertjf/Umbraco-CMS,umbraco/Umbraco-CMS,dawoe/Umbraco-CMS,abryukhov/Umbraco-CMS,abryukhov/Umbraco-CMS,abjerner/Umbraco-CMS,JimBobSquarePants/Umbraco-CMS,abjerner/Umbraco-CMS,abjerner/Umbraco-CMS,robertjf/Umbraco-CMS,JimBobSquarePants/Umbraco-CMS,abryukhov/Umbraco-CMS,umbraco/Umbraco-CMS,marcemarc/Umbraco-CMS,marcemarc/Umbraco-CMS,KevinJump/Umbraco-CMS,arknu/Umbraco-CMS,umbraco/Umbraco-CMS,marcemarc/Umbraco-CMS,abryukhov/Umbraco-CMS,KevinJump/Umbraco-CMS,JimBobSquarePants/Umbraco-CMS,marcemarc/Umbraco-CMS,dawoe/Umbraco-CMS,marcemarc/Umbraco-CMS,dawoe/Umbraco-CMS,arknu/Umbraco-CMS,robertjf/Umbraco-CMS,robertjf/Umbraco-CMS,umbraco/Umbraco-CMS,KevinJump/Umbraco-CMS,arknu/Umbraco-CMS,arknu/Umbraco-CMS,KevinJump/Umbraco-CMS
|
680dc50b8451fba4990331e186e1769a4da44c96
|
osu.Framework/Testing/TestingExtensions.cs
|
osu.Framework/Testing/TestingExtensions.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.Collections.Generic;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
namespace osu.Framework.Testing
{
public static class TestingExtensions
{
/// <summary>
/// Find all children recursively of a specific type. As this is expensive and dangerous, it should only be used for testing purposes.
/// </summary>
public static IEnumerable<T> ChildrenOfType<T>(this Drawable drawable) where T : Drawable
{
switch (drawable)
{
case T found:
yield return found;
break;
case CompositeDrawable composite:
foreach (var child in composite.InternalChildren)
{
foreach (var found in child.ChildrenOfType<T>())
yield return found;
}
break;
}
}
}
}
|
// 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.Collections.Generic;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
namespace osu.Framework.Testing
{
public static class TestingExtensions
{
/// <summary>
/// Find all children recursively of a specific type. As this is expensive and dangerous, it should only be used for testing purposes.
/// </summary>
public static IEnumerable<T> ChildrenOfType<T>(this Drawable drawable)
{
switch (drawable)
{
case T found:
yield return found;
break;
case CompositeDrawable composite:
foreach (var child in composite.InternalChildren)
{
foreach (var found in child.ChildrenOfType<T>())
yield return found;
}
break;
}
}
}
}
|
Remove type constraint for ChildrenOfType<T>
|
Remove type constraint for ChildrenOfType<T>
|
C#
|
mit
|
ZLima12/osu-framework,smoogipooo/osu-framework,peppy/osu-framework,peppy/osu-framework,ppy/osu-framework,ZLima12/osu-framework,ppy/osu-framework,ppy/osu-framework,peppy/osu-framework,smoogipooo/osu-framework
|
00a5ecb10c338fd877d03071323e837012a9f3fe
|
src/AsmResolver/IO/IBinaryStreamReaderFactory.cs
|
src/AsmResolver/IO/IBinaryStreamReaderFactory.cs
|
using System;
namespace AsmResolver.IO
{
/// <summary>
/// Provides members for creating new binary streams.
/// </summary>
public interface IBinaryStreamReaderFactory : IDisposable
{
/// <summary>
/// Gets the maximum length a single binary stream reader produced by this factory can have.
/// </summary>
uint MaxLength
{
get;
}
/// <summary>
/// Creates a new binary reader at the provided address.
/// </summary>
/// <param name="address">The raw address to start reading from.</param>
/// <param name="rva">The virtual address (relative to the image base) that is associated to the raw address.</param>
/// <param name="length">The number of bytes to read.</param>
/// <returns>The created reader.</returns>
BinaryStreamReader CreateReader(ulong address, uint rva, uint length);
}
public static partial class IOExtensions
{
/// <summary>
/// Creates a binary reader for the entire address space.
/// </summary>
/// <param name="factory">The factory to use.</param>
/// <returns>The constructed reader.</returns>
public static BinaryStreamReader CreateReader(this IBinaryStreamReaderFactory factory)
=> factory.CreateReader(0, 0, factory.MaxLength);
}
}
|
using System;
using System.IO;
namespace AsmResolver.IO
{
/// <summary>
/// Provides members for creating new binary streams.
/// </summary>
public interface IBinaryStreamReaderFactory : IDisposable
{
/// <summary>
/// Gets the maximum length a single binary stream reader produced by this factory can have.
/// </summary>
uint MaxLength
{
get;
}
/// <summary>
/// Creates a new binary reader at the provided address.
/// </summary>
/// <param name="address">The raw address to start reading from.</param>
/// <param name="rva">The virtual address (relative to the image base) that is associated to the raw address.</param>
/// <param name="length">The number of bytes to read.</param>
/// <returns>The created reader.</returns>
/// <exception cref="ArgumentOutOfRangeException">Occurs if <paramref name="address"/> is not a valid address.</exception>
/// <exception cref="EndOfStreamException">Occurs if <paramref name="length"/> is too long.</exception>
BinaryStreamReader CreateReader(ulong address, uint rva, uint length);
}
public static partial class IOExtensions
{
/// <summary>
/// Creates a binary reader for the entire address space.
/// </summary>
/// <param name="factory">The factory to use.</param>
/// <returns>The constructed reader.</returns>
public static BinaryStreamReader CreateReader(this IBinaryStreamReaderFactory factory)
=> factory.CreateReader(0, 0, factory.MaxLength);
}
}
|
Add <exception> tags to CreateReader.
|
Add <exception> tags to CreateReader.
|
C#
|
mit
|
Washi1337/AsmResolver,Washi1337/AsmResolver,Washi1337/AsmResolver,Washi1337/AsmResolver
|
4e9ea01784d4df1e339ad7a14c1bc2a657baeacd
|
src/BuildingBlocks.CopyManagement/CryptHelper.cs
|
src/BuildingBlocks.CopyManagement/CryptHelper.cs
|
using System.Security.Cryptography;
using System.Text;
namespace BuildingBlocks.CopyManagement
{
public static class CryptHelper
{
public static string ToFingerPrintMd5Hash(this string value)
{
var cryptoProvider = new MD5CryptoServiceProvider();
var encoding = new ASCIIEncoding();
var encodedBytes = encoding.GetBytes(value);
var hashBytes = cryptoProvider.ComputeHash(encodedBytes);
var hexString = BytesToHexString(hashBytes);
return hexString;
}
private static string BytesToHexString(byte[] bytes)
{
var result = string.Empty;
for (var i = 0; i < bytes.Length; i++)
{
var b = bytes[i];
var n = (int)b;
var n1 = n & 15;
var n2 = (n >> 4) & 15;
if (n2 > 9)
{
result += ((char)(n2 - 10 + 'A')).ToString();
}
else
{
result += n2.ToString();
}
if (n1 > 9)
{
result += ((char)(n1 - 10 + 'A')).ToString();
}
else
{
result += n1.ToString();
}
if ((i + 1) != bytes.Length && (i + 1) % 2 == 0)
{
result += "-";
}
}
return result;
}
}
}
|
using System.Security.Cryptography;
using System.Text;
namespace BuildingBlocks.CopyManagement
{
public static class CryptHelper
{
public static string ToFingerPrintMd5Hash(this string value, char? separator = '-')
{
var cryptoProvider = new MD5CryptoServiceProvider();
var encoding = new ASCIIEncoding();
var encodedBytes = encoding.GetBytes(value);
var hashBytes = cryptoProvider.ComputeHash(encodedBytes);
var hexString = BytesToHexString(hashBytes, separator);
return hexString;
}
private static string BytesToHexString(byte[] bytes, char? separator)
{
var stringBuilder = new StringBuilder();
for (var i = 0; i < bytes.Length; i++)
{
var b = bytes[i];
var n = (int)b;
var n1 = n & 15;
var n2 = (n >> 4) & 15;
if (n2 > 9)
{
stringBuilder.Append((char) n2 - 10 + 'A');
}
else
{
stringBuilder.Append(n2);
}
if (n1 > 9)
{
stringBuilder.Append((char) n1 - 10 + 'A');
}
else
{
stringBuilder.Append(n1);
}
if (separator.HasValue && ((i + 1) != bytes.Length && (i + 1) % 2 == 0))
{
stringBuilder.Append(separator.Value);
}
}
return stringBuilder.ToString();
}
}
}
|
Allow replace separator in crypt helper
|
Allow replace separator in crypt helper
|
C#
|
apache-2.0
|
ifilipenko/Building-Blocks,ifilipenko/Building-Blocks,ifilipenko/Building-Blocks
|
05df51d8e2e78ebeaad38e3f41c10730195fc3cb
|
src/Glimpse.Agent.Web/GlimpseAgentWebServices.cs
|
src/Glimpse.Agent.Web/GlimpseAgentWebServices.cs
|
using Glimpse.Agent;
using Microsoft.Framework.ConfigurationModel;
using Microsoft.Framework.DependencyInjection;
using System;
using System.Collections.Generic;
using Glimpse.Agent.Web.Options;
namespace Glimpse
{
public class GlimpseAgentWebServices
{
public static IEnumerable<IServiceDescriptor> GetDefaultServices()
{
return GetDefaultServices(new Configuration());
}
public static IEnumerable<IServiceDescriptor> GetDefaultServices(IConfiguration configuration)
{
var describe = new ServiceDescriber(configuration);
//
// Options
//
yield return describe.Singleton<IIgnoredUrisProvider, DefaultIgnoredUrisProvider>();
}
}
}
|
using Glimpse.Agent;
using Microsoft.Framework.ConfigurationModel;
using Microsoft.Framework.DependencyInjection;
using System;
using System.Collections.Generic;
using Glimpse.Agent.Web;
using Glimpse.Agent.Web.Options;
using Microsoft.Framework.OptionsModel;
namespace Glimpse
{
public class GlimpseAgentWebServices
{
public static IEnumerable<IServiceDescriptor> GetDefaultServices()
{
return GetDefaultServices(null);
}
public static IEnumerable<IServiceDescriptor> GetDefaultServices(IConfiguration configuration)
{
var describe = new ServiceDescriber(configuration);
//
// Options
//
yield return describe.Transient<IConfigureOptions<GlimpseAgentWebOptions>, GlimpseAgentWebOptionsSetup>();
yield return describe.Singleton<IIgnoredUrisProvider, DefaultIgnoredUrisProvider>();
}
}
}
|
Add Options setup registration in DI container
|
Add Options setup registration in DI container
|
C#
|
mit
|
mike-kaufman/Glimpse.Prototype,Glimpse/Glimpse.Prototype,peterblazejewicz/Glimpse.Prototype,peterblazejewicz/Glimpse.Prototype,zanetdev/Glimpse.Prototype,pranavkm/Glimpse.Prototype,zanetdev/Glimpse.Prototype,pranavkm/Glimpse.Prototype,pranavkm/Glimpse.Prototype,pranavkm/Glimpse.Prototype,mike-kaufman/Glimpse.Prototype,peterblazejewicz/Glimpse.Prototype,Glimpse/Glimpse.Prototype,Glimpse/Glimpse.Prototype,mike-kaufman/Glimpse.Prototype,zanetdev/Glimpse.Prototype,mike-kaufman/Glimpse.Prototype,mike-kaufman/Glimpse.Prototype,zanetdev/Glimpse.Prototype,peterblazejewicz/Glimpse.Prototype,peterblazejewicz/Glimpse.Prototype,Glimpse/Glimpse.Prototype
|
24888165919b6df7899a9cfa05abd82399edfe7e
|
Api/DIServiceRegister/ModelRepositories.cs
|
Api/DIServiceRegister/ModelRepositories.cs
|
using Api.Repositories;
using Microsoft.Extensions.DependencyInjection;
namespace Api.DIServiceRegister {
public class Repositories
{
public static void Register(IServiceCollection services) {
services.AddSingleton<IAdministratorsRepository, AdministratorsRepository>();
services.AddSingleton<IBookmarksRepository, BookmarksRepository>();
services.AddSingleton<ICommentsRepository, CommentsRepository>();
services.AddSingleton<IFollowersRepository, FollowersRepository>();
services.AddSingleton<ILikesRepository, LikesRepository>();
services.AddSingleton<ILocationsRepository, LocationsRepository>();
services.AddSingleton<IPostsRepository, IPostsRepository>();
services.AddSingleton<IReportsRepository, ReportsRepository>();
services.AddSingleton<ITagsRepository, TagsRepository>();
}
}
}
|
using Api.Repositories;
using Microsoft.Extensions.DependencyInjection;
namespace Api.DIServiceRegister {
public class ModelRepositories
{
public static void Register(IServiceCollection services) {
services.AddScoped<IAdministratorsRepository, AdministratorsRepository>();
services.AddScoped<IBookmarksRepository, BookmarksRepository>();
services.AddScoped<ICommentsRepository, CommentsRepository>();
services.AddScoped<IFollowersRepository, FollowersRepository>();
services.AddScoped<ILikesRepository, LikesRepository>();
services.AddScoped<ILocationsRepository, LocationsRepository>();
services.AddScoped<IPostsRepository, PostsRepository>();
services.AddScoped<IReportsRepository, ReportsRepository>();
services.AddScoped<ITagsRepository, TagsRepository>();
}
}
}
|
Fix typo in Model-Repositories Service Register
|
Fix typo in Model-Repositories Service Register
|
C#
|
apache-2.0
|
Jaskaranbir/InstaPost,Jaskaranbir/InstaPost,Jaskaranbir/InstaPost,Jaskaranbir/InstaPost
|
8f5d107169315c5c10e815be58c91b480b16d719
|
Facile.Core/ExecutionResult.cs
|
Facile.Core/ExecutionResult.cs
|
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Facile.Core
{
public class ExecutionResult
{
public bool Success { get; set; }
public IEnumerable<ValidationResult> Errors { get; set; }
}
public class ExecutionResult<T> : ExecutionResult
{
public T Value { get; set; }
}
}
|
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
namespace Facile.Core
{
/// <summary>
/// Defines the result of a command's execution
/// </summary>
public class ExecutionResult
{
public bool Success { get; set; }
public IEnumerable<ValidationResult> Errors { get; set; }
}
/// <summary>
/// Defines the result of a command's execution and returns a value of T
/// </summary>
public class ExecutionResult<T> : ExecutionResult
{
public T Value { get; set; }
}
}
|
Add documentation and remove unused using statements
|
Add documentation and remove unused using statements
|
C#
|
mit
|
peasy/Samples,peasy/Samples,peasy/Samples,ahanusa/facile.net,ahanusa/Peasy.NET,peasy/Peasy.NET
|
dc3c91bde78c04487811fc0baa21007e5572b9f7
|
MbDotNet/Models/Imposters/HttpsImposter.cs
|
MbDotNet/Models/Imposters/HttpsImposter.cs
|
using MbDotNet.Models.Stubs;
using Newtonsoft.Json;
using System.Collections.Generic;
namespace MbDotNet.Models.Imposters
{
public class HttpsImposter : Imposter
{
[JsonProperty("stubs")]
public ICollection<HttpStub> Stubs { get; private set; }
[JsonProperty("key")]
public string Key { get; private set; }
public HttpsImposter(int port, string name) : this(port, name, null)
{
}
public HttpsImposter(int port, string name, string key) : base(port, MbDotNet.Enums.Protocol.Https, name)
{
Key = key;
Stubs = new List<HttpStub>();
}
public HttpStub AddStub()
{
var stub = new HttpStub();
Stubs.Add(stub);
return stub;
}
}
}
|
using MbDotNet.Models.Stubs;
using Newtonsoft.Json;
using System.Collections.Generic;
namespace MbDotNet.Models.Imposters
{
public class HttpsImposter : Imposter
{
[JsonProperty("stubs")]
public ICollection<HttpStub> Stubs { get; private set; }
// TODO Need to not include key in serialization when its null to allow mb to use self-signed certificate.
[JsonProperty("key")]
public string Key { get; private set; }
public HttpsImposter(int port, string name) : this(port, name, null)
{
}
public HttpsImposter(int port, string name, string key) : base(port, MbDotNet.Enums.Protocol.Https, name)
{
Key = key;
Stubs = new List<HttpStub>();
}
public HttpStub AddStub()
{
var stub = new HttpStub();
Stubs.Add(stub);
return stub;
}
}
}
|
Add TODO to handle serialization for null key
|
Add TODO to handle serialization for null key
|
C#
|
mit
|
mattherman/MbDotNet,mattherman/MbDotNet,SuperDrew/MbDotNet
|
91d57852b66d0796f1a3799bcd44af7d7ca63949
|
NowPlayingLib/SonyDatabase/MediaManager.cs
|
NowPlayingLib/SonyDatabase/MediaManager.cs
|
using SonyMediaPlayerXLib;
using SonyVzProperty;
using System;
using System.Data.OleDb;
using System.IO;
using System.Linq;
namespace NowPlayingLib.SonyDatabase
{
/// <summary>
/// x-アプリのデータベースから曲情報を取得します。
/// </summary>
public class MediaManager
{
/// <summary>
/// データベースのパス。
/// </summary>
public static readonly string DatabasePath = @"Sony Corporation\Sony MediaPlayerX\Packages\MtData.mdb";
/// <summary>
/// メディア オブジェクトを指定して曲情報を取得します。
/// </summary>
/// <param name="media">メディア オブジェクト。</param>
/// <returns>データベースから得られた</returns>
public static ObjectTable GetMediaEntry(ISmpxMediaDescriptor2 media)
{
string path = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData), DatabasePath);
using (var connection = new OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + path))
using (var context = new MtDataDataContext(connection))
{
return context.ObjectTable.Where(x => x.SpecId == (int)VzObjectCategoryEnum.vzObjectCategory_Music + 1 &&
x.Album == media.packageTitle &&
x.Artist == media.artist &&
x.Genre == media.genre &&
x.Name == media.title).ToArray().FirstOrDefault();
}
}
}
}
|
using SonyMediaPlayerXLib;
using SonyVzProperty;
using System;
using System.Data.OleDb;
using System.IO;
using System.Linq;
namespace NowPlayingLib.SonyDatabase
{
/// <summary>
/// x-アプリのデータベースから曲情報を取得します。
/// </summary>
public class MediaManager
{
/// <summary>
/// データベースのパス。
/// </summary>
public static readonly string DatabasePath = @"Sony Corporation\Sony MediaPlayerX\Packages\MtData.mdb";
/// <summary>
/// メディア オブジェクトを指定して曲情報を取得します。
/// </summary>
/// <param name="media">メディア オブジェクト。</param>
/// <returns>データベースから得られた</returns>
public static ObjectTable GetMediaEntry(ISmpxMediaDescriptor2 media)
{
string path = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData), DatabasePath);
using (var connection = new OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + path))
using (var context = new MtDataDataContext(connection))
{
// IQueryable.FirstOrDefault では不正な SQL 文が発行される
return context.ObjectTable.Where(x => x.SpecId == (int)VzObjectCategoryEnum.vzObjectCategory_Music + 1 &&
x.Album == media.packageTitle &&
x.Artist == media.artist &&
x.Genre == media.genre &&
x.Name == media.title).AsEnumerable().FirstOrDefault();
}
}
}
}
|
Remove a redundant ToArray call
|
Fix: Remove a redundant ToArray call
|
C#
|
mit
|
chitoku-k/NowPlayingLib
|
815895f2f5b56f836255c930909cd06a68148523
|
test/RestSharp.IntegrationTests/ProxyTests.cs
|
test/RestSharp.IntegrationTests/ProxyTests.cs
|
using System;
using System.Net;
using NUnit.Framework;
using RestSharp.Tests.Shared.Fixtures;
namespace RestSharp.IntegrationTests
{
[TestFixture]
public class ProxyTests
{
class RequestBodyCapturer
{
public const string RESOURCE = "Capture";
}
[Test]
public void Set_Invalid_Proxy_Fails()
{
using var server = HttpServerFixture.StartServer((_, __) => { });
var client = new RestClient(server.Url) {Proxy = new WebProxy("non_existent_proxy", false)};
var request = new RestRequest();
const string contentType = "text/plain";
const string bodyData = "abc123 foo bar baz BING!";
request.AddParameter(contentType, bodyData, ParameterType.RequestBody);
var response = client.Get(request);
Assert.False(response.IsSuccessful);
Assert.IsInstanceOf<WebException>(response.ErrorException);
}
[Test]
public void Set_Invalid_Proxy_Fails_RAW()
{
using var server = HttpServerFixture.StartServer((_, __) => { });
var requestUri = new Uri(new Uri(server.Url), "");
var webRequest = (HttpWebRequest) WebRequest.Create(requestUri);
webRequest.Proxy = new WebProxy("non_existent_proxy", false);
Assert.Throws<WebException>(() => webRequest.GetResponse());
}
}
}
|
using System;
using System.Net;
using NUnit.Framework;
using RestSharp.Tests.Shared.Fixtures;
namespace RestSharp.IntegrationTests
{
[TestFixture]
public class ProxyTests
{
[Test]
public void Set_Invalid_Proxy_Fails()
{
using var server = HttpServerFixture.StartServer((_, __) => { });
var client = new RestClient(server.Url) {Proxy = new WebProxy("non_existent_proxy", false)};
var request = new RestRequest();
var response = client.Get(request);
Assert.False(response.IsSuccessful);
Assert.IsInstanceOf<WebException>(response.ErrorException);
}
[Test]
public void Set_Invalid_Proxy_Fails_RAW()
{
using var server = HttpServerFixture.StartServer((_, __) => { });
var requestUri = new Uri(new Uri(server.Url), "");
var webRequest = (HttpWebRequest) WebRequest.Create(requestUri);
webRequest.Proxy = new WebProxy("non_existent_proxy", false);
Assert.Throws<WebException>(() => webRequest.GetResponse());
}
}
}
|
Fix the proxy test, why the body was even there?
|
Fix the proxy test, why the body was even there?
|
C#
|
apache-2.0
|
PKRoma/RestSharp,restsharp/RestSharp
|
22711e9623eb9e3b367758b3c3e3865962492ad1
|
VstsMetrics/Commands/CycleTime/WorkItemCycleTimeExtensions.cs
|
VstsMetrics/Commands/CycleTime/WorkItemCycleTimeExtensions.cs
|
using System;
using System.Collections.Generic;
using System.Linq;
using MathNet.Numerics.Statistics;
namespace VstsMetrics.Commands.CycleTime
{
public static class WorkItemCycleTimeExtensions
{
public static IEnumerable<WorkItemCycleTimeSummary> Summarise(this IEnumerable<WorkItemCycleTime> cycleTimes)
{
var elapsedAverage = cycleTimes.Average(ct => ct.ElapsedCycleTimeInHours);
var workingAverage = cycleTimes.Average(ct => ct.ApproximateWorkingCycleTimeInHours);
var elapsedMoe = cycleTimes.MarginOfError(ct => ct.ElapsedCycleTimeInHours);
var workingMoe = cycleTimes.MarginOfError(ct => ct.ApproximateWorkingCycleTimeInHours);
return new[] {
new WorkItemCycleTimeSummary("Elapsed", elapsedAverage, elapsedMoe),
new WorkItemCycleTimeSummary("Approximate Working Time", workingAverage, workingMoe)
};
}
private static double MarginOfError(this IEnumerable<WorkItemCycleTime> cycleTimes, Func<WorkItemCycleTime, double> getter)
{
// http://www.dummies.com/education/math/statistics/how-to-calculate-the-margin-of-error-for-a-sample-mean/
return cycleTimes.Select(getter).PopulationStandardDeviation()
/ Math.Sqrt(cycleTimes.Count())
* 1.96;
}
}
}
|
using System;
using System.Collections.Generic;
using System.Linq;
using MathNet.Numerics.Statistics;
namespace VstsMetrics.Commands.CycleTime
{
public static class WorkItemCycleTimeExtensions
{
public static IEnumerable<WorkItemCycleTimeSummary> Summarise(this IEnumerable<WorkItemCycleTime> cycleTimes)
{
var elapsedAverage = cycleTimes.Average(ct => ct.ElapsedCycleTimeInHours);
var workingAverage = cycleTimes.Average(ct => ct.ApproximateWorkingCycleTimeInHours);
var elapsedMoe = cycleTimes.MarginOfError(ct => ct.ElapsedCycleTimeInHours);
var workingMoe = cycleTimes.MarginOfError(ct => ct.ApproximateWorkingCycleTimeInHours);
return new[] {
new WorkItemCycleTimeSummary("Elapsed", elapsedAverage, elapsedMoe),
new WorkItemCycleTimeSummary("Approximate Working Time", workingAverage, workingMoe)
};
}
private static double MarginOfError(this IEnumerable<WorkItemCycleTime> cycleTimes, Func<WorkItemCycleTime, double> getter)
{
// http://www.dummies.com/education/math/statistics/how-to-calculate-the-margin-of-error-for-a-sample-mean/
// If the central limit theorem does not apply, then this will be incorrect. This should be exposed somehow at some point.
return cycleTimes.Select(getter).PopulationStandardDeviation()
/ Math.Sqrt(cycleTimes.Count())
* 1.96;
}
}
}
|
Add a comment about when the MoE calculation will be wrong.
|
Add a comment about when the MoE calculation will be wrong.
|
C#
|
agpl-3.0
|
christopher-bimson/VstsMetrics
|
fabb3acc505014bd521a915a5abd8537d3974995
|
NBitcoin/Secp256k1/Musig/MusigPartialSignature.cs
|
NBitcoin/Secp256k1/Musig/MusigPartialSignature.cs
|
#if HAS_SPAN
#nullable enable
using NBitcoin.Secp256k1.Musig;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.Runtime.CompilerServices;
using System.Text;
namespace NBitcoin.Secp256k1
{
#if SECP256K1_LIB
public
#endif
class MusigPartialSignature
{
#if SECP256K1_LIB
public
#else
internal
#endif
readonly Scalar E;
public MusigPartialSignature(Scalar e)
{
this.E = e;
}
public MusigPartialSignature(ReadOnlySpan<byte> in32)
{
this.E = new Scalar(in32, out var overflow);
if (overflow != 0)
throw new ArgumentOutOfRangeException(nameof(in32), "in32 is overflowing");
}
public void WriteToSpan(Span<byte> in32)
{
E.WriteToSpan(in32);
}
public byte[] ToBytes()
{
byte[] b = new byte[32];
WriteToSpan(b);
return b;
}
}
}
#endif
|
#if HAS_SPAN
#nullable enable
using NBitcoin.Secp256k1.Musig;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.Runtime.CompilerServices;
using System.Text;
namespace NBitcoin.Secp256k1.Musig
{
#if SECP256K1_LIB
public
#endif
class MusigPartialSignature
{
#if SECP256K1_LIB
public
#else
internal
#endif
readonly Scalar E;
public MusigPartialSignature(Scalar e)
{
this.E = e;
}
public MusigPartialSignature(ReadOnlySpan<byte> in32)
{
this.E = new Scalar(in32, out var overflow);
if (overflow != 0)
throw new ArgumentOutOfRangeException(nameof(in32), "in32 is overflowing");
}
public void WriteToSpan(Span<byte> in32)
{
E.WriteToSpan(in32);
}
public byte[] ToBytes()
{
byte[] b = new byte[32];
WriteToSpan(b);
return b;
}
}
}
#endif
|
Move musig class in the musig namespace
|
Move musig class in the musig namespace
|
C#
|
mit
|
MetacoSA/NBitcoin,MetacoSA/NBitcoin
|
7e12c63190c5e6e11846ceec005df7a7084c7406
|
Assets/AdjustImei/Android/AdjustImeiAndroid.cs
|
Assets/AdjustImei/Android/AdjustImeiAndroid.cs
|
using System;
using System.Runtime.InteropServices;
using UnityEngine;
namespace com.adjust.sdk.imei
{
#if UNITY_ANDROID
public class AdjustImeiAndroid
{
private static AndroidJavaClass ajcAdjustImei = new AndroidJavaClass("com.adjust.sdk.imei.AdjustImei");
public static void ReadImei()
{
if (ajcAdjustImei == null)
{
ajcAdjustImei = new AndroidJavaClass("com.adjust.sdk.Adjust");
}
ajcAdjustImei.CallStatic("readImei");
}
public static void DoNotReadImei()
{
if (ajcAdjustImei == null)
{
ajcAdjustImei = new AndroidJavaClass("com.adjust.sdk.Adjust");
}
ajcAdjustImei.CallStatic("doNotReadImei");
}
}
#endif
}
|
using System;
using System.Runtime.InteropServices;
using UnityEngine;
namespace com.adjust.sdk.imei
{
#if UNITY_ANDROID
public class AdjustImeiAndroid
{
private static AndroidJavaClass ajcAdjustImei = new AndroidJavaClass("com.adjust.sdk.imei.AdjustImei");
public static void ReadImei()
{
if (ajcAdjustImei == null)
{
ajcAdjustImei = new AndroidJavaClass("com.adjust.sdk.imei.AdjustImei");
}
ajcAdjustImei.CallStatic("readImei");
}
public static void DoNotReadImei()
{
if (ajcAdjustImei == null)
{
ajcAdjustImei = new AndroidJavaClass("com.adjust.sdk.imei.AdjustImei");
}
ajcAdjustImei.CallStatic("doNotReadImei");
}
}
#endif
}
|
Fix native AdjustImei class path
|
Fix native AdjustImei class path
|
C#
|
mit
|
adjust/unity_sdk,adjust/unity_sdk,adjust/unity_sdk
|
8d5977d158f87068060c684cb9fc0efb52bf22f8
|
StyleCop.Analyzers.Status.Generator/Program.cs
|
StyleCop.Analyzers.Status.Generator/Program.cs
|
namespace StyleCop.Analyzers.Status.Generator
{
using System;
using System.IO;
using LibGit2Sharp;
using Newtonsoft.Json;
/// <summary>
/// The starting point of this application.
/// </summary>
internal class Program
{
/// <summary>
/// The starting point of this application.
/// </summary>
/// <param name="args">The command line parameters.</param>
internal static void Main(string[] args)
{
if (args.Length < 1)
{
Console.WriteLine("Path to sln file required.");
return;
}
SolutionReader reader = SolutionReader.CreateAsync(args[0]).Result;
var diagnostics = reader.GetDiagnosticsAsync().Result;
string commitId;
using (Repository repository = new Repository(Path.GetDirectoryName(args[0])))
{
commitId = repository.Head.Tip.Sha;
}
var output = new
{
diagnostics,
commitId
};
Console.WriteLine(JsonConvert.SerializeObject(output));
}
}
}
|
namespace StyleCop.Analyzers.Status.Generator
{
using System;
using System.IO;
using System.Linq;
using LibGit2Sharp;
using Newtonsoft.Json;
/// <summary>
/// The starting point of this application.
/// </summary>
internal class Program
{
/// <summary>
/// The starting point of this application.
/// </summary>
/// <param name="args">The command line parameters.</param>
internal static void Main(string[] args)
{
if (args.Length < 1)
{
Console.WriteLine("Path to sln file required.");
return;
}
SolutionReader reader = SolutionReader.CreateAsync(args[0]).Result;
var diagnostics = reader.GetDiagnosticsAsync().Result;
Commit commit;
string commitId;
using (Repository repository = new Repository(Path.GetDirectoryName(args[0])))
{
commitId = repository.Head.Tip.Sha;
commit = repository.Head.Tip;
var output = new
{
diagnostics,
git = new
{
commit.Sha,
commit.Message,
commit.Author,
commit.Committer,
Parents = commit.Parents.Select(x => x.Sha)
}
};
Console.WriteLine(JsonConvert.SerializeObject(output));
}
}
}
}
|
Include git information in json file
|
Include git information in json file
|
C#
|
mit
|
pdelvo/StyleCop.Analyzers.Status,sharwell/StyleCop.Analyzers.Status,pdelvo/StyleCop.Analyzers.Status,sharwell/StyleCop.Analyzers.Status,DotNetAnalyzers/StyleCopAnalyzers,sharwell/StyleCop.Analyzers.Status,pdelvo/StyleCop.Analyzers.Status
|
011b14ca5cf162b87fd62ade83706de97b8842ef
|
Properties/AssemblyInfo.cs
|
Properties/AssemblyInfo.cs
|
using System;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
[assembly: AssemblyTitle("Autofac.Integration.Wcf")]
[assembly: AssemblyDescription("Autofac WCF Integration")]
[assembly: InternalsVisibleTo("Autofac.Tests.Integration.Wcf, PublicKey=00240000048000009400000006020000002400005253413100040000010001008728425885ef385e049261b18878327dfaaf0d666dea3bd2b0e4f18b33929ad4e5fbc9087e7eda3c1291d2de579206d9b4292456abffbe8be6c7060b36da0c33b883e3878eaf7c89fddf29e6e27d24588e81e86f3a22dd7b1a296b5f06fbfb500bbd7410faa7213ef4e2ce7622aefc03169b0324bcd30ccfe9ac8204e4960be6")]
[assembly: ComVisible(false)]
|
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
[assembly: AssemblyTitle("Autofac.Integration.Wcf")]
[assembly: InternalsVisibleTo("Autofac.Tests.Integration.Wcf, PublicKey=00240000048000009400000006020000002400005253413100040000010001008728425885ef385e049261b18878327dfaaf0d666dea3bd2b0e4f18b33929ad4e5fbc9087e7eda3c1291d2de579206d9b4292456abffbe8be6c7060b36da0c33b883e3878eaf7c89fddf29e6e27d24588e81e86f3a22dd7b1a296b5f06fbfb500bbd7410faa7213ef4e2ce7622aefc03169b0324bcd30ccfe9ac8204e4960be6")]
[assembly: ComVisible(false)]
|
Build script now writes the package name and version into the AssemblyDescription attibute. This allows the package information to be seen in Visual Studio avoiding confusion with the assembly version that remains at the major.
|
Build script now writes the package name and version into the AssemblyDescription attibute. This allows the package information to be seen in Visual Studio avoiding confusion with the assembly version that remains at the major.
|
C#
|
mit
|
caioproiete/Autofac.Wcf,autofac/Autofac.Wcf
|
4fb93463f5d493c8c5939006ff4763026972c960
|
src/Daterpillar.Core/Compare/ComparisonReport.cs
|
src/Daterpillar.Core/Compare/ComparisonReport.cs
|
using System.Collections.Generic;
namespace Gigobyte.Daterpillar.Compare
{
public class ComparisonReport
{
public Counter Counters;
public Outcome Summary { get; set; }
public IList<Discrepancy> Discrepancies { get; set; }
public struct Counter
{
public int SourceTables;
public int DestTables;
}
}
}
|
using System.Collections;
using System.Collections.Generic;
using System.Runtime.Serialization;
namespace Gigobyte.Daterpillar.Compare
{
[DataContract]
public class ComparisonReport : IEnumerable<Discrepancy>
{
public Counter Counters;
[DataMember]
public Outcome Summary { get; set; }
[DataMember]
public IList<Discrepancy> Discrepancies { get; set; }
public IEnumerator<Discrepancy> GetEnumerator()
{
foreach (var item in Discrepancies) { yield return item; }
}
IEnumerator IEnumerable.GetEnumerator()
{
return GetEnumerator();
}
public struct Counter
{
public int SourceTables;
public int DestTables;
}
}
}
|
Add data contract attributes to ComparisionReport.cs
|
Add data contract attributes to ComparisionReport.cs
|
C#
|
mit
|
Ackara/Daterpillar
|
451207c6a8c522461c8d253fa5a8abc62b8c81ee
|
Phoebe/Bugsnag/Data/Event.cs
|
Phoebe/Bugsnag/Data/Event.cs
|
using System;
using Newtonsoft.Json;
using Toggl.Phoebe.Bugsnag.Json;
using System.Collections.Generic;
namespace Toggl.Phoebe.Bugsnag.Data
{
[JsonObject (MemberSerialization.OptIn)]
public class Event
{
[JsonProperty ("user", DefaultValueHandling = DefaultValueHandling.Ignore)]
public UserInfo User { get; set; }
[JsonProperty ("app")]
public ApplicationInfo App { get; set; }
[JsonProperty ("appState", DefaultValueHandling = DefaultValueHandling.Ignore)]
public ApplicationState AppState { get; set; }
[JsonProperty ("device", DefaultValueHandling = DefaultValueHandling.Ignore)]
public SystemInfo System { get; set; }
[JsonProperty ("deviceState", DefaultValueHandling = DefaultValueHandling.Ignore)]
public SystemState SystemState { get; set; }
[JsonProperty ("context")]
public string Context { get; set; }
[JsonProperty ("severity"), JsonConverter (typeof(ErrorSeverityConverter))]
public ErrorSeverity Severity { get; set; }
[JsonProperty ("exceptions")]
public List<ExceptionInfo> Exceptions { get; set; }
[JsonProperty ("metadata")]
public Metadata Metadata { get; set; }
}
}
|
using System;
using Newtonsoft.Json;
using Toggl.Phoebe.Bugsnag.Json;
using System.Collections.Generic;
namespace Toggl.Phoebe.Bugsnag.Data
{
[JsonObject (MemberSerialization.OptIn)]
public class Event
{
[JsonProperty ("user", DefaultValueHandling = DefaultValueHandling.Ignore)]
public UserInfo User { get; set; }
[JsonProperty ("app")]
public ApplicationInfo App { get; set; }
[JsonProperty ("appState", DefaultValueHandling = DefaultValueHandling.Ignore)]
public ApplicationState AppState { get; set; }
[JsonProperty ("device", DefaultValueHandling = DefaultValueHandling.Ignore)]
public SystemInfo System { get; set; }
[JsonProperty ("deviceState", DefaultValueHandling = DefaultValueHandling.Ignore)]
public SystemState SystemState { get; set; }
[JsonProperty ("context")]
public string Context { get; set; }
[JsonProperty ("severity"), JsonConverter (typeof(ErrorSeverityConverter))]
public ErrorSeverity Severity { get; set; }
[JsonProperty ("exceptions")]
public List<ExceptionInfo> Exceptions { get; set; }
[JsonProperty ("metaData")]
public Metadata Metadata { get; set; }
}
}
|
Fix metaData JSON property name case.
|
Fix metaData JSON property name case.
|
C#
|
bsd-3-clause
|
peeedge/mobile,eatskolnikov/mobile,ZhangLeiCharles/mobile,eatskolnikov/mobile,peeedge/mobile,eatskolnikov/mobile,masterrr/mobile,ZhangLeiCharles/mobile,masterrr/mobile
|
5bd7913cfb6f187ac2df29d3cab7cc178aa245da
|
Currency.cs
|
Currency.cs
|
using System.Runtime.Serialization;
namespace Plexo
{
[DataContract]
public class Currency
{
[DataMember]
public int CurrencyId { get; set; }
[DataMember]
public string Name { get; set; }
[DataMember]
public string Plural { get; set; }
[DataMember]
public string Symbol { get; set; }
//Mercury Id is for internal use, no serialization required
public int MercuryId { get; set; }
}
}
|
using System.Runtime.Serialization;
using Newtonsoft.Json;
namespace Plexo
{
[DataContract]
public class Currency
{
[DataMember]
public int CurrencyId { get; set; }
[DataMember]
public string Name { get; set; }
[DataMember]
public string Plural { get; set; }
[DataMember]
public string Symbol { get; set; }
//Mercury Id is for internal use, no serialization required
[JsonIgnore]
public int MercuryId { get; set; }
}
}
|
Make sure MercuryId do not get serialized.
|
Make sure MercuryId do not get serialized.
|
C#
|
agpl-3.0
|
gOOvaUY/Plexo.Models,gOOvaUY/Goova.Plexo.Models
|
b00a8cb069fc72cb33b6e4ccd42c8bdda9d5cbf7
|
src/GraphQL/Types/IGraphType.cs
|
src/GraphQL/Types/IGraphType.cs
|
namespace GraphQL.Types
{
public interface INamedType
{
string Name { get; set; }
}
public interface IGraphType : IProvideMetadata, INamedType
{
string Description { get; set; }
string DeprecationReason { get; set; }
string CollectTypes(TypeCollectionContext context);
}
public interface IOutputGraphType : IGraphType
{
}
public interface IInputGraphType : IGraphType
{
}
}
|
namespace GraphQL.Types
{
public interface INamedType
{
string Name { get; set; }
}
public interface IGraphType : IProvideMetadata, INamedType
{
string Description { get; set; }
string DeprecationReason { get; set; }
string CollectTypes(TypeCollectionContext context);
}
}
|
Remove input/output interfaces for now
|
Remove input/output interfaces for now
Fixes #335
|
C#
|
mit
|
graphql-dotnet/graphql-dotnet,joemcbride/graphql-dotnet,graphql-dotnet/graphql-dotnet,graphql-dotnet/graphql-dotnet,joemcbride/graphql-dotnet
|
c06e99ef82934f7f07f963ea8b59aa9c36bfffb1
|
resharper/resharper-unity/src/AsmDef/Feature/Services/Daemon/Attributes/AsmDefHighlightingAttributeIds.cs
|
resharper/resharper-unity/src/AsmDef/Feature/Services/Daemon/Attributes/AsmDefHighlightingAttributeIds.cs
|
using JetBrains.TextControl.DocumentMarkup;
namespace JetBrains.ReSharper.Plugins.Unity.AsmDef.Feature.Services.Daemon.Attributes
{
[RegisterHighlighter(GUID_REFERENCE_TOOLTIP, EffectType = EffectType.TEXT)]
public static class AsmDefHighlightingAttributeIds
{
public const string GUID_REFERENCE_TOOLTIP = "ReSharper AsmDef GUID Reference Tooltip";
}
}
|
using JetBrains.TextControl.DocumentMarkup;
namespace JetBrains.ReSharper.Plugins.Unity.AsmDef.Feature.Services.Daemon.Attributes
{
// Rider doesn't support an empty set of attributes (all the implementations of IRiderHighlighterModelCreator
// return null), so we must define something. If we define an EffectType, ReSharper throws if we don't define it
// properly. But this is just a tooltip, and should have EffectType.NONE. So define one dummy attribute, this keeps
// both Rider and ReSharper happy
[RegisterHighlighter(GUID_REFERENCE_TOOLTIP, FontFamily = "Unused")]
public static class AsmDefHighlightingAttributeIds
{
public const string GUID_REFERENCE_TOOLTIP = "ReSharper AsmDef GUID Reference Tooltip";
}
}
|
Fix registration of tooltip only highlighter
|
Fix registration of tooltip only highlighter
Resolves part of RSPL-6988
|
C#
|
apache-2.0
|
JetBrains/resharper-unity,JetBrains/resharper-unity,JetBrains/resharper-unity
|
ece15d692e82d1fb39cbb1dbca4591e14109d006
|
Source/EventFlow/MetadataKeys.cs
|
Source/EventFlow/MetadataKeys.cs
|
// The MIT License (MIT)
//
// Copyright (c) 2015 Rasmus Mikkelsen
// https://github.com/rasmus/EventFlow
//
// 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.
namespace EventFlow
{
public sealed class MetadataKeys
{
public const string EventName = "event_name";
public const string EventVersion = "event_version";
public const string Timestamp = "timestamp";
public const string AggregateSequenceNumber = "global_sequence_number";
}
}
|
// The MIT License (MIT)
//
// Copyright (c) 2015 Rasmus Mikkelsen
// https://github.com/rasmus/EventFlow
//
// 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.
namespace EventFlow
{
public sealed class MetadataKeys
{
public const string EventName = "event_name";
public const string EventVersion = "event_version";
public const string Timestamp = "timestamp";
public const string AggregateSequenceNumber = "aggregate_sequence_number";
}
}
|
Fix metadata key, its the aggregate sequence number not the global one
|
Fix metadata key, its the aggregate sequence number not the global one
|
C#
|
mit
|
liemqv/EventFlow,AntoineGa/EventFlow,rasmus/EventFlow
|
f1aa99e1033c8115259f4b9dcbc7c9ecf49932b0
|
osu.Game.Rulesets.Catch/Edit/Blueprints/CatchSelectionBlueprint.cs
|
osu.Game.Rulesets.Catch/Edit/Blueprints/CatchSelectionBlueprint.cs
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using osu.Framework.Allocation;
using osu.Game.Rulesets.Catch.Objects;
using osu.Game.Rulesets.Edit;
using osu.Game.Rulesets.UI;
using osu.Game.Rulesets.UI.Scrolling;
using osuTK;
namespace osu.Game.Rulesets.Catch.Edit.Blueprints
{
public abstract class CatchSelectionBlueprint<THitObject> : HitObjectSelectionBlueprint<THitObject>
where THitObject : CatchHitObject
{
public override Vector2 ScreenSpaceSelectionPoint
{
get
{
float x = HitObject.OriginalX;
float y = HitObjectContainer.PositionAtTime(HitObject.StartTime);
return HitObjectContainer.ToScreenSpace(new Vector2(x, y + HitObjectContainer.DrawHeight));
}
}
public override bool ReceivePositionalInputAt(Vector2 screenSpacePos) => SelectionQuad.Contains(screenSpacePos);
protected ScrollingHitObjectContainer HitObjectContainer => (ScrollingHitObjectContainer)playfield.HitObjectContainer;
[Resolved]
private Playfield playfield { get; set; }
protected CatchSelectionBlueprint(THitObject hitObject)
: base(hitObject)
{
}
}
}
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using osu.Framework.Allocation;
using osu.Game.Rulesets.Catch.Objects;
using osu.Game.Rulesets.Edit;
using osu.Game.Rulesets.UI;
using osu.Game.Rulesets.UI.Scrolling;
using osuTK;
namespace osu.Game.Rulesets.Catch.Edit.Blueprints
{
public abstract class CatchSelectionBlueprint<THitObject> : HitObjectSelectionBlueprint<THitObject>
where THitObject : CatchHitObject
{
protected override bool AlwaysShowWhenSelected => true;
public override Vector2 ScreenSpaceSelectionPoint
{
get
{
float x = HitObject.OriginalX;
float y = HitObjectContainer.PositionAtTime(HitObject.StartTime);
return HitObjectContainer.ToScreenSpace(new Vector2(x, y + HitObjectContainer.DrawHeight));
}
}
public override bool ReceivePositionalInputAt(Vector2 screenSpacePos) => SelectionQuad.Contains(screenSpacePos);
protected ScrollingHitObjectContainer HitObjectContainer => (ScrollingHitObjectContainer)playfield.HitObjectContainer;
[Resolved]
private Playfield playfield { get; set; }
protected CatchSelectionBlueprint(THitObject hitObject)
: base(hitObject)
{
}
}
}
|
Fix catch selection blueprint not displayed after copy-pasted
|
Fix catch selection blueprint not displayed after copy-pasted
|
C#
|
mit
|
peppy/osu,UselessToucan/osu,peppy/osu-new,NeoAdonis/osu,smoogipoo/osu,NeoAdonis/osu,ppy/osu,smoogipoo/osu,UselessToucan/osu,peppy/osu,UselessToucan/osu,smoogipooo/osu,smoogipoo/osu,NeoAdonis/osu,ppy/osu,peppy/osu,ppy/osu
|
d25792a686ffe626744872f4149a6d621ecdd71c
|
Cake.Xamarin.Build/Models/BuildPlatforms.cs
|
Cake.Xamarin.Build/Models/BuildPlatforms.cs
|
using System;
namespace Cake.Xamarin.Build
{
[Flags]
public enum BuildPlatforms
{
Mac = 0,
Windows = 1,
Linux = 2
}
}
|
using System;
namespace Cake.Xamarin.Build
{
[Flags]
public enum BuildPlatforms
{
Mac = 1,
Windows = 2,
Linux = 4
}
}
|
Fix flags (Mac shouldn't be 0 based)
|
Fix flags (Mac shouldn't be 0 based)
|
C#
|
mit
|
Redth/Cake.Xamarin.Build
|
e21ceb420a439708085e8280d4b59b7c4dea4037
|
Kudu.Services/HttpRequestExtensions.cs
|
Kudu.Services/HttpRequestExtensions.cs
|
using System.IO;
using System.IO.Compression;
using System.Web;
namespace Kudu.Services
{
public static class HttpRequestExtensions
{
public static Stream GetInputStream(this HttpRequestBase request)
{
var contentEncoding = request.Headers["Content-Encoding"];
if (contentEncoding != null && contentEncoding.Contains("gzip"))
{
return new GZipStream(request.InputStream, CompressionMode.Decompress);
}
return request.InputStream;
}
}
}
|
using System.IO;
using System.IO.Compression;
using System.Web;
namespace Kudu.Services
{
public static class HttpRequestExtensions
{
public static Stream GetInputStream(this HttpRequestBase request)
{
var contentEncoding = request.Headers["Content-Encoding"];
if (contentEncoding != null && contentEncoding.Contains("gzip"))
{
return new GZipStream(request.GetBufferlessInputStream(), CompressionMode.Decompress);
}
return request.GetBufferlessInputStream();
}
}
}
|
Use bufferless stream to improve perf and resource usage
|
Use bufferless stream to improve perf and resource usage
Fixes #518
|
C#
|
apache-2.0
|
projectkudu/kudu,shrimpy/kudu,MavenRain/kudu,kenegozi/kudu,kenegozi/kudu,shanselman/kudu,puneet-gupta/kudu,badescuga/kudu,MavenRain/kudu,YOTOV-LIMITED/kudu,sitereactor/kudu,chrisrpatterson/kudu,projectkudu/kudu,shanselman/kudu,sitereactor/kudu,badescuga/kudu,kenegozi/kudu,mauricionr/kudu,puneet-gupta/kudu,uQr/kudu,juvchan/kudu,dev-enthusiast/kudu,barnyp/kudu,juoni/kudu,oliver-feng/kudu,sitereactor/kudu,bbauya/kudu,barnyp/kudu,sitereactor/kudu,shibayan/kudu,dev-enthusiast/kudu,duncansmart/kudu,mauricionr/kudu,chrisrpatterson/kudu,badescuga/kudu,badescuga/kudu,shibayan/kudu,projectkudu/kudu,WeAreMammoth/kudu-obsolete,mauricionr/kudu,badescuga/kudu,mauricionr/kudu,puneet-gupta/kudu,EricSten-MSFT/kudu,duncansmart/kudu,YOTOV-LIMITED/kudu,barnyp/kudu,sitereactor/kudu,juvchan/kudu,juvchan/kudu,oliver-feng/kudu,bbauya/kudu,EricSten-MSFT/kudu,shanselman/kudu,EricSten-MSFT/kudu,kali786516/kudu,kenegozi/kudu,duncansmart/kudu,puneet-gupta/kudu,juoni/kudu,chrisrpatterson/kudu,projectkudu/kudu,juvchan/kudu,MavenRain/kudu,oliver-feng/kudu,projectkudu/kudu,bbauya/kudu,puneet-gupta/kudu,juvchan/kudu,shibayan/kudu,kali786516/kudu,YOTOV-LIMITED/kudu,shrimpy/kudu,kali786516/kudu,barnyp/kudu,oliver-feng/kudu,uQr/kudu,shrimpy/kudu,shibayan/kudu,dev-enthusiast/kudu,juoni/kudu,chrisrpatterson/kudu,MavenRain/kudu,shrimpy/kudu,bbauya/kudu,uQr/kudu,WeAreMammoth/kudu-obsolete,dev-enthusiast/kudu,YOTOV-LIMITED/kudu,kali786516/kudu,EricSten-MSFT/kudu,WeAreMammoth/kudu-obsolete,duncansmart/kudu,EricSten-MSFT/kudu,shibayan/kudu,uQr/kudu,juoni/kudu
|
209176fd0b3bea645e9cd04c607edb9da628416a
|
test/websites/Glimpse.FunctionalTest.Website/Startup.cs
|
test/websites/Glimpse.FunctionalTest.Website/Startup.cs
|
using System.Diagnostics.Tracing;
using Glimpse.Agent.AspNet.Mvc;
using Glimpse.Agent.Web;
using Glimpse.Server.Web;
using Microsoft.AspNet.Builder;
using Microsoft.Framework.DependencyInjection;
namespace Glimpse.FunctionalTest.Website
{
public class Startup
{
public void ConfigureServices(IServiceCollection services)
{
services
.AddGlimpse()
.RunningAgentWeb()
.RunningServerWeb()
.WithLocalAgent();
services.AddMvc();
services.AddTransient<MvcTelemetryListener>();
}
public void Configure(IApplicationBuilder app)
{
var telemetryListener = app.ApplicationServices.GetRequiredService<TelemetryListener>();
telemetryListener.SubscribeWithAdapter(app.ApplicationServices.GetRequiredService<MvcTelemetryListener>());
app.UseGlimpseServer();
app.UseGlimpseAgent();
app.UseMvcWithDefaultRoute();
}
}
}
|
using System.Diagnostics.Tracing;
using Glimpse.Agent.AspNet.Mvc;
using Glimpse.Agent.Web;
using Glimpse.Server.Web;
using Microsoft.AspNet.Builder;
using Microsoft.Framework.DependencyInjection;
namespace Glimpse.FunctionalTest.Website
{
public class Startup
{
public void ConfigureServices(IServiceCollection services)
{
services
.AddGlimpse()
.RunningAgentWeb()
.RunningServerWeb()
.WithLocalAgent();
services.AddMvc();
}
public void Configure(IApplicationBuilder app)
{
app.UseGlimpseServer();
app.UseGlimpseAgent();
app.UseMvcWithDefaultRoute();
}
}
}
|
Remove need for function test to register telemetry source
|
Remove need for function test to register telemetry source
|
C#
|
mit
|
mike-kaufman/Glimpse.Prototype,zanetdev/Glimpse.Prototype,mike-kaufman/Glimpse.Prototype,mike-kaufman/Glimpse.Prototype,zanetdev/Glimpse.Prototype,peterblazejewicz/Glimpse.Prototype,peterblazejewicz/Glimpse.Prototype,peterblazejewicz/Glimpse.Prototype,Glimpse/Glimpse.Prototype,zanetdev/Glimpse.Prototype,peterblazejewicz/Glimpse.Prototype,zanetdev/Glimpse.Prototype,Glimpse/Glimpse.Prototype,mike-kaufman/Glimpse.Prototype,Glimpse/Glimpse.Prototype,Glimpse/Glimpse.Prototype,peterblazejewicz/Glimpse.Prototype,mike-kaufman/Glimpse.Prototype
|
94d21c95c6c39e2cf4af356b65eba745864455d3
|
tools/Crest.OpenApi/Properties/AssemblyInfo.cs
|
tools/Crest.OpenApi/Properties/AssemblyInfo.cs
|
// Copyright (c) Samuel Cragg.
//
// Licensed under the MIT license. See LICENSE file in the project root for
// full license information.
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Samuel Cragg")]
[assembly: AssemblyProduct("Crest.OpenApi")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: InternalsVisibleTo("OpenApi.UnitTests")]
|
// Copyright (c) Samuel Cragg.
//
// Licensed under the MIT license. See LICENSE file in the project root for
// full license information.
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Samuel Cragg")]
[assembly: AssemblyProduct("Crest.OpenApi")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: InternalsVisibleTo("DynamicProxyGenAssembly2")] // NSubstitute
[assembly: InternalsVisibleTo("OpenApi.UnitTests")]
|
Allow substituting of internal types.
|
Allow substituting of internal types.
|
C#
|
mit
|
samcragg/Crest,samcragg/Crest,samcragg/Crest
|
edcf9f9a321cc865b2c680f1439197cf2e217a37
|
SoundWaves/Assets/DestroyEnemy.cs
|
SoundWaves/Assets/DestroyEnemy.cs
|
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
public class DestroyEnemy : MonoBehaviour {
public static int kills = 0;
void OnCollisionEnter (Collision col) {
if(col.gameObject.name.Contains("Monster")) {
kills += 1;
Destroy(col.gameObject);
if (kills >= 5) {
SceneManager.LoadScene ("GameWin", LoadSceneMode.Single);
}
}
}
}
|
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
public class DestroyEnemy : MonoBehaviour {
public static int kills = 0;
void OnCollisionEnter (Collision col) {
if(col.gameObject.name.Contains("Monster")) {
kills += 1;
Destroy(col.gameObject);
if (kills >= 5) {
kills = 0;
SceneManager.LoadScene ("GameWin", LoadSceneMode.Single);
}
}
}
}
|
Reset the counter for the next playthrough - BH
|
Reset the counter for the next playthrough - BH
|
C#
|
mit
|
Tolk-Haggard/GlobalGameJam2017
|
c509ad77ffc67b3a4cc5e7374206e1279bcfaae8
|
src/MR.Augmenter/AugmenterServiceCollectionExtensions.cs
|
src/MR.Augmenter/AugmenterServiceCollectionExtensions.cs
|
using System;
using Microsoft.Extensions.DependencyInjection;
using MR.Augmenter.Internal;
namespace MR.Augmenter
{
public static class AugmenterServiceCollectionExtensions
{
public static IAugmenterBuilder AddAugmenter(
this IServiceCollection services,
Action<AugmenterConfiguration> configure)
{
services.AddScoped<IAugmenter, Augmenter>();
var configuration = new AugmenterConfiguration();
configure(configuration);
configuration.Build();
services.AddSingleton(configuration);
return new AugmenterBuilder(services);
}
}
}
|
using System;
using Microsoft.Extensions.DependencyInjection;
using MR.Augmenter.Internal;
namespace MR.Augmenter
{
public static class AugmenterServiceCollectionExtensions
{
/// <summary>
/// Adds augmenter to services.
/// </summary>
/// <param name="services"></param>
/// <param name="configure">Can be null.</param>
public static IAugmenterBuilder AddAugmenter(
this IServiceCollection services,
Action<AugmenterConfiguration> configure)
{
services.AddScoped<IAugmenter, Augmenter>();
var configuration = new AugmenterConfiguration();
configure?.Invoke(configuration);
configuration.Build();
services.AddSingleton(configuration);
return new AugmenterBuilder(services);
}
}
}
|
Allow configure to be null
|
Allow configure to be null
|
C#
|
mit
|
mrahhal/MR.Augmenter,mrahhal/MR.Augmenter
|
e70266fa8e3588841ffb293cea786b637e6b1627
|
AudioSharp.Config/ConfigHandler.cs
|
AudioSharp.Config/ConfigHandler.cs
|
using System;
using System.Collections.Generic;
using System.IO;
using System.Windows.Input;
using AudioSharp.Utils;
namespace AudioSharp.Config
{
public class ConfigHandler
{
public static void SaveConfig(Configuration config)
{
string json = JsonUtils.SerializeObject(config);
File.WriteAllText(Path.Combine(FileUtils.AppDataFolder, "settings.json"), json);
}
public static Configuration ReadConfig()
{
string path = Path.Combine(FileUtils.AppDataFolder, "settings.json");
if (File.Exists(path))
{
string json = File.ReadAllText(path);
Configuration config = JsonUtils.DeserializeObject<Configuration>(json);
if (config.MP3EncodingPreset == 0)
config.MP3EncodingPreset = 1001;
return config;
}
return new Configuration()
{
RecordingsFolder = Environment.GetFolderPath(Environment.SpecialFolder.MyMusic),
RecordingPrefix = "Recording{n}",
NextRecordingNumber = 1,
AutoIncrementRecordingNumber = true,
OutputFormat = "wav",
ShowTrayIcon = true,
GlobalHotkeys = new Dictionary<HotkeyType, Tuple<Key, ModifierKeys>>(),
RecordingSettingsPanelVisible = true,
RecordingOutputPanelVisible = true,
CheckForUpdates = true
};
}
}
}
|
using System;
using System.Collections.Generic;
using System.IO;
using System.Windows.Input;
using AudioSharp.Utils;
namespace AudioSharp.Config
{
public class ConfigHandler
{
public static void SaveConfig(Configuration config)
{
string json = JsonUtils.SerializeObject(config);
File.WriteAllText(Path.Combine(FileUtils.AppDataFolder, "settings.json"), json);
}
public static Configuration ReadConfig()
{
string path = Path.Combine(FileUtils.AppDataFolder, "settings.json");
if (File.Exists(path))
{
string json = File.ReadAllText(path);
Configuration config = JsonUtils.DeserializeObject<Configuration>(json);
if (config.MP3EncodingPreset == 0)
config.MP3EncodingPreset = 1001;
return config;
}
return new Configuration()
{
RecordingsFolder = Environment.GetFolderPath(Environment.SpecialFolder.MyMusic),
RecordingPrefix = "Recording{n}",
NextRecordingNumber = 1,
AutoIncrementRecordingNumber = true,
OutputFormat = "wav",
ShowTrayIcon = true,
GlobalHotkeys = new Dictionary<HotkeyType, Tuple<Key, ModifierKeys>>(),
RecordingSettingsPanelVisible = true,
RecordingOutputPanelVisible = true,
CheckForUpdates = true,
MP3EncodingPreset = 1001
};
}
}
}
|
Set a default value for MP3 recording preset for new config files
|
Set a default value for MP3 recording preset for new config files
|
C#
|
mit
|
Heufneutje/HeufyAudioRecorder,Heufneutje/AudioSharp
|
bc73b7af84c1f134ffff05a80cb7a36ce18ad03b
|
ExtjsWd/Properties/AssemblyInfo.cs
|
ExtjsWd/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("ExtjsWd")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Microsoft")]
[assembly: AssemblyProduct("ExtjsWd")]
[assembly: AssemblyCopyright("Copyright © Microsoft 2015")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("efc31b18-7c2f-44f2-a1f3-4c49b28f409c")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
|
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("ExtjsWd")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Microsoft")]
[assembly: AssemblyProduct("ExtjsWd")]
[assembly: AssemblyCopyright("Copyright © Microsoft 2015")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("efc31b18-7c2f-44f2-a1f3-4c49b28f409c")]
// 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.2")]
[assembly: AssemblyFileVersion("1.0.0.2")]
|
Update assembly and file version
|
Update assembly and file version
|
C#
|
mit
|
pratoservices/extjswebdriver,pratoservices/extjswebdriver,pratoservices/extjswebdriver
|
541b2a595afdc1f6ad5785c2aedba661121b94c7
|
BobTheBuilder/Activation/InstanceCreator.cs
|
BobTheBuilder/Activation/InstanceCreator.cs
|
using System.Linq;
using BobTheBuilder.ArgumentStore.Queries;
using JetBrains.Annotations;
namespace BobTheBuilder.Activation
{
internal class InstanceCreator
{
private readonly IArgumentStoreQuery constructorArgumentsQuery;
public InstanceCreator([NotNull]IArgumentStoreQuery constructorArgumentsQuery)
{
this.constructorArgumentsQuery = constructorArgumentsQuery;
}
public T CreateInstanceOf<T>() where T: class
{
var instanceType = typeof(T);
var constructor = instanceType.GetConstructors().Single();
var constructorArguments = constructorArgumentsQuery.Execute(instanceType);
return (T)constructor.Invoke(constructorArguments.Select(arg => arg.Value).ToArray());
}
}
}
|
using System.Linq;
using BobTheBuilder.ArgumentStore.Queries;
using JetBrains.Annotations;
namespace BobTheBuilder.Activation
{
internal class InstanceCreator
{
private readonly IArgumentStoreQuery constructorArgumentsQuery;
public InstanceCreator([NotNull]IArgumentStoreQuery constructorArgumentsQuery)
{
this.constructorArgumentsQuery = constructorArgumentsQuery;
}
public T CreateInstanceOf<T>() where T: class
{
var instanceType = typeof(T);
var constructor = instanceType.GetConstructors().Single();
var constructorArguments = constructorArgumentsQuery.Execute(instanceType);
return constructor.Invoke(constructorArguments.Select(arg => arg.Value).ToArray()) as T;
}
}
}
|
Use safe cast for readability
|
Use safe cast for readability
|
C#
|
apache-2.0
|
alastairs/BobTheBuilder
|
db58302feb76e087d4d396aa7c7e7c21c2938b0b
|
TeacherPouch.Web/Controllers/PagesController.cs
|
TeacherPouch.Web/Controllers/PagesController.cs
|
using System;
using System.Web.Mvc;
using TeacherPouch.Models;
using TeacherPouch.Web.ViewModels;
namespace TeacherPouch.Web.Controllers
{
public partial class PagesController : ControllerBase
{
// GET: /
public virtual ViewResult Home()
{
return View(Views.Home);
}
public virtual ViewResult About()
{
return View(Views.About);
}
// GET: /Contact
public virtual ViewResult Contact()
{
var viewModel = new ContactViewModel();
return View(Views.Contact, viewModel);
}
// POST: /Contact
[HttpPost]
[ValidateAntiForgeryToken]
public virtual ActionResult Contact(ContactSubmission submision)
{
if (submision.IsValid)
{
if (!base.Request.IsLocal)
{
submision.SendEmail();
}
}
else
{
var viewModel = new ContactViewModel();
viewModel.ErrorMessage = "You must fill out the form before submitting.";
return View(Views.Contact, viewModel);
}
return RedirectToAction(Actions.ContactThanks());
}
// GET: /Contact/Thanks
public virtual ViewResult ContactThanks()
{
return View(Views.ContactThanks);
}
// GET: /Copyright
public virtual ViewResult Copyright()
{
return View(Views.Copyright);
}
}
}
|
using System;
using System.Web.Mvc;
using TeacherPouch.Models;
using TeacherPouch.Web.ViewModels;
namespace TeacherPouch.Web.Controllers
{
public partial class PagesController : ControllerBase
{
// GET: /
public virtual ViewResult Home()
{
return View(Views.Home);
}
public virtual ViewResult About()
{
return View(Views.About);
}
// GET: /Contact
public virtual ViewResult Contact()
{
var viewModel = new ContactViewModel();
return View(Views.Contact, viewModel);
}
// POST: /Contact
[HttpPost]
[ValidateAntiForgeryToken]
public virtual ActionResult Contact(ContactSubmission submision)
{
if (submision.IsValid)
{
if (!base.Request.IsLocal)
{
submision.SendEmail();
}
}
else
{
var viewModel = new ContactViewModel();
viewModel.ErrorMessage = "You must fill out the form before submitting.";
return View(Views.Contact, viewModel);
}
return RedirectToAction(Actions.ContactThanks());
}
// GET: /Contact/Thanks
public virtual ViewResult ContactThanks()
{
return View(Views.ContactThanks);
}
// GET: /License
public virtual ViewResult License()
{
return View(Views.License);
}
}
}
|
Change Copyright page to License page.
|
Change Copyright page to License page.
|
C#
|
mit
|
dsteinweg/TeacherPouch,dsteinweg/TeacherPouch,dsteinweg/TeacherPouch,dsteinweg/TeacherPouch
|
5d0edd323ef1e263b42eb6ea942d7ee4802d07d8
|
Engine/Extensions.cs
|
Engine/Extensions.cs
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Management.Automation.Language;
namespace Microsoft.Windows.PowerShell.ScriptAnalyzer.Extensions
{
// TODO Add documentation
public static class Extensions
{
public static IEnumerable<string> GetLines(this string text)
{
return text.Split('\n').Select(line => line.TrimEnd('\r'));
}
public static IScriptExtent Translate(this IScriptExtent extent, int lineDelta, int columnDelta)
{
var newStartLineNumber = extent.StartLineNumber + lineDelta;
if (newStartLineNumber < 1)
{
throw new ArgumentException(
"Invalid line delta. Resulting start line number must be greather than 1.");
}
var newStartColumnNumber = extent.StartColumnNumber + columnDelta;
var newEndColumnNumber = extent.EndColumnNumber + columnDelta;
if (newStartColumnNumber < 1 || newEndColumnNumber < 1)
{
throw new ArgumentException(@"Invalid column delta.
Resulting start column and end column number must be greather than 1.");
}
return new ScriptExtent(
new ScriptPosition(
extent.File,
newStartLineNumber,
newStartColumnNumber,
extent.StartScriptPosition.Line),
new ScriptPosition(
extent.File,
extent.EndLineNumber + lineDelta,
newEndColumnNumber,
extent.EndScriptPosition.Line));
}
/// <summary>
/// Converts IScriptExtent to Range
/// </summary>
public static Range ToRange(this IScriptExtent extent)
{
return new Range(
extent.StartLineNumber,
extent.StartColumnNumber,
extent.EndLineNumber,
extent.EndColumnNumber);
}
}
}
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Management.Automation.Language;
namespace Microsoft.Windows.PowerShell.ScriptAnalyzer.Extensions
{
// TODO Add documentation
public static class Extensions
{
public static IEnumerable<string> GetLines(this string text)
{
return text.Split('\n').Select(line => line.TrimEnd('\r'));
}
/// <summary>
/// Converts IScriptExtent to Range
/// </summary>
public static Range ToRange(this IScriptExtent extent)
{
return new Range(
extent.StartLineNumber,
extent.StartColumnNumber,
extent.EndLineNumber,
extent.EndColumnNumber);
}
}
}
|
Remove IScriptExtent.Translate method from extensions
|
Remove IScriptExtent.Translate method from extensions
|
C#
|
mit
|
daviwil/PSScriptAnalyzer,dlwyatt/PSScriptAnalyzer,PowerShell/PSScriptAnalyzer
|
74ae4c8de73b498d6c7aa434c848dc69355dad58
|
src/GitHub.VisualStudio/UI/Views/PullRequestCreationView.xaml.cs
|
src/GitHub.VisualStudio/UI/Views/PullRequestCreationView.xaml.cs
|
using GitHub.Exports;
using GitHub.UI;
using GitHub.ViewModels;
using System.ComponentModel.Composition;
using System.Windows.Controls;
using ReactiveUI;
namespace GitHub.VisualStudio.UI.Views
{
public class GenericPullRequestCreationView : SimpleViewUserControl<IPullRequestCreationViewModel, GenericPullRequestCreationView>
{ }
[ExportView(ViewType = UIViewType.PRCreation)]
[PartCreationPolicy(CreationPolicy.NonShared)]
public partial class PullRequestCreationView : GenericPullRequestCreationView
{
public PullRequestCreationView()
{
InitializeComponent();
// DataContextChanged += (s, e) => ViewModel = e.NewValue as IPullRequestCreationViewModel;
DataContextChanged += (s, e) => ViewModel = new GitHub.SampleData.PullRequestCreationViewModelDesigner() as IPullRequestCreationViewModel;
this.WhenActivated(d =>
{
});
}
}
}
|
using GitHub.Exports;
using GitHub.UI;
using GitHub.ViewModels;
using System.ComponentModel.Composition;
using System.Windows.Controls;
using ReactiveUI;
namespace GitHub.VisualStudio.UI.Views
{
public class GenericPullRequestCreationView : SimpleViewUserControl<IPullRequestCreationViewModel, GenericPullRequestCreationView>
{ }
[ExportView(ViewType = UIViewType.PRCreation)]
[PartCreationPolicy(CreationPolicy.NonShared)]
public partial class PullRequestCreationView : GenericPullRequestCreationView
{
public PullRequestCreationView()
{
InitializeComponent();
DataContextChanged += (s, e) => ViewModel = e.NewValue as IPullRequestCreationViewModel;
this.WhenActivated(d =>
{
});
}
}
}
|
Revert "Try to use SampleData instead of real data in the meantime"
|
Revert "Try to use SampleData instead of real data in the meantime"
This reverts commit 2b0105a4c5761ac030bfc31ed7aebcfb4e8d3253.
|
C#
|
mit
|
github/VisualStudio,github/VisualStudio,github/VisualStudio
|
d829ede2241e1dc53d80ddb6be298a0f6e411843
|
WebDriverManager/DriverConfigs/Impl/OperaConfig.cs
|
WebDriverManager/DriverConfigs/Impl/OperaConfig.cs
|
using System.Linq;
using System.Net;
using AngleSharp;
using AngleSharp.Parser.Html;
namespace WebDriverManager.DriverConfigs.Impl
{
public class OperaConfig : IDriverConfig
{
public virtual string GetName()
{
return "Opera";
}
public virtual string GetUrl32()
{
return "https://github.com/operasoftware/operachromiumdriver/releases/download/v.<version>/operadriver_win32.zip";
}
public virtual string GetUrl64()
{
return "https://github.com/operasoftware/operachromiumdriver/releases/download/v.<version>/operadriver_win64.zip";
}
public virtual string GetBinaryName()
{
return "operadriver.exe";
}
public virtual string GetLatestVersion()
{
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
using (var client = new WebClient())
{
var htmlCode = client.DownloadString("https://github.com/operasoftware/operachromiumdriver/releases");
var parser = new HtmlParser(Configuration.Default.WithDefaultLoader());
var document = parser.Parse(htmlCode);
var version = document.QuerySelectorAll("[class~='release-title'] a")
.Select(element => element.TextContent)
.FirstOrDefault();
return version;
}
}
}
}
|
using System.Linq;
using System.Net;
using AngleSharp;
using AngleSharp.Parser.Html;
namespace WebDriverManager.DriverConfigs.Impl
{
public class OperaConfig : IDriverConfig
{
public virtual string GetName()
{
return "Opera";
}
public virtual string GetUrl32()
{
return "https://github.com/operasoftware/operachromiumdriver/releases/download/v.<version>/operadriver_win32.zip";
}
public virtual string GetUrl64()
{
return "https://github.com/operasoftware/operachromiumdriver/releases/download/v.<version>/operadriver_win64.zip";
}
public virtual string GetBinaryName()
{
return "operadriver.exe";
}
public virtual string GetLatestVersion()
{
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
using (var client = new WebClient())
{
var htmlCode = client.DownloadString("https://github.com/operasoftware/operachromiumdriver/releases");
var parser = new HtmlParser(Configuration.Default.WithDefaultLoader());
var document = parser.Parse(htmlCode);
var version = document.QuerySelectorAll(".release-title > a")
.Select(element => element.TextContent)
.FirstOrDefault();
return version;
}
}
}
}
|
Simplify release title with version selector
|
Simplify release title with version selector
|
C#
|
mit
|
rosolko/WebDriverManager.Net
|
35ae4e07c8dc9821e14b9fe278f99967a3552569
|
Source/Lib/TraktApiSharp/Objects/Get/Shows/Seasons/TraktSeasonIds.cs
|
Source/Lib/TraktApiSharp/Objects/Get/Shows/Seasons/TraktSeasonIds.cs
|
namespace TraktApiSharp.Objects.Get.Shows.Seasons
{
using Newtonsoft.Json;
/// <summary>A collection of ids for various web services, including the Trakt id, for a Trakt season.</summary>
public class TraktSeasonIds
{
/// <summary>Gets or sets the Trakt numeric id.</summary>
[JsonProperty(PropertyName = "trakt")]
public int Trakt { get; set; }
/// <summary>Gets or sets the numeric id from thetvdb.com</summary>
[JsonProperty(PropertyName = "tvdb")]
public int? Tvdb { get; set; }
/// <summary>Gets or sets the numeric id from themoviedb.org</summary>
[JsonProperty(PropertyName = "tmdb")]
public int? Tmdb { get; set; }
/// <summary>Gets or sets the numeric id from tvrage.com</summary>
[JsonProperty(PropertyName = "tvrage")]
public int? TvRage { get; set; }
/// <summary>Returns, whether any id has been set.</summary>
[JsonIgnore]
public bool HasAnyId => Trakt > 0 || Tvdb > 0 || Tvdb > 0 || TvRage > 0;
}
}
|
namespace TraktApiSharp.Objects.Get.Shows.Seasons
{
using Newtonsoft.Json;
/// <summary>A collection of ids for various web services, including the Trakt id, for a Trakt season.</summary>
public class TraktSeasonIds
{
/// <summary>Gets or sets the Trakt numeric id.</summary>
[JsonProperty(PropertyName = "trakt")]
public int Trakt { get; set; }
/// <summary>Gets or sets the numeric id from thetvdb.com</summary>
[JsonProperty(PropertyName = "tvdb")]
public int? Tvdb { get; set; }
/// <summary>Gets or sets the numeric id from themoviedb.org</summary>
[JsonProperty(PropertyName = "tmdb")]
public int? Tmdb { get; set; }
/// <summary>Gets or sets the numeric id from tvrage.com</summary>
[JsonProperty(PropertyName = "tvrage")]
public int? TvRage { get; set; }
/// <summary>Returns, whether any id has been set.</summary>
[JsonIgnore]
public bool HasAnyId => Trakt > 0 || Tvdb > 0 || Tvdb > 0 || TvRage > 0;
/// <summary>Gets the most reliable id from those that have been set.</summary>
/// <returns>The id as a string or an empty string, if no id is set.</returns>
public string GetBestId()
{
if (Trakt > 0)
return Trakt.ToString();
if (Tvdb.HasValue && Tvdb.Value > 0)
return Tvdb.Value.ToString();
if (Tmdb.HasValue && Tmdb.Value > 0)
return Tmdb.Value.ToString();
if (TvRage.HasValue && TvRage.Value > 0)
return TvRage.Value.ToString();
return string.Empty;
}
}
}
|
Add get best id method for season ids.
|
Add get best id method for season ids.
|
C#
|
mit
|
henrikfroehling/TraktApiSharp
|
8c26f6b167776d9fc790e55daf2dd02dfbaf839d
|
Mindscape.Raygun4Net.Mvc/RaygunExceptionFilterAttacher.cs
|
Mindscape.Raygun4Net.Mvc/RaygunExceptionFilterAttacher.cs
|
using System;
using System.Linq;
using System.Web;
using System.Web.Mvc;
namespace Mindscape.Raygun4Net
{
public static class RaygunExceptionFilterAttacher
{
public static void AttachExceptionFilter(HttpApplication context, RaygunHttpModule module)
{
if (GlobalFilters.Filters.Count == 0) return;
Filter filter = GlobalFilters.Filters.FirstOrDefault(f => f.Instance.GetType().FullName.Equals("System.Web.Mvc.HandleErrorAttribute"));
if (filter != null)
{
GlobalFilters.Filters.Add(new RaygunExceptionFilterAttribute(context, module));
}
}
}
}
|
using System.Linq;
using System.Web;
using System.Web.Mvc;
namespace Mindscape.Raygun4Net
{
public static class RaygunExceptionFilterAttacher
{
public static void AttachExceptionFilter(HttpApplication context, RaygunHttpModule module)
{
if (GlobalFilters.Filters.Count == 0) return;
Filter filter = GlobalFilters.Filters.FirstOrDefault(f => f.Instance.GetType().FullName.Equals("System.Web.Mvc.HandleErrorAttribute"));
if (filter != null)
{
if (GlobalFilters.Filters.Any(f => f.Instance.GetType() == typeof(RaygunExceptionFilterAttribute))) return;
GlobalFilters.Filters.Add(new RaygunExceptionFilterAttribute(context, module));
}
}
}
}
|
Make sure the RaygunExceptionFilterAttribute hasn't already been added before we add it to the GlobalFilters list
|
Make sure the RaygunExceptionFilterAttribute hasn't already been added
before we add it to the GlobalFilters list
|
C#
|
mit
|
articulate/raygun4net,MindscapeHQ/raygun4net,articulate/raygun4net,nelsonsar/raygun4net,ddunkin/raygun4net,tdiehl/raygun4net,ddunkin/raygun4net,MindscapeHQ/raygun4net,nelsonsar/raygun4net,MindscapeHQ/raygun4net,tdiehl/raygun4net
|
342ac2a8303d5e1a412bab8ab25e271063515820
|
WebAPIODataV4Scaffolding/src/System.Web.OData.Design.Scaffolding/ScaffolderVersions.cs
|
WebAPIODataV4Scaffolding/src/System.Web.OData.Design.Scaffolding/ScaffolderVersions.cs
|
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
namespace System.Web.OData.Design.Scaffolding
{
internal static class ScaffolderVersions
{
public static readonly Version WebApiODataScaffolderVersion = new Version(1, 0, 0, 0);
}
}
|
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
namespace System.Web.OData.Design.Scaffolding
{
internal static class ScaffolderVersions
{
public static readonly Version WebApiODataScaffolderVersion = new Version(0, 1, 0, 0);
}
}
|
Fix Version Problem for Scaffolding
|
Fix Version Problem for Scaffolding
|
C#
|
mit
|
YOTOV-LIMITED/lab,LaylaLiu/lab,congysu/lab
|
61cae5463f35d0ab8cf06b7251fdd3fb89420923
|
test/VaultTest.cs
|
test/VaultTest.cs
|
using System.Linq;
using NUnit.Framework;
namespace LastPass.Test
{
[TestFixture]
class VaultTest
{
[Test]
public void Create_returns_vault_with_correct_accounts()
{
var vault = Vault.Create(new Blob(TestData.Blob, 1));
Assert.AreEqual(TestData.Accounts.Length, vault.EncryptedAccounts.Length);
Assert.AreEqual(TestData.Accounts.Select(i => i.Url), vault.EncryptedAccounts.Select(i => i.Url));
}
[Test]
public void DecryptAccount_decrypts_account()
{
var vault = Vault.Create(new Blob(TestData.Blob, 1));
var account = vault.DecryptAccount(vault.EncryptedAccounts[0], "p8utF7ZB8yD06SrtrD4hsdvEOiBU1Y19cr2dhG9DWZg=".Decode64());
Assert.AreEqual(TestData.Accounts[0].Name, account.Name);
Assert.AreEqual(TestData.Accounts[0].Username, account.Username);
Assert.AreEqual(TestData.Accounts[0].Password, account.Password);
Assert.AreEqual(TestData.Accounts[0].Url, account.Url);
}
}
}
|
using System.Linq;
using NUnit.Framework;
namespace LastPass.Test
{
[TestFixture]
class VaultTest
{
[Test]
public void Create_returns_vault_with_correct_accounts()
{
var vault = Vault.Create(new Blob(TestData.Blob, 1));
Assert.AreEqual(TestData.Accounts.Length, vault.EncryptedAccounts.Length);
Assert.AreEqual(TestData.Accounts.Select(i => i.Url), vault.EncryptedAccounts.Select(i => i.Url));
}
[Test]
public void DecryptAccount_decrypts_accounts()
{
var vault = Vault.Create(new Blob(TestData.Blob, 1));
for (var i = 0; i < vault.EncryptedAccounts.Length; ++i)
{
var account = vault.DecryptAccount(vault.EncryptedAccounts[i],
"p8utF7ZB8yD06SrtrD4hsdvEOiBU1Y19cr2dhG9DWZg=".Decode64());
var expectedAccount = TestData.Accounts[i];
Assert.AreEqual(expectedAccount.Name, account.Name);
Assert.AreEqual(expectedAccount.Username, account.Username);
Assert.AreEqual(expectedAccount.Password, account.Password);
Assert.AreEqual(expectedAccount.Url, account.Url);
}
}
}
}
|
Test that all accounts decrypt correctly
|
Test that all accounts decrypt correctly
|
C#
|
mit
|
detunized/lastpass-sharp,detunized/lastpass-sharp,rottenorange/lastpass-sharp
|
15bdd6bb81102bafd3ba240166e830191438950a
|
Bindings/Portable/CoreData.cs
|
Bindings/Portable/CoreData.cs
|
using Urho.Gui;
using Urho.Resources;
namespace Urho.Portable
{
//TODO: generate this class using T4 from CoreData folder
public static class CoreAssets
{
public static ResourceCache Cache => Application.Current.ResourceCache;
public static class Models
{
public static Model Box => Cache.GetModel("Models/Box.mdl");
public static Model Cone => Cache.GetModel("Models/Cone.mdl");
public static Model Cylinder => Cache.GetModel("Models/Cylinder.mdl");
public static Model Plane => Cache.GetModel("Models/Plane.mdl");
public static Model Pyramid => Cache.GetModel("Models/Pyramid.mdl");
public static Model Sphere => Cache.GetModel("Models/Sphere.mdl");
public static Model Torus => Cache.GetModel("Models/Torus.mdl");
}
public static class Materials
{
public static Material DefaultGrey => Cache.GetMaterial("Materials/DefaultGrey.xml");
}
public static class Fonts
{
public static Font AnonymousPro => Cache.GetFont("Fonts/Anonymous Pro.ttf");
}
public static class RenderPaths
{
}
public static class Shaders
{
}
public static class Techniques
{
}
}
}
|
using Urho.Gui;
using Urho.Resources;
namespace Urho
{
//TODO: generate this class using T4 from CoreData folder
public static class CoreAssets
{
public static ResourceCache Cache => Application.Current.ResourceCache;
public static class Models
{
public static Model Box => Cache.GetModel("Models/Box.mdl");
public static Model Cone => Cache.GetModel("Models/Cone.mdl");
public static Model Cylinder => Cache.GetModel("Models/Cylinder.mdl");
public static Model Plane => Cache.GetModel("Models/Plane.mdl");
public static Model Pyramid => Cache.GetModel("Models/Pyramid.mdl");
public static Model Sphere => Cache.GetModel("Models/Sphere.mdl");
public static Model Torus => Cache.GetModel("Models/Torus.mdl");
}
public static class Materials
{
public static Material DefaultGrey => Cache.GetMaterial("Materials/DefaultGrey.xml");
}
public static class Fonts
{
public static Font AnonymousPro => Cache.GetFont("Fonts/Anonymous Pro.ttf");
}
public static class RenderPaths
{
}
public static class Shaders
{
}
public static class Techniques
{
}
}
}
|
Remove "Portable" from namespace name in CoreAssets
|
Remove "Portable" from namespace name in CoreAssets
|
C#
|
mit
|
florin-chelaru/urho,florin-chelaru/urho,florin-chelaru/urho,florin-chelaru/urho,florin-chelaru/urho,florin-chelaru/urho
|
a59a5b6a1c7ffddef7b00ffb49b2f4e0b3438fb6
|
SupportManager.Telegram/Program.cs
|
SupportManager.Telegram/Program.cs
|
using System;
using Microsoft.EntityFrameworkCore;
using SupportManager.Telegram.DAL;
using Topshelf;
namespace SupportManager.Telegram
{
class Program
{
static void Main(string[] args)
{
if (args.Length == 2 && args[0].Equals("migrate", StringComparison.InvariantCultureIgnoreCase))
{
var filename = args[1];
var builder = new DbContextOptionsBuilder<UserDbContext>();
builder.UseSqlite($"Data Source={filename}");
var db = new UserDbContext(builder.Options);
db.Database.Migrate();
return;
}
var config = new Configuration();
var exitCode = HostFactory.Run(cfg =>
{
cfg.AddCommandLineDefinition("db", v => config.DbFileName = v);
cfg.AddCommandLineDefinition("botkey", v => config.BotKey = v);
cfg.AddCommandLineDefinition("url", v => config.SupportManagerUri = new Uri(v));
cfg.AddCommandLineDefinition("hostUrl", v => config.HostUri = new Uri(v));
cfg.Service<Service>(svc =>
{
svc.ConstructUsing(() => new Service(config));
svc.WhenStarted((s, h) => s.Start(h));
svc.WhenStopped((s, h) => s.Stop(h));
});
cfg.SetServiceName("SupportManager.Telegram");
cfg.SetDisplayName("SupportManager.Telegram");
cfg.SetDescription("SupportManager Telegram bot");
cfg.RunAsNetworkService();
cfg.StartAutomatically();
});
}
}
}
|
using System;
using Microsoft.EntityFrameworkCore;
using SupportManager.Telegram;
using SupportManager.Telegram.Infrastructure;
using Topshelf;
if (args.Length == 2 && args[0].Equals("migrate", StringComparison.InvariantCultureIgnoreCase))
{
var db = DbContextFactory.Create(args[1]);
db.Database.Migrate();
return;
}
HostFactory.Run(cfg =>
{
var config = new Configuration();
cfg.AddCommandLineDefinition("db", v => config.DbFileName = v);
cfg.AddCommandLineDefinition("botkey", v => config.BotKey = v);
cfg.AddCommandLineDefinition("url", v => config.SupportManagerUri = new Uri(v));
cfg.AddCommandLineDefinition("hostUrl", v => config.HostUri = new Uri(v));
cfg.Service<Service>(svc =>
{
svc.ConstructUsing(() => new Service(config));
svc.WhenStarted((s, h) => s.Start(h));
svc.WhenStopped((s, h) => s.Stop(h));
});
cfg.SetServiceName("SupportManager.Telegram");
cfg.SetDisplayName("SupportManager.Telegram");
cfg.SetDescription("SupportManager Telegram bot");
cfg.RunAsNetworkService();
cfg.StartAutomatically();
});
|
Replace main with top-level statements
|
telegram: Replace main with top-level statements
|
C#
|
mit
|
mycroes/SupportManager,mycroes/SupportManager,mycroes/SupportManager
|
7cbb7215e0d905011bce6f8a6d4818258eee8049
|
LazyStorage/StorableObject.cs
|
LazyStorage/StorableObject.cs
|
using System;
using System.Collections.Generic;
namespace LazyStorage
{
public class StorableObject : IEquatable<StorableObject>
{
public int LazyStorageInternalId { get; set; }
public Dictionary<string, string> Info { get; }
public StorableObject()
{
Info = new Dictionary<string, string>();
}
public bool Equals(StorableObject other)
{
return (other.LazyStorageInternalId == LazyStorageInternalId);
}
}
}
|
using System;
using System.Collections.Generic;
namespace LazyStorage
{
public class StorableObject
{
public Dictionary<string, string> Info { get; }
public StorableObject()
{
Info = new Dictionary<string, string>();
}
}
}
|
Remove Id from storable object
|
Remove Id from storable object
|
C#
|
mit
|
TheEadie/LazyStorage,TheEadie/LazyStorage,TheEadie/LazyLibrary
|
08f05190ce9dd63a6c69b7c88a1efb1e299ccc4d
|
Presentation.Web/Controllers/API/PasswordResetRequestController.cs
|
Presentation.Web/Controllers/API/PasswordResetRequestController.cs
|
using System;
using System.Net;
using System.Net.Http;
using System.Web.Http;
using Core.DomainModel;
using Core.DomainServices;
using Presentation.Web.Models;
namespace Presentation.Web.Controllers.API
{
public class PasswordResetRequestController : BaseApiController
{
private readonly IUserService _userService;
private readonly IUserRepository _userRepository;
public PasswordResetRequestController(IUserService userService, IUserRepository userRepository)
{
_userService = userService;
_userRepository = userRepository;
}
// POST api/PasswordResetRequest
public HttpResponseMessage Post([FromBody] UserDTO input)
{
try
{
var user = _userRepository.GetByEmail(input.Email);
var request = _userService.IssuePasswordReset(user, null, null);
return Ok();
}
catch (Exception e)
{
return CreateResponse(HttpStatusCode.InternalServerError, e);
}
}
// GET api/PasswordResetRequest
public HttpResponseMessage Get(string requestId)
{
try
{
var request = _userService.GetPasswordReset(requestId);
if (request == null) return NotFound();
var dto = AutoMapper.Mapper.Map<PasswordResetRequest, PasswordResetRequestDTO>(request);
var msg = CreateResponse(HttpStatusCode.OK, dto);
return msg;
}
catch (Exception e)
{
return CreateResponse(HttpStatusCode.InternalServerError, e);
}
}
}
}
|
using System;
using System.Net;
using System.Net.Http;
using System.Web.Http;
using Core.DomainModel;
using Core.DomainServices;
using Presentation.Web.Models;
namespace Presentation.Web.Controllers.API
{
[AllowAnonymous]
public class PasswordResetRequestController : BaseApiController
{
private readonly IUserService _userService;
private readonly IUserRepository _userRepository;
public PasswordResetRequestController(IUserService userService, IUserRepository userRepository)
{
_userService = userService;
_userRepository = userRepository;
}
// POST api/PasswordResetRequest
public HttpResponseMessage Post([FromBody] UserDTO input)
{
try
{
var user = _userRepository.GetByEmail(input.Email);
var request = _userService.IssuePasswordReset(user, null, null);
return Ok();
}
catch (Exception e)
{
return CreateResponse(HttpStatusCode.InternalServerError, e);
}
}
// GET api/PasswordResetRequest
public HttpResponseMessage Get(string requestId)
{
try
{
var request = _userService.GetPasswordReset(requestId);
if (request == null) return NotFound();
var dto = AutoMapper.Mapper.Map<PasswordResetRequest, PasswordResetRequestDTO>(request);
var msg = CreateResponse(HttpStatusCode.OK, dto);
return msg;
}
catch (Exception e)
{
return CreateResponse(HttpStatusCode.InternalServerError, e);
}
}
}
}
|
Allow anonymous on password reset requests
|
Allow anonymous on password reset requests
|
C#
|
mpl-2.0
|
miracle-as/kitos,os2kitos/kitos,os2kitos/kitos,miracle-as/kitos,os2kitos/kitos,os2kitos/kitos,miracle-as/kitos,miracle-as/kitos
|
14ffdf6ed28d9e89224f41f754dd2a300f467198
|
src/Server/Infrastructure/PackageUtility.cs
|
src/Server/Infrastructure/PackageUtility.cs
|
using System;
using System.Web;
using System.Web.Hosting;
namespace NuGet.Server.Infrastructure {
public class PackageUtility {
internal static string PackagePhysicalPath = HostingEnvironment.MapPath("~/Packages");
public static Uri GetPackageUrl(string path, Uri baseUri) {
return new Uri(baseUri, GetPackageDownloadUrl(path));
}
private static string GetPackageDownloadUrl(string path) {
return VirtualPathUtility.ToAbsolute("~/Packages/" + path);
}
}
}
|
using System;
using System.Web;
using System.Web.Hosting;
using System.Configuration;
namespace NuGet.Server.Infrastructure
{
public class PackageUtility
{
internal static string PackagePhysicalPath;
private static string DefaultPackagePhysicalPath = HostingEnvironment.MapPath("~/Packages");
static PackageUtility()
{
string packagePath = ConfigurationManager.AppSettings["NuGetPackagePath"];
if (string.IsNullOrEmpty(packagePath))
{
PackagePhysicalPath = DefaultPackagePhysicalPath;
}
else
{
PackagePhysicalPath = packagePath;
}
}
public static Uri GetPackageUrl(string path, Uri baseUri)
{
return new Uri(baseUri, GetPackageDownloadUrl(path));
}
private static string GetPackageDownloadUrl(string path)
{
return VirtualPathUtility.ToAbsolute("~/Packages/" + path);
}
}
}
|
Use the AppSettings 'NuGetPackagePath' if exists and the default ~/Packages otherwise
|
Use the AppSettings 'NuGetPackagePath' if exists and the default ~/Packages otherwise
|
C#
|
apache-2.0
|
antiufo/NuGet2,GearedToWar/NuGet2,mrward/nuget,jmezach/NuGet2,jholovacs/NuGet,pratikkagda/nuget,indsoft/NuGet2,mrward/nuget,indsoft/NuGet2,antiufo/NuGet2,pratikkagda/nuget,oliver-feng/nuget,indsoft/NuGet2,akrisiun/NuGet,dolkensp/node.net,RichiCoder1/nuget-chocolatey,indsoft/NuGet2,jmezach/NuGet2,oliver-feng/nuget,mrward/NuGet.V2,zskullz/nuget,GearedToWar/NuGet2,rikoe/nuget,ctaggart/nuget,atheken/nuget,indsoft/NuGet2,zskullz/nuget,themotleyfool/NuGet,GearedToWar/NuGet2,GearedToWar/NuGet2,jholovacs/NuGet,mrward/NuGet.V2,kumavis/NuGet,jmezach/NuGet2,anurse/NuGet,antiufo/NuGet2,alluran/node.net,jholovacs/NuGet,dolkensp/node.net,zskullz/nuget,mono/nuget,jmezach/NuGet2,themotleyfool/NuGet,rikoe/nuget,ctaggart/nuget,RichiCoder1/nuget-chocolatey,chocolatey/nuget-chocolatey,ctaggart/nuget,xero-github/Nuget,alluran/node.net,mrward/NuGet.V2,atheken/nuget,xoofx/NuGet,oliver-feng/nuget,chocolatey/nuget-chocolatey,antiufo/NuGet2,mrward/nuget,RichiCoder1/nuget-chocolatey,RichiCoder1/nuget-chocolatey,rikoe/nuget,GearedToWar/NuGet2,alluran/node.net,jholovacs/NuGet,kumavis/NuGet,oliver-feng/nuget,alluran/node.net,jholovacs/NuGet,akrisiun/NuGet,dolkensp/node.net,dolkensp/node.net,RichiCoder1/nuget-chocolatey,chocolatey/nuget-chocolatey,mrward/nuget,oliver-feng/nuget,antiufo/NuGet2,xoofx/NuGet,indsoft/NuGet2,xoofx/NuGet,anurse/NuGet,xoofx/NuGet,mrward/nuget,mrward/NuGet.V2,pratikkagda/nuget,chester89/nugetApi,chocolatey/nuget-chocolatey,mrward/NuGet.V2,chester89/nugetApi,OneGet/nuget,mrward/nuget,GearedToWar/NuGet2,mono/nuget,mrward/NuGet.V2,zskullz/nuget,xoofx/NuGet,oliver-feng/nuget,rikoe/nuget,chocolatey/nuget-chocolatey,chocolatey/nuget-chocolatey,pratikkagda/nuget,pratikkagda/nuget,mono/nuget,RichiCoder1/nuget-chocolatey,OneGet/nuget,xoofx/NuGet,pratikkagda/nuget,jmezach/NuGet2,OneGet/nuget,jmezach/NuGet2,jholovacs/NuGet,antiufo/NuGet2,ctaggart/nuget,mono/nuget,themotleyfool/NuGet,OneGet/nuget
|
7e43a94ac470507ba74ffa56b501a4903d07c5ba
|
NFleetSDK/Data/RouteEventData.cs
|
NFleetSDK/Data/RouteEventData.cs
|
using System;
using System.Collections.Generic;
namespace NFleet.Data
{
public class RouteEventData : IResponseData, IVersioned
{
public static string MIMEType = "application/vnd.jyu.nfleet.routeevent";
public static string MIMEVersion = "2.0";
int IVersioned.VersionNumber { get; set; }
public string State { get; set; }
public double WaitingTimeBefore { get; set; }
public DateTime? ArrivalTime { get; set; }
public DateTime? DepartureTime { get; set; }
public List<Link> Meta { get; set; }
public string DataState { get; set; }
public string FeasibilityState { get; set; }
public int TaskEventId { get; set; }
public KPIData KPIs { get; set; }
public string Type { get; set; }
public LocationData Location { get; set; }
}
}
|
using System;
using System.Collections.Generic;
namespace NFleet.Data
{
public class RouteEventData : IResponseData, IVersioned
{
public static string MIMEType = "application/vnd.jyu.nfleet.routeevent";
public static string MIMEVersion = "2.0";
int IVersioned.VersionNumber { get; set; }
public string State { get; set; }
public double WaitingTimeBefore { get; set; }
public DateTime? ArrivalTime { get; set; }
public DateTime? DepartureTime { get; set; }
public List<Link> Meta { get; set; }
public string DataState { get; set; }
public string FeasibilityState { get; set; }
public int TaskEventId { get; set; }
public KPIData KPIs { get; set; }
public string Type { get; set; }
public LocationData Location { get; set; }
public List<CapacityData> Capacities { get; set; }
public List<TimeWindowData> TimeWindows { get; set; }
}
}
|
Add capacity and time window data to route events.
|
Add capacity and time window data to route events.
|
C#
|
mit
|
nfleet/.net-sdk
|
31e2248d59926b0bbd93335ab4e741557339d434
|
SCPI/IDN.cs
|
SCPI/IDN.cs
|
using System;
using System.Linq;
using System.Text;
namespace SCPI
{
public class IDN : ICommand
{
public string Description => "Query the ID string of the instrument";
public string Manufacturer { get; private set; }
public string Model { get; private set; }
public string SerialNumber { get; private set; }
public string SoftwareVersion { get; private set; }
public string HelpMessage()
{
return nameof(IDN);
}
public string Command(params string[] parameters)
{
return "*IDN?";
}
public bool Parse(byte[] data)
{
// RIGOL TECHNOLOGIES,<model>,<serial number>,<software version>
var id = Encoding.ASCII.GetString(data).Split(',').Select(f => f.Trim());
// According to IEEE 488.2 there are four fields in the response
if (id.Count() == 4)
{
Manufacturer = id.ElementAt(0);
Model = id.ElementAt(1);
SerialNumber = id.ElementAt(2);
SoftwareVersion = id.ElementAt(3);
return true;
}
return false;
}
}
}
|
using System.Linq;
using System.Text;
namespace SCPI
{
public class IDN : ICommand
{
public string Description => "Query the ID string of the instrument";
public string Manufacturer { get; private set; }
public string Model { get; private set; }
public string SerialNumber { get; private set; }
public string SoftwareVersion { get; private set; }
public string HelpMessage() => nameof(IDN);
public string Command(params string[] parameters) => "*IDN?";
public bool Parse(byte[] data)
{
// RIGOL TECHNOLOGIES,<model>,<serial number>,<software version>
var id = Encoding.ASCII.GetString(data).Split(',').Select(f => f.Trim());
// According to IEEE 488.2 there are four fields in the response
if (id.Count() == 4)
{
Manufacturer = id.ElementAt(0);
Model = id.ElementAt(1);
SerialNumber = id.ElementAt(2);
SoftwareVersion = id.ElementAt(3);
return true;
}
return false;
}
}
}
|
Change the method to expression body definition
|
Change the method to expression body definition
|
C#
|
mit
|
tparviainen/oscilloscope
|
c62893056f25f909787537a39a560d955bb8cf49
|
osu.Framework/Graphics/Cursor/IHasCustomTooltip.cs
|
osu.Framework/Graphics/Cursor/IHasCustomTooltip.cs
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
namespace osu.Framework.Graphics.Cursor
{
/// <summary>
/// Implementing this interface allows the implementing <see cref="Drawable"/> to display a custom tooltip if it is the child of a <see cref="TooltipContainer"/>.
/// Keep in mind that tooltips can only be displayed by a <see cref="TooltipContainer"/> if the <see cref="Drawable"/> implementing <see cref="IHasCustomTooltip"/> has <see cref="Drawable.HandlePositionalInput"/> set to true.
/// </summary>
public interface IHasCustomTooltip : ITooltipContentProvider
{
/// <summary>
/// The custom tooltip that should be displayed.
/// </summary>
/// <returns>The custom tooltip that should be displayed.</returns>
ITooltip GetCustomTooltip();
/// <summary>
/// Tooltip text that shows when hovering the drawable.
/// </summary>
object TooltipContent { get; }
}
/// <inheritdoc />
public interface IHasCustomTooltip<TContent> : IHasCustomTooltip
{
ITooltip IHasCustomTooltip.GetCustomTooltip() => GetCustomTooltip();
/// <inheritdoc cref="IHasCustomTooltip.GetCustomTooltip"/>
new ITooltip<TContent> GetCustomTooltip();
object IHasCustomTooltip.TooltipContent => TooltipContent;
/// <inheritdoc cref="IHasCustomTooltip.TooltipContent"/>
new TContent TooltipContent { get; }
}
}
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
namespace osu.Framework.Graphics.Cursor
{
/// <summary>
/// Implementing this interface allows the implementing <see cref="Drawable"/> to display a custom tooltip if it is the child of a <see cref="TooltipContainer"/>.
/// Keep in mind that tooltips can only be displayed by a <see cref="TooltipContainer"/> if the <see cref="Drawable"/> implementing <see cref="IHasCustomTooltip"/> has <see cref="Drawable.HandlePositionalInput"/> set to true.
/// </summary>
public interface IHasCustomTooltip : ITooltipContentProvider
{
/// <summary>
/// The custom tooltip that should be displayed.
/// </summary>
/// <remarks>
/// A tooltip may be reused between different drawables with different content if they share the same tooltip type.
/// Therefore it is recommended for all displayed content in the tooltip to be provided by <see cref="TooltipContent"/> instead.
/// </remarks>
/// <returns>The custom tooltip that should be displayed.</returns>
ITooltip GetCustomTooltip();
/// <summary>
/// Tooltip text that shows when hovering the drawable.
/// </summary>
object TooltipContent { get; }
}
/// <inheritdoc />
public interface IHasCustomTooltip<TContent> : IHasCustomTooltip
{
ITooltip IHasCustomTooltip.GetCustomTooltip() => GetCustomTooltip();
/// <inheritdoc cref="IHasCustomTooltip.GetCustomTooltip"/>
new ITooltip<TContent> GetCustomTooltip();
object IHasCustomTooltip.TooltipContent => TooltipContent;
/// <inheritdoc cref="IHasCustomTooltip.TooltipContent"/>
new TContent TooltipContent { get; }
}
}
|
Add note about reusing of tooltips and the new behaviour
|
Add note about reusing of tooltips and the new behaviour
|
C#
|
mit
|
ZLima12/osu-framework,ppy/osu-framework,smoogipooo/osu-framework,peppy/osu-framework,ppy/osu-framework,ppy/osu-framework,peppy/osu-framework,ZLima12/osu-framework,smoogipooo/osu-framework,peppy/osu-framework
|
27f992efe1456aa3c1f61459742406d779e24b15
|
src/Dalian/Models/Sites.cs
|
src/Dalian/Models/Sites.cs
|
using NPoco;
using System;
namespace Dalian.Models
{
[PrimaryKey("SiteId")]
public class Sites
{
public string SiteId { get; set; }
public string Name { get; set; }
public string Url { get; set; }
public string Note { get; set; }
public string Source { get; set; }
public DateTime DateTime { get; set; }
public bool Active { get; set; }
public string MetaTitle { get; set; }
public string MetaDescription { get; set; }
public string MetaKeywords { get; set; }
public int Status { get; set; }
public bool Bookmarklet { get; set; }
public bool ReadItLater { get; set; }
public bool Clipped { get; set; }
public string ArchiveUrl { get; set; }
public bool Highlight { get; set; }
public bool PersonalHighlight { get; set; }
}
}
|
using NPoco;
using System;
namespace Dalian.Models
{
[PrimaryKey("SiteId", AutoIncrement = false)]
public class Sites
{
public string SiteId { get; set; }
public string Name { get; set; }
public string Url { get; set; }
public string Note { get; set; }
public string Source { get; set; }
public DateTime DateTime { get; set; }
public bool Active { get; set; }
public string MetaTitle { get; set; }
public string MetaDescription { get; set; }
public string MetaKeywords { get; set; }
public int Status { get; set; }
public bool Bookmarklet { get; set; }
public bool ReadItLater { get; set; }
public bool Clipped { get; set; }
public string ArchiveUrl { get; set; }
public bool Highlight { get; set; }
public bool PersonalHighlight { get; set; }
}
}
|
Fix not null constraint failed exception
|
Fix not null constraint failed exception
|
C#
|
mit
|
06b/Dalian,06b/Dalian
|
77e65aa1ffe117294e0ee90a1c4ded844bb60e05
|
src/ServiceStack/DependencyInjection/DependencyResolver.cs
|
src/ServiceStack/DependencyInjection/DependencyResolver.cs
|
using System;
using System.Collections.Generic;
using Autofac;
using Autofac.Core;
namespace ServiceStack.DependencyInjection
{
public class DependencyResolver : IDisposable
{
private readonly ILifetimeScope _lifetimeScope;
public DependencyResolver(ILifetimeScope lifetimeScope)
{
_lifetimeScope = lifetimeScope;
}
public T Resolve<T>()
{
return _lifetimeScope.Resolve<T>();
}
public object Resolve(Type type)
{
return _lifetimeScope.Resolve(type);
}
public T TryResolve<T>()
{
try
{
return _lifetimeScope.Resolve<T>();
}
catch (DependencyResolutionException unusedException)
{
return default(T);
}
}
public void Dispose()
{
_lifetimeScope.Dispose();
}
}
}
|
using System;
using System.Collections.Generic;
using Autofac;
using Autofac.Core;
namespace ServiceStack.DependencyInjection
{
public class DependencyResolver : IDisposable
{
private readonly ILifetimeScope _lifetimeScope;
public DependencyResolver(ILifetimeScope lifetimeScope)
{
_lifetimeScope = lifetimeScope;
}
public T Resolve<T>()
{
return _lifetimeScope.Resolve<T>();
}
public object Resolve(Type type)
{
return _lifetimeScope.Resolve(type);
}
public T TryResolve<T>()
{
if (_lifetimeScope.IsRegistered<T>())
{
try
{
return _lifetimeScope.Resolve<T>();
}
catch (DependencyResolutionException unusedException)
{
return default(T);
}
}
else
{
return default (T);
}
}
public void Dispose()
{
_lifetimeScope.Dispose();
}
}
}
|
Check if registered before trying.
|
Check if registered before trying.
|
C#
|
bsd-3-clause
|
ZocDoc/ServiceStack,ZocDoc/ServiceStack,ZocDoc/ServiceStack,ZocDoc/ServiceStack
|
374dac57f2b3c4ea34a24929700119fa9a4eb52a
|
osu.Game/Beatmaps/Drawables/Cards/ExpandedContentScrollContainer.cs
|
osu.Game/Beatmaps/Drawables/Cards/ExpandedContentScrollContainer.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.Input.Events;
using osu.Framework.Utils;
using osu.Game.Graphics.Containers;
namespace osu.Game.Beatmaps.Drawables.Cards
{
public class ExpandedContentScrollContainer : OsuScrollContainer
{
public const float HEIGHT = 400;
public ExpandedContentScrollContainer()
{
ScrollbarVisible = false;
}
protected override void Update()
{
base.Update();
Height = Math.Min(Content.DrawHeight, HEIGHT);
}
private bool allowScroll => !Precision.AlmostEquals(DrawSize, Content.DrawSize);
protected override bool OnDragStart(DragStartEvent e)
{
if (!allowScroll)
return false;
return base.OnDragStart(e);
}
protected override void OnDrag(DragEvent e)
{
if (!allowScroll)
return;
base.OnDrag(e);
}
protected override void OnDragEnd(DragEndEvent e)
{
if (!allowScroll)
return;
base.OnDragEnd(e);
}
protected override bool OnScroll(ScrollEvent e)
{
if (!allowScroll)
return false;
return base.OnScroll(e);
}
}
}
|
// 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.Input.Events;
using osu.Framework.Utils;
using osu.Game.Graphics.Containers;
namespace osu.Game.Beatmaps.Drawables.Cards
{
public class ExpandedContentScrollContainer : OsuScrollContainer
{
public const float HEIGHT = 200;
public ExpandedContentScrollContainer()
{
ScrollbarVisible = false;
}
protected override void Update()
{
base.Update();
Height = Math.Min(Content.DrawHeight, HEIGHT);
}
private bool allowScroll => !Precision.AlmostEquals(DrawSize, Content.DrawSize);
protected override bool OnDragStart(DragStartEvent e)
{
if (!allowScroll)
return false;
return base.OnDragStart(e);
}
protected override void OnDrag(DragEvent e)
{
if (!allowScroll)
return;
base.OnDrag(e);
}
protected override void OnDragEnd(DragEndEvent e)
{
if (!allowScroll)
return;
base.OnDragEnd(e);
}
protected override bool OnScroll(ScrollEvent e)
{
if (!allowScroll)
return false;
return base.OnScroll(e);
}
}
}
|
Change expanded card content height to 200
|
Change expanded card content height to 200
|
C#
|
mit
|
NeoAdonis/osu,NeoAdonis/osu,NeoAdonis/osu,peppy/osu,ppy/osu,peppy/osu,peppy/osu,ppy/osu,ppy/osu
|
ce68566751b6c3b8aa63446c2ebbddd89a1a85a5
|
Joinrpg/Views/Account/RegisterSuccess.cshtml
|
Joinrpg/Views/Account/RegisterSuccess.cshtml
|
@model dynamic
@{
ViewBag.Title = "Регистрация успешна";
}
<h2>@ViewBag.Title</h2>
<p>Остался всего один клик! Проверьте свою почту, там лежит письмо от нас с просьбой подтвердить email...</p>
|
@model dynamic
@{
ViewBag.Title = "Регистрация успешна";
}
<h2>@ViewBag.Title</h2>
<p>Остался всего один клик! Проверьте свою почту, там лежит письмо от нас с просьбой подтвердить email.</p>
|
Change message in register success
|
Change message in register success
|
C#
|
mit
|
leotsarev/joinrpg-net,joinrpg/joinrpg-net,leotsarev/joinrpg-net,kirillkos/joinrpg-net,joinrpg/joinrpg-net,joinrpg/joinrpg-net,kirillkos/joinrpg-net,leotsarev/joinrpg-net,joinrpg/joinrpg-net,leotsarev/joinrpg-net
|
c6979c1d636f8c2f2d30a2a01bba940c611e767e
|
Samples/Program.cs
|
Samples/Program.cs
|
using System;
using Ooui;
namespace Samples
{
class Program
{
static void Main (string[] args)
{
new ButtonSample ().Publish ();
new TodoSample ().Publish ();
Console.ReadLine ();
}
}
}
|
using System;
using Ooui;
namespace Samples
{
class Program
{
static void Main (string[] args)
{
for (var i = 0; i < args.Length; i++) {
var a = args[i];
switch (args[i]) {
case "-p" when i + 1 < args.Length:
case "--port" when i + 1 < args.Length:
{
int p;
if (int.TryParse (args[i + 1], out p)) {
UI.Port = p;
}
i++;
}
break;
}
}
new ButtonSample ().Publish ();
new TodoSample ().Publish ();
Console.ReadLine ();
}
}
}
|
Add --port option to samples
|
Add --port option to samples
Fixes #6
|
C#
|
mit
|
praeclarum/Ooui,praeclarum/Ooui,praeclarum/Ooui
|
b3e4170f3f006db2aa402667fcdb2762f517d860
|
src/Hangfire.Console/Server/ConsoleServerFilter.cs
|
src/Hangfire.Console/Server/ConsoleServerFilter.cs
|
using Hangfire.Common;
using Hangfire.Console.Serialization;
using Hangfire.Console.Storage;
using Hangfire.Server;
using Hangfire.States;
using System;
namespace Hangfire.Console.Server
{
/// <summary>
/// Server filter to initialize and cleanup console environment.
/// </summary>
internal class ConsoleServerFilter : IServerFilter
{
private readonly ConsoleOptions _options;
public ConsoleServerFilter(ConsoleOptions options)
{
if (options == null)
throw new ArgumentNullException(nameof(options));
_options = options;
}
public void OnPerforming(PerformingContext context)
{
var state = context.Connection.GetStateData(context.BackgroundJob.Id);
if (state == null)
{
// State for job not found?
return;
}
if (!string.Equals(state.Name, ProcessingState.StateName, StringComparison.OrdinalIgnoreCase))
{
// Not in Processing state? Something is really off...
return;
}
var startedAt = JobHelper.DeserializeDateTime(state.Data["StartedAt"]);
context.Items["ConsoleContext"] = new ConsoleContext(
new ConsoleId(context.BackgroundJob.Id, startedAt),
new ConsoleStorage(context.Connection));
}
public void OnPerformed(PerformedContext context)
{
if (context.Canceled)
{
// Processing was been cancelled by one of the job filters
// There's nothing to do here, as processing hasn't started
return;
}
ConsoleContext.FromPerformContext(context)?.Expire(_options.ExpireIn);
}
}
}
|
using Hangfire.Common;
using Hangfire.Console.Serialization;
using Hangfire.Console.Storage;
using Hangfire.Server;
using Hangfire.States;
using System;
namespace Hangfire.Console.Server
{
/// <summary>
/// Server filter to initialize and cleanup console environment.
/// </summary>
internal class ConsoleServerFilter : IServerFilter
{
private readonly ConsoleOptions _options;
public ConsoleServerFilter(ConsoleOptions options)
{
if (options == null)
throw new ArgumentNullException(nameof(options));
_options = options;
}
public void OnPerforming(PerformingContext filterContext)
{
var state = filterContext.Connection.GetStateData(filterContext.BackgroundJob.Id);
if (state == null)
{
// State for job not found?
return;
}
if (!string.Equals(state.Name, ProcessingState.StateName, StringComparison.OrdinalIgnoreCase))
{
// Not in Processing state? Something is really off...
return;
}
var startedAt = JobHelper.DeserializeDateTime(state.Data["StartedAt"]);
filterContext.Items["ConsoleContext"] = new ConsoleContext(
new ConsoleId(filterContext.BackgroundJob.Id, startedAt),
new ConsoleStorage(filterContext.Connection));
}
public void OnPerformed(PerformedContext filterContext)
{
if (filterContext.Canceled)
{
// Processing was been cancelled by one of the job filters
// There's nothing to do here, as processing hasn't started
return;
}
ConsoleContext.FromPerformContext(filterContext)?.Expire(_options.ExpireIn);
}
}
}
|
Rename arguments to match base names
|
Rename arguments to match base names
|
C#
|
mit
|
pieceofsummer/Hangfire.Console,pieceofsummer/Hangfire.Console
|
581544e1d641b44263172509bf5a6cec490c9f46
|
osu.Game.Rulesets.Osu/Mods/OsuModTouchDevice.cs
|
osu.Game.Rulesets.Osu/Mods/OsuModTouchDevice.cs
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using osu.Game.Rulesets.Mods;
namespace osu.Game.Rulesets.Osu.Mods
{
public class OsuModTouchDevice : Mod
{
public override string Name => "Touch Device";
public override string Acronym => "TD";
public override double ScoreMultiplier => 1;
}
}
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using osu.Game.Rulesets.Mods;
namespace osu.Game.Rulesets.Osu.Mods
{
public class OsuModTouchDevice : Mod
{
public override string Name => "Touch Device";
public override string Acronym => "TD";
public override double ScoreMultiplier => 1;
public override bool Ranked => true;
}
}
|
Fix TD mod not being ranked
|
Fix TD mod not being ranked
|
C#
|
mit
|
smoogipooo/osu,DrabWeb/osu,NeoAdonis/osu,UselessToucan/osu,naoey/osu,ppy/osu,peppy/osu,NeoAdonis/osu,2yangk23/osu,UselessToucan/osu,peppy/osu,ppy/osu,EVAST9919/osu,naoey/osu,ZLima12/osu,peppy/osu-new,DrabWeb/osu,naoey/osu,EVAST9919/osu,ppy/osu,smoogipoo/osu,NeoAdonis/osu,peppy/osu,johnneijzen/osu,UselessToucan/osu,smoogipoo/osu,DrabWeb/osu,smoogipoo/osu,2yangk23/osu,ZLima12/osu,johnneijzen/osu
|
ffb3e6e188dc4fde35787770a962244f46408519
|
Assets/Microgames/_Bosses/DarkRoom/Scripts/DarkRoomObstacleEnable.cs
|
Assets/Microgames/_Bosses/DarkRoom/Scripts/DarkRoomObstacleEnable.cs
|
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class DarkRoomObstacleEnable : MonoBehaviour
{
[SerializeField]
private float maxXDistance = 11f;
void Start ()
{
}
void Update ()
{
for (int i = 0; i < transform.childCount; i++)
{
var child = transform.GetChild(i);
var shouldEnable = Mathf.Abs(MainCameraSingleton.instance.transform.position.x - child.position.x) <= maxXDistance;
if (shouldEnable != child.gameObject.activeInHierarchy)
child.gameObject.SetActive(shouldEnable);
}
}
}
|
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using System.Linq;
public class DarkRoomObstacleEnable : MonoBehaviour
{
[SerializeField]
private float maxXDistance = 11f;
void Start ()
{
for (int i = 0; i < transform.childCount; i++)
{
var child = transform.GetChild(i);
if (!child.gameObject.activeInHierarchy)
Destroy(child.gameObject);
}
}
void Update ()
{
for (int i = 0; i < transform.childCount; i++)
{
var child = transform.GetChild(i);
var shouldEnable = Mathf.Abs(MainCameraSingleton.instance.transform.position.x - child.position.x) <= maxXDistance;
if (shouldEnable != child.gameObject.activeInHierarchy)
child.gameObject.SetActive(shouldEnable);
}
}
}
|
Destroy obstacles disabled at scene start
|
DarkRoom: Destroy obstacles disabled at scene start
|
C#
|
mit
|
NitorInc/NitoriWare,Barleytree/NitoriWare,NitorInc/NitoriWare,Barleytree/NitoriWare
|
411740ae83854834db9eca3d98dcf32d765de896
|
clipr/VerbAttribute.cs
|
clipr/VerbAttribute.cs
|
using System;
namespace clipr
{
/// <summary>
/// Mark the property as a subcommand. (cf. 'svn checkout')
/// </summary>
[AttributeUsage(AttributeTargets.Property, AllowMultiple = true)]
public class VerbAttribute : Attribute
{
/// <summary>
/// Name of the subcommand. If provided as an argument, it
/// will trigger parsing of the subcommand.
/// </summary>
public string Name { get; private set; }
/// <summary>
/// Description of the subcommand, suitable for help pages.
/// </summary>
public string Description { get; private set; }
/// <summary>
/// Create a new subcommand.
/// </summary>
/// <param name="name"></param>
public VerbAttribute(string name)
{
Name = name;
}
/// <summary>
/// Create a new subcommand.
/// </summary>
/// <param name="name"></param>
/// <param name="description"></param>
public VerbAttribute(string name, string description)
{
Name = name;
Description = description;
}
}
}
|
using System;
namespace clipr
{
/// <summary>
/// Mark the property as a subcommand. (cf. 'svn checkout')
/// </summary>
[AttributeUsage(AttributeTargets.Property, AllowMultiple = true)]
public class VerbAttribute : Attribute
{
/// <summary>
/// Name of the subcommand. If provided as an argument, it
/// will trigger parsing of the subcommand.
/// </summary>
public string Name { get; set; }
/// <summary>
/// Description of the subcommand, suitable for help pages.
/// </summary>
public string Description { get; set; }
/// <summary>
/// Create a new subcommand.
/// </summary>
public VerbAttribute()
{
}
/// <summary>
/// Create a new subcommand.
/// </summary>
/// <param name="name"></param>
public VerbAttribute(string name)
{
Name = name;
}
/// <summary>
/// Create a new subcommand.
/// </summary>
/// <param name="name"></param>
/// <param name="description"></param>
public VerbAttribute(string name, string description)
{
Name = name;
Description = description;
}
}
}
|
Allow verb name to be optional.
|
Allow verb name to be optional.
|
C#
|
mit
|
nemec/clipr
|
74600a155ac034f271ffedf5b1395906f96c9f29
|
common.cake
|
common.cake
|
#tool nuget:?package=XamarinComponent&version=1.1.0.32
#addin nuget:?package=Cake.Xamarin.Build&version=1.0.14.0
#addin nuget:?package=Cake.Xamarin
#addin nuget:?package=Cake.XCode
|
#tool nuget:?package=XamarinComponent&version=1.1.0.32
#addin nuget:?package=Cake.Xamarin.Build
#addin nuget:?package=Cake.Xamarin
#addin nuget:?package=Cake.XCode
|
Remove explicit build addin dependency version
|
Remove explicit build addin dependency version
|
C#
|
mit
|
SotoiGhost/FacebookComponents,SotoiGhost/FacebookComponents
|
653356a5cdbf16c639b4d00ded9e5098cf06f672
|
src/TestHarness/Program.cs
|
src/TestHarness/Program.cs
|
using System;
using System.Threading.Tasks;
using KafkaNet;
using KafkaNet.Model;
using KafkaNet.Protocol;
using System.Collections.Generic;
namespace TestHarness
{
class Program
{
static void Main(string[] args)
{
var options = new KafkaOptions(new Uri("http://CSDKAFKA01:9092"), new Uri("http://CSDKAFKA02:9092"))
{
Log = new ConsoleLog()
};
var router = new BrokerRouter(options);
var client = new Producer(router);
Task.Factory.StartNew(() =>
{
var consumer = new Consumer(new ConsumerOptions("TestHarness", router));
foreach (var data in consumer.Consume())
{
Console.WriteLine("Response: P{0},O{1} : {2}", data.Meta.PartitionId, data.Meta.Offset, data.Value);
}
});
Console.WriteLine("Type a message and press enter...");
while (true)
{
var message = Console.ReadLine();
if (message == "quit") break;
client.SendMessageAsync("TestHarness", new[] { new Message(message) });
}
using (client)
using (router)
{
}
}
}
}
|
using System;
using System.Threading.Tasks;
using KafkaNet;
using KafkaNet.Common;
using KafkaNet.Model;
using KafkaNet.Protocol;
using System.Collections.Generic;
namespace TestHarness
{
class Program
{
static void Main(string[] args)
{
//create an options file that sets up driver preferences
var options = new KafkaOptions(new Uri("http://CSDKAFKA01:9092"), new Uri("http://CSDKAFKA02:9092"))
{
Log = new ConsoleLog()
};
//start an out of process thread that runs a consumer that will write all received messages to the console
Task.Factory.StartNew(() =>
{
var consumer = new Consumer(new ConsumerOptions("TestHarness", new BrokerRouter(options)));
foreach (var data in consumer.Consume())
{
Console.WriteLine("Response: P{0},O{1} : {2}", data.Meta.PartitionId, data.Meta.Offset, data.Value.ToUTF8String());
}
});
//create a producer to send messages with
var producer = new Producer(new BrokerRouter(options));
Console.WriteLine("Type a message and press enter...");
while (true)
{
var message = Console.ReadLine();
if (message == "quit") break;
if (string.IsNullOrEmpty(message))
{
//special case, send multi messages quickly
for (int i = 0; i < 20; i++)
{
producer.SendMessageAsync("TestHarness", new[] { new Message(i.ToString()) })
.ContinueWith(t =>
{
t.Result.ForEach(x => Console.WriteLine("Complete: {0}, Offset: {1}", x.PartitionId, x.Offset));
});
}
}
else
{
producer.SendMessageAsync("TestHarness", new[] { new Message(message) });
}
}
using (producer)
{
}
}
}
}
|
Clean up TestHarness to be more instructive
|
Clean up TestHarness to be more instructive
|
C#
|
apache-2.0
|
geffzhang/kafka-net,gigya/KafkaNetClient,bridgewell/kafka-net,CenturyLinkCloud/kafka-net,EranOfer/KafkaNetClient,martijnhoekstra/kafka-net,nightkid1027/kafka-net,Jroland/kafka-net,PKRoma/kafka-net,BDeus/KafkaNetClient
|
6d779f17b31746fc6a9f2c9f3c401b69ab936dfd
|
video/Controls/LabelTooltip.cs
|
video/Controls/LabelTooltip.cs
|
using System;
using System.Diagnostics;
using System.Drawing;
using System.Windows.Forms;
namespace TweetDuck.Video.Controls{
sealed class LabelTooltip : Label{
public LabelTooltip(){
Visible = false;
}
public void AttachTooltip(Control control, bool followCursor, string tooltip){
AttachTooltip(control, followCursor, args => tooltip);
}
public void AttachTooltip(Control control, bool followCursor, Func<MouseEventArgs, string> tooltipFunc){
control.MouseEnter += control_MouseEnter;
control.MouseLeave += control_MouseLeave;
control.MouseMove += (sender, args) => {
Form form = control.FindForm();
Debug.Assert(form != null);
Text = tooltipFunc(args);
Location = form.PointToClient(control.Parent.PointToScreen(new Point(control.Location.X-Width/2+(followCursor ? args.X : control.Width/2), -Height+Margin.Top-Margin.Bottom)));;
};
}
private void control_MouseEnter(object sender, EventArgs e){
Visible = true;
}
private void control_MouseLeave(object sender, EventArgs e){
Visible = false;
}
}
}
|
using System;
using System.Drawing;
using System.Windows.Forms;
namespace TweetDuck.Video.Controls{
sealed class LabelTooltip : Label{
public LabelTooltip(){
Visible = false;
}
public void AttachTooltip(Control control, bool followCursor, string tooltip){
AttachTooltip(control, followCursor, args => tooltip);
}
public void AttachTooltip(Control control, bool followCursor, Func<MouseEventArgs, string> tooltipFunc){
control.MouseEnter += control_MouseEnter;
control.MouseLeave += control_MouseLeave;
control.MouseMove += (sender, args) => {
Form form = control.FindForm();
System.Diagnostics.Debug.Assert(form != null);
Text = tooltipFunc(args);
Point loc = form.PointToClient(control.Parent.PointToScreen(new Point(control.Location.X+(followCursor ? args.X : control.Width/2), 0)));
loc.X = Math.Max(0, Math.Min(form.Width-Width, loc.X-Width/2));
loc.Y -= Height-Margin.Top+Margin.Bottom;
Location = loc;
};
}
private void control_MouseEnter(object sender, EventArgs e){
Visible = true;
}
private void control_MouseLeave(object sender, EventArgs e){
Visible = false;
}
}
}
|
Fix video player tooltip going outside Form bounds
|
Fix video player tooltip going outside Form bounds
|
C#
|
mit
|
chylex/TweetDuck,chylex/TweetDuck,chylex/TweetDuck,chylex/TweetDuck
|
5d170cba74689af59e28dacf91b01f065a51181a
|
src/Ecwid/Models/Profile/Rule.cs
|
src/Ecwid/Models/Profile/Rule.cs
|
// Licensed under the GPL License, Version 3.0. See LICENSE in the git repository root for license information.
using Newtonsoft.Json;
namespace Ecwid.Models
{
/// <summary>
/// </summary>
public class TaxRule
{
/// <summary>
/// Gets or sets the tax in %.
/// </summary>
/// <value>
/// The tax.
/// </value>
[JsonProperty("tax")]
public int Tax { get; set; }
/// <summary>
/// Gets or sets the destination zone identifier.
/// </summary>
/// <value>
/// The zone identifier.
/// </value>
[JsonProperty("zoneId")]
public string ZoneId { get; set; }
}
}
|
// Licensed under the GPL License, Version 3.0. See LICENSE in the git repository root for license information.
using Newtonsoft.Json;
namespace Ecwid.Models
{
/// <summary>
/// </summary>
public class TaxRule
{
/// <summary>
/// Gets or sets the tax in %.
/// </summary>
/// <value>
/// The tax.
/// </value>
[JsonProperty("tax")]
public double Tax { get; set; }
/// <summary>
/// Gets or sets the destination zone identifier.
/// </summary>
/// <value>
/// The zone identifier.
/// </value>
[JsonProperty("zoneId")]
public string ZoneId { get; set; }
}
}
|
Fix tax rule to be double not int
|
Fix tax rule to be double not int
|
C#
|
mit
|
kroniak/extensions-ecwid,kroniak/extensions-ecwid
|
74f478187b94528d0a905b76583374b664fa1715
|
Rebus.AdoNet/Dialects/PostgreSql82Dialect.cs
|
Rebus.AdoNet/Dialects/PostgreSql82Dialect.cs
|
using System;
using System.Data;
using System.Data.Common;
namespace Rebus.AdoNet.Dialects
{
public class PostgreSql82Dialect : PostgreSqlDialect
{
protected override Version MinimumDatabaseVersion => new Version("8.2");
public override ushort Priority => 82;
public override bool SupportsReturningClause => true;
public override bool SupportsSelectForWithNoWait => true;
public override string SelectForNoWaitClause => "NOWAIT";
public override bool IsSelectForNoWaitLockingException(DbException ex)
{
if (ex != null && ex.GetType().Name == "NpgsqlException")
{
var psqlex = new PostgreSqlExceptionAdapter(ex);
return psqlex.Code == "55P03";
}
return false;
}
}
}
|
using System;
using System.Linq;
using System.Collections.Generic;
using System.Data;
using System.Data.Common;
namespace Rebus.AdoNet.Dialects
{
public class PostgreSql82Dialect : PostgreSqlDialect
{
private static readonly IEnumerable<string> _postgresExceptionNames = new[] { "NpgsqlException", "PostgresException" };
protected override Version MinimumDatabaseVersion => new Version("8.2");
public override ushort Priority => 82;
public override bool SupportsReturningClause => true;
public override bool SupportsSelectForWithNoWait => true;
public override string SelectForNoWaitClause => "NOWAIT";
public override bool IsSelectForNoWaitLockingException(DbException ex)
{
if (ex != null && _postgresExceptionNames.Contains(ex.GetType().Name))
{
var psqlex = new PostgreSqlExceptionAdapter(ex);
return psqlex.Code == "55P03";
}
return false;
}
}
}
|
Add PostgresException on postgresExceptionNames fixing select for NoWait locking exceptions
|
Add PostgresException on postgresExceptionNames fixing select for NoWait locking exceptions
|
C#
|
mit
|
evicertia/Rebus.AdoNet
|
2b13ce4e0676b4c4eb576efeeea31b530117c258
|
samples/Unity-Plugin/Assets/Tactosy/Scripts/TactosyEditor.cs
|
samples/Unity-Plugin/Assets/Tactosy/Scripts/TactosyEditor.cs
|
using UnityEditor;
using UnityEngine;
namespace Tactosy.Unity
{
[CustomEditor(typeof(Manager_Tactosy))]
public class TactosyEditor : Editor
{
public override void OnInspectorGUI()
{
DrawDefaultInspector();
Manager_Tactosy tactosyManager = (Manager_Tactosy) target;
foreach (var mappings in tactosyManager.FeedbackMappings)
{
var key = mappings.Key;
if (GUILayout.Button(key))
{
tactosyManager.Play(key);
}
}
if (GUILayout.Button("Turn Off"))
{
tactosyManager.TurnOff();
}
}
}
}
|
#if UNITY_EDITOR
using UnityEditor;
#endif
using UnityEngine;
namespace Tactosy.Unity
{
#if UNITY_EDITOR
[CustomEditor(typeof(Manager_Tactosy))]
public class TactosyEditor : Editor
{
public override void OnInspectorGUI()
{
DrawDefaultInspector();
Manager_Tactosy tactosyManager = (Manager_Tactosy) target;
foreach (var mappings in tactosyManager.FeedbackMappings)
{
var key = mappings.Key;
if (GUILayout.Button(key))
{
tactosyManager.Play(key);
}
}
if (GUILayout.Button("Turn Off"))
{
tactosyManager.TurnOff();
}
}
}
#endif
}
|
Add preprocessor to prevent compilation error
|
Add preprocessor to prevent compilation error
|
C#
|
mit
|
bhaptics/tactosy-unity
|
db1a9c7a67d6be83c765bfa0abd5b5e56581fbba
|
src/PowerShellEditorServices.Protocol/LanguageServer/SignatureHelp.cs
|
src/PowerShellEditorServices.Protocol/LanguageServer/SignatureHelp.cs
|
//
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//
using Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol;
namespace Microsoft.PowerShell.EditorServices.Protocol.LanguageServer
{
public class SignatureHelpRequest
{
public static readonly
RequestType<TextDocumentPositionParams, SignatureHelp, object, object> Type =
RequestType<TextDocumentPositionParams, SignatureHelp, object, object>.Create("textDocument/signatureHelp");
}
public class ParameterInformation
{
public string Label { get; set; }
public string Documentation { get; set; }
}
public class SignatureInformation
{
public string Label { get; set; }
public string Documentation { get; set; }
public ParameterInformation[] Parameters { get; set; }
}
public class SignatureHelp
{
public SignatureInformation[] Signatures { get; set; }
public int? ActiveSignature { get; set; }
public int? ActiveParameter { get; set; }
}
}
|
//
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//
using Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol;
namespace Microsoft.PowerShell.EditorServices.Protocol.LanguageServer
{
public class SignatureHelpRequest
{
public static readonly
RequestType<TextDocumentPositionParams, SignatureHelp, object, SignatureHelpRegistrationOptions> Type =
RequestType<TextDocumentPositionParams, SignatureHelp, object, SignatureHelpRegistrationOptions>.Create("textDocument/signatureHelp");
}
public class SignatureHelpRegistrationOptions : TextDocumentRegistrationOptions
{
// We duplicate the properties of SignatureHelpOptions class here because
// we cannot derive from two classes. One way to get around this situation
// is to use define SignatureHelpOptions as an interface instead of a class.
public string[] TriggerCharacters { get; set; }
}
public class ParameterInformation
{
public string Label { get; set; }
public string Documentation { get; set; }
}
public class SignatureInformation
{
public string Label { get; set; }
public string Documentation { get; set; }
public ParameterInformation[] Parameters { get; set; }
}
public class SignatureHelp
{
public SignatureInformation[] Signatures { get; set; }
public int? ActiveSignature { get; set; }
public int? ActiveParameter { get; set; }
}
}
|
Add registration options for signaturehelp request
|
Add registration options for signaturehelp request
|
C#
|
mit
|
PowerShell/PowerShellEditorServices
|
c8871129b48dda0677263f5b41ffc2e1240ac571
|
Biggy.SqlCe.Tests/SqlCEColumnMapping.cs
|
Biggy.SqlCe.Tests/SqlCEColumnMapping.cs
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Xunit;
namespace Biggy.SqlCe.Tests {
[Trait("SQL CE Compact column mapping", "")]
public class SqlCEColumnMapping {
public string _connectionStringName = "chinook";
[Fact(DisplayName = "Maps Pk if specified by attribute")]
public void MapingSpecifiedPk() {
var db = new SqlCeStore<Album>(_connectionStringName); //, "Album"
var pkMap = db.TableMapping.PrimaryKeyMapping;
Assert.Single(pkMap);
Assert.Equal("Id", pkMap[0].PropertyName);
Assert.Equal("AlbumId", pkMap[0].ColumnName);
Assert.True(pkMap[0].IsAutoIncementing);
}
[Fact(DisplayName = "Maps Pk even if wasn't specified by attribute")]
public void MapingNotSpecifiedPk() {
var db = new SqlCeStore<Genre>(_connectionStringName); //, "Genre"
var pkMap = db.TableMapping.PrimaryKeyMapping;
Assert.Single(pkMap);
Assert.Equal("Id", pkMap[0].PropertyName);
Assert.Equal("GenreId", pkMap[0].ColumnName);
Assert.True(pkMap[0].IsAutoIncementing);
}
}
}
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Xunit;
namespace Biggy.SqlCe.Tests {
[Trait("SQL CE Compact column mapping", "")]
public class SqlCEColumnMapping {
public string _connectionStringName = "chinook";
[Fact(DisplayName = "Maps Pk if specified by attribute")]
public void MapingSpecifiedPk() {
var db = new SqlCeStore<Album>(_connectionStringName); //, "Album"
var pkMap = db.TableMapping.PrimaryKeyMapping;
Assert.Single(pkMap);
Assert.Equal("Id", pkMap[0].PropertyName);
Assert.Equal("AlbumId", pkMap[0].ColumnName);
Assert.True(pkMap[0].IsAutoIncementing);
}
[Fact(DisplayName = "Maps Pk even if wasn't specified by attribute")]
public void MapingNotSpecifiedPk() {
var db = new SqlCeStore<Genre>(_connectionStringName); //, "Genre"
var pkMap = db.TableMapping.PrimaryKeyMapping;
Assert.Single(pkMap);
Assert.Equal("Id", pkMap[0].PropertyName);
Assert.Equal("GenreId", pkMap[0].ColumnName);
Assert.True(pkMap[0].IsAutoIncementing);
}
[Fact(DisplayName = "Properly maps Pk when is not auto incrementing")]
public void MapingNotAutoIncPk()
{
var db = new SqlCeDocumentStore<MonkeyDocument>(_connectionStringName);
var pkMap = db.TableMapping.PrimaryKeyMapping;
Assert.Single(pkMap);
Assert.Equal("Name", pkMap[0].PropertyName);
Assert.Equal("Name", pkMap[0].ColumnName);
Assert.Equal(typeof(string), pkMap[0].DataType);
Assert.False(pkMap[0].IsAutoIncementing);
}
}
}
|
Add another mapping test, non-auto inc Pk
|
Add another mapping test, non-auto inc Pk
|
C#
|
bsd-3-clause
|
garethbrown/biggy,garethbrown/biggy,jjchiw/biggy,jjchiw/biggy,jjchiw/biggy,garethbrown/biggy,xivSolutions/biggy
|
f6190211aa3d584310ef2aafa9db75cce2798d67
|
src/BloomTests/SendReceiveTests.cs
|
src/BloomTests/SendReceiveTests.cs
|
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.IO;
using System.Linq;
using System.Text;
using Bloom.Publish;
using BloomTemp;
using Chorus.VcsDrivers.Mercurial;
using LibChorus.TestUtilities;
using NUnit.Framework;
using Palaso.IO;
using Palaso.Progress.LogBox;
namespace BloomTests
{
[TestFixture]
public class SendReceiveTests
{
[Test]
public void CreateOrLocate_FolderHasAccentedLetter_FindsIt()
{
using (var setup = new RepositorySetup("Abé Books"))
{
Assert.NotNull(HgRepository.CreateOrLocate(setup.Repository.PathToRepo, new ConsoleProgress()));
}
}
[Test]
public void CreateOrLocate_FolderHasAccentedLetter2_FindsIt()
{
using (var testRoot = new TemporaryFolder("bloom sr test"))
{
string path = Path.Combine(testRoot.FolderPath, "Abé Books");
Directory.CreateDirectory(path);
Assert.NotNull(HgRepository.CreateOrLocate(path, new ConsoleProgress()));
Assert.NotNull(HgRepository.CreateOrLocate(path, new ConsoleProgress()));
}
}
}
}
|
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.IO;
using System.Linq;
using System.Text;
using Bloom.Publish;
using BloomTemp;
using Chorus.VcsDrivers.Mercurial;
using LibChorus.TestUtilities;
using NUnit.Framework;
using Palaso.IO;
using Palaso.Progress.LogBox;
namespace BloomTests
{
[TestFixture]
public class SendReceiveTests
{
[Test, Ignore("not yet")]
public void CreateOrLocate_FolderHasAccentedLetter_FindsIt()
{
using (var setup = new RepositorySetup("Abé Books"))
{
Assert.NotNull(HgRepository.CreateOrLocate(setup.Repository.PathToRepo, new ConsoleProgress()));
}
}
[Test, Ignore("not yet")]
public void CreateOrLocate_FolderHasAccentedLetter2_FindsIt()
{
using (var testRoot = new TemporaryFolder("bloom sr test"))
{
string path = Path.Combine(testRoot.FolderPath, "Abé Books");
Directory.CreateDirectory(path);
Assert.NotNull(HgRepository.CreateOrLocate(path, new ConsoleProgress()));
Assert.NotNull(HgRepository.CreateOrLocate(path, new ConsoleProgress()));
}
}
}
}
|
Disable 2 s/r tests that demonstrate known chorus problems
|
Disable 2 s/r tests that demonstrate known chorus problems
|
C#
|
mit
|
BloomBooks/BloomDesktop,andrew-polk/BloomDesktop,StephenMcConnel/BloomDesktop,JohnThomson/BloomDesktop,andrew-polk/BloomDesktop,andrew-polk/BloomDesktop,gmartin7/myBloomFork,StephenMcConnel/BloomDesktop,andrew-polk/BloomDesktop,StephenMcConnel/BloomDesktop,gmartin7/myBloomFork,BloomBooks/BloomDesktop,gmartin7/myBloomFork,andrew-polk/BloomDesktop,JohnThomson/BloomDesktop,JohnThomson/BloomDesktop,BloomBooks/BloomDesktop,StephenMcConnel/BloomDesktop,JohnThomson/BloomDesktop,andrew-polk/BloomDesktop,BloomBooks/BloomDesktop,gmartin7/myBloomFork,StephenMcConnel/BloomDesktop,gmartin7/myBloomFork,BloomBooks/BloomDesktop,JohnThomson/BloomDesktop,BloomBooks/BloomDesktop,StephenMcConnel/BloomDesktop,gmartin7/myBloomFork
|
d7a55b087575f9412d04666f7870ec5d180a5a9a
|
BZ2TerrainEditor/Program.cs
|
BZ2TerrainEditor/Program.cs
|
using System;
using System.Windows.Forms;
namespace BZ2TerrainEditor
{
/// <summary>
/// Main class.
/// </summary>
public static class Program
{
private static int editorInstances;
/// <summary>
/// Gets or sets the number of editor instances.
/// The application will exit when the number of instaces equals 0.
/// </summary>
public static int EditorInstances
{
get { return editorInstances; }
set
{
editorInstances = value;
if (editorInstances == 0)
{
Application.Exit();
}
}
}
/// <summary>
/// Entry point.
/// </summary>
[STAThread]
public static void Main()
{
Application.EnableVisualStyles();
Editor editor = new Editor();
editor.Show();
Application.Run();
}
}
}
|
using System;
using System.Windows.Forms;
namespace BZ2TerrainEditor
{
/// <summary>
/// Main class.
/// </summary>
public static class Program
{
private static int editorInstances;
/// <summary>
/// Gets or sets the number of editor instances.
/// The application will exit when the number of instaces equals 0.
/// </summary>
public static int EditorInstances
{
get { return editorInstances; }
set
{
editorInstances = value;
if (editorInstances == 0)
{
Application.Exit();
}
}
}
/// <summary>
/// Entry point.
/// </summary>
[STAThread]
public static void Main(string[] args)
{
Application.EnableVisualStyles();
Editor editor;
if (args.Length > 0)
editor = new Editor(args[0]);
else
editor = new Editor();
editor.Show();
Application.Run();
}
}
}
|
Add command line parsing (for "Open With...")
|
Add command line parsing (for "Open With...")
|
C#
|
mit
|
nitroxis/bz2terraineditor
|
95f0ff94b474f08a90583255053b7857532259a0
|
Assets/scripts/ui/ResetBallUI.cs
|
Assets/scripts/ui/ResetBallUI.cs
|
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Networking;
public class ResetBallUI : NetworkBehaviour {
private void OnGUI()
{
GUILayout.BeginArea(new Rect(Screen.width - 150, 10, 140, 40));
if (GUILayout.Button("Reset Ball Position"))
{
CmdResetBallPosition();
}
GUILayout.EndArea();
}
[Command]
private void CmdResetBallPosition()
{
var ball = GameObject.FindGameObjectWithTag("Ball");
if(ball != null)
{
ball.GetComponent<Ball>().ResetPosition();
}
}
}
|
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Networking;
using UnityEngine.Networking.NetworkSystem;
public class ResetBallUI : NetworkBehaviour {
// Message handle for the client id message
private short RESPAWN_MESSAGE = 1003;
void OnServerStart()
{
NetworkServer.RegisterHandler(RESPAWN_MESSAGE, OnResetBallPosition);
}
private void OnGUI()
{
GUILayout.BeginArea(new Rect(Screen.width - 150, 10, 140, 40));
if (GUILayout.Button("Reset Ball Position"))
{
ResetBallPosition();
}
GUILayout.EndArea();
}
[Server]
private void OnResetBallPosition(NetworkMessage netMsg)
{
ResetBallPosition();
}
private void ResetBallPosition()
{
if (NetworkServer.connections.Count > 0 || !NetworkManager.singleton.isNetworkActive)
{
// If local or the server reset the ball position
var ball = GameObject.FindGameObjectWithTag("Ball");
if(ball != null)
{
ball.GetComponent<Ball>().ResetPosition();
}
}
else
{
// Send an empty message of type respawn message
NetworkManager.singleton.client.connection.Send(RESPAWN_MESSAGE, new EmptyMessage());
}
}
}
|
Fix reset ball ui for local and multiplayer
|
Fix reset ball ui for local and multiplayer
|
C#
|
mit
|
Double-Fine-Game-Club/pongball
|
4ab797811bd286a824ac1166cbe85921a14940c3
|
PiDashcam/PiDashcam/StillCam.cs
|
PiDashcam/PiDashcam/StillCam.cs
|
using System;
using System.Timers;
using Shell.Execute;
namespace PiDashcam
{
public class StillCam
{
Timer timer;
int imgcounter;
public StillCam()
{
timer = new Timer(10000);
timer.Elapsed += Timer_Elapsed;
timer.Start();
imgcounter = 1;
}
public void Stop()
{
timer.Stop();
}
void Timer_Elapsed(object sender, ElapsedEventArgs e)
{
ProgramLauncher.Execute("raspistill", String.Format("-o {0}.jpg",imgcounter++));
}
}
}
|
using System;
using System.Timers;
using Shell.Execute;
namespace PiDashcam
{
public class StillCam
{
Timer timer;
int imgcounter;
public StillCam()
{
timer = new Timer(6000);
timer.Elapsed += Timer_Elapsed;
timer.Start();
imgcounter = 1;
}
public void Stop()
{
timer.Stop();
}
void Timer_Elapsed(object sender, ElapsedEventArgs e)
{
ProgramLauncher.Execute("raspistill", String.Format("-h 1920 -v 1080 -n -o {0}.jpg",imgcounter++));
}
}
}
|
Change still image capture parameters.
|
Change still image capture parameters.
|
C#
|
mit
|
zhen08/PiDashcam,zhen08/PiDashcam
|
2e3aca1fbe3ea2714fae606ca49d87eeeb0bf835
|
CertiPay.Common.Tests/Logging/MetricLoggingExtensionsTests.cs
|
CertiPay.Common.Tests/Logging/MetricLoggingExtensionsTests.cs
|
using CertiPay.Common.Logging;
using NUnit.Framework;
using System;
using System.Threading;
namespace CertiPay.Common.Tests.Logging
{
public class MetricLoggingExtensionsTests
{
private static readonly ILog Log = LogManager.GetLogger<MetricLoggingExtensionsTests>();
[Test]
public void Use_Log_Timer_No_Identifier()
{
using (Log.Timer("Use_Log_Timer"))
{
// Cool stuff happens here
}
}
[Test]
public void Use_Log_Timer_With_Debug()
{
using (Log.Timer("Use_Log_Timer_With_Debug", level: LogLevel.Debug))
{
// Debug tracking happens here
}
}
[Test]
public void Takes_Longer_Than_Threshold()
{
using (Log.Timer("Takes_Longer_Than_Threshold", warnIfExceeds: TimeSpan.FromMilliseconds(100)))
{
Thread.Sleep(TimeSpan.FromMilliseconds(150));
}
}
[Test]
public void Object_Context_Provided()
{
using (Log.Timer("Object_Context_Provided", new { id = 10, userId = 12 }))
{
// Cool stuff happens here
}
}
}
}
|
using CertiPay.Common.Logging;
using NUnit.Framework;
using System;
using System.Threading;
namespace CertiPay.Common.Tests.Logging
{
public class MetricLoggingExtensionsTests
{
private static readonly ILog Log = LogManager.GetLogger<MetricLoggingExtensionsTests>();
[Test]
public void Use_Log_Timer_No_Identifier()
{
using (Log.Timer("Use_Log_Timer"))
{
// Cool stuff happens here
}
}
[Test]
public void Takes_Longer_Than_Threshold()
{
using (Log.Timer("Takes_Longer_Than_Threshold", warnIfExceeds: TimeSpan.FromMilliseconds(100)))
{
Thread.Sleep(TimeSpan.FromMilliseconds(150));
}
}
[Test]
public void Object_Context_Provided()
{
using (Log.Timer("Object_Context_Provided {id} {userId}", new { id = 10, userId = 12 }))
{
// Cool stuff happens here
}
}
}
}
|
Tweak tests to reflect new interface for log timing
|
Tweak tests to reflect new interface for log timing
|
C#
|
mit
|
mattgwagner/CertiPay.Common
|
e4dbe3f83616f9f98242366f3b0e894241c128d6
|
Assets/ReturnToHiveState.cs
|
Assets/ReturnToHiveState.cs
|
using UnityEngine;
public class ReturnToHiveState : State
{
Arrive arrive;
public ReturnToHiveState(GameObject gameObject) : base(gameObject)
{
this.gameObject = gameObject;
}
public override void Enter()
{
arrive = gameObject.GetComponent<Arrive>();
arrive.targetGameObject = gameObject.transform.parent.gameObject;
}
public override void Exit()
{
}
public override void Update()
{
if (Vector3.Distance(gameObject.transform.position, gameObject.transform.parent.transform.position) < 1.0f)
{
gameObject.transform.parent.GetComponent<BeeSpawner>().pollenCount += gameObject.GetComponent<Bee>().collectedPollen;
gameObject.GetComponent<Bee>().collectedPollen = 0.0f;
gameObject.GetComponent<StateMachine>().SwitchState(new ExploreState(gameObject));
}
}
}
|
using UnityEngine;
public class ReturnToHiveState : State
{
Arrive arrive;
public ReturnToHiveState(GameObject gameObject) : base(gameObject)
{
this.gameObject = gameObject;
}
public override void Enter()
{
arrive = gameObject.GetComponent<Arrive>();
arrive.targetGameObject = gameObject.transform.parent.gameObject;
}
public override void Exit()
{
arrive.targetGameObject = null;
}
public override void Update()
{
if (Vector3.Distance(gameObject.transform.position, gameObject.transform.parent.transform.position) < 1.0f)
{
gameObject.transform.parent.GetComponent<BeeSpawner>().pollenCount += gameObject.GetComponent<Bee>().collectedPollen;
gameObject.GetComponent<Bee>().collectedPollen = 0.0f;
gameObject.GetComponent<StateMachine>().SwitchState(new ExploreState(gameObject));
}
}
}
|
Set targetGameObject = null on ReturnToHive state exit as this target was overriding the target position when the boids switched back to exploring
|
Set targetGameObject = null on ReturnToHive state exit as this target was overriding the target position when the boids switched back to exploring
|
C#
|
mit
|
kevindoyle93/GAI-LabTest-2
|
d212a844a38fcca956f9ed88cc2bf473c32f0cb5
|
Src/Veil/Compiler/VeilTemplateCompiler.EmitWriteExpression.cs
|
Src/Veil/Compiler/VeilTemplateCompiler.EmitWriteExpression.cs
|
namespace Veil.Compiler
{
internal partial class VeilTemplateCompiler
{
private static void EmitWriteExpression<T>(VeilCompilerState<T> state, SyntaxTreeNode.WriteExpressionNode node)
{
state.Emitter.LoadWriterToStack();
state.PushExpressionScopeOnStack(node.Expression);
state.Emitter.LoadExpressionFromCurrentModelOnStack(node.Expression);
if (node.HtmlEncode && node.Expression.ResultType == typeof(string))
{
var method = typeof(Helpers).GetMethod("HtmlEncode");
state.Emitter.Call(method);
}
else
{
state.Emitter.CallWriteFor(node.Expression.ResultType);
}
}
}
}
|
using System.Reflection;
namespace Veil.Compiler
{
internal partial class VeilTemplateCompiler
{
private static MethodInfo htmlEncodeMethod = typeof(Helpers).GetMethod("HtmlEncode");
private static void EmitWriteExpression<T>(VeilCompilerState<T> state, SyntaxTreeNode.WriteExpressionNode node)
{
state.Emitter.LoadWriterToStack();
state.PushExpressionScopeOnStack(node.Expression);
state.Emitter.LoadExpressionFromCurrentModelOnStack(node.Expression);
if (node.HtmlEncode)
{
if (node.Expression.ResultType != typeof(string)) throw new VeilCompilerException("Tried to HtmlEncode an expression that does not evaluate to a string");
state.Emitter.Call(htmlEncodeMethod);
}
else
{
state.Emitter.CallWriteFor(node.Expression.ResultType);
}
}
}
}
|
Tidy up error handling in WriteExpression
|
Tidy up error handling in WriteExpression
|
C#
|
mit
|
csainty/Veil,csainty/Veil
|
88d2658fca4a631008f576fd969b600bed82c6bc
|
src/Witness/Controllers/SandboxController.cs
|
src/Witness/Controllers/SandboxController.cs
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
namespace Witness.Controllers
{
public class SandboxController : Controller
{
public ActionResult Index()
{
return View();
}
}
}
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
namespace Witness.Controllers
{
public class SandboxController : Controller
{
public ActionResult Index()
{
Response.Cache.SetExpires(DateTime.UtcNow.AddMinutes(1));
return View();
}
}
}
|
Add short term caching to sandbox html response to avoid repeated download by the browser.
|
Add short term caching to sandbox html response to avoid repeated download by the browser.
|
C#
|
bsd-2-clause
|
andrewdavey/witness,andrewdavey/witness,andrewdavey/witness
|
610d608c237b3fa0a41c2f795d257df5e2597140
|
GitTfs/Core/TfsInterop/WrapperFor.cs
|
GitTfs/Core/TfsInterop/WrapperFor.cs
|
namespace Sep.Git.Tfs.Core.TfsInterop
{
public class WrapperFor<T>
{
private readonly T _wrapped;
public WrapperFor(T wrapped)
{
_wrapped = wrapped;
}
public T Unwrap()
{
return _wrapped;
}
public static T Unwrap(object wrapper)
{
return ((WrapperFor<T>)wrapper).Unwrap();
}
}
}
|
namespace Sep.Git.Tfs.Core.TfsInterop
{
public class WrapperFor<TFS_TYPE>
{
private readonly TFS_TYPE _wrapped;
public WrapperFor(TFS_TYPE wrapped)
{
_wrapped = wrapped;
}
public TFS_TYPE Unwrap()
{
return _wrapped;
}
public static TFS_TYPE Unwrap(object wrapper)
{
return ((WrapperFor<TFS_TYPE>)wrapper).Unwrap();
}
}
}
|
Make the generic type self-documenting.
|
Make the generic type self-documenting.
|
C#
|
apache-2.0
|
allansson/git-tfs,irontoby/git-tfs,bleissem/git-tfs,bleissem/git-tfs,steveandpeggyb/Public,modulexcite/git-tfs,guyboltonking/git-tfs,jeremy-sylvis-tmg/git-tfs,allansson/git-tfs,vzabavnov/git-tfs,codemerlin/git-tfs,NathanLBCooper/git-tfs,allansson/git-tfs,modulexcite/git-tfs,spraints/git-tfs,guyboltonking/git-tfs,codemerlin/git-tfs,WolfVR/git-tfs,jeremy-sylvis-tmg/git-tfs,kgybels/git-tfs,NathanLBCooper/git-tfs,spraints/git-tfs,kgybels/git-tfs,adbre/git-tfs,git-tfs/git-tfs,TheoAndersen/git-tfs,andyrooger/git-tfs,irontoby/git-tfs,NathanLBCooper/git-tfs,modulexcite/git-tfs,steveandpeggyb/Public,irontoby/git-tfs,TheoAndersen/git-tfs,spraints/git-tfs,TheoAndersen/git-tfs,codemerlin/git-tfs,WolfVR/git-tfs,jeremy-sylvis-tmg/git-tfs,WolfVR/git-tfs,PKRoma/git-tfs,pmiossec/git-tfs,adbre/git-tfs,kgybels/git-tfs,allansson/git-tfs,hazzik/git-tfs,steveandpeggyb/Public,hazzik/git-tfs,bleissem/git-tfs,hazzik/git-tfs,adbre/git-tfs,TheoAndersen/git-tfs,hazzik/git-tfs,guyboltonking/git-tfs
|
a8e00a9675e912a57bb494c028e5d48f10bd0d5b
|
source/Nuke.Common/CI/ShutdownDotNetBuildServerOnFinish.cs
|
source/Nuke.Common/CI/ShutdownDotNetBuildServerOnFinish.cs
|
// Copyright 2020 Maintainers of NUKE.
// Distributed under the MIT License.
// https://github.com/nuke-build/nuke/blob/master/LICENSE
using System;
using System.Linq;
using JetBrains.Annotations;
using Nuke.Common.Execution;
using Nuke.Common.Tools.DotNet;
namespace Nuke.Common.CI
{
[PublicAPI]
[AttributeUsage(AttributeTargets.Class)]
public class ShutdownDotNetBuildServerOnFinish : Attribute, IOnBuildFinished
{
public void OnBuildFinished(NukeBuild build)
{
// Note https://github.com/dotnet/cli/issues/11424
DotNetTasks.DotNet("build-server shutdown");
}
}
}
|
// Copyright 2020 Maintainers of NUKE.
// Distributed under the MIT License.
// https://github.com/nuke-build/nuke/blob/master/LICENSE
using System;
using System.Linq;
using JetBrains.Annotations;
using Nuke.Common.Execution;
using Nuke.Common.Tools.DotNet;
namespace Nuke.Common.CI
{
[PublicAPI]
[AttributeUsage(AttributeTargets.Class)]
public class ShutdownDotNetBuildServerOnFinish : Attribute, IOnBuildFinished
{
public bool EnableLogging { get; set; }
public void OnBuildFinished(NukeBuild build)
{
// Note https://github.com/dotnet/cli/issues/11424
DotNetTasks.DotNet("build-server shutdown", logInvocation: EnableLogging, logOutput: EnableLogging);
}
}
}
|
Disable logging for shutdown of dotnet process by default
|
Disable logging for shutdown of dotnet process by default
|
C#
|
mit
|
nuke-build/nuke,nuke-build/nuke,nuke-build/nuke,nuke-build/nuke
|
739a54a41b667aa5aa54f1135fb46ce7ee27944d
|
Properties/VersionAssemblyInfo.cs
|
Properties/VersionAssemblyInfo.cs
|
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.34003
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
using System;
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
[assembly: AssemblyVersion("3.0.0.0")]
[assembly: AssemblyFileVersion("3.0.0.0")]
[assembly: AssemblyConfiguration("Release built on 2013-10-23 22:48")]
[assembly: AssemblyCopyright("Copyright © 2013 Autofac Contributors")]
[assembly: AssemblyDescription("Autofac.Extras.NHibernate 3.0.0")]
|
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.18051
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
using System;
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
[assembly: AssemblyVersion("3.0.0.0")]
[assembly: AssemblyFileVersion("3.0.0.0")]
[assembly: AssemblyConfiguration("Release built on 2013-12-03 10:23")]
[assembly: AssemblyCopyright("Copyright © 2013 Autofac Contributors")]
[assembly: AssemblyDescription("Autofac.Extras.NHibernate 3.0.0")]
|
Split WCF functionality out of Autofac.Extras.Multitenant into a separate assembly/package, Autofac.Extras.Multitenant.Wcf. Both packages are versioned 3.1.0.
|
Split WCF functionality out of Autofac.Extras.Multitenant into a separate
assembly/package, Autofac.Extras.Multitenant.Wcf. Both packages are versioned
3.1.0.
|
C#
|
mit
|
autofac/Autofac.Extras.NHibernate
|
059e1143f783a2948035f56165df0ab15a930a8c
|
src/Mvc/Dinamico/Dinamico/Themes/Default/Views/ContentPages/News.cshtml
|
src/Mvc/Dinamico/Dinamico/Themes/Default/Views/ContentPages/News.cshtml
|
@model Dinamico.Models.ContentPage
@{
Content.Define(re =>
{
re.Title = "News page";
re.IconUrl = "{IconsUrl}/newspaper.png";
re.DefaultValue("Visible", false);
re.RestrictParents("Container");
re.Sort(N2.Definitions.SortBy.PublishedDescending);
});
}
@Html.Partial("LayoutPartials/BlogContent")
@using (Content.BeginScope(Content.Traverse.Parent()))
{
@Content.Render.Tokens("NewsFooter")
}
|
@model Dinamico.Models.ContentPage
@{
Content.Define(re =>
{
re.Title = "News page";
re.IconUrl = "{IconsUrl}/newspaper.png";
re.DefaultValue("Visible", false);
re.RestrictParents("Container");
re.Sort(N2.Definitions.SortBy.PublishedDescending);
re.Tags("Tags");
});
}
@Html.Partial("LayoutPartials/BlogContent")
@using (Content.BeginScope(Content.Traverse.Parent()))
{
@Content.Render.Tokens("NewsFooter")
}
|
Add tagging capability to Dinamico news page
|
Add tagging capability to Dinamico news page
|
C#
|
lgpl-2.1
|
nicklv/n2cms,SntsDev/n2cms,VoidPointerAB/n2cms,n2cms/n2cms,nimore/n2cms,DejanMilicic/n2cms,EzyWebwerkstaden/n2cms,DejanMilicic/n2cms,EzyWebwerkstaden/n2cms,nicklv/n2cms,n2cms/n2cms,EzyWebwerkstaden/n2cms,nicklv/n2cms,nimore/n2cms,bussemac/n2cms,n2cms/n2cms,SntsDev/n2cms,EzyWebwerkstaden/n2cms,VoidPointerAB/n2cms,bussemac/n2cms,bussemac/n2cms,n2cms/n2cms,SntsDev/n2cms,EzyWebwerkstaden/n2cms,bussemac/n2cms,nicklv/n2cms,nimore/n2cms,DejanMilicic/n2cms,SntsDev/n2cms,nicklv/n2cms,VoidPointerAB/n2cms,VoidPointerAB/n2cms,DejanMilicic/n2cms,bussemac/n2cms,nimore/n2cms
|
cd618344b82d479992ece0007858b55d52273aea
|
Source/Web/WarehouseSystem.Web/Global.asax.cs
|
Source/Web/WarehouseSystem.Web/Global.asax.cs
|
namespace WarehouseSystem.Web
{
using System.Web.Mvc;
using System.Web.Optimization;
using System.Web.Routing;
using WarehouseSystem.Web.App_Start;
public class MvcApplication : System.Web.HttpApplication
{
protected void Application_Start()
{
AreaRegistration.RegisterAllAreas();
FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
RouteConfig.RegisterRoutes(RouteTable.Routes);
BundleConfig.RegisterBundles(BundleTable.Bundles);
DbConfig.Initialize();
AutoMapperConfig.Execute();
}
}
}
|
namespace WarehouseSystem.Web
{
using System.Web.Mvc;
using System.Web.Optimization;
using System.Web.Routing;
using WarehouseSystem.Web.App_Start;
public class MvcApplication : System.Web.HttpApplication
{
protected void Application_Start()
{
ViewEngines.Engines.Clear();
ViewEngines.Engines.Add(new RazorViewEngine());
AreaRegistration.RegisterAllAreas();
FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
RouteConfig.RegisterRoutes(RouteTable.Routes);
BundleConfig.RegisterBundles(BundleTable.Bundles);
DbConfig.Initialize();
AutoMapperConfig.Execute();
}
}
}
|
Set only Razor view Engine
|
Set only Razor view Engine
|
C#
|
mit
|
NikitoG/WarehouseSystem,NikitoG/WarehouseSystem
|
1f97d021a301fe6a4e51c693a217afd47a5614e5
|
src/Nest/Domain/Mapping/Types/DateMapping.cs
|
src/Nest/Domain/Mapping/Types/DateMapping.cs
|
using System.Collections.Generic;
using Newtonsoft.Json;
using System;
using Newtonsoft.Json.Converters;
namespace Nest
{
[JsonObject(MemberSerialization.OptIn)]
public class DateMapping : MultiFieldMapping, IElasticType, IElasticCoreType
{
public DateMapping():base("date")
{
}
/// <summary>
/// The name of the field that will be stored in the index. Defaults to the property/field name.
/// </summary>
[JsonProperty("index_name")]
public string IndexName { get; set; }
[JsonProperty("store")]
public bool? Store { get; set; }
[JsonProperty("index"), JsonConverter(typeof(StringEnumConverter))]
public NonStringIndexOption? Index { get; set; }
[JsonProperty("format")]
public string Format { get; set; }
[JsonProperty("precision_step")]
public int? PrecisionStep { get; set; }
[JsonProperty("boost")]
public double? Boost { get; set; }
[JsonProperty("null_value")]
public DateTime? NullValue { get; set; }
[JsonProperty("ignore_malformed")]
public bool? IgnoreMalformed { get; set; }
[JsonProperty("doc_values")]
public bool? DocValues { get; set; }
[JsonProperty("numeric_resolution")]
public NumericResolutionUnit NumericResolution { get; set; }
}
}
|
using System.Collections.Generic;
using Newtonsoft.Json;
using System;
using Newtonsoft.Json.Converters;
namespace Nest
{
[JsonObject(MemberSerialization.OptIn)]
public class DateMapping : MultiFieldMapping, IElasticType, IElasticCoreType
{
public DateMapping():base("date")
{
}
/// <summary>
/// The name of the field that will be stored in the index. Defaults to the property/field name.
/// </summary>
[JsonProperty("index_name")]
public string IndexName { get; set; }
[JsonProperty("store")]
public bool? Store { get; set; }
[JsonProperty("index"), JsonConverter(typeof(StringEnumConverter))]
public NonStringIndexOption? Index { get; set; }
[JsonProperty("format")]
public string Format { get; set; }
[JsonProperty("precision_step")]
public int? PrecisionStep { get; set; }
[JsonProperty("boost")]
public double? Boost { get; set; }
[JsonProperty("null_value")]
public DateTime? NullValue { get; set; }
[JsonProperty("ignore_malformed")]
public bool? IgnoreMalformed { get; set; }
[JsonProperty("doc_values")]
public bool? DocValues { get; set; }
[JsonProperty("numeric_resolution")]
public NumericResolutionUnit? NumericResolution { get; set; }
}
}
|
Make numeric_resolution on date mapping nullable
|
Make numeric_resolution on date mapping nullable
|
C#
|
apache-2.0
|
gayancc/elasticsearch-net,junlapong/elasticsearch-net,gayancc/elasticsearch-net,starckgates/elasticsearch-net,mac2000/elasticsearch-net,ststeiger/elasticsearch-net,starckgates/elasticsearch-net,SeanKilleen/elasticsearch-net,tkirill/elasticsearch-net,joehmchan/elasticsearch-net,LeoYao/elasticsearch-net,robrich/elasticsearch-net,LeoYao/elasticsearch-net,mac2000/elasticsearch-net,starckgates/elasticsearch-net,faisal00813/elasticsearch-net,robertlyson/elasticsearch-net,junlapong/elasticsearch-net,DavidSSL/elasticsearch-net,tkirill/elasticsearch-net,robertlyson/elasticsearch-net,ststeiger/elasticsearch-net,abibell/elasticsearch-net,joehmchan/elasticsearch-net,robrich/elasticsearch-net,ststeiger/elasticsearch-net,faisal00813/elasticsearch-net,abibell/elasticsearch-net,abibell/elasticsearch-net,tkirill/elasticsearch-net,robertlyson/elasticsearch-net,joehmchan/elasticsearch-net,wawrzyn/elasticsearch-net,mac2000/elasticsearch-net,SeanKilleen/elasticsearch-net,gayancc/elasticsearch-net,SeanKilleen/elasticsearch-net,robrich/elasticsearch-net,junlapong/elasticsearch-net,DavidSSL/elasticsearch-net,wawrzyn/elasticsearch-net,LeoYao/elasticsearch-net,wawrzyn/elasticsearch-net,faisal00813/elasticsearch-net,DavidSSL/elasticsearch-net
|
9d2f14088ece1313debb0f14b260f7ffb1aca758
|
src/SFA.DAS.EmployerAccounts.Web/Views/EmployerTeam/V2/FundingComplete.cshtml
|
src/SFA.DAS.EmployerAccounts.Web/Views/EmployerTeam/V2/FundingComplete.cshtml
|
@model SFA.DAS.EmployerAccounts.Web.ViewModels.AccountDashboardViewModel
<div class="das-panel das-panel--featured">
@if (Model.ReservedFundingToShow != null)
{
<h3 class="das-panel__heading">Apprenticeship funding secured</h3>
<dl class="das-definition-list das-definition-list--with-separator">
<dt class="das-definition-list__title">Legal entity:</dt>
<dd class="das-definition-list__definition">@Model.ReservedFundingToShowLegalEntityName</dd>
<dt class="das-definition-list__title">Training course:</dt>
<dd class="das-definition-list__definition">@Model.ReservedFundingToShow.CourseName</dd>
<dt class="das-definition-list__title">Start and end date: </dt>
<dd class="das-definition-list__definition">@Model.ReservedFundingToShow.StartDate.ToString("MMMM yyyy") to @Model.ReservedFundingToShow.EndDate.ToString("MMMM yyyy")</dd>
</dl>
}
@if (Model.RecentlyAddedReservationId != null &&
Model.ReservedFundingToShow?.ReservationId != Model.RecentlyAddedReservationId)
{
<p>We're dealing with your request for funding, please check back later.</p>
}
<p><a href="@Url.ReservationsAction("reservations")" class="das-panel__link">Check and secure funding now</a> </p>
</div>
|
@model SFA.DAS.EmployerAccounts.Web.ViewModels.AccountDashboardViewModel
@if (Model.ReservedFundingToShow != null)
{
<h3 class="das-panel__heading">Apprenticeship funding secured</h3>
<dl class="das-definition-list das-definition-list--with-separator">
<dt class="das-definition-list__title">Legal entity:</dt>
<dd class="das-definition-list__definition">@Model.ReservedFundingToShowLegalEntityName</dd>
<dt class="das-definition-list__title">Training course:</dt>
<dd class="das-definition-list__definition">@Model.ReservedFundingToShow.CourseName</dd>
<dt class="das-definition-list__title">Start and end date: </dt>
<dd class="das-definition-list__definition">@Model.ReservedFundingToShow.StartDate.ToString("MMMM yyyy") to @Model.ReservedFundingToShow.EndDate.ToString("MMMM yyyy")</dd>
</dl>
}
@if (Model.RecentlyAddedReservationId != null &&
Model.ReservedFundingToShow?.ReservationId != Model.RecentlyAddedReservationId)
{
<p>We're dealing with your request for funding, please check back later.</p>
}
<p><a href="@Url.ReservationsAction("reservations")" class="das-panel__link">Check and secure funding now</a> </p>
|
Remove nested div to fix style issue
|
[CON-378] Remove nested div to fix style issue
|
C#
|
mit
|
SkillsFundingAgency/das-employerapprenticeshipsservice,SkillsFundingAgency/das-employerapprenticeshipsservice,SkillsFundingAgency/das-employerapprenticeshipsservice
|
bd6c43ea400f4de152e48a019da19a750c6af6ec
|
src/DailySoccerSolution/DailySoccerAppService/Controllers/MatchesController.cs
|
src/DailySoccerSolution/DailySoccerAppService/Controllers/MatchesController.cs
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;
using Microsoft.Azure.Mobile.Server;
using DailySoccer.Shared.Models;
namespace DailySoccerAppService.Controllers
{
public class MatchesController : ApiController
{
public ApiServices Services { get; set; }
[HttpGet]
public GetMatchesRespond GetMatches(GetMatchesRequest request)
{
var now = DateTime.Now;
var matches = new List<MatchInformation>
{
new MatchInformation
{
Id = 1,
BeginDate = now,
LeagueName = "Premier League",
TeamHome = new TeamInformation
{
Id = 1,
Name = "FC Astana",
CurrentScore = 1,
CurrentPredictionPoints = 7,
WinningPredictionPoints = 5
},
TeamAway = new TeamInformation
{
Id = 2,
Name = "Atletico Madrid",
CurrentScore = 0,
CurrentPredictionPoints = 3,
},
},
};
return new GetMatchesRespond
{
CurrentDate = now,
AccountInfo = new AccountInformation
{
Points = 255,
RemainingGuessAmount = 5,
CurrentOrderedCoupon = 15
},
Matches = matches
};
}
}
}
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;
using Microsoft.Azure.Mobile.Server;
using DailySoccer.Shared.Models;
namespace DailySoccerAppService.Controllers
{
public class MatchesController : ApiController
{
public ApiServices Services { get; set; }
// GET: api/Matches
[HttpGet]
public string Get()
{
return "Respond by GET method";
}
[HttpPost]
public string Post(int id)
{
return "Respond by POST method, your ID: " + id;
}
[HttpPost]
public GetMatchesRespond GetMatches(GetMatchesRequest request)
{
var now = DateTime.Now;
var matches = new List<MatchInformation>
{
new MatchInformation
{
Id = 1,
BeginDate = now,
LeagueName = "Premier League",
TeamHome = new TeamInformation
{
Id = 1,
Name = "FC Astana",
CurrentScore = 1,
CurrentPredictionPoints = 7,
WinningPredictionPoints = 5
},
TeamAway = new TeamInformation
{
Id = 2,
Name = "Atletico Madrid",
CurrentScore = 0,
CurrentPredictionPoints = 3,
},
},
};
return new GetMatchesRespond
{
CurrentDate = now,
AccountInfo = new AccountInformation
{
Points = 255,
RemainingGuessAmount = 5,
CurrentOrderedCoupon = 15
},
Matches = matches
};
}
}
}
|
Add basic GET & POST methods into the MatchServices.
|
Add basic GET & POST methods into the MatchServices.
Signed-off-by: Sakul Jaruthanaset <17b4bfe9c570ddd7d4345ec4b3617835712513c0@perfenterprise.com>
|
C#
|
mit
|
tlaothong/xdailysoccer,tlaothong/xdailysoccer,tlaothong/xdailysoccer,tlaothong/xdailysoccer
|
117e18be43d536d32d617f9e331a5c8c0a5a6559
|
Smaller/RunJobController.cs
|
Smaller/RunJobController.cs
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Windows;
using System.Windows.Documents;
using System.Windows.Threading;
namespace Smaller
{
public class RunJobController
{
private static readonly EventWaitHandle _showSignal = new EventWaitHandle(false, EventResetMode.AutoReset, "Smaller.ShowSignal");
public void TriggerRunJobs()
{
_showSignal.Set();
}
private RunJobController()
{
StartListenForJobs();
}
private static readonly RunJobController _instance = new RunJobController();
public static RunJobController Instance
{
get { return _instance; }
}
private void RunJobs()
{
Action x = () =>
{
//if (Application.Current.MainWindow == null)
//{
// Application.Current.MainWindow = new MainWindow();
// Application.Current.MainWindow.Show();
//}
new JobRunner().Run();
};
Application.Current.Dispatcher.Invoke(x, DispatcherPriority.Send);
}
private void StartListenForJobs()
{
new Thread(() =>
{
while (true)
{
_showSignal.WaitOne();
RunJobs();
}
}).Start();
}
}
}
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Windows;
using System.Windows.Documents;
using System.Windows.Threading;
namespace Smaller
{
public class RunJobController
{
private static readonly EventWaitHandle _showSignal = new EventWaitHandle(false, EventResetMode.AutoReset, "Smaller.ShowSignal");
public void TriggerRunJobs()
{
_showSignal.Set();
}
private RunJobController()
{
StartListenForJobs();
}
private static readonly RunJobController _instance = new RunJobController();
public static RunJobController Instance
{
get { return _instance; }
}
private void RunJobs()
{
Action x = () =>
{
//if (Application.Current.MainWindow == null)
//{
// Application.Current.MainWindow = new MainWindow();
// Application.Current.MainWindow.Show();
//}
new JobRunner().Run();
};
Application.Current.Dispatcher.Invoke(x, DispatcherPriority.Send);
}
private void StartListenForJobs()
{
new Thread(() =>
{
// only wait for signals while the app is running
while (Application.Current != null)
{
if (_showSignal.WaitOne(500))
{
RunJobs();
}
}
}).Start();
}
}
}
|
Fix bug where Smaller wouldn't exit properly
|
Fix bug where Smaller wouldn't exit properly
|
C#
|
agpl-3.0
|
geoffles/Smaller
|
c6b22302245637e626a4055a6d35a62788832abf
|
src/bindings/EthernetFrame.cs
|
src/bindings/EthernetFrame.cs
|
using System;
namespace TAPCfg {
public class EthernetFrame {
private byte[] data;
private byte[] src = new byte[6];
private byte[] dst = new byte[6];
private int etherType;
public EthernetFrame(byte[] data) {
this.data = data;
Array.Copy(data, 0, dst, 0, 6);
Array.Copy(data, 6, src, 0, 6);
etherType = (data[12] << 8) | data[13];
}
public byte[] Data {
get { return data; }
}
public int Length {
get { return data.Length; }
}
public byte[] SourceAddress {
get { return src; }
}
public byte[] DestinationAddress {
get { return dst; }
}
public int EtherType {
get { return etherType; }
}
public byte[] Payload {
get {
byte[] ret = new byte[data.Length - 14];
Array.Copy(data, 14, ret, 0, ret.Length);
return ret;
}
}
}
}
|
using System;
namespace TAPCfg {
public enum EtherType : int {
InterNetwork = 0x0800,
ARP = 0x0806,
RARP = 0x8035,
AppleTalk = 0x809b,
AARP = 0x80f3,
InterNetworkV6 = 0x86dd,
CobraNet = 0x8819,
}
public class EthernetFrame {
private byte[] data;
private byte[] src = new byte[6];
private byte[] dst = new byte[6];
private int etherType;
public EthernetFrame(byte[] data) {
this.data = data;
Array.Copy(data, 0, dst, 0, 6);
Array.Copy(data, 6, src, 0, 6);
etherType = (data[12] << 8) | data[13];
}
public byte[] Data {
get { return data; }
}
public int Length {
get { return data.Length; }
}
public byte[] SourceAddress {
get { return src; }
}
public byte[] DestinationAddress {
get { return dst; }
}
public int EtherType {
get { return etherType; }
}
public byte[] Payload {
get {
byte[] ret = new byte[data.Length - 14];
Array.Copy(data, 14, ret, 0, ret.Length);
return ret;
}
}
}
}
|
Add EtherType enumeration for some types (not all)
|
Add EtherType enumeration for some types (not all)
|
C#
|
lgpl-2.1
|
juhovh/tapcfg,zhanleewo/tapcfg,eyecreate/tapcfg,juhovh/tapcfg,zhanleewo/tapcfg,eyecreate/tapcfg,zhanleewo/tapcfg,zhanleewo/tapcfg,zhanleewo/tapcfg,juhovh/tapcfg,eyecreate/tapcfg,eyecreate/tapcfg,juhovh/tapcfg,juhovh/tapcfg,juhovh/tapcfg,eyecreate/tapcfg
|
08fb5c279728d2d377382d70f677e108f66b060d
|
src/Cake.AppVeyor.Tests/Keys.cs
|
src/Cake.AppVeyor.Tests/Keys.cs
|
using System;
using System.IO;
namespace Cake.AppVeyor.Tests
{
public static class Keys
{
const string YOUR_APPVEYOR_API_TOKEN = "{APPVEYOR_APITOKEN}";
static string appVeyorApiToken;
public static string AppVeyorApiToken {
get
{
if (appVeyorApiToken == null)
{
// Check for a local file with a token first
var localFile = Path.Combine(AppContext.BaseDirectory, "..", "..", "..", "..", ".appveyorapitoken");
if (File.Exists(localFile))
appVeyorApiToken = File.ReadAllText(localFile);
// Next check for an environment variable
if (string.IsNullOrEmpty(appVeyorApiToken))
appVeyorApiToken = Environment.GetEnvironmentVariable("appveyor_api_token");
// Finally use the const value
if (string.IsNullOrEmpty(appVeyorApiToken))
appVeyorApiToken = YOUR_APPVEYOR_API_TOKEN;
}
return appVeyorApiToken;
}
}
}
}
|
using System;
using System.IO;
namespace Cake.AppVeyor.Tests
{
public static class Keys
{
const string YOUR_APPVEYOR_API_TOKEN = "{APPVEYOR_APITOKEN}";
static string appVeyorApiToken;
public static string AppVeyorApiToken {
get
{
if (appVeyorApiToken == null)
{
// Check for a local file with a token first
var localFile = Path.Combine(AppContext.BaseDirectory, "..", "..", "..", "..", "..", ".appveyorapitoken");
if (File.Exists(localFile))
appVeyorApiToken = File.ReadAllText(localFile);
// Next check for an environment variable
if (string.IsNullOrEmpty(appVeyorApiToken))
appVeyorApiToken = Environment.GetEnvironmentVariable("appveyor_api_token");
// Finally use the const value
if (string.IsNullOrEmpty(appVeyorApiToken))
appVeyorApiToken = YOUR_APPVEYOR_API_TOKEN;
}
return appVeyorApiToken;
}
}
}
}
|
Fix path to local key file
|
Fix path to local key file
|
C#
|
apache-2.0
|
Redth/Cake.AppVeyor,Redth/Cake.AppVeyor
|
b47cc6f4287386188d6c7bf45941b869c940786c
|
FbxSharpTests/ObjectPrinterTest.cs
|
FbxSharpTests/ObjectPrinterTest.cs
|
using System;
using NUnit.Framework;
using FbxSharp;
namespace FbxSharpTests
{
[TestFixture]
public class ObjectPrinterTest
{
[Test]
public void QuoteQuotesAndEscapeStrings()
{
Assert.AreEqual("\"abcdefghijklmnopqrstuvwxyz\"", ObjectPrinter.quote("abcdefghijklmnopqrstuvwxyz"));
Assert.AreEqual("\"ABCDEFGHIJKLMNOPQRSTUVWXYZ\"", ObjectPrinter.quote("ABCDEFGHIJKLMNOPQRSTUVWXYZ"));
Assert.AreEqual("\"0123456789\"", ObjectPrinter.quote("0123456789"));
Assert.AreEqual("\"`~!@#$%^&*()_+-=\"", ObjectPrinter.quote("`~!@#$%^&*()_+-="));
// Assert.AreEqual("\"\\\\\"", ObjectPrinter.quote("\\"));
// Assert.AreEqual("\"\\\"\"", ObjectPrinter.quote("\""));
Assert.AreEqual("\"[]{}|;:',<.>/?\"", ObjectPrinter.quote("[]{}|;:',<.>/?"));
Assert.AreEqual("\"\\r\"", ObjectPrinter.quote("\r"));
Assert.AreEqual("\"\\n\"", ObjectPrinter.quote("\n"));
Assert.AreEqual("\"\\t\"", ObjectPrinter.quote("\t"));
}
}
}
|
using System;
using NUnit.Framework;
using FbxSharp;
using System.IO;
namespace FbxSharpTests
{
[TestFixture]
public class ObjectPrinterTest
{
[Test]
public void QuoteQuotesAndEscapeStrings()
{
Assert.AreEqual("\"abcdefghijklmnopqrstuvwxyz\"", ObjectPrinter.quote("abcdefghijklmnopqrstuvwxyz"));
Assert.AreEqual("\"ABCDEFGHIJKLMNOPQRSTUVWXYZ\"", ObjectPrinter.quote("ABCDEFGHIJKLMNOPQRSTUVWXYZ"));
Assert.AreEqual("\"0123456789\"", ObjectPrinter.quote("0123456789"));
Assert.AreEqual("\"`~!@#$%^&*()_+-=\"", ObjectPrinter.quote("`~!@#$%^&*()_+-="));
// Assert.AreEqual("\"\\\\\"", ObjectPrinter.quote("\\"));
// Assert.AreEqual("\"\\\"\"", ObjectPrinter.quote("\""));
Assert.AreEqual("\"[]{}|;:',<.>/?\"", ObjectPrinter.quote("[]{}|;:',<.>/?"));
Assert.AreEqual("\"\\r\"", ObjectPrinter.quote("\r"));
Assert.AreEqual("\"\\n\"", ObjectPrinter.quote("\n"));
Assert.AreEqual("\"\\t\"", ObjectPrinter.quote("\t"));
}
[Test]
public void PrintPropertyPrintsTheProperty()
{
// given
var prop = new PropertyT<double>("something");
var printer = new ObjectPrinter();
var writer = new StringWriter();
var expected =
@" Name = something
Type = Double (MonoType)
Value = 0
SrcObjectCount = 0
DstObjectCount = 0
";
// when
printer.PrintProperty(prop, writer);
// then
Assert.AreEqual(expected, writer.ToString());
}
}
}
|
Add a test with a specific writer.
|
Add a test with a specific writer.
|
C#
|
lgpl-2.1
|
izrik/FbxSharp,izrik/FbxSharp,izrik/FbxSharp,izrik/FbxSharp,izrik/FbxSharp
|
eaf3c60339d0374ef15162a7327895faf34ae066
|
Mindscape.Raygun4Net.WebApi/Properties/AssemblyVersionInfo.cs
|
Mindscape.Raygun4Net.WebApi/Properties/AssemblyVersionInfo.cs
|
using System.Reflection;
// 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("5.10.2.0")]
[assembly: AssemblyFileVersion("5.10.2.0")]
|
using System.Reflection;
// 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("5.10.1.0")]
[assembly: AssemblyFileVersion("5.10.1.0")]
|
Revert "Bump WebApi version to 5.10.3"
|
Revert "Bump WebApi version to 5.10.3"
This reverts commit 9356b6eb8eb6c9080fd72df0cd1f69f7b499912b.
|
C#
|
mit
|
MindscapeHQ/raygun4net,MindscapeHQ/raygun4net,MindscapeHQ/raygun4net
|
0c2f0122b78fea983ae79c173aceaaf981fbca2f
|
Roton/Emulation/Interactions/Impl/ForestInteraction.cs
|
Roton/Emulation/Interactions/Impl/ForestInteraction.cs
|
using System;
using Roton.Emulation.Core;
using Roton.Emulation.Data;
using Roton.Emulation.Data.Impl;
using Roton.Infrastructure.Impl;
namespace Roton.Emulation.Interactions.Impl
{
[Context(Context.Original, 0x14)]
[Context(Context.Super, 0x14)]
public sealed class ForestInteraction : IInteraction
{
private readonly Lazy<IEngine> _engine;
private IEngine Engine => _engine.Value;
public ForestInteraction(Lazy<IEngine> engine)
{
_engine = engine;
}
public void Interact(IXyPair location, int index, IXyPair vector)
{
Engine.ClearForest(location);
Engine.UpdateBoard(location);
var forestIndex = Engine.State.ForestIndex;
var forestSongLength = Engine.Sounds.Forest.Length;
Engine.State.ForestIndex = (forestIndex + 2) % forestSongLength;
Engine.PlaySound(3, Engine.Sounds.Forest, forestIndex, 2);
if (!Engine.Alerts.Forest)
return;
Engine.SetMessage(0xC8, Engine.Alerts.ForestMessage);
Engine.Alerts.Forest = false;
}
}
}
|
using System;
using Roton.Emulation.Core;
using Roton.Emulation.Data;
using Roton.Emulation.Data.Impl;
using Roton.Infrastructure.Impl;
namespace Roton.Emulation.Interactions.Impl
{
[Context(Context.Original, 0x14)]
[Context(Context.Super, 0x14)]
public sealed class ForestInteraction : IInteraction
{
private readonly Lazy<IEngine> _engine;
private IEngine Engine => _engine.Value;
public ForestInteraction(Lazy<IEngine> engine)
{
_engine = engine;
}
public void Interact(IXyPair location, int index, IXyPair vector)
{
Engine.ClearForest(location);
Engine.UpdateBoard(location);
var forestSongLength = Engine.Sounds.Forest.Length;
var forestIndex = Engine.State.ForestIndex % forestSongLength;
Engine.State.ForestIndex = (forestIndex + 2) % forestSongLength;
Engine.PlaySound(3, Engine.Sounds.Forest, forestIndex, 2);
if (!Engine.Alerts.Forest)
return;
Engine.SetMessage(0xC8, Engine.Alerts.ForestMessage);
Engine.Alerts.Forest = false;
}
}
}
|
Fix a forest crash in ZZT.
|
Fix a forest crash in ZZT.
|
C#
|
isc
|
SaxxonPike/roton,SaxxonPike/roton
|
7fcc938fcb1acc481d58cfc0d98096d7a3410a1a
|
source/MMS.ServiceBus/Pipeline/NewtonsoftJsonMessageSerializer.cs
|
source/MMS.ServiceBus/Pipeline/NewtonsoftJsonMessageSerializer.cs
|
//-------------------------------------------------------------------------------
// <copyright file="NewtonsoftJsonMessageSerializer.cs" company="MMS AG">
// Copyright (c) MMS AG, 2008-2015
// </copyright>
//-------------------------------------------------------------------------------
namespace MMS.ServiceBus.Pipeline
{
using System;
using System.IO;
using Newtonsoft.Json;
public class NewtonsoftJsonMessageSerializer : IMessageSerializer
{
public string ContentType
{
get
{
return "application/json";
}
}
public void Serialize(object message, Stream body)
{
var streamWriter = new StreamWriter(body);
var writer = new JsonTextWriter(streamWriter);
var serializer = new JsonSerializer();
serializer.Serialize(writer, message);
streamWriter.Flush();
body.Flush();
body.Position = 0;
}
public object Deserialize(Stream body, Type messageType)
{
var streamReader = new StreamReader(body);
var reader = new JsonTextReader(streamReader);
var serializer = new JsonSerializer();
return serializer.Deserialize(reader, messageType);
}
}
}
|
//-------------------------------------------------------------------------------
// <copyright file="NewtonsoftJsonMessageSerializer.cs" company="MMS AG">
// Copyright (c) MMS AG, 2008-2015
// </copyright>
//-------------------------------------------------------------------------------
namespace MMS.ServiceBus.Pipeline
{
using System;
using System.IO;
using Newtonsoft.Json;
public class NewtonsoftJsonMessageSerializer : IMessageSerializer
{
private readonly Func<JsonSerializerSettings> settings;
public NewtonsoftJsonMessageSerializer() : this(() => null)
{
}
public NewtonsoftJsonMessageSerializer(Func<JsonSerializerSettings> settings)
{
this.settings = settings;
}
public string ContentType
{
get
{
return "application/json";
}
}
public void Serialize(object message, Stream body)
{
var streamWriter = new StreamWriter(body);
var writer = new JsonTextWriter(streamWriter);
var serializer = JsonSerializer.Create(this.settings());
serializer.Serialize(writer, message);
streamWriter.Flush();
body.Flush();
body.Position = 0;
}
public object Deserialize(Stream body, Type messageType)
{
var streamReader = new StreamReader(body);
var reader = new JsonTextReader(streamReader);
var serializer = JsonSerializer.Create(this.settings());
return serializer.Deserialize(reader, messageType);
}
}
}
|
Enable configuration of Json Serializer
|
Enable configuration of Json Serializer
|
C#
|
apache-2.0
|
MultimediaSolutionsAg/ServiceBus
|
96a1946979e836502eca23991396a34a02f38549
|
src/Kephas.Data.InMemory/ContextExtensions.cs
|
src/Kephas.Data.InMemory/ContextExtensions.cs
|
// --------------------------------------------------------------------------------------------------------------------
// <copyright file="ContextExtensions.cs" company="Quartz Software SRL">
// Copyright (c) Quartz Software SRL. All rights reserved.
// </copyright>
// <summary>
// Implements the context extensions class.
// </summary>
// --------------------------------------------------------------------------------------------------------------------
namespace Kephas.Data.InMemory
{
using System.Collections.Generic;
using Kephas.Data.Capabilities;
using Kephas.Diagnostics.Contracts;
using Kephas.Services;
/// <summary>
/// Extension methods for <see cref="IContext"/>.
/// </summary>
public static class ContextExtensions
{
/// <summary>
/// Gets the initial data.
/// </summary>
/// <param name="context">The context to act on.</param>
/// <returns>
/// An enumeration of entity information.
/// </returns>
public static IEnumerable<IEntityInfo> GetInitialData(this IContext context)
{
Requires.NotNull(context, nameof(context));
return context[nameof(InMemoryDataContextConfiguration.InitialData)] as IEnumerable<IEntityInfo>;
}
/// <summary>
/// Sets the initial data.
/// </summary>
/// <param name="context">The context to act on.</param>
/// <param name="initialData">The initial data.</param>
public static void SetInitialData(this IContext context, IEnumerable<IEntityInfo> initialData)
{
Requires.NotNull(context, nameof(context));
context[nameof(InMemoryDataContextConfiguration.InitialData)] = initialData;
}
}
}
|
// --------------------------------------------------------------------------------------------------------------------
// <copyright file="ContextExtensions.cs" company="Quartz Software SRL">
// Copyright (c) Quartz Software SRL. All rights reserved.
// </copyright>
// <summary>
// Implements the context extensions class.
// </summary>
// --------------------------------------------------------------------------------------------------------------------
namespace Kephas.Data.InMemory
{
using System.Collections.Generic;
using Kephas.Data.Capabilities;
using Kephas.Diagnostics.Contracts;
using Kephas.Services;
/// <summary>
/// Extension methods for <see cref="IContext"/>.
/// </summary>
public static class ContextExtensions
{
/// <summary>
/// Gets the initial data.
/// </summary>
/// <param name="context">The context to act on.</param>
/// <returns>
/// An enumeration of entity information.
/// </returns>
public static IEnumerable<IEntityInfo> GetInitialData(this IContext context)
{
return context?[nameof(InMemoryDataContextConfiguration.InitialData)] as IEnumerable<IEntityInfo>;
}
/// <summary>
/// Sets the initial data.
/// </summary>
/// <param name="context">The context to act on.</param>
/// <param name="initialData">The initial data.</param>
public static void SetInitialData(this IContext context, IEnumerable<IEntityInfo> initialData)
{
Requires.NotNull(context, nameof(context));
context[nameof(InMemoryDataContextConfiguration.InitialData)] = initialData;
}
}
}
|
Allow context to be null when querying for initial data.
|
Allow context to be null when querying for initial data.
|
C#
|
mit
|
quartz-software/kephas,quartz-software/kephas
|
fd677047f4cd277dce78939d150591376712e3c2
|
src/Microsoft.AspNet.Security.DataProtection/DefaultDataProtectionProvider.cs
|
src/Microsoft.AspNet.Security.DataProtection/DefaultDataProtectionProvider.cs
|
// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
using Microsoft.AspNet.Security.DataProtection.KeyManagement;
using Microsoft.Framework.DependencyInjection;
using Microsoft.Framework.DependencyInjection.Fallback;
using Microsoft.Framework.OptionsModel;
namespace Microsoft.AspNet.Security.DataProtection
{
public class DefaultDataProtectionProvider : IDataProtectionProvider
{
private readonly IDataProtectionProvider _innerProvider;
public DefaultDataProtectionProvider()
{
// use DI defaults
var collection = new ServiceCollection();
var defaultServices = DataProtectionServices.GetDefaultServices();
collection.Add(defaultServices);
var serviceProvider = collection.BuildServiceProvider();
_innerProvider = (IDataProtectionProvider)serviceProvider.GetService(typeof(IDataProtectionProvider));
CryptoUtil.Assert(_innerProvider != null, "_innerProvider != null");
}
public DefaultDataProtectionProvider(
[NotNull] IOptions<DataProtectionOptions> optionsAccessor,
[NotNull] IKeyManager keyManager)
{
KeyRingBasedDataProtectionProvider rootProvider = new KeyRingBasedDataProtectionProvider(new KeyRingProvider(keyManager));
var options = optionsAccessor.Options;
_innerProvider = (!String.IsNullOrEmpty(options.ApplicationDiscriminator))
? (IDataProtectionProvider)rootProvider.CreateProtector(options.ApplicationDiscriminator)
: rootProvider;
}
public IDataProtector CreateProtector([NotNull] string purpose)
{
return _innerProvider.CreateProtector(purpose);
}
}
}
|
// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
using Microsoft.AspNet.Security.DataProtection.KeyManagement;
using Microsoft.Framework.DependencyInjection;
using Microsoft.Framework.DependencyInjection.Fallback;
using Microsoft.Framework.OptionsModel;
namespace Microsoft.AspNet.Security.DataProtection
{
public class DefaultDataProtectionProvider : IDataProtectionProvider
{
private readonly IDataProtectionProvider _innerProvider;
public DefaultDataProtectionProvider()
{
// use DI defaults
var collection = new ServiceCollection();
var defaultServices = DataProtectionServices.GetDefaultServices();
collection.Add(defaultServices);
var serviceProvider = collection.BuildServiceProvider();
_innerProvider = serviceProvider.GetRequiredService<IDataProtectionProvider>();
}
public DefaultDataProtectionProvider(
[NotNull] IOptions<DataProtectionOptions> optionsAccessor,
[NotNull] IKeyManager keyManager)
{
KeyRingBasedDataProtectionProvider rootProvider = new KeyRingBasedDataProtectionProvider(new KeyRingProvider(keyManager));
var options = optionsAccessor.Options;
_innerProvider = (!String.IsNullOrEmpty(options.ApplicationDiscriminator))
? (IDataProtectionProvider)rootProvider.CreateProtector(options.ApplicationDiscriminator)
: rootProvider;
}
public IDataProtector CreateProtector([NotNull] string purpose)
{
return _innerProvider.CreateProtector(purpose);
}
}
}
|
Change GetService call to GetRequiredService
|
Change GetService call to GetRequiredService
Remove the assertion that the returned service is not null, since the
GetRequiredService extension method will throw instead of ever
returning null.
|
C#
|
apache-2.0
|
aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore
|
f079ebe857ebf708c5aae6ee0a7c102ea4c9c5f5
|
osu.Game/Online/API/Requests/GetBeatmapRequest.cs
|
osu.Game/Online/API/Requests/GetBeatmapRequest.cs
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using osu.Game.Beatmaps;
using osu.Game.Online.API.Requests.Responses;
namespace osu.Game.Online.API.Requests
{
public class GetBeatmapRequest : APIRequest<APIBeatmap>
{
private readonly BeatmapInfo beatmap;
private string lookupString => beatmap.OnlineBeatmapID > 0 ? beatmap.OnlineBeatmapID.ToString() : $@"lookup?checksum={beatmap.MD5Hash}&filename={System.Uri.EscapeUriString(beatmap.Path)}";
public GetBeatmapRequest(BeatmapInfo beatmap)
{
this.beatmap = beatmap;
}
protected override string Target => $@"beatmaps/{lookupString}";
}
}
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using osu.Game.Beatmaps;
using osu.Game.Online.API.Requests.Responses;
namespace osu.Game.Online.API.Requests
{
public class GetBeatmapRequest : APIRequest<APIBeatmap>
{
private readonly BeatmapInfo beatmap;
public GetBeatmapRequest(BeatmapInfo beatmap)
{
this.beatmap = beatmap;
}
protected override string Target => $@"beatmaps/lookup?id={beatmap.OnlineBeatmapID}&checksum={beatmap.MD5Hash}&filename={System.Uri.EscapeUriString(beatmap.Path)}";
}
}
|
Simplify beatmap lookup to use a single endpoint
|
Simplify beatmap lookup to use a single endpoint
|
C#
|
mit
|
peppy/osu-new,smoogipoo/osu,peppy/osu,2yangk23/osu,NeoAdonis/osu,EVAST9919/osu,NeoAdonis/osu,peppy/osu,smoogipoo/osu,2yangk23/osu,smoogipooo/osu,EVAST9919/osu,johnneijzen/osu,NeoAdonis/osu,ppy/osu,UselessToucan/osu,ppy/osu,UselessToucan/osu,smoogipoo/osu,johnneijzen/osu,ppy/osu,UselessToucan/osu,peppy/osu
|
669c708a14a317addd4003acac94e3f04f4eb8a3
|
DanTup.DartAnalysis/Properties/AssemblyInfo.cs
|
DanTup.DartAnalysis/Properties/AssemblyInfo.cs
|
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
[assembly: AssemblyTitle("DanTup's DartAnalysis.NET: A .NET wrapper around Google's Analysis Server for Dart.")]
[assembly: AssemblyProduct("DanTup's DartAnalysis.NET: A .NET wrapper around Google's Analysis Server for Dart.")]
[assembly: AssemblyCompany("Danny Tuppeny")]
[assembly: AssemblyCopyright("Copyright Danny Tuppeny © 2014")]
[assembly: ComVisible(false)]
[assembly: AssemblyVersion("0.1.*")]
[assembly: AssemblyFileVersion("0.1.0.0")]
[assembly: InternalsVisibleTo("DanTup.DartAnalysis.Tests")]
|
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
[assembly: AssemblyTitle("DartAnalysis.NET: A .NET wrapper around Google's Analysis Server for Dart.")]
[assembly: AssemblyProduct("DartAnalysis.NET: A .NET wrapper around Google's Analysis Server for Dart.")]
[assembly: AssemblyCompany("Danny Tuppeny")]
[assembly: AssemblyCopyright("Copyright Danny Tuppeny © 2014")]
[assembly: ComVisible(false)]
[assembly: AssemblyVersion("0.1.*")]
[assembly: InternalsVisibleTo("DanTup.DartAnalysis.Tests")]
|
Remove name from assembly info; this looks silly on NuGet.
|
Remove name from assembly info; this looks silly on NuGet.
|
C#
|
mit
|
DartVS/DartVS,modulexcite/DartVS,DartVS/DartVS,DartVS/DartVS,modulexcite/DartVS,modulexcite/DartVS
|
accc60d81973f6a307215fdda59bb391927daa31
|
Mvc52Application/Controllers/HomeController.cs
|
Mvc52Application/Controllers/HomeController.cs
|
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Web;
using System.Web.Mvc;
namespace Mvc52Application.Controllers
{
public class HomeController : Controller
{
public ActionResult Index()
{
return View();
}
public ActionResult About()
{
string foo = ConfigurationManager.AppSettings["foo"];
ViewBag.Message = String.Format("The value of setting foo is: '{0}'", foo);
return View();
}
public ActionResult Contact()
{
ViewBag.Message = "Your contact page.";
return View();
}
}
}
|
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Diagnostics;
using System.Linq;
using System.Web;
using System.Web.Mvc;
namespace Mvc52Application.Controllers
{
public class HomeController : Controller
{
public ActionResult Index()
{
Trace.TraceInformation("{0}: This is an informational trace message", DateTime.Now);
Trace.TraceWarning("{0}: Here is trace warning", DateTime.Now);
Trace.TraceError("{0}: Something is broken; tracing an error!", DateTime.Now);
return View();
}
public ActionResult About()
{
string foo = ConfigurationManager.AppSettings["foo"];
ViewBag.Message = String.Format("The value of setting foo is: '{0}'", foo);
return View();
}
public ActionResult Contact()
{
ViewBag.Message = "Your contact page.";
return View();
}
}
}
|
Add some test tracing to Index action
|
Add some test tracing to Index action
|
C#
|
apache-2.0
|
davidebbo-test/Mvc52Application,davidebbo-test/Mvc52Application,davidebbo-test/Mvc52Application
|
7a2e0044316acb1d89d5baaecad3dd0ea5aa3d0b
|
src/ErgastApi/Requests/Standard/SeasonListRequest.cs
|
src/ErgastApi/Requests/Standard/SeasonListRequest.cs
|
using ErgastApi.Client.Attributes;
using ErgastApi.Responses;
namespace ErgastApi.Requests
{
public class SeasonListRequest : StandardRequest<SeasonResponse>
{
// Value not used
// ReSharper disable once UnassignedGetOnlyAutoProperty
[UrlTerminator, UrlSegment("seasons")]
protected object Seasons { get; }
}
}
|
using ErgastApi.Client.Attributes;
using ErgastApi.Responses;
namespace ErgastApi.Requests
{
public class SeasonListRequest : StandardRequest<SeasonResponse>
{
[UrlSegment("constructorStandings")]
public int? ConstructorStanding { get; set; }
[UrlSegment("driverStandings")]
public int? DriverStanding { get; set; }
// Value not used
// ReSharper disable once UnassignedGetOnlyAutoProperty
[UrlTerminator, UrlSegment("seasons")]
protected object Seasons { get; }
}
}
|
Support driver constructor standing parameter for season list request
|
Support driver constructor standing parameter for season list request
|
C#
|
unlicense
|
Krusen/ErgastApi.Net
|
3025bea195bad51bcc41a3e8c258984d5c31010a
|
src/Sinch.ServerSdk/Callouts/ICalloutApiEndpoints.cs
|
src/Sinch.ServerSdk/Callouts/ICalloutApiEndpoints.cs
|
using System.Threading.Tasks;
using Sinch.ServerSdk.Callouts;
using Sinch.WebApiClient;
public interface ICalloutApiEndpoints
{
[HttpPost("calling/v1/callouts/")]
Task<CalloutResponse> Callout([ToBody] CalloutRequest request);
}
|
using System.Threading.Tasks;
using Sinch.ServerSdk.Callouts;
using Sinch.WebApiClient;
public interface ICalloutApiEndpoints
{
[HttpPost("calling/v1/callouts")]
Task<CalloutResponse> Callout([ToBody] CalloutRequest request);
}
|
Remove API route trailing slash to avoid AWS API Gateway modification
|
Remove API route trailing slash to avoid AWS API Gateway modification
Remove last slash in API route so url don't get modified when passing AWS API Gateway. This may be cause of signature error
|
C#
|
mit
|
sinch/nuget-serversdk
|
6073c6ec0f756db7396d4e78bb2a611554832cf9
|
src/ImGui/Development/GUIDebug.cs
|
src/ImGui/Development/GUIDebug.cs
|
namespace ImGui.Development
{
public class GUIDebug
{
public static void SetWindowPosition(string windowName, Point position)
{
var possibleWindow = Application.ImGuiContext.WindowManager.Windows.Find(window => window.Name == windowName);
if (possibleWindow != null)
{
possibleWindow.Position = position;
}
}
}
}
|
using ImGui.Rendering;
namespace ImGui.Development
{
public class GUIDebug
{
public static void SetWindowPosition(string windowName, Point position)
{
var possibleWindow = Application.ImGuiContext.WindowManager.Windows.Find(window => window.Name == windowName);
if (possibleWindow != null)
{
possibleWindow.Position = position;
}
}
}
}
namespace ImGui
{
public partial class GUI
{
public static void DebugBox(int id, Rect rect, Color color)
{
var window = GetCurrentWindow();
if (window.SkipItems)
return;
//get or create the root node
var container = window.AbsoluteVisualList;
var node = (Node)container.Find(visual => visual.Id == id);
if (node == null)
{
//create node
node = new Node(id, $"DebugBox<{id}>");
node.UseBoxModel = true;
node.RuleSet.Replace(GUISkin.Current[GUIControlName.Box]);
node.RuleSet.BackgroundColor = color;
container.Add(node);
}
node.ActiveSelf = true;
// last item state
window.TempData.LastItemState = node.State;
// rect
node.Rect = window.GetRect(rect);
using (var dc = node.RenderOpen())
{
dc.DrawBoxModel(node.RuleSet, node.Rect);
}
}
}
}
|
Add DebugBox for debugging issues in popup windows
|
Add DebugBox for debugging issues in popup windows
|
C#
|
agpl-3.0
|
zwcloud/ImGui,zwcloud/ImGui,zwcloud/ImGui
|
01ab58fe7c58215f60b5a78e92b33418505b5137
|
src/SFA.DAS.EmployerApprenticeshipsService.Domain/Entities/Account/LegalEntity.cs
|
src/SFA.DAS.EmployerApprenticeshipsService.Domain/Entities/Account/LegalEntity.cs
|
namespace SFA.DAS.EmployerApprenticeshipsService.Domain.Entities.Account
{
public class LegalEntity
{
public long Id { get; set; }
public string Name { get; set; }
}
}
|
using System;
namespace SFA.DAS.EmployerApprenticeshipsService.Domain.Entities.Account
{
public class LegalEntity
{
public long Id { get; set; }
public string CompanyNumber { get; set; }
public string Name { get; set; }
public string RegisteredAddress { get; set; }
public DateTime DateOfIncorporation { get; set; }
}
}
|
Change legal entity to include the CompanyNumber, RegisteredAddress and DateOfIncorporation
|
Change legal entity to include the CompanyNumber, RegisteredAddress and DateOfIncorporation
|
C#
|
mit
|
SkillsFundingAgency/das-employerapprenticeshipsservice,SkillsFundingAgency/das-employerapprenticeshipsservice,SkillsFundingAgency/das-employerapprenticeshipsservice
|
0c5c7bab97b82c2088e0c4f3b03d90a5ee563f20
|
Akiba/Core/Configuration.cs
|
Akiba/Core/Configuration.cs
|
namespace Akiba.Core
{
using System.IO;
using YamlDotNet.Serialization;
using YamlDotNet.Serialization.NamingConventions;
internal class Configuration
{
public const string ConfigurationName = "configuration.yaml";
public enum ScreenModes : ushort
{
Windowed,
Fullscreen,
Borderless,
};
public ushort FramesPerSecond { get; private set; } = 60;
public ushort RenderingResolutionWidth { get; private set; } = 1920;
public ushort RenderingResolutionHeight { get; private set; } = 1080;
public ScreenModes ScreenMode { get; private set; } = ScreenModes.Fullscreen;
public bool VerticalSynchronization { get; private set; } = false;
public bool AntiAliasing { get; private set; } = false;
public bool HideCursor { get; private set; } = false;
public bool PreventSystemSleep { get; private set; } = true;
public bool DisableMovies { get; private set; } = false;
public Configuration Save()
{
var serializer = new SerializerBuilder().EmitDefaults().WithNamingConvention(new CamelCaseNamingConvention()).Build();
using (var streamWriter = new StreamWriter(ConfigurationName))
{
serializer.Serialize(streamWriter, this);
}
return this;
}
public static Configuration LoadFromFile()
{
var deserializer = new DeserializerBuilder().IgnoreUnmatchedProperties().WithNamingConvention(new CamelCaseNamingConvention()).Build();
using (var streamReader = new StreamReader(ConfigurationName))
{
return deserializer.Deserialize<Configuration>(streamReader);
}
}
}
}
|
namespace Akiba.Core
{
using System.IO;
using YamlDotNet.Serialization;
using YamlDotNet.Serialization.NamingConventions;
internal class Configuration
{
public const string ConfigurationName = "configuration.yaml";
public enum ScreenModes : ushort
{
Windowed,
Fullscreen,
Borderless,
};
public ushort FramesPerSecond { get; private set; } = 60;
public ushort RenderingResolutionWidth { get; private set; } = 1920;
public ushort RenderingResolutionHeight { get; private set; } = 1080;
public ScreenModes ScreenMode { get; private set; } = ScreenModes.Borderless;
public bool VerticalSynchronization { get; private set; } = false;
public bool AntiAliasing { get; private set; } = false;
public bool HideCursor { get; private set; } = false;
public bool PreventSystemSleep { get; private set; } = true;
public bool DisableMovies { get; private set; } = false;
public Configuration Save()
{
var serializer = new SerializerBuilder().EmitDefaults().WithNamingConvention(new CamelCaseNamingConvention()).Build();
using (var streamWriter = new StreamWriter(ConfigurationName))
{
serializer.Serialize(streamWriter, this);
}
return this;
}
public static Configuration LoadFromFile()
{
var deserializer = new DeserializerBuilder().IgnoreUnmatchedProperties().WithNamingConvention(new CamelCaseNamingConvention()).Build();
using (var streamReader = new StreamReader(ConfigurationName))
{
return deserializer.Deserialize<Configuration>(streamReader);
}
}
}
}
|
Set a more sensible default for the screen mode.
|
Set a more sensible default for the screen mode.
|
C#
|
mit
|
spideyfusion/akiba
|
f395f657fc40abb8eb2a1895a476c60b6652e64b
|
src/System.Private.CoreLib/shared/System/Runtime/CompilerServices/DiscardableAttribute.cs
|
src/System.Private.CoreLib/shared/System/Runtime/CompilerServices/DiscardableAttribute.cs
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
namespace System.Runtime.CompilerServices
{
// Custom attribute to indicating a TypeDef is a discardable attribute.
public class DiscardableAttribute : Attribute
{
public DiscardableAttribute() { }
}
}
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
namespace System.Runtime.CompilerServices
{
// Custom attribute to indicating a TypeDef is a discardable attribute.
[AttributeUsage(AttributeTargets.All)]
public class DiscardableAttribute : Attribute
{
public DiscardableAttribute() { }
}
}
|
Fix FxCop warning CA1018 (attributes should have AttributeUsage)
|
Fix FxCop warning CA1018 (attributes should have AttributeUsage)
|
C#
|
mit
|
poizan42/coreclr,cshung/coreclr,krk/coreclr,poizan42/coreclr,cshung/coreclr,poizan42/coreclr,krk/coreclr,cshung/coreclr,krk/coreclr,cshung/coreclr,krk/coreclr,krk/coreclr,krk/coreclr,poizan42/coreclr,cshung/coreclr,cshung/coreclr,poizan42/coreclr,poizan42/coreclr
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.