Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
ConsoleErrorCustomAsyncWriter.cs
1using System;
2using System.Threading.Tasks;
3
5{
10 {
11 private readonly CustomAsyncWriter writer;
12
19 public ConsoleErrorCustomAsyncWriter(CustomAsyncWriter Writer, ConsoleColor? ForegroundColor, ConsoleColor? BackgroundColor)
20 : base(ForegroundColor, BackgroundColor)
21 {
22 this.writer = Writer;
23 }
24
28 protected override Task DoWrite()
29 {
30 return this.writer(System.Console.Error);
31 }
32 }
33}
Abstract base class for custom writers
ConsoleErrorCustomAsyncWriter(CustomAsyncWriter Writer, ConsoleColor? ForegroundColor, ConsoleColor? BackgroundColor)
Performs custom writing
override Task DoWrite()
Method that does the actual custom writing.
delegate Task CustomAsyncWriter(TextWriter Output)
Delegate for asynchronous custom writers.