Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
ConsoleInPeekCharacter.cs
1using System;
2using System.Threading.Tasks;
3
5{
10 {
11 private readonly TaskCompletionSource<int> result;
12
17 public ConsoleInPeekCharacter(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.Peek();
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}
override Task Execute()
Executes the console operation.
ConsoleInPeekCharacter(TaskCompletionSource< int > Result)
Peeks a character from the console.
Manages a Console operation.
Definition: WorkItem.cs:9