Exemplo n.º 1
0
        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();
        }
Exemplo n.º 2
0
 public static Installation InstallTextMate(
     this TextEditor editor,
     ThemeName theme,
     IGrammar grammar = null)
 {
     return(new Installation(editor, theme, grammar));
 }
Exemplo n.º 3
0
 public static void ResetTheme()
 {
     Console.ForegroundColor = ConsoleColor.Gray;
     Console.BackgroundColor = ConsoleColor.Black;
     Console.Clear();
     Theme = DefTheme;
 }
Exemplo n.º 4
0
        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();
        }
Exemplo n.º 6
0
            public void SetTheme(ThemeName themeName)
            {
                IRawTheme rawTheme = _textMateRegistryOptions.LoadTheme(themeName);

                _textMateRegistry.SetTheme(rawTheme);

                GetOrCreateTransformer().SetTheme(_textMateRegistry.GetTheme());

                _tmModel?.InvalidateLine(0);
                _editorModel?.TokenizeViewPort();
            }
Exemplo n.º 7
0
        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));
        }
Exemplo n.º 8
0
            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);
            }
Exemplo n.º 9
0
        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));
                }
        }
Exemplo n.º 10
0
        /// <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() }));
        }
Exemplo n.º 11
0
        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);
        }
Exemplo n.º 12
0
        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;
            }
        }
Exemplo n.º 13
0

        
Exemplo n.º 14
0
        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;
            }
        }
Exemplo n.º 15
0
        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");
        }
Exemplo n.º 16
0
 public RegistryOptions(ThemeName defaultTheme)
 {
     _defaultTheme = defaultTheme;
     InitializeGrammars();
 }
Exemplo n.º 17
0
 public void UpdateLanguage(object sender, EventArgs e)
 {
     ShowName = ThemeName.getText();
 }