3using System.Threading.Tasks;
13 private readonly TaskCompletionSource<int> result;
14 private readonly
char[] buffer;
15 private readonly
int index;
16 private readonly
int count;
31 public ConsoleInRead(
char[] Buffer,
int Index,
int Count, TaskCompletionSource<int> Result)
43 public override async Task
Execute(CancellationToken Cancel)
47 int Result = await
System.Console.In.ReadAsync(this.buffer, this.index, this.count);
48 this.result.TrySetResult(Result);
52 this.result.TrySetException(ex);
Reads characters from the console.
ConsoleInRead(char[] Buffer, int Index, int Count, TaskCompletionSource< int > Result)
Reads characters from the console.
override async Task Execute(CancellationToken Cancel)
Executes the console operation.
Represents an asynchronous operation to be performed.