public static IServiceCollection AddBootstrapTheme(this IServiceCollection services) { var dynamicComponentPairs = DynamicComponentScanner.ScanDynmaicComponentByAssembly(Assembly.GetExecutingAssembly()); DynamicComponentScanner.AddComponentPairs(dynamicComponentPairs); var bootstrapTheme = new BootstrapTheme(); DynamicComponentScanner.ThemeList.Add(bootstrapTheme); return(services); }
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); }
internal static void SetBufferAppearance(BootstrapTheme theme, BootstrapType type, BootstrapStyle style, bool fillLineBackground) { lock (Bootstrap.Threads) { string descTheme = EnumExtension.GetDescription(theme); string descType = EnumExtension.GetDescription(type); string fgColor = (theme != BootstrapTheme.LigthColor ? descType : $"Dark{descType}"); string bgColor = (theme != BootstrapTheme.LigthColor ? $"Dark{descType}" : descType); if (style == BootstrapStyle.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 != BootstrapStyle.Text ? bgColor : "Black"), true); } FillLineBackground(fillLineBackground); }