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 List(IEnumerable<T> collection) | |
{ | |
if (collection == null) | |
ThrowHelper.ThrowArgumentNullException(ExceptionArgument.collection); | |
ICollection<T> objs = collection as ICollection<T>; | |
if (objs != null) | |
{ | |
int count = objs.Count; | |
if (count == 0) | |
{ |
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
<# | |
.SYNOPSIS | |
Copies the files that belong to a deployment to a target folder. | |
.PARAMETER Source | |
The path of the source folder. | |
.PARAMETER Target | |
The path of the target folder. | |
#> | |
[CmdletBinding(SupportsShouldProcess=$True)] |
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
namespace ConsoleHostedScriptCs | |
{ | |
using System; | |
using Common.Logging.Simple; | |
using NuGet; | |
using ScriptCs.Contracts; | |
using ScriptCs.Engine.Roslyn; | |
using ScriptCs.Hosting; | |
using PackageReference = ScriptCs.PackageReference; |
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
class Program | |
{ | |
static async Task Main(string[] args) | |
{ | |
var connection = new HubConnectionBuilder().WithUrl("http://localhost:19715/chat") | |
.Build(); | |
await connection.StartAsync(); | |
var receiveCounter = 0; | |
var isReceiver = args.Length < 1 || args[0].ToLower() != "sender"; |
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
using System; | |
using System.Threading; | |
using System.Threading.Channels; | |
using System.Threading.Tasks; | |
class Program | |
{ | |
public static async Task Main(string[] args) | |
{ | |
var channel = |
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
{ | |
"$type": "MyNamespace.Dto`6[[System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.Double, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.Single, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.Uri, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.DateTime, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.TimeSpan, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]], NETClassicApp, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null", | |
"StringProp": "my string", | |
"DoubleProp": 123.0, | |
"FloatProp": 345.0, | |
"ByteArrayProp": { | |
"$type": "System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089", | |
"$value": "AQID" | |
}, | |
"UriProp": "http://localhost:80", |
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
namespace ChannelTest | |
{ | |
using System; | |
using System.Threading; | |
using System.Threading.Channels; | |
using System.Threading.Tasks; | |
class Program | |
{ | |
public static async Task Main(string[] 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
private Task completion = Task.CompletedTask; | |
private int counter; | |
private void ButtonOnClick(object sender, RoutedEventArgs e) | |
{ | |
this.completion = this.completion.ContinueWith(async _ => | |
{ | |
this.counter = this.counter + 1; | |
Debug.WriteLine($"Enter ButtonOnClick {counter}"); | |
await DoSubAsync(counter); |
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
private int counter = 0; | |
private async void ButtonOnClick(object sender, RoutedEventArgs e) | |
{ | |
counter = counter + 1; | |
Debug.WriteLine($"Enter ButtonOnClick {counter}"); | |
await DoSubAsync(counter); | |
Debug.WriteLine($"Exit ButtonOnClick {counter}"); | |
} | |
public async Task DoSubAsync(int number) | |
{ |
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
private Task completion = Task.CompletedTask; | |
private int counter; | |
private async void ButtonOnClick(object sender, RoutedEventArgs e) | |
{ | |
this.completion = this.completion.ContinueWith(async _ => | |
{ | |
this.counter = this.counter + 1; | |
Debug.WriteLine($"Enter ButtonOnClick {counter}"); | |
await DoSubAsync(counter); |