public void WriteLineBlue(string text, params string[] redTokens) { using (ConsoleColorSelector.SetConsoleForegroundColor(ConsoleColor.DarkBlue)) { WriteLine(text, redTokens); } }
public void WriteLineGreen(string text) { using (ConsoleColorSelector.SetConsoleForegroundColor(ConsoleColor.DarkGreen)) { WriteLine(text); } }
public void WriteLineRed(string text) { using (ConsoleColorSelector.SetConsoleBackgroundColor(ConsoleColor.Red)) using (ConsoleColorSelector.SetConsoleForegroundColor(ConsoleColor.White)) { WriteLine(text); } }
private void PrintText(string text, ConsoleColor color) { if (string.IsNullOrWhiteSpace(text)) { return; } using (ConsoleColorSelector.SetConsoleForegroundColor(color)) { WriteLine(); WriteLine(text); } }
public void PrintException(Exception exception) { using (ConsoleColorSelector.SetConsoleForegroundColor(ConsoleColor.Red)) { WriteLine(); WriteLine(@"The operation has failed."); WriteLine(); WriteLine(exception?.ToString() ?? "UNKNOWN ERROR"); } WriteLine(@"Press any key to continue."); WriteInputPrompt(); WaitForKeyPress(); ResetConsole(); }