This file contains hidden or 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
private static SKMatrix MapUnitSquareToGivenPoints(SKPoint topLeft, SKPoint topRight, SKPoint bottomLeft, SKPoint bottomRight) | |
{ | |
var rightDiff = bottomRight - topRight; | |
var bottomDiff = bottomRight - bottomLeft; | |
var determinant = rightDiff.X * bottomDiff.Y - bottomDiff.X * rightDiff.Y; | |
var topDiff = topRight - topLeft; | |
var leftDiff = bottomLeft - topLeft; |
This file contains hidden or 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
using System.Collections.Specialized; | |
using System.Diagnostics; | |
using System.Net; | |
using System.Web; | |
public static class ImplicitFlowOAuthClient | |
{ | |
public static async Task<ImplicitFlowOAuthResult> AuthorizeAsync( | |
string authorityUri, | |
string clientId, |
This file contains hidden or 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
using Microsoft.TeamFoundation.SourceControl.WebApi; | |
using Microsoft.TeamFoundation.WorkItemTracking.WebApi; | |
using Microsoft.TeamFoundation.WorkItemTracking.WebApi.Models; | |
using Microsoft.VisualStudio.Services.Common; | |
using Microsoft.VisualStudio.Services.WebApi; | |
using System.Reactive.Linq; | |
using System.Text.RegularExpressions; | |
public sealed partial class Program | |
{ |
This file contains hidden or 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 static class RxExtensions | |
{ | |
/// <summary> | |
/// <para> | |
/// Fixes an issue when awaiting Rx.NET observables when <see cref="SynchronizationContext.Current"/> is <see | |
/// langword="null"/>, where the <see langword="await"/> resumes without disposing resources in the observables. | |
/// Those resources are not disposed until the program suspends at a later unrelated <see langword="await"/>. | |
/// </para> | |
/// <para> | |
/// This indefinite delay in disposing resources happens because Rx.NET forwards OnCompleted and OnError to the |
This file contains hidden or 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
using System.Buffers; | |
using System.Buffers.Binary; | |
using System.Collections.Immutable; | |
using System.Net; | |
using System.Net.NetworkInformation; | |
using System.Net.Sockets; | |
using System.Text; | |
/// <summary> | |
/// Discovers SQL Server instances on the local network asynchronously using <see |
This file contains hidden or 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 Debouncer : IAsyncDisposable | |
{ | |
private readonly TimeSpan delay; | |
private readonly Action action; | |
private readonly ITimer timer; | |
private bool isWaitingOrActing; | |
public Debouncer(TimeSpan delay, Action action, TimeProvider? timeProvider = null) | |
{ | |
this.delay = delay; |
This file contains hidden or 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
using System.Buffers; | |
using System.Globalization; | |
public sealed class KdlWriter(TextWriter writer) | |
{ | |
private static readonly NumberFormatInfo DefaultNumberFormat = new() | |
{ | |
NumberGroupSeparator = "_", | |
NumberGroupSizes = [3], | |
}; |
This file contains hidden or 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 AsyncAutoResetEvent | |
{ | |
private readonly Lock @lock = new(); | |
private Task? currentWait; | |
private TaskCompletionSource? taskCompletionSource; | |
public void Set() | |
{ | |
lock (@lock) | |
{ |
This file contains hidden or 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
using Microsoft.Win32; | |
using Microsoft.Win32.SafeHandles; | |
using System; | |
using System.ComponentModel; | |
using System.Threading; | |
using Windows.Win32; | |
using Windows.Win32.Foundation; | |
using Windows.Win32.System.Registry; | |
/// <summary> |
This file contains hidden or 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
System.Tuple (System.Runtime 9.0.0.0): | |
- Tuple<T1> Create<T1>(T1) | |
System.Tuple (System.Runtime 9.0.0.0): | |
- Tuple<T1, T2> Create<T1, T2>(T1, T2) | |
System.Tuple (System.Runtime 9.0.0.0): | |
- Tuple<T1, T2, T3> Create<T1, T2, T3>(T1, T2, T3) | |
System.Tuple (System.Runtime 9.0.0.0): |
NewerOlder