3using System.Threading.Tasks;
13 private readonly TaskCompletionSource<int> result;
28 public override Task
Execute(CancellationToken Cancel)
32 int Result =
System.Console.In.Read();
33 this.result.TrySetResult(Result);
37 this.result.TrySetException(ex);
40 return Task.CompletedTask;
Reads a character from the console.
ConsoleInReadCharacter(TaskCompletionSource< int > Result)
Reads a character from the console.
override Task Execute(CancellationToken Cancel)
Executes the console operation.
Represents an asynchronous operation to be performed.