Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
ConsoleInReadLine.cs
1using System;
2using System.Threading;
3using System.Threading.Tasks;
5
7{
12 {
13 private readonly TaskCompletionSource<string> result;
14
19 public ConsoleInReadLine(TaskCompletionSource<string> Result)
20 {
21 this.result = Result;
22 }
23
28 public override async Task Execute(CancellationToken Cancel)
29 {
30 try
31 {
32 string Row = await System.Console.In.ReadLineAsync();
33 this.result.TrySetResult(Row);
34 }
35 catch (Exception ex)
36 {
37 this.result.TrySetException(ex);
38 }
39 }
40 }
41}
override async Task Execute(CancellationToken Cancel)
Executes the console operation.
ConsoleInReadLine(TaskCompletionSource< string > Result)
Reads a line from the console.
Represents an asynchronous operation to be performed.
Definition: WorkItem.cs:10