Beispiel #1
0
 public void ThemeToLight()
 {
     if (Properties.Settings.Default.ThemeSwitch)
     {
         ThemeHandler.ChangeTheme(Properties.Settings.Default.ThemeLight);
     }
     else
     {
         if (Properties.Settings.Default.AccentColor && Properties.Settings.Default.SystemThemeChange.Equals(0))
         {
             ColorPrevalence(0);
             Thread.Sleep(Properties.Settings.Default.AccentColorSwitchTime);
         }
         if (Properties.Settings.Default.AppThemeChange.Equals(0))
         {
             AppTheme(1);
         }
         if (Properties.Settings.Default.SystemThemeChange.Equals(0))
         {
             SystemTheme(1);
         }
         if (Properties.Settings.Default.WallpaperSwitch)
         {
             WallpaperHandler.SetBackground(Properties.Settings.Default.WallpaperLight);
         }
     }
     if (Properties.Settings.Default.EdgeThemeChange.Equals(0))
     {
         EdgeTheme(0);
     }
     if (Properties.Settings.Default.OfficeThemeChange.Equals(0))
     {
         OfficeTheme(0);
     }
 }
Beispiel #2
0
        public void ThemeToLight()
        {
            if (Settings.Default.ThemeSwitch)
            {
                try
                {
                    ThemeHandler.ChangeTheme(Settings.Default.ThemeLight);
                }
                catch (System.Runtime.InteropServices.COMException)
                {
                    MsgBox msg = new MsgBox(string.Format(Resources.ThemeApplyError2, Resources.NavbarWallpaper), "Auto Dark Mode", "error", "close");
                    msg.ShowDialog();
                    Settings.Default.ThemeSwitch = false;
                    Settings.Default.ThemeLight  = null;
                    ThemeToLight();
                }
            }
            else
            {
                if (Settings.Default.AccentColor && Settings.Default.SystemThemeChange.Equals(0))
                {
                    ColorPrevalence(0);
                    Thread.Sleep(Settings.Default.AccentColorSwitchTime);
                }
                if (Settings.Default.AppThemeChange.Equals(0))
                {
                    SetAppTheme(1);
                }
                if (Settings.Default.SystemThemeChange.Equals(0))
                {
                    SetSystemTheme(1);
                }
                if (Settings.Default.WallpaperSwitch)
                {
                    WallpaperHandler.SetBackground(Settings.Default.WallpaperLight);
                }
            }

            if (Settings.Default.EdgeThemeChange.Equals(0))
            {
                SetEdgeTheme(0);
            }
            if (Settings.Default.OfficeThemeChange.Equals(0) & !Settings.Default.OfficeThemeChangeWhiteDesign)
            {
                OfficeTheme(0);
            }
            else if (Settings.Default.OfficeThemeChange.Equals(0) & Settings.Default.OfficeThemeChangeWhiteDesign)
            {
                OfficeTheme(5);
            }
            if (Settings.Default.ColourFilterKeystroke)
            {
                ColourFilterKeySender(false);
            }
        }