Exemple #1
0
        public void LoadSettings()
        {
            SettingsController.LoadSettings();
            IniData data = SettingsController.GetCurrentSettings();

            if (data["Hotkeys"]["HotkeysEnable"] == "1")
            {
                SetHotkeysByStrings(data["Hotkeys"]["HotkeyUp"], data["Hotkeys"]["HotkeyDown"]);
            }

            if (data["Misc"]["Blur"] == "1" && Environment.OSVersion.Version.Major == 10)
            {
                Background = null;
                AcrylicWindow.SetEnabled(this, true);
            }

            UpdateCheckTimer.Tick += (sender, e) =>
            {
                CheckForUpdates(false);
            };

            if (data["Updates"]["DisableCheckEveryDay"] != "1")
            {
                UpdateCheckTimer.Start();
            }

            if (data["Updates"]["DisableCheckOnStartup"] != "1")
            {
                CheckForUpdates(false);
            }

            //AutoBrightness
            if (data["AutoBrightness"]["Enabled"] == "1")
            {
                CheckForSunriset.Start();
            }

            SetupAutoBrightnessTimer();

            TrayIcon.TrayBalloonTipClicked += (senderB, eB) => new Update().Window_Loaded();
        }
Exemple #2
0
        private void AutoBrightnessOnPowerChange(object s, PowerModeChangedEventArgs e)
        {
            IniData data = SettingsController.GetCurrentSettings();

            switch (e.Mode)
            {
            case PowerModes.Resume:
                if (data["AutoBrightness"]["Enabled"] == "1")
                {
                    CheckForSunriset.Start();
                    Task.Run(() =>
                    {
                        System.Threading.Thread.Sleep(4000);
                        SetAutoBrightness(1);
                    });
                }
                break;

            case PowerModes.Suspend:
                CheckForSunriset.Stop();
                break;
            }
        }