public static void ApplyTheme(ThemeSettings themeSettings) { _currentThemeSettings = themeSettings; if (themeSettings.IsGlassEnabled) { ((RibbonWindow)Application.Current.MainWindow).IsGlassEnabled = themeSettings.IsGlassEnabled; } ThemeName theme = ThemeName.Generic; Enum.TryParse <ThemeName>(themeSettings.ThemeName, out theme); if (themeSettings.TintColor.HasValue) { TintedThemeCatalog catalog = new TintedThemeCatalog("Custom", theme.ToString()); theme = ThemeName.Custom; catalog.TintGroups.AddRange(TintGroupSets.Default, themeSettings.TintColor.Value); catalog.TintGroups.AddRange(TintGroupSets.ApplicationMenu, themeSettings.TintColor.Value); ThemeManager.RegisterThemeCatalog("Custom", catalog); if (ThemeManager.CurrentTheme == ThemeName.Custom.ToString()) { ThemeManager.ApplyTheme(); return; } } ThemeManager.CurrentTheme = theme.ToString(); }
public static Installation InstallTextMate( this TextEditor editor, ThemeName theme, IGrammar grammar = null) { return(new Installation(editor, theme, grammar)); }
public static void ResetTheme() { Console.ForegroundColor = ConsoleColor.Gray; Console.BackgroundColor = ConsoleColor.Black; Console.Clear(); Theme = DefTheme; }
public static void ChangeTheme(ThemeName theme) { switch (theme) { case ThemeName.Inverse: Console.ForegroundColor = ConsoleColor.Black; Console.BackgroundColor = ConsoleColor.White; break; case ThemeName.Casino: Console.ForegroundColor = ConsoleColor.Red; Console.BackgroundColor = ConsoleColor.DarkBlue; break; case ThemeName.Default: default: Console.ForegroundColor = ConsoleColor.Gray; Console.BackgroundColor = ConsoleColor.Black; break; } Console.Clear(); Console.WriteLine(theme.ToString()); Console.WriteLine("\nPress 'I' for Inverse"); Console.WriteLine("Press 'C' for Casino"); Console.WriteLine("Press 'D' for Default"); Console.WriteLine("Press 'Enter' to confirm the setting"); }
private void ThemeNameComboBoxSelectionChanged(object sender, SelectionChangedEventArgs e) { ThemeName theme = (ThemeName)e.AddedItems[0]; _mainWindowSettings.ThemeSettings.TintColor = null; _mainWindowSettings.ThemeSettings.ThemeName = theme.ToString(); ApplyTheme(); }
public void SetTheme(ThemeName themeName) { IRawTheme rawTheme = _textMateRegistryOptions.LoadTheme(themeName); _textMateRegistry.SetTheme(rawTheme); GetOrCreateTransformer().SetTheme(_textMateRegistry.GetTheme()); _tmModel?.InvalidateLine(0); _editorModel?.TokenizeViewPort(); }
public override Stream Open() { var repo = new ThemeVarsRepository(); if (ThemeName.IsEmpty()) { return(GenerateStreamFromString(string.Empty)); } var css = repo.GetPreprocessorCss(Extension, ThemeName, StoreId); return(GenerateStreamFromString(css)); }
public Installation(TextEditor editor, ThemeName defaultTheme, IGrammar grammar) { _textMateRegistryOptions = new RegistryOptions(defaultTheme); _textMateRegistry = new Registry(_textMateRegistryOptions); _editor = editor; SetTheme(defaultTheme); SetGrammar(grammar); editor.DocumentChanged += OnEditorOnDocumentChanged; OnEditorOnDocumentChanged(editor, EventArgs.Empty); }
public IRawTheme LoadTheme(ThemeName name) { string themeFile = GetThemeFile(name); if (themeFile == null) { return(null); } using (Stream s = ResourceLoader.TryOpenThemeStream(GetThemeFile(name))) using (StreamReader reader = new StreamReader(s)) { return(ThemeReader.ReadThemeSync(reader)); } }
/// <summary> /// 验证皮肤是否存在 /// </summary> /// <param name="Name"></param> /// <returns></returns> public JsonResult ValiThemeName(string Name) { string ThemeName = ""; ThemeConfig Theme = base.GetThemeList(); if (base.CheckThemeName(Name, Theme)) { ThemeName = Name; } else { ThemeName = base.GetDefaultThemeName(); } return(Json(new { Name = ThemeName.ToLower().Trim() })); }
string GetThemeFile(ThemeName name) { switch (name) { case ThemeName.Abbys: return("abyss-color-theme.json"); case ThemeName.Dark: return("dark_vs.json"); case ThemeName.DarkPlus: return("dark_plus.json"); case ThemeName.DimmedMonokai: return("dimmed-monokai-color-theme.json"); case ThemeName.KimbieDark: return("kimbie-dark-color-theme.json"); case ThemeName.Light: return("light_vs.json"); case ThemeName.LightPlus: return("light_plus.json"); case ThemeName.Monokai: return("monokai-color-theme.json"); case ThemeName.QuietLight: return("quietlight-color-theme.json"); case ThemeName.Red: return("Red-color-theme.json"); case ThemeName.SolarizedDark: return("solarized-dark-color-theme.json"); case ThemeName.SolarizedLight: return("solarized-light-color-theme.json"); case ThemeName.TomorrowNightBlue: return("tomorrow-night-blue-color-theme.json"); } return(null); }
public void InitTheme(ThemeName themeName) { switch (themeName) { case ThemeName.DefaultDark: Styles.Insert(0, DefaultDark); break; case ThemeName.DefaultLight: Styles.Insert(0, DefaultLight); break; case ThemeName.FluentDark: Styles.Insert(0, FluentDark); break; default: case ThemeName.FluentLight: Styles.Insert(0, FluentLight); break; } }
public void SetTheme(ThemeName themeName) { switch (themeName) { case ThemeName.DefaultDark: Styles[0] = DefaultDark; break; case ThemeName.DefaultLight: Styles[0] = DefaultLight; break; case ThemeName.FluentDark: Styles[0] = FluentDark; break; default: case ThemeName.FluentLight: Styles[0] = FluentLight; break; } }
public static void ThemeSetting() { Console.WriteLine("Game theme is: " + Theme); Console.WriteLine("Press 'I' for Inverse"); Console.WriteLine("Press 'C' for Casino"); Console.WriteLine("Press 'D' for Default"); Console.WriteLine("Press 'Enter' to confirm the setting"); ConsoleKeyInfo keyInfo; ThemeName theme = Theme; do { keyInfo = Console.ReadKey(true); if (keyInfo.Key == ConsoleKey.I) { theme = ThemeName.Inverse; ChangeTheme(theme); } if (keyInfo.Key == ConsoleKey.C) { theme = ThemeName.Casino; ChangeTheme(theme); } if (keyInfo.Key == ConsoleKey.D) { theme = ThemeName.Default; ChangeTheme(theme); } }while (keyInfo.Key != ConsoleKey.Enter); Theme = theme; Console.WriteLine("\nGame theme is: " + Theme.ToString() + "\n"); }
public RegistryOptions(ThemeName defaultTheme) { _defaultTheme = defaultTheme; InitializeGrammars(); }
public void UpdateLanguage(object sender, EventArgs e) { ShowName = ThemeName.getText(); }