2using System.Threading.Tasks;
12 private readonly ConsoleColor? foregroundColor;
13 private readonly ConsoleColor? backgroundColor;
22 this.foregroundColor = ForegroundColor;
23 this.backgroundColor = BackgroundColor;
29 public override sealed async Task
Execute()
33 ConsoleColor FgBak = System.Console.ForegroundColor;
34 ConsoleColor BgBak = System.Console.BackgroundColor;
36 if (this.foregroundColor.HasValue)
37 System.Console.ForegroundColor = this.foregroundColor.Value;
39 if (this.backgroundColor.HasValue)
40 System.Console.BackgroundColor = this.backgroundColor.Value;
44 System.Console.ForegroundColor = FgBak;
45 System.Console.BackgroundColor = BgBak;
Static class managing the application event log. Applications and services log events on this static ...
static void Exception(Exception Exception, string Object, string Actor, string EventId, EventLevel Level, string Facility, string Module, params KeyValuePair< string, object >[] Tags)
Logs an exception. Event type will be determined by the severity of the exception.
Abstract base class for custom writers
ConsoleCustomWriter(ConsoleColor? ForegroundColor, ConsoleColor? BackgroundColor)
Abstract base class for custom writers
abstract Task DoWrite()
Method that does the actual custom writing.
override sealed async Task Execute()
Executes the console operation.
Manages a Console operation.