Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
ConsoleInReadToEnd.cs
1using System;
2using System.Threading;
3using System.Threading.Tasks;
5
7{
12 {
13 private readonly TaskCompletionSource<string> result;
14
19 public ConsoleInReadToEnd(TaskCompletionSource<string> Result)
20 {
21 this.result = Result;
22 }
23
28 public override async Task Execute(CancellationToken Cancel)
29 {
30 try
31 {
32 string Data = await System.Console.In.ReadToEndAsync();
33 this.result.TrySetResult(Data);
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.
ConsoleInReadToEnd(TaskCompletionSource< string > Result)
Reads a line from the console.
Represents an asynchronous operation to be performed.
Definition: WorkItem.cs:10