3using System.Threading.Tasks;
13 private readonly TaskCompletionSource<ConsoleKeyInfo> result;
14 private readonly
bool intercept;
24 this.intercept = Intercept;
31 public override Task
Execute(CancellationToken Cancel)
35 ConsoleKeyInfo Result =
System.Console.ReadKey(this.intercept);
36 this.result.TrySetResult(Result);
40 this.result.TrySetException(ex);
43 return Task.CompletedTask;
Reads a key from the console.
override Task Execute(CancellationToken Cancel)
Executes the console operation.
ConsoleInReadKey(bool Intercept, TaskCompletionSource< ConsoleKeyInfo > Result)
Reads a key from the console.
Represents an asynchronous operation to be performed.