public static void Print(string text, Color color, ConsoleWriteMethod writeMethod) { if (!string.IsNullOrWhiteSpace(text)) { switch (writeMethod) { case ConsoleWriteMethod.Write: ColorfulConsole.Write(text, color); break; case ConsoleWriteMethod.WriteLine: default: ColorfulConsole.WriteLine(text, color); break; } } }
public static void PrintFormatted(Dictionary <string, Formatter> textAndFormats, Color fallbackColor, ConsoleWriteMethod writeMethod) { if (textAndFormats?.Any() ?? false) { foreach (var(text, format) in textAndFormats) { switch (writeMethod) { case ConsoleWriteMethod.Write: ColorfulConsole.WriteFormatted(text, fallbackColor, format); break; case ConsoleWriteMethod.WriteLine: default: ColorfulConsole.WriteLineFormatted(text, fallbackColor, format); break; } } } }