This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Arguments: $(Build.BuildNumber) | |
Add-Content .\SharedAssemblyInfo.cs "`r`n[assembly: AssemblyInformationalVersion(`"$args`")]" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[PublicAPI] | |
public sealed class AssemblyVersionTelemetryInitializer : ITelemetryInitializer | |
{ | |
[CanBeNull] string _version; | |
public void Initialize([CanBeNull] ITelemetry telemetry) | |
{ | |
var component = telemetry?.Context?.Component; | |
if (component == null) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public sealed class ReactiveStubObserver : IStubObserver | |
{ | |
readonly ISubject<Tuple<Type, Delegate>> _subject1; | |
readonly ISubject<Tuple<Type, Delegate, object>> _subject2; | |
readonly ISubject<Tuple<Type, Delegate, object, object>> _subject3; | |
readonly ISubject<Tuple<Type, Delegate, object, object, object>> _subject4; | |
readonly ISubject<Tuple<Type, Delegate, object[]>> _subject5; | |
public ReactiveStubObserver(IObserver<Tuple<Type, Delegate, object[]>> observer) : this(CreateSubject(observer)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
internal class TestProvider : LiteralBasedProvider | |
{ | |
public override void NotifyUser(string user, string password) | |
{ | |
Console.WriteLine($"NotifyUser {user} {password}"); | |
if (false) | |
throw new AccessException("Unauthorized user"); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class ServiceLocator | |
{ | |
static readonly TaskCompletionSource<IContainer> __container = new TaskCompletionSource<IContainer>(); | |
public static IContainer Instance { | |
get => __container.Task.Result; | |
set => __container.SetResult(value); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// Returns the specified code when the CancellationToken is canceled | |
/// </summary> | |
public sealed class CancellationDelegatingHandler : DelegatingHandler | |
{ | |
readonly HttpStatusCode _canceledCode; | |
public CancellationDelegatingHandler(HttpStatusCode canceledCode = HttpStatusCode.Gone) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class SingleProducer | |
{ | |
public static IObservable<T> Merge<T>(params IObservable<T>[] sequences) | |
{ | |
IDisposable SubscribeObserver(IObserver<T> observer) | |
{ | |
IDisposable SubscribeSequence(IObservable<T> sequence) => sequence.Subscribe(observer); | |
foreach (var sequence in sequences) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
internal sealed class DailyFileLog : ILog | |
{ | |
readonly DailyFileLogWriter _eventLog; | |
readonly DailyFileLogWriter _messageLog; | |
public DailyFileLog(FileLogWriterOptions eventLog, FileLogWriterOptions messageLog) | |
{ | |
_eventLog = new DailyFileLogWriter(eventLog); | |
_messageLog = new DailyFileLogWriter(messageLog); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class SessionSettingsExtensions | |
{ | |
public static bool TryUseWeekdaySessionSettings(this SessionSettings sessionSettings) | |
{ | |
var allSessionIds = sessionSettings.GetSessions(); | |
var result = allSessionIds.Select(sessionId => TryUseWeekdaySessionSettings(sessionSettings, sessionId)).All(x => x); | |
Console.WriteLine(sessionSettings); | |
return result; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class KeyValuePairExtensions | |
{ | |
public static void CopyTo<TKey>(this IEnumerable<KeyValuePair<TKey, string>> keyValuePairs, IDictionary<TKey, string> target) => CopyTo(keyValuePairs, target, (a, b) => $"{a},{b}"); | |
public static void CopyTo<TKey, TValue>(this IEnumerable<KeyValuePair<TKey, TValue>> keyValuePairs, IDictionary<TKey, TValue> target, Func<TValue, TValue, TValue> aggregator) | |
{ | |
foreach (var keyValuePair in keyValuePairs) | |
{ | |
var key = keyValuePair.Key; | |