static void Writer(string format, BootstrapType type = BootstrapType.Default, BootsrapStyle style = BootsrapStyle.Text, bool fill = false, bool beep = false) { Bootstrap.PerformBeep(beep); Bootstrap.SetConsoleAppearance(Bootstrap.Theme, type, style); Bootstrap.FillLine(fill); char[] chars = format.ToCharArray(); lock (Bootstrap._threads) { for (int i = 0; i < chars.Length; i++) { Thread.Sleep(_random.Next(_minDelay, _maxDelay)); Console.Write(chars[i]); } } Console.ResetColor(); }
private static void Writer(string format, BootstrapType type = BootstrapType.Default, BootsrapStyle style = BootsrapStyle.Text, bool fill = false, bool beep = false) { PerformBeep(beep); SetConsoleAppearance(Theme, type, style); FillLine(fill); char[] chars = format.ToCharArray(); lock (_threads) { WriteLog(type, format); for (int i = 0; i < chars.Length; i++) { Console.Write(chars[i]); } } Console.ResetColor(); }
public static void WriteLine(string format, BootstrapType type = BootstrapType.Default, BootsrapStyle style = BootsrapStyle.Text, bool fill = false, bool beep = false) { Writer(format, type, style, fill, beep); Console.WriteLine(); }
internal static void SetConsoleAppearance(BootstrapTheme theme = BootstrapTheme.LigthColor, BootstrapType type = BootstrapType.Default, BootsrapStyle style = BootsrapStyle.Text) { string descTheme = GetDescription(theme); string descType = GetDescription(type); string fgColor = (theme != BootstrapTheme.LigthColor ? descType : $"Dark{descType}"); string bgColor = (theme != BootstrapTheme.LigthColor ? $"Dark{descType}" : descType); if (style == BootsrapStyle.Text) { fgColor = (theme != BootstrapTheme.LigthColor ? $"Dark{descType}" : descType); } Console.ForegroundColor = (ConsoleColor)Enum.Parse(typeof(ConsoleColor), fgColor, true); Console.BackgroundColor = (ConsoleColor)Enum.Parse(typeof(ConsoleColor), (style != BootsrapStyle.Text ? bgColor : "Black"), true); }