commit
stringlengths 40
40
| subject
stringlengths 4
1.73k
| repos
stringlengths 5
127k
| old_file
stringlengths 2
751
| new_file
stringlengths 2
751
| new_contents
stringlengths 1
8.98k
| old_contents
stringlengths 0
6.59k
| license
stringclasses 13
values | lang
stringclasses 23
values |
---|---|---|---|---|---|---|---|---|
2216ad4f10ac3155e1a4912c0fa6294b22831381 | Fix SQL Server tests | danielgerlag/workflow-core | test/WorkflowCore.Tests.SqlServer/DockerSetup.cs | test/WorkflowCore.Tests.SqlServer/DockerSetup.cs | using System;
using System.Collections.Generic;
using System.Data.SqlClient;
using Docker.Testify;
using Xunit;
namespace WorkflowCore.Tests.SqlServer
{
public class SqlDockerSetup : DockerSetup
{
public static string ConnectionString { get; set; }
public static string ScenarioConnectionString { get; set; }
public override string ImageName => "mcr.microsoft.com/mssql/server";
public override int InternalPort => 1433;
public override TimeSpan TimeOut => TimeSpan.FromSeconds(120);
public const string SqlPassword = "I@mJustT3st1ing";
public override IList<string> EnvironmentVariables => new List<string> {"ACCEPT_EULA=Y", $"SA_PASSWORD={SqlPassword}"};
public override void PublishConnectionInfo()
{
ConnectionString = $"Server=127.0.0.1,{ExternalPort};Database=workflowcore-tests;User Id=sa;Password={SqlPassword};";
ScenarioConnectionString = $"Server=127.0.0.1,{ExternalPort};Database=workflowcore-scenario-tests;User Id=sa;Password={SqlPassword};";
}
public override bool TestReady()
{
try
{
var client = new SqlConnection($"Server=127.0.0.1,{ExternalPort};Database=master;User Id=sa;Password={SqlPassword};");
client.Open();
client.Close();
return true;
}
catch
{
return false;
}
}
}
[CollectionDefinition("SqlServer collection")]
public class SqlServerCollection : ICollectionFixture<SqlDockerSetup>
{
}
} | using System;
using System.Collections.Generic;
using System.Data.SqlClient;
using Docker.Testify;
using Xunit;
namespace WorkflowCore.Tests.SqlServer
{
public class SqlDockerSetup : DockerSetup
{
public static string ConnectionString { get; set; }
public static string ScenarioConnectionString { get; set; }
public override string ImageName => "microsoft/mssql-server-linux";
public override int InternalPort => 1433;
public override TimeSpan TimeOut => TimeSpan.FromSeconds(120);
public const string SqlPassword = "I@mJustT3st1ing";
public override IList<string> EnvironmentVariables => new List<string> {"ACCEPT_EULA=Y", $"SA_PASSWORD={SqlPassword}"};
public override void PublishConnectionInfo()
{
ConnectionString = $"Server=127.0.0.1,{ExternalPort};Database=workflowcore-tests;User Id=sa;Password={SqlPassword};";
ScenarioConnectionString = $"Server=127.0.0.1,{ExternalPort};Database=workflowcore-scenario-tests;User Id=sa;Password={SqlPassword};";
}
public override bool TestReady()
{
try
{
var client = new SqlConnection($"Server=127.0.0.1,{ExternalPort};Database=master;User Id=sa;Password={SqlPassword};");
client.Open();
client.Close();
return true;
}
catch
{
return false;
}
}
}
[CollectionDefinition("SqlServer collection")]
public class SqlServerCollection : ICollectionFixture<SqlDockerSetup>
{
}
} | mit | C# |
3d79534d9896370c7431e2af8c433e6624d8d342 | update AsyncLock | WeihanLi/WeihanLi.Common,WeihanLi/WeihanLi.Common,WeihanLi/WeihanLi.Common | src/WeihanLi.Common/AsyncLock.cs | src/WeihanLi.Common/AsyncLock.cs | using System;
using System.Threading;
using System.Threading.Tasks;
namespace WeihanLi.Common
{
/// <summary>
/// AsyncLock basedOn SemaphoreSlim
/// 基于 SemaphoreSlim 的 异步锁
/// </summary>
public sealed class AsyncLock : IDisposable
{
private readonly SemaphoreSlim _mutex = new SemaphoreSlim(1, 1);
public IDisposable Lock()
{
_mutex.Wait();
return new AsyncLockReleaser(_mutex);
}
public Task<IDisposable> LockAsync() => LockAsync(CancellationToken.None);
public Task<IDisposable> LockAsync(CancellationToken cancellationToken) => LockAsync(TimeSpan.Zero, cancellationToken);
public async Task<IDisposable> LockAsync(TimeSpan timeout, CancellationToken cancellationToken)
{
if (timeout <= TimeSpan.Zero)
{
await _mutex.WaitAsync(cancellationToken);
}
else
{
await _mutex.WaitAsync(timeout, cancellationToken);
}
return new AsyncLockReleaser(_mutex);
}
public void Dispose()
{
_mutex?.Dispose();
}
#region AsyncLockReleaser
private struct AsyncLockReleaser : IDisposable
{
private readonly SemaphoreSlim _semaphoreSlim;
public AsyncLockReleaser(SemaphoreSlim semaphoreSlim) => _semaphoreSlim = semaphoreSlim;
public void Dispose()
{
_semaphoreSlim?.Release();
}
}
#endregion AsyncLockReleaser
}
}
| using System;
using System.Threading;
using System.Threading.Tasks;
namespace WeihanLi.Common
{
/// <summary>
/// AsyncLock basedOn SemaphoreSlim
/// 基于 SemaphoreSlim 的 异步锁
/// </summary>
public sealed class AsyncLock : IDisposable
{
private readonly SemaphoreSlim _mutex = new SemaphoreSlim(1, 1);
public Task<IDisposable> LockAsync() => LockAsync(CancellationToken.None);
public Task<IDisposable> LockAsync(CancellationToken cancellationToken) => LockAsync(TimeSpan.Zero, cancellationToken);
public async Task<IDisposable> LockAsync(TimeSpan timeout, CancellationToken cancellationToken)
{
if (timeout <= TimeSpan.Zero)
{
await _mutex.WaitAsync(cancellationToken);
}
else
{
await _mutex.WaitAsync(timeout, cancellationToken);
}
return new AsyncLockReleaser(_mutex);
}
#region IDisposable Support
private bool _disposed; // 要检测冗余调用
private void Dispose(bool disposing)
{
if (!_disposed)
{
if (disposing)
{
// 释放托管状态(托管对象)。
}
_mutex.Dispose();
_disposed = true;
}
}
// 添加此代码以正确实现可处置模式。
public void Dispose()
{
// 请勿更改此代码。将清理代码放入以上 Dispose(bool disposing) 中。
Dispose(true);
// 如果在以上内容中替代了终结器,则取消注释以下行。
GC.SuppressFinalize(this);
}
#endregion IDisposable Support
#region AsyncLockReleaser
private struct AsyncLockReleaser : IDisposable
{
private readonly SemaphoreSlim _semaphoreSlim;
public AsyncLockReleaser(SemaphoreSlim semaphoreSlim) => _semaphoreSlim = semaphoreSlim;
public void Dispose()
{
_semaphoreSlim?.Release();
}
}
#endregion AsyncLockReleaser
}
}
| mit | C# |
0400f88da8c4f556aecc9e43f9c35d92788280e2 | Add Func with 3 params | dahall/vanara | Core/BkwdComp/Func.NET2.cs | Core/BkwdComp/Func.NET2.cs | #if (NET20)
namespace System
{
/// <summary>Encapsulates a method that returns a value of the type specified by the TResult parameter.</summary>
/// <typeparam name="TResult">The type of the return value of the method that this delegate encapsulates.</typeparam>
/// <returns>The return value of the method that this delegate encapsulates.</returns>
public delegate TResult Func<out TResult>();
/// <summary>Encapsulates a method that has one parameter and returns a value of the type specified by the TResult parameter.</summary>
/// <typeparam name="T">The type of the parameter of the method that this delegate encapsulates.</typeparam>
/// <typeparam name="TResult">The type of the return value of the method that this delegate encapsulates.</typeparam>
/// <param name="arg">The parameter of the method that this delegate encapsulates.</param>
/// <returns>The return value of the method that this delegate encapsulates.</returns>
public delegate TResult Func<in T, out TResult>(T arg);
/// <summary>Encapsulates a method that has two parameters and returns a value of the type specified by the TResult parameter.</summary>
/// <typeparam name="T1">The type of the first parameter of the method that this delegate encapsulates.</typeparam>
/// <typeparam name="T2">The type of the second parameter of the method that this delegate encapsulates.</typeparam>
/// <typeparam name="TResult">The type of the return value of the method that this delegate encapsulates.</typeparam>
/// <param name="arg1">The first parameter of the method that this delegate encapsulates.</param>
/// <param name="arg2">The second parameter of the method that this delegate encapsulates.</param>
/// <returns>The return value of the method that this delegate encapsulates.</returns>
public delegate TResult Func<in T1, in T2, out TResult>(T1 arg1, T2 arg2);
/// <summary>Encapsulates a method that has two parameters and returns a value of the type specified by the TResult parameter.</summary>
/// <typeparam name="T1">The type of the first parameter of the method that this delegate encapsulates.</typeparam>
/// <typeparam name="T2">The type of the second parameter of the method that this delegate encapsulates.</typeparam>
/// <typeparam name="T3">The type of the third parameter of the method that this delegate encapsulates.</typeparam>
/// <typeparam name="TResult">The type of the return value of the method that this delegate encapsulates.</typeparam>
/// <param name="arg1">The first parameter of the method that this delegate encapsulates.</param>
/// <param name="arg2">The second parameter of the method that this delegate encapsulates.</param>
/// <param name="arg3">The third parameter of the method that this delegate encapsulates.</param>
/// <returns>The return value of the method that this delegate encapsulates.</returns>
public delegate TResult Func<in T1, in T2, in T3, out TResult>(T1 arg1, T2 arg2, T3 arg3);
/// <summary>Encapsulates a method that has no parameters and does not return a value.</summary>
public delegate void Action();
/// <summary>Encapsulates a method that has two parameters and does not return a value.</summary>
/// <typeparam name="T1">The type of the first parameter of the method that this delegate encapsulates.</typeparam>
/// <typeparam name="T2">The type of the second parameter of the method that this delegate encapsulates.</typeparam>
/// <param name="arg1">The first parameter of the method that this delegate encapsulates.</param>
/// <param name="arg2">The second parameter of the method that this delegate encapsulates.</param>
public delegate void Action<in T1, in T2>(T1 arg1, T2 arg2);
}
#endif | #if (NET20)
namespace System
{
/// <summary>Encapsulates a method that returns a value of the type specified by the TResult parameter.</summary>
/// <typeparam name="TResult">The type of the return value of the method that this delegate encapsulates.</typeparam>
/// <returns>The return value of the method that this delegate encapsulates.</returns>
public delegate TResult Func<out TResult>();
/// <summary>Encapsulates a method that has one parameter and returns a value of the type specified by the TResult parameter.</summary>
/// <typeparam name="T">The type of the parameter of the method that this delegate encapsulates.</typeparam>
/// <typeparam name="TResult">The type of the return value of the method that this delegate encapsulates.</typeparam>
/// <param name="arg">The parameter of the method that this delegate encapsulates.</param>
/// <returns>The return value of the method that this delegate encapsulates.</returns>
public delegate TResult Func<in T, out TResult>(T arg);
/// <summary>Encapsulates a method that has two parameters and returns a value of the type specified by the TResult parameter.</summary>
/// <typeparam name="T1">The type of the first parameter of the method that this delegate encapsulates.</typeparam>
/// <typeparam name="T2">The type of the second parameter of the method that this delegate encapsulates.</typeparam>
/// <typeparam name="TResult">The type of the return value of the method that this delegate encapsulates.</typeparam>
/// <param name="arg1">The first parameter of the method that this delegate encapsulates.</param>
/// <param name="arg2">The second parameter of the method that this delegate encapsulates.</param>
/// <returns>The return value of the method that this delegate encapsulates.</returns>
public delegate TResult Func<in T1, in T2, out TResult>(T1 arg1, T2 arg2);
/// <summary>Encapsulates a method that has no parameters and does not return a value.</summary>
public delegate void Action();
/// <summary>Encapsulates a method that has two parameters and does not return a value.</summary>
/// <typeparam name="T1">The type of the first parameter of the method that this delegate encapsulates.</typeparam>
/// <typeparam name="T2">The type of the second parameter of the method that this delegate encapsulates.</typeparam>
/// <param name="arg1">The first parameter of the method that this delegate encapsulates.</param>
/// <param name="arg2">The second parameter of the method that this delegate encapsulates.</param>
public delegate void Action<in T1, in T2>(T1 arg1, T2 arg2);
}
#endif | mit | C# |
21ae453289ff2bbac0d80307c7c2767dc0aa0db8 | Fix tests not running on windows | EVAST9919/osu-framework,ppy/osu-framework,EVAST9919/osu-framework,ZLima12/osu-framework,peppy/osu-framework,ppy/osu-framework,ZLima12/osu-framework,peppy/osu-framework,EVAST9919/osu-framework,peppy/osu-framework,smoogipooo/osu-framework,EVAST9919/osu-framework,smoogipooo/osu-framework,ppy/osu-framework | osu.Framework.Tests/Platform/TrackBassTest.cs | osu.Framework.Tests/Platform/TrackBassTest.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.Threading;
using ManagedBass;
using NUnit.Framework;
using osu.Framework.Audio.Track;
using osu.Framework.IO.Stores;
using osu.Framework.Platform;
namespace osu.Framework.Tests.Platform
{
[TestFixture]
public class TrackBassTest
{
private readonly TrackBass track;
public TrackBassTest()
{
Architecture.SetIncludePath();
// Initialize bass with no audio to make sure the test remains consistent even if there is no audio device.
Bass.Init(0);
var resources = new DllResourceStore("osu.Framework.Tests.dll");
var fileStream = resources.GetStream("Resources.Tracks.sample-track.mp3");
track = new TrackBass(fileStream);
}
[SetUp]
public void Setup()
{
#pragma warning disable 4014
track.SeekAsync(1000);
#pragma warning restore 4014
track.Update();
Assert.AreEqual(1000, track.CurrentTime);
}
/// <summary>
/// Bass does not allow seeking to the end of the track. It should fail and the current time should not change.
/// </summary>
[Test]
public void TestTrackSeekingToEndFails()
{
#pragma warning disable 4014
track.SeekAsync(track.Length);
#pragma warning restore 4014
track.Update();
Assert.AreEqual(1000, track.CurrentTime);
}
/// <summary>
/// Bass restarts the track from the beginning if Start is called when the track has been completed.
/// This is blocked locally in <see cref="TrackBass"/>, so this test expects the track to not restart.
/// </summary>
[Test]
public void TestTrackPlaybackBlocksAtTrackEnd()
{
#pragma warning disable 4014
track.SeekAsync(track.Length - 1);
#pragma warning restore 4014
track.StartAsync();
track.Update();
Thread.Sleep(50);
track.Update();
Assert.IsFalse(track.IsRunning);
Assert.AreEqual(track.Length, track.CurrentTime);
track.StartAsync();
track.Update();
Assert.AreEqual(track.Length, track.CurrentTime);
}
}
}
| // 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.Threading;
using ManagedBass;
using NUnit.Framework;
using osu.Framework.Audio.Track;
using osu.Framework.IO.Stores;
namespace osu.Framework.Tests.Platform
{
[TestFixture]
public class TrackBassTest
{
private readonly TrackBass track;
public TrackBassTest()
{
// Initialize bass with no audio to make sure the test remains consistent even if there is no audio device.
Bass.Init(0);
var resources = new DllResourceStore("osu.Framework.Tests.dll");
var fileStream = resources.GetStream("Resources.Tracks.sample-track.mp3");
track = new TrackBass(fileStream);
}
[SetUp]
public void Setup()
{
#pragma warning disable 4014
track.SeekAsync(1000);
#pragma warning restore 4014
track.Update();
Assert.AreEqual(1000, track.CurrentTime);
}
/// <summary>
/// Bass does not allow seeking to the end of the track. It should fail and the current time should not change.
/// </summary>
[Test]
public void TestTrackSeekingToEndFails()
{
#pragma warning disable 4014
track.SeekAsync(track.Length);
#pragma warning restore 4014
track.Update();
Assert.AreEqual(1000, track.CurrentTime);
}
/// <summary>
/// Bass restarts the track from the beginning if Start is called when the track has been completed.
/// This is blocked locally in <see cref="TrackBass"/>, so this test expects the track to not restart.
/// </summary>
[Test]
public void TestTrackPlaybackBlocksAtTrackEnd()
{
#pragma warning disable 4014
track.SeekAsync(track.Length - 1);
#pragma warning restore 4014
track.StartAsync();
track.Update();
Thread.Sleep(50);
track.Update();
Assert.IsFalse(track.IsRunning);
Assert.AreEqual(track.Length, track.CurrentTime);
track.StartAsync();
track.Update();
Assert.AreEqual(track.Length, track.CurrentTime);
}
}
}
| mit | C# |
2df71a5c9b7576594679d0a79d3e7704d0a18f1d | Add whitespace to type enum definitions | SICU-Stress-Measurement-System/frontend-cs | StressMeasurementSystem/Models/Patient.cs | StressMeasurementSystem/Models/Patient.cs | using System.Collections.Generic;
using System.Net.Mail;
namespace StressMeasurementSystem.Models
{
public class Patient
{
#region Structs
public struct Name
{
public string Prefix { get; set; }
public string First { get; set; }
public string Middle { get; set; }
public string Last { get; set; }
public string Suffix { get; set; }
}
public struct Organization
{
public string Company { get; set; }
public string JobTitle { get; set; }
}
public struct PhoneNumber
{
public enum Type { Mobile, Home, Work, Main, WorkFax, HomeFax, Pager, Other }
public string Number { get; set; }
public Type T { get; set; }
}
public struct Email
{
public enum Type { Home, Work, Other }
public MailAddress Address { get; set; }
public Type T { get; set; }
}
#endregion
#region Fields
private Name _name;
private uint _age;
private Organization _organization;
private List<PhoneNumber> _phoneNumbers;
private List<Email> _emails;
#endregion
#region Constructors
public Patient(Name name, uint age, Organization organization,
List<PhoneNumber> phoneNumbers, List<Email> emails)
{
_name = name;
_age = age;
_organization = organization;
_phoneNumbers = phoneNumbers;
_emails = emails;
}
#endregion
}
}
| using System.Collections.Generic;
using System.Net.Mail;
namespace StressMeasurementSystem.Models
{
public class Patient
{
#region Structs
public struct Name
{
public string Prefix { get; set; }
public string First { get; set; }
public string Middle { get; set; }
public string Last { get; set; }
public string Suffix { get; set; }
}
public struct Organization
{
public string Company { get; set; }
public string JobTitle { get; set; }
}
public struct PhoneNumber
{
public enum Type {Mobile, Home, Work, Main, WorkFax, HomeFax, Pager, Other}
public string Number { get; set; }
public Type T { get; set; }
}
public struct Email
{
public enum Type {Home, Work, Other}
public MailAddress Address { get; set; }
public Type T { get; set; }
}
#endregion
#region Fields
private Name _name;
private uint _age;
private Organization _organization;
private List<PhoneNumber> _phoneNumbers;
private List<Email> _emails;
#endregion
#region Constructors
public Patient(Name name, uint age, Organization organization,
List<PhoneNumber> phoneNumbers, List<Email> emails)
{
_name = name;
_age = age;
_organization = organization;
_phoneNumbers = phoneNumbers;
_emails = emails;
}
#endregion
}
}
| apache-2.0 | C# |
faff413575d5bfe426fe24ddc82c1ce8563e29fa | Fix to avoid CA1307 | y-iihoshi/ThScoreFileConverter,y-iihoshi/ThScoreFileConverter | ThScoreFileConverter/Squirrel/SQString.cs | ThScoreFileConverter/Squirrel/SQString.cs | //-----------------------------------------------------------------------
// <copyright file="SQString.cs" company="None">
// Copyright (c) IIHOSHI Yoshinori.
// Licensed under the BSD-2-Clause license. See LICENSE.txt file in the project root for full license information.
// </copyright>
//-----------------------------------------------------------------------
#pragma warning disable SA1600 // Elements should be documented
using System;
using System.IO;
using ThScoreFileConverter.Extensions;
using ThScoreFileConverter.Models;
using ThScoreFileConverter.Properties;
namespace ThScoreFileConverter.Squirrel
{
internal sealed class SQString : SQObject, IEquatable<SQString>
{
public SQString(string value = "")
: base(SQObjectType.String)
{
this.Value = value;
}
public new string Value
{
get => (string)base.Value;
private set => base.Value = value;
}
public static implicit operator string(SQString sq)
{
return sq.Value;
}
public static SQString Create(BinaryReader reader, bool skipType = false)
{
if (reader is null)
throw new ArgumentNullException(nameof(reader));
if (!skipType)
{
var type = reader.ReadInt32();
if (type != (int)SQObjectType.String)
throw new InvalidDataException(Resources.InvalidDataExceptionWrongType);
}
var size = reader.ReadInt32();
return new SQString(
(size > 0) ? Encoding.CP932.GetString(reader.ReadExactBytes(size)) : string.Empty);
}
public override bool Equals(object obj)
{
return (obj is SQString value) && this.Equals(value);
}
public override int GetHashCode()
{
#if NETFRAMEWORK
return this.Type.GetHashCode() ^ this.Value.GetHashCode();
#else
return this.Type.GetHashCode() ^ this.Value.GetHashCode(StringComparison.InvariantCulture);
#endif
}
public bool Equals(SQString other)
{
if (other is null)
return false;
return (this.Type == other.Type) && (this.Value == other.Value);
}
}
}
| //-----------------------------------------------------------------------
// <copyright file="SQString.cs" company="None">
// Copyright (c) IIHOSHI Yoshinori.
// Licensed under the BSD-2-Clause license. See LICENSE.txt file in the project root for full license information.
// </copyright>
//-----------------------------------------------------------------------
#pragma warning disable SA1600 // Elements should be documented
using System;
using System.IO;
using ThScoreFileConverter.Extensions;
using ThScoreFileConverter.Models;
using ThScoreFileConverter.Properties;
namespace ThScoreFileConverter.Squirrel
{
internal sealed class SQString : SQObject, IEquatable<SQString>
{
public SQString(string value = "")
: base(SQObjectType.String)
{
this.Value = value;
}
public new string Value
{
get => (string)base.Value;
private set => base.Value = value;
}
public static implicit operator string(SQString sq)
{
return sq.Value;
}
public static SQString Create(BinaryReader reader, bool skipType = false)
{
if (reader is null)
throw new ArgumentNullException(nameof(reader));
if (!skipType)
{
var type = reader.ReadInt32();
if (type != (int)SQObjectType.String)
throw new InvalidDataException(Resources.InvalidDataExceptionWrongType);
}
var size = reader.ReadInt32();
return new SQString(
(size > 0) ? Encoding.CP932.GetString(reader.ReadExactBytes(size)) : string.Empty);
}
public override bool Equals(object obj)
{
return (obj is SQString value) && this.Equals(value);
}
public override int GetHashCode()
{
return this.Type.GetHashCode() ^ this.Value.GetHashCode();
}
public bool Equals(SQString other)
{
if (other is null)
return false;
return (this.Type == other.Type) && (this.Value == other.Value);
}
}
}
| bsd-2-clause | C# |
4391885572aba25e27013ad8699a303fc61d068e | fix build error | steven-r/Oberon0Compiler | oberon0/Expressions/Arithmetic/ArithmeticRepository.cs | oberon0/Expressions/Arithmetic/ArithmeticRepository.cs | using System;
using System.Collections.Generic;
using System.ComponentModel.Composition;
using System.ComponentModel.Composition.Hosting;
using Oberon0.Compiler.Solver;
namespace Oberon0.Compiler.Expressions.Arithmetic
{
class ArithmeticRepository
{
#pragma warning disable 649
[ImportMany(typeof(ICalculatable))]
// ReSharper disable once CollectionNeverUpdated.Global
public List<ICalculatable> ClassRepository;
#pragma warning restore 649
// ReSharper disable once PrivateFieldCanBeConvertedToLocalVariable
private readonly CompositionContainer _container;
public ArithmeticRepository()
{
var catalog = new AggregateCatalog();
catalog.Catalogs.Add(new AssemblyCatalog(typeof(ICalculatable).Assembly));
_container = new CompositionContainer(catalog,
CompositionOptions.DisableSilentRejection |
CompositionOptions.IsThreadSafe);
_container.ComposeParts(this);
}
}
}
| using System;
using System.Collections.Generic;
using System.ComponentModel.Composition;
using System.ComponentModel.Composition.Hosting;
using System.ComponentModel.Composition.Registration;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using Oberon0.Compiler.Solver;
namespace Oberon0.Compiler.Expressions.Arithmetic
{
class ArithmeticRepository
{
#pragma warning disable 649
[ImportMany(typeof(ICalculatable))]
public List<ICalculatable> ClassRepository;
#pragma warning restore 649
// ReSharper disable once PrivateFieldCanBeConvertedToLocalVariable
private readonly CompositionContainer _container;
public ArithmeticRepository()
{
var catalog = new AggregateCatalog();
catalog.Catalogs.Add(new AssemblyCatalog(typeof(ICalculatable).Assembly));
_container = new CompositionContainer(catalog,
CompositionOptions.DisableSilentRejection |
CompositionOptions.IsThreadSafe);
_container.ComposeParts(this);
}
}
}
| mit | C# |
0a7b64e0fd8a61f51d87a538b830888d5700bb6f | Bump version | alecgorge/adzerk-dot-net | StackExchange.Adzerk/Properties/AssemblyInfo.cs | StackExchange.Adzerk/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("StackExchange.Adzerk")]
[assembly: AssemblyDescription("Unofficial Adzerk API client.")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Stack Overflow")]
[assembly: AssemblyProduct("StackExchange.Adzerk")]
[assembly: AssemblyCopyright("Copyright © 2017")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("d05e1e25-d95d-43d6-a74b-3cb38492fa7e")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.0.0.41")]
[assembly: AssemblyFileVersion("0.0.0.41")]
| 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("StackExchange.Adzerk")]
[assembly: AssemblyDescription("Unofficial Adzerk API client.")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Stack Overflow")]
[assembly: AssemblyProduct("StackExchange.Adzerk")]
[assembly: AssemblyCopyright("Copyright © 2017")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("d05e1e25-d95d-43d6-a74b-3cb38492fa7e")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.0.0.40")]
[assembly: AssemblyFileVersion("0.0.0.40")]
| mit | C# |
81cfe057e95ffb27605716c3fd7f8f8281fc5b6b | Update DotNetXmlSerializer.cs | tiksn/TIKSN-Framework | TIKSN.Core/Serialization/DotNetXmlSerializer.cs | TIKSN.Core/Serialization/DotNetXmlSerializer.cs | using System.IO;
using System.Xml.Serialization;
namespace TIKSN.Serialization
{
public class DotNetXmlSerializer : SerializerBase<string>
{
protected override string SerializeInternal<T>(T obj)
{
var serializer = new XmlSerializer(obj.GetType());
var writer = new StringWriter();
serializer.Serialize(writer, obj);
return writer.ToString();
}
}
}
| using System.IO;
using System.Xml.Serialization;
namespace TIKSN.Serialization
{
public class DotNetXmlSerializer : SerializerBase<string>
{
protected override string SerializeInternal<T>(T obj)
{
var serializer = new XmlSerializer(obj.GetType());
var writer = new StringWriter();
serializer.Serialize(writer, obj);
return writer.ToString();
}
}
} | mit | C# |
96bfb808a8e554f0c78be0a395fd371ffbc6f758 | add missing registration | zmira/abremir.AllMyBricks | abremir.AllMyBricks.Device/Configuration/IoC.cs | abremir.AllMyBricks.Device/Configuration/IoC.cs | using abremir.AllMyBricks.Device.Interfaces;
using abremir.AllMyBricks.Device.Services;
using SimpleInjector;
using Xamarin.Essentials.Implementation;
using Xamarin.Essentials.Interfaces;
namespace abremir.AllMyBricks.Device.Configuration
{
public static class IoC
{
public static Container Configure(Container container = null)
{
container = container ?? new Container();
container.Register<IFileSystem, FileSystemImplementation>(Lifestyle.Transient);
container.Register<IVersionTracking, VersionTrackingImplementation>(Lifestyle.Transient);
container.Register<IConnectivity, ConnectivityImplementation>(Lifestyle.Transient);
container.Register<ISecureStorage, SecureStorageImplementation>(Lifestyle.Transient);
container.Register<IDeviceInfo, DeviceInfoImplementation>(Lifestyle.Transient);
container.Register<IFileSystemService, FileSystemService>(Lifestyle.Transient);
container.Register<IVersionTrackingService, VersionTrackingService>(Lifestyle.Transient);
container.Register<IConnectivityService, ConnectivityService>(Lifestyle.Transient);
container.Register<ISecureStorageService, SecureStorageService>(Lifestyle.Transient);
container.Register<IDeviceInformationService, DeviceInformationService>(Lifestyle.Transient);
return container;
}
}
} | using abremir.AllMyBricks.Device.Interfaces;
using abremir.AllMyBricks.Device.Services;
using SimpleInjector;
using Xamarin.Essentials.Implementation;
using Xamarin.Essentials.Interfaces;
namespace abremir.AllMyBricks.Device.Configuration
{
public static class IoC
{
public static Container Configure(Container container = null)
{
container = container ?? new Container();
container.Register<IFileSystem, FileSystemImplementation>(Lifestyle.Transient);
container.Register<IVersionTracking, VersionTrackingImplementation>(Lifestyle.Transient);
container.Register<IConnectivity, ConnectivityImplementation>(Lifestyle.Transient);
container.Register<ISecureStorage, SecureStorageImplementation>(Lifestyle.Transient);
container.Register<IFileSystemService, FileSystemService>(Lifestyle.Transient);
container.Register<IVersionTrackingService, VersionTrackingService>(Lifestyle.Transient);
container.Register<IConnectivityService, ConnectivityService>(Lifestyle.Transient);
container.Register<ISecureStorageService, SecureStorageService>(Lifestyle.Transient);
return container;
}
}
} | mit | C# |
67dd07c8d0486d4758be62701d7be0300808673d | Fix migration | CollActionteam/CollAction,CollActionteam/CollAction,CollActionteam/CollAction,CollActionteam/CollAction,CollActionteam/CollAction | CollAction/Migrations/20180710223436_ProjectEmails.cs | CollAction/Migrations/20180710223436_ProjectEmails.cs | using System;
using Microsoft.EntityFrameworkCore.Migrations;
namespace CollAction.Migrations
{
public partial class unsubscribetoken : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<int>(
name: "NumberProjectEmailsSend",
table: "Projects",
nullable: false,
defaultValue: 0);
migrationBuilder.AddColumn<bool>(
name: "SubscribedToProjectEmails",
table: "ProjectParticipants",
nullable: false,
defaultValue: true);
migrationBuilder.AddColumn<Guid>(
name: "UnsubscribeToken",
table: "ProjectParticipants",
nullable: false,
defaultValue: new Guid("00000000-0000-0000-0000-000000000000"));
migrationBuilder.Sql("UPDATE public.\"ProjectParticipants\" SET \"UnsubscribeToken\"= uuid_in(md5(random()::text || now()::text || \"UserId\" || \"ProjectId\")::cstring);");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "UnsubscribeToken",
table: "ProjectParticipants");
migrationBuilder.DropColumn(
name: "NumberProjectEmailsSend",
table: "Projects");
migrationBuilder.DropColumn(
name: "SubscribedToProjectEmails",
table: "ProjectParticipants");
}
}
}
| using System;
using Microsoft.EntityFrameworkCore.Migrations;
namespace CollAction.Migrations
{
public partial class unsubscribetoken : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<int>(
name: "NumberProjectEmailsSend",
table: "Projects",
nullable: false,
defaultValue: 0);
migrationBuilder.AddColumn<bool>(
name: "SubscribedToProjectEmails",
table: "ProjectParticipants",
nullable: false,
defaultValue: false);
migrationBuilder.AddColumn<Guid>(
name: "UnsubscribeToken",
table: "ProjectParticipants",
nullable: false,
defaultValue: new Guid("00000000-0000-0000-0000-000000000000"));
migrationBuilder.Sql("UPDATE public.\"ProjectParticipants\" SET \"UnsubscribeToken\"= uuid_in(md5(random()::text || now()::text || \"UserId\" || \"ProjectId\")::cstring);");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "UnsubscribeToken",
table: "ProjectParticipants");
migrationBuilder.DropColumn(
name: "NumberProjectEmailsSend",
table: "Projects");
migrationBuilder.DropColumn(
name: "SubscribedToProjectEmails",
table: "ProjectParticipants");
}
}
}
| agpl-3.0 | C# |
1039d82d161681ab35048720fb751531eb056cfc | Update KpsHandler.cs | yugecin/osukps | osukps/KpsHandler.cs | osukps/KpsHandler.cs | using System.Drawing;
using System.Windows.Forms;
namespace osukps
{
class KpsHandler
{
private Label lblKps;
private Label lblTotal;
private byte index;
private byte[] kps;
private int total;
private int max=0;
public KpsHandler( Label lblKps, Label lblTotal )
{
this.lblKps = lblKps;
this.lblTotal = lblTotal;
kps = new byte[10];
Timer timer = new Timer();
timer.Interval = 100;
timer.Tick += t_Tick;
timer.Start();
}
private void t_Tick( object sender, System.EventArgs e )
{
kps[index] = 0;
if( ++index >= 10 )
{
index = 0;
}
}
public void Update( byte keyCount )
{
for( byte i = 0; i < 10; i++ )
{
kps[i] += keyCount;
}
total += keyCount;
UpdateLabels();
}
private void UpdateLabels()
{
byte kps = this.kps[index];
if(kps>max)
{
max = kps;
}
if( kps >= 10 )
{
lblKps.ForeColor = Color.FromArgb( 255, 248, 0, 0 );
}
else if( kps >= 5 )
{
lblKps.ForeColor = Color.FromArgb( 255, 0, 190, 255 );
}
else
{
lblKps.ForeColor = Color.White;
}
if (kps == 0) {
lblKps.Text = string.Format("{0} Max", max);
}
else lblKps.Text = string.Format("{0} Kps", kps);
lblTotal.Text = total.ToString();
//frmMain.kpsmax(kps);
}
public void ResetTotal()
{
total = 0;
UpdateLabels();
}
public void resetmax()
{
max = 0;
UpdateLabels();
}
}
}
| using System.Drawing;
using System.Windows.Forms;
namespace osukps
{
class KpsHandler
{
private Label lblKps;
private Label lblTotal;
private byte index;
private byte[] kps;
private int total;
private int max=0;
public KpsHandler( Label lblKps, Label lblTotal )
{
this.lblKps = lblKps;
this.lblTotal = lblTotal;
kps = new byte[10];
Timer timer = new Timer();
timer.Interval = 100;
timer.Tick += t_Tick;
timer.Start();
}
private void t_Tick( object sender, System.EventArgs e )
{
kps[index] = 0;
if( ++index >= 10 )
{
index = 0;
}
}
public void Update( byte keyCount )
{
for( byte i = 0; i < 10; i++ )
{
kps[i] += keyCount;
}
total += keyCount;
UpdateLabels();
}
public void resetmax()
{
max = 0;
}
private void UpdateLabels()
{
byte kps = this.kps[index];
if(kps>max)
{
max = kps;
}
if( kps >= 10 )
{
lblKps.ForeColor = Color.FromArgb( 255, 248, 0, 0 );
}
else if( kps >= 5 )
{
lblKps.ForeColor = Color.FromArgb( 255, 0, 190, 255 );
}
else
{
lblKps.ForeColor = Color.White;
}
if (kps == 0) {
lblKps.Text = string.Format("{0} Max", max);
}
else lblKps.Text = string.Format("{0} Kps", kps);
lblTotal.Text = total.ToString();
//frmMain.kpsmax(kps);
}
public void ResetTotal()
{
total = 0;
UpdateLabels();
}
}
}
| mit | C# |
e17cd9e964e5eaeded62b3b2a4584a813bec5470 | Reduce length of tests | johnneijzen/osu,peppy/osu-new,peppy/osu,smoogipoo/osu,EVAST9919/osu,ppy/osu,ppy/osu,peppy/osu,NeoAdonis/osu,NeoAdonis/osu,EVAST9919/osu,UselessToucan/osu,smoogipoo/osu,ZLima12/osu,peppy/osu,UselessToucan/osu,2yangk23/osu,johnneijzen/osu,ZLima12/osu,smoogipoo/osu,smoogipooo/osu,NeoAdonis/osu,UselessToucan/osu,ppy/osu,2yangk23/osu | osu.Game.Tests/Visual/Gameplay/TestSceneAutoplay.cs | osu.Game.Tests/Visual/Gameplay/TestSceneAutoplay.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.ComponentModel;
using System.Linq;
using osu.Game.Beatmaps;
using osu.Game.Rulesets;
using osu.Game.Rulesets.Scoring;
using osu.Game.Screens.Play;
namespace osu.Game.Tests.Visual.Gameplay
{
[Description("Player instantiated with an autoplay mod.")]
public class TestSceneAutoplay : AllPlayersTestScene
{
private ClockBackedTestWorkingBeatmap.TrackVirtualManual track;
protected override Player CreatePlayer(Ruleset ruleset)
{
Mods.Value = Mods.Value.Concat(new[] { ruleset.GetAutoplayMod() }).ToArray();
return new ScoreAccessiblePlayer();
}
protected override void AddCheckSteps()
{
AddUntilStep("score above zero", () => ((ScoreAccessiblePlayer)Player).ScoreProcessor.TotalScore.Value > 0);
AddUntilStep("key counter counted keys", () => ((ScoreAccessiblePlayer)Player).HUDOverlay.KeyCounter.Children.Any(kc => kc.CountPresses > 2));
AddStep("rewind", () => track.Seek(-10000));
AddUntilStep("key counter reset", () => ((ScoreAccessiblePlayer)Player).HUDOverlay.KeyCounter.Children.All(kc => kc.CountPresses == 0));
}
protected override WorkingBeatmap CreateWorkingBeatmap(IBeatmap beatmap)
{
var working = base.CreateWorkingBeatmap(beatmap);
track = (ClockBackedTestWorkingBeatmap.TrackVirtualManual)working.Track;
return working;
}
private class ScoreAccessiblePlayer : TestPlayer
{
public new ScoreProcessor ScoreProcessor => base.ScoreProcessor;
public new HUDOverlay HUDOverlay => base.HUDOverlay;
public new GameplayClockContainer GameplayClockContainer => base.GameplayClockContainer;
public ScoreAccessiblePlayer()
: base(false, false)
{
}
}
}
}
| // 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.ComponentModel;
using System.Linq;
using osu.Game.Beatmaps;
using osu.Game.Rulesets;
using osu.Game.Rulesets.Scoring;
using osu.Game.Screens.Play;
namespace osu.Game.Tests.Visual.Gameplay
{
[Description("Player instantiated with an autoplay mod.")]
public class TestSceneAutoplay : AllPlayersTestScene
{
private ClockBackedTestWorkingBeatmap.TrackVirtualManual track;
protected override Player CreatePlayer(Ruleset ruleset)
{
Mods.Value = Mods.Value.Concat(new[] { ruleset.GetAutoplayMod() }).ToArray();
return new ScoreAccessiblePlayer();
}
protected override void AddCheckSteps()
{
AddUntilStep("score above zero", () => ((ScoreAccessiblePlayer)Player).ScoreProcessor.TotalScore.Value > 0);
AddUntilStep("key counter counted keys", () => ((ScoreAccessiblePlayer)Player).HUDOverlay.KeyCounter.Children.Any(kc => kc.CountPresses > 5));
AddStep("rewind", () => track.Seek(-10000));
AddUntilStep("key counter reset", () => ((ScoreAccessiblePlayer)Player).HUDOverlay.KeyCounter.Children.All(kc => kc.CountPresses == 0));
}
protected override WorkingBeatmap CreateWorkingBeatmap(IBeatmap beatmap)
{
var working = base.CreateWorkingBeatmap(beatmap);
track = (ClockBackedTestWorkingBeatmap.TrackVirtualManual)working.Track;
return working;
}
private class ScoreAccessiblePlayer : TestPlayer
{
public new ScoreProcessor ScoreProcessor => base.ScoreProcessor;
public new HUDOverlay HUDOverlay => base.HUDOverlay;
public new GameplayClockContainer GameplayClockContainer => base.GameplayClockContainer;
public ScoreAccessiblePlayer()
: base(false, false)
{
}
}
}
}
| mit | C# |
df975d5aa7d55c5d5cad2162060b93da01f81830 | Fix build problem | Nabile-Rahmani/osu-framework,ppy/osu-framework,RedNesto/osu-framework,DrabWeb/osu-framework,naoey/osu-framework,EVAST9919/osu-framework,default0/osu-framework,EVAST9919/osu-framework,EVAST9919/osu-framework,RedNesto/osu-framework,DrabWeb/osu-framework,ZLima12/osu-framework,smoogipooo/osu-framework,naoey/osu-framework,ppy/osu-framework,Tom94/osu-framework,peppy/osu-framework,paparony03/osu-framework,smoogipooo/osu-framework,ppy/osu-framework,ZLima12/osu-framework,Tom94/osu-framework,default0/osu-framework,EVAST9919/osu-framework,DrabWeb/osu-framework,paparony03/osu-framework,peppy/osu-framework,peppy/osu-framework,Nabile-Rahmani/osu-framework | osu.Framework.VisualTests/Tests/TestCaseSliderbar.cs | osu.Framework.VisualTests/Tests/TestCaseSliderbar.cs | using System;
using osu.Framework.Configuration;
using osu.Framework.GameModes.Testing;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Graphics.UserInterface;
using OpenTK;
using OpenTK.Graphics;
namespace osu.Framework.VisualTests.Tests
{
public class TestCaseSliderbar : TestCase
{
public override string Name => @"Sliderbar";
public override string Description => @"Sliderbar tests.";
private SliderBar<double> sliderBar;
private BindableDouble sliderBarValue;
private SpriteText sliderbarText;
public override void Reset()
{
base.Reset();
sliderBarValue = new BindableDouble(8)
{
MinValue = -10,
MaxValue = 10
};
sliderBarValue.ValueChanged += sliderBarValueChanged;
sliderbarText = new SpriteText
{
Text = $"Selected value: {sliderBarValue.Value}",
Position = new Vector2(25, 0)
};
sliderBar = new SliderBar<double>
{
Size = new Vector2(200, 10),
Position = new Vector2(25, 25),
Bindable = sliderBarValue,
Color = Color4.White,
SelectionColor = Color4.Pink,
KeyboardStep = 1
};
Add(sliderBar);
Add(sliderbarText);
}
private void sliderBarValueChanged(object sender, EventArgs e)
{
sliderbarText.Text = $"Selected value: {sliderBarValue.Value:N}";
}
}
}
| using System;
using osu.Framework.Configuration;
using osu.Framework.GameModes.Testing;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Graphics.UserInterface;
using OpenTK;
using OpenTK.Graphics;
namespace osu.Framework.VisualTests.Tests
{
public class TestCaseSliderbar : TestCase
{
public override string Name => @"Sliderbar";
public override string Description => @"Sliderbar tests.";
private SliderBar sliderBar;
private BindableDouble sliderBarValue;
private SpriteText sliderbarText;
public override void Reset()
{
base.Reset();
sliderBarValue = new BindableDouble(8)
{
MinValue = -10,
MaxValue = 10
};
sliderBarValue.ValueChanged += sliderBarValueChanged;
sliderbarText = new SpriteText
{
Text = $"Selected value: {sliderBarValue.Value}",
Position = new Vector2(25, 0)
};
sliderBar = new SliderBar
{
Size = new Vector2(200, 10),
Position = new Vector2(25, 25),
Bindable = sliderBarValue,
Color = Color4.White,
SelectionColor = Color4.Pink,
KeyboardStep = 1
};
Add(sliderBar);
Add(sliderbarText);
}
private void sliderBarValueChanged(object sender, EventArgs e)
{
sliderbarText.Text = $"Selected value: {sliderBarValue.Value:N}";
}
}
}
| mit | C# |
bd351535177d0ba388b00cacae85aef856a04f57 | Fix incorrect default value in interface. | NeoAdonis/osu-framework,EVAST9919/osu-framework,ZLima12/osu-framework,EVAST9919/osu-framework,smoogipooo/osu-framework,DrabWeb/osu-framework,naoey/osu-framework,ppy/osu-framework,peppy/osu-framework,Nabile-Rahmani/osu-framework,smoogipooo/osu-framework,paparony03/osu-framework,peppy/osu-framework,Tom94/osu-framework,RedNesto/osu-framework,DrabWeb/osu-framework,NeoAdonis/osu-framework,Tom94/osu-framework,ppy/osu-framework,naoey/osu-framework,ZLima12/osu-framework,default0/osu-framework,DrabWeb/osu-framework,paparony03/osu-framework,RedNesto/osu-framework,Nabile-Rahmani/osu-framework,default0/osu-framework,EVAST9919/osu-framework,peppy/osu-framework,ppy/osu-framework,EVAST9919/osu-framework | osu.Framework/Graphics/Transformations/ITransform.cs | osu.Framework/Graphics/Transformations/ITransform.cs | //Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu-framework/master/LICENCE
using System;
namespace osu.Framework.Graphics.Transformations
{
public interface ITransform
{
double Duration { get; }
bool IsAlive { get; }
double StartTime { get; set; }
double EndTime { get; set; }
void Apply(Drawable d);
ITransform Clone();
ITransform CloneReverse();
void Reverse();
void Loop(double delay, int loopCount = -1);
}
} | //Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu-framework/master/LICENCE
using System;
namespace osu.Framework.Graphics.Transformations
{
public interface ITransform
{
double Duration { get; }
bool IsAlive { get; }
double StartTime { get; set; }
double EndTime { get; set; }
void Apply(Drawable d);
ITransform Clone();
ITransform CloneReverse();
void Reverse();
void Loop(double delay, int loopCount = 0);
}
} | mit | C# |
f085c0c60117c8669aa0b6e5f1225c2ab0f4a4ed | update version | rajfidel/appium-dotnet-driver,appium/appium-dotnet-driver,Astro03/appium-dotnet-driver,rajfidel/appium-dotnet-driver,suryarend/appium-dotnet-driver | appium-dotnet-driver/Properties/AssemblyInfo.cs | appium-dotnet-driver/Properties/AssemblyInfo.cs | using System.Reflection;
// Information about this assembly is defined by the following attributes.
// Change them to the values specific to your project.
[assembly: AssemblyTitle ("appium-dotnet-driver")]
[assembly: AssemblyDescription ("Appium Dotnet Driver")]
[assembly: AssemblyConfiguration ("")]
[assembly: AssemblyCompany ("Appium Contributors")]
[assembly: AssemblyProduct ("Appium-Dotnet-Driver")]
[assembly: AssemblyCopyright ("Copyright © 2014")]
[assembly: AssemblyTrademark ("")]
[assembly: AssemblyCulture ("")]
// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}".
// The form "{Major}.{Minor}.*" will automatically update the build and revision,
// and "{Major}.{Minor}.{Build}.*" will update just the revision.
[assembly: AssemblyVersion ("1.3.0.1")]
// The following attributes are used to specify the signing key for the assembly,
// if desired. See the Mono documentation for more information about signing.
//[assembly: AssemblyDelaySign(false)]
//[assembly: AssemblyKeyFile("")]
| using System.Reflection;
// Information about this assembly is defined by the following attributes.
// Change them to the values specific to your project.
[assembly: AssemblyTitle ("appium-dotnet-driver")]
[assembly: AssemblyDescription ("Appium Dotnet Driver")]
[assembly: AssemblyConfiguration ("")]
[assembly: AssemblyCompany ("Appium Contributors")]
[assembly: AssemblyProduct ("Appium-Dotnet-Driver")]
[assembly: AssemblyCopyright ("Copyright © 2014")]
[assembly: AssemblyTrademark ("")]
[assembly: AssemblyCulture ("")]
// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}".
// The form "{Major}.{Minor}.*" will automatically update the build and revision,
// and "{Major}.{Minor}.{Build}.*" will update just the revision.
[assembly: AssemblyVersion ("1.2.0.8")]
// The following attributes are used to specify the signing key for the assembly,
// if desired. See the Mono documentation for more information about signing.
//[assembly: AssemblyDelaySign(false)]
//[assembly: AssemblyKeyFile("")]
| apache-2.0 | C# |
8446d8b8dedba9a89c6397e98cc5fc6d797ab597 | Fix to read in dlv attribute A correctly from xml --Signed-off-by Kathleen Oneal | ADAPT/ISOv4Plugin | ISOv4Plugin/ImportMappers/LogMappers/XmlReaders/DlvReader.cs | ISOv4Plugin/ImportMappers/LogMappers/XmlReaders/DlvReader.cs | using System;
using System.Collections.Generic;
using System.Linq;
using System.Xml.Linq;
using AgGateway.ADAPT.ISOv4Plugin.ObjectModel;
namespace AgGateway.ADAPT.ISOv4Plugin.ImportMappers.LogMappers.XmlReaders
{
public interface IDlvReader
{
IEnumerable<DLVHeader> Read(List<XElement> dlvElement);
}
public class DlvReader : IDlvReader
{
public IEnumerable<DLVHeader> Read(List<XElement> dlvElements)
{
if(dlvElements == null)
return null;
return dlvElements.Select(Read);
}
private DLVHeader Read(XElement dlvElement)
{
return new DLVHeader
{
ProcessDataDDI = GetProcessDataDdi(dlvElement),
ProcessDataValue = new HeaderProperty(dlvElement.Attribute("B")),
DeviceElementIdRef = new HeaderProperty(dlvElement.Attribute("C")),
DataLogPGN = new HeaderProperty(dlvElement.Attribute("D")),
DataLogPGNStartBit = new HeaderProperty(dlvElement.Attribute("E")),
DataLogPGNStopBit = new HeaderProperty(dlvElement.Attribute("F"))
};
}
private static HeaderProperty GetProcessDataDdi(XElement dlvElement)
{
if(dlvElement.Attribute("A") == null)
return new HeaderProperty{ State = HeaderPropertyState.IsNull };
var hexDdi = dlvElement.Attribute("A").Value;
var intDdi = int.Parse(hexDdi, System.Globalization.NumberStyles.HexNumber);
return new HeaderProperty { State = HeaderPropertyState.HasValue, Value = intDdi };
}
}
}
| using System;
using System.Collections.Generic;
using System.Linq;
using System.Xml.Linq;
using AgGateway.ADAPT.ISOv4Plugin.ObjectModel;
namespace AgGateway.ADAPT.ISOv4Plugin.ImportMappers.LogMappers.XmlReaders
{
public interface IDlvReader
{
IEnumerable<DLVHeader> Read(List<XElement> dlvElement);
}
public class DlvReader : IDlvReader
{
public IEnumerable<DLVHeader> Read(List<XElement> dlvElements)
{
if(dlvElements == null)
return null;
return dlvElements.Select(Read);
}
private DLVHeader Read(XElement dlvElement)
{
return new DLVHeader
{
ProcessDataDDI = GetProcessDataDdi(dlvElement),
ProcessDataValue = new HeaderProperty(dlvElement.Attribute("B")),
DeviceElementIdRef = new HeaderProperty(dlvElement.Attribute("C")),
DataLogPGN = new HeaderProperty(dlvElement.Attribute("D")),
DataLogPGNStartBit = new HeaderProperty(dlvElement.Attribute("E")),
DataLogPGNStopBit = new HeaderProperty(dlvElement.Attribute("F"))
};
}
private static HeaderProperty GetProcessDataDdi(XElement dlvElement)
{
if(dlvElement.Attribute("A") == null)
return new HeaderProperty{ State = HeaderPropertyState.IsNull };
var stringDdi = dlvElement.Attribute("A").Value;
var byteDdi = Convert.ToByte(stringDdi, 16);
var intDdi = Convert.ToInt32(byteDdi);
return new HeaderProperty { State = HeaderPropertyState.HasValue, Value = intDdi };
}
}
}
| epl-1.0 | C# |
72023606ff239d07092f661d5cba6cb4b7267b30 | Fix typo in exception message | gael-ltd/NEventStore | src/NEventStore/CommonDomain/Core/ExtensionMethods.cs | src/NEventStore/CommonDomain/Core/ExtensionMethods.cs | namespace CommonDomain.Core
{
using System.Globalization;
internal static class ExtensionMethods
{
public static string FormatWith(this string format, params object[] args)
{
return string.Format(CultureInfo.InvariantCulture, format ?? string.Empty, args);
}
public static void ThrowHandlerNotFound(this IAggregate aggregate, object eventMessage)
{
string exceptionMessage =
"Aggregate of type '{0}' raised an event of type '{1}' but no handler could be found to handle the message."
.FormatWith(aggregate.GetType().Name, eventMessage.GetType().Name);
throw new HandlerForDomainEventNotFoundException(exceptionMessage);
}
}
} | namespace CommonDomain.Core
{
using System.Globalization;
internal static class ExtensionMethods
{
public static string FormatWith(this string format, params object[] args)
{
return string.Format(CultureInfo.InvariantCulture, format ?? string.Empty, args);
}
public static void ThrowHandlerNotFound(this IAggregate aggregate, object eventMessage)
{
string exceptionMessage =
"Aggregate of type '{0}' raised an event of type '{1}' but not handler could be found to handle the message."
.FormatWith(aggregate.GetType().Name, eventMessage.GetType().Name);
throw new HandlerForDomainEventNotFoundException(exceptionMessage);
}
}
} | mit | C# |
848d422bd1865df4920504ece278eb2a628b12e2 | Make NegotiationToken public for manual check type (#141) | SteveSyfuhs/Kerberos.NET | Kerberos.NET/Entities/SpNego/NegotiateContextToken.cs | Kerberos.NET/Entities/SpNego/NegotiateContextToken.cs | using Kerberos.NET.Crypto;
using System;
namespace Kerberos.NET.Entities
{
public sealed class NegotiateContextToken : ContextToken
{
public NegotiateContextToken(GssApiToken gssToken)
{
// SPNego tokens optimistically include a token of the first MechType
// so if mechType[0] == Ntlm process as ntlm, == kerb process as kerb, etc.
Token = NegotiationToken.Decode(gssToken.Token);
}
public NegotiationToken Token { get; }
public override DecryptedKrbApReq DecryptApReq(KeyTable keys)
{
var mechToken = Token.InitialToken.MechToken;
var apReq = MessageParser.Parse<ContextToken>(mechToken.Value);
if (apReq is NegotiateContextToken)
{
throw new InvalidOperationException(
"Negotiated ContextToken is another negotiated token. Failing to prevent stack overflow."
);
}
return apReq.DecryptApReq(keys);
}
}
}
| using Kerberos.NET.Crypto;
using System;
namespace Kerberos.NET.Entities
{
public sealed class NegotiateContextToken : ContextToken
{
private readonly NegotiationToken token;
public NegotiateContextToken(GssApiToken gssToken)
{
// SPNego tokens optimistically include a token of the first MechType
// so if mechType[0] == Ntlm process as ntlm, == kerb process as kerb, etc.
token = NegotiationToken.Decode(gssToken.Token);
}
public override DecryptedKrbApReq DecryptApReq(KeyTable keys)
{
var mechToken = token.InitialToken.MechToken;
var apReq = MessageParser.Parse<ContextToken>(mechToken.Value);
if (apReq is NegotiateContextToken)
{
throw new InvalidOperationException(
"Negotiated ContextToken is another negotiated token. Failing to prevent stack overflow."
);
}
return apReq.DecryptApReq(keys);
}
}
}
| mit | C# |
3b32ff1a0ff754c6c8a59ef3a90202353564b1c0 | fix encoding of GlobalSuppressions | adamralph/xbehave.net,hitesh97/xbehave.net,xbehave/xbehave.net,mvalipour/xbehave.net,modulexcite/xbehave.net,modulexcite/xbehave.net,mvalipour/xbehave.net,hitesh97/xbehave.net | src/Xbehave.2.Execution.desktop/GlobalSuppressions.cs | src/Xbehave.2.Execution.desktop/GlobalSuppressions.cs | // <copyright file="GlobalSuppressions.cs" company="xBehave.net contributors">
// Copyright (c) xBehave.net contributors. All rights reserved.
// </copyright>
// This file is used by Code Analysis to maintain SuppressMessage
// attributes that are applied to this project.
// Project-level suppressions either have no target or are given
// a specific target and scoped to a namespace, type, member, etc.
//
// To add a suppression to this file, right-click the message in the
// Code Analysis results, point to "Suppress Message", and click
// "In Suppression File".
// You do not need to add suppressions to this file manually.
using System.Diagnostics.CodeAnalysis;
[assembly: SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "desktop", Justification = "Matching xunit casing.")]
| / / < |