Ejemplo n.º 1
0
        public string setLightOrDark(string themeName)
        {
            if (themeName.Contains("Office2013"))
            {
                switch (themeName)
                {
                case "Office2013_LightGray":
                    Office2013Palette.LoadPreset(Office2013Palette.ColorVariation.LightGray);
                    break;

                case "Office2013_DarkGray":
                    Office2013Palette.LoadPreset(Office2013Palette.ColorVariation.DarkGray);
                    break;

                default:
                    Office2013Palette.LoadPreset(Office2013Palette.ColorVariation.White);
                    break;
                }
                return("Office2013");
            }
            if (themeName.Contains("VisualStudio2013"))
            {
                switch (themeName)
                {
                case "VisualStudio2013_Blue":
                    VisualStudio2013Palette.LoadPreset(VisualStudio2013Palette.ColorVariation.Blue);
                    break;

                case "VisualStudio2013_Dark":
                    VisualStudio2013Palette.LoadPreset(VisualStudio2013Palette.ColorVariation.Dark);
                    break;

                default:
                    VisualStudio2013Palette.LoadPreset(VisualStudio2013Palette.ColorVariation.Light);
                    break;
                }
                return("VisualStudio2013");
            }
            if (themeName.Contains("Green"))
            {
                switch (themeName)
                {
                case "Green_Light":
                    GreenPalette.LoadPreset(GreenPalette.ColorVariation.Light);
                    break;

                case "Green_Dark":
                    GreenPalette.LoadPreset(GreenPalette.ColorVariation.Dark);
                    break;

                default:
                    GreenPalette.LoadPreset(GreenPalette.ColorVariation.Dark);
                    break;
                }
                return("Green");
            }
            if (themeName.Contains("Fluent"))
            {
                switch (themeName)
                {
                case "Fluent_Dark":
                    FluentPalette.LoadPreset(FluentPalette.ColorVariation.Dark);
                    break;

                default:
                    FluentPalette.LoadPreset(FluentPalette.ColorVariation.Light);
                    break;
                }
                return("Fluent");
            }
            if (themeName.Contains("Crystal"))
            {
                if (themeName.Contains("Crystal_Dark"))
                {
                    CrystalPalette.LoadPreset(CrystalPalette.ColorVariation.Dark);
                }
                else
                {
                    CrystalPalette.LoadPreset(CrystalPalette.ColorVariation.Light);
                }
                return("Crystal");
            }
            return(themeName);
        }
Ejemplo n.º 2
0
        private string GetDefaultThemeNameAndSetColorVariation(string themeName)
        {
            // Office2013 Theme
            if (themeName.Contains(ApplicationThemeManager.Office2013DefaultThemeName))
            {
                switch (themeName)
                {
                case (ApplicationThemeManager.Office2013LightGrayThemeName):
                {
                    Office2013Palette.LoadPreset(Office2013Palette.ColorVariation.LightGray);
                }
                break;

                case (ApplicationThemeManager.Office2013DarkGrayThemeName):
                {
                    Office2013Palette.LoadPreset(Office2013Palette.ColorVariation.DarkGray);
                }
                break;

                default:
                {
                    Office2013Palette.LoadPreset(Office2013Palette.ColorVariation.White);
                }
                break;
                }

                return(ApplicationThemeManager.Office2013DefaultThemeName);
            }

            // VisualStudio2013 Theme
            if (themeName.Contains(ApplicationThemeManager.VisualStudio2013DefaultThemeName))
            {
                switch (themeName)
                {
                case (ApplicationThemeManager.VisualStudio2013BlueThemeName):
                {
                    VisualStudio2013Palette.LoadPreset(VisualStudio2013Palette.ColorVariation.Blue);
                }
                break;

                case (ApplicationThemeManager.VisualStudio2013DarkThemeName):
                {
                    VisualStudio2013Palette.LoadPreset(VisualStudio2013Palette.ColorVariation.Dark);
                }
                break;

                default:
                {
                    VisualStudio2013Palette.LoadPreset(VisualStudio2013Palette.ColorVariation.Light);
                }
                break;
                }

                return(ApplicationThemeManager.VisualStudio2013DefaultThemeName);
            }

            // Green Theme
            if (themeName.Contains(ApplicationThemeManager.GreenDefaultThemeName))
            {
                switch (themeName)
                {
                case (ApplicationThemeManager.GreenLightThemeName):
                {
                    GreenPalette.LoadPreset(GreenPalette.ColorVariation.Light);
                }
                break;

                case (ApplicationThemeManager.GreenDarkThemeName):
                {
                    GreenPalette.LoadPreset(GreenPalette.ColorVariation.Dark);
                }
                break;

                default:
                {
                    GreenPalette.LoadPreset(GreenPalette.ColorVariation.Dark);
                }
                break;
                }

                return(ApplicationThemeManager.GreenDefaultThemeName);
            }

            // Fluent Theme
            if (themeName.Contains(ApplicationThemeManager.FluentDefaultThemeName))
            {
                switch (themeName)
                {
                case (ApplicationThemeManager.FluentDarkThemeName):
                {
                    FluentPalette.LoadPreset(FluentPalette.ColorVariation.Dark);
                }
                break;

                default:
                {
                    FluentPalette.LoadPreset(FluentPalette.ColorVariation.Light);
                }
                break;
                }

                return(ApplicationThemeManager.FluentDefaultThemeName);
            }

            // Crystal Theme
            if (themeName.Contains(ApplicationThemeManager.CrystalDefaultThemeName))
            {
                switch (themeName)
                {
                case (ApplicationThemeManager.CrystalDarkThemeName):
                {
                    CrystalPalette.LoadPreset(CrystalPalette.ColorVariation.Dark);
                }
                break;

                default:
                {
                    CrystalPalette.LoadPreset(CrystalPalette.ColorVariation.Light);
                }
                break;
                }

                return(ApplicationThemeManager.CrystalDefaultThemeName);
            }

            return(themeName);
        }