Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
ConsoleInReadCharacter.cs
1using System;
2using System.Threading.Tasks;
3
5{
10 {
11 private readonly TaskCompletionSource<int> result;
12
17 public ConsoleInReadCharacter(TaskCompletionSource<int> Result)
18 {
19 this.result = Result;
20 }
21
25 public override Task Execute()
26 {
27 try
28 {
29 int Result = System.Console.In.Read();
30 this.result.TrySetResult(Result);
31 }
32 catch (Exception ex)
33 {
34 this.result.TrySetException(ex);
35 }
36
37 return Task.CompletedTask;
38 }
39 }
40}
ConsoleInReadCharacter(TaskCompletionSource< int > Result)
Reads a character from the console.
override Task Execute()
Executes the console operation.
Manages a Console operation.
Definition: WorkItem.cs:9