Beispiel #1
0
        private void checkBoxAutostart_CheckedChanged(object sender, EventArgs e)
        {
            RegistryController autostartController = new RegistryController();

            if (this.checkBoxAutostart.Checked)
            {
                if (!autostartController.isProgramRegistered(appName))
                {
                    if (autostartController.registerProgram(appName, "\"" + Application.ExecutablePath.ToString() + "\" -minimized"))
                    {
                        listBoxLog.Items.Add("Registered to Autostart!");
                    }
                    else
                    {
                        listBoxLog.Items.Add("Registering to Autostart failed!");
                    }
                }
            }
            else
            {
                if (autostartController.unregisterProgram(appName))
                {
                    listBoxLog.Items.Add("Unregistered from Autostart!");
                }
                else
                {
                    listBoxLog.Items.Add("Unregistering from Autostart failed!");
                }
            }
        }
Beispiel #2
0
        private void readVibranceSettings(out int vibranceIngameLevel, out int vibranceWindowsLevel, out bool keepActive, out int refreshRate)
        {
            registryController             = new RegistryController();
            this.checkBoxAutostart.Checked = registryController.isProgramRegistered(appName);

            SettingsController settingsController = new SettingsController();

            settingsController.readVibranceSettings(out vibranceIngameLevel, out vibranceWindowsLevel, out keepActive, out refreshRate);

            //no null check needed, SettingsController will always return matching values.
            labelWindowsLevel.Text = NvidiaSettingsWrapper.find(vibranceWindowsLevel).getPercentage;
            labelIngameLevel.Text  = NvidiaSettingsWrapper.find(vibranceIngameLevel).getPercentage;

            trackBarWindowsLevel.Value = vibranceWindowsLevel;
            trackBarIngameLevel.Value  = vibranceIngameLevel;
            checkBoxKeepActive.Checked = keepActive;
            textBoxRefreshRate.Text    = refreshRate.ToString();
        }
Beispiel #3
0
 private void checkBoxAutostart_CheckedChanged(object sender, EventArgs e)
 {
     RegistryController autostartController = new RegistryController();
     if (this.checkBoxAutostart.Checked)
     {
         if (!autostartController.isProgramRegistered(appName))
         {
             bool success = autostartController.registerProgram(appName, "\"" + Application.ExecutablePath.ToString() + "\" -minimized");
             if (!success)
                 listBoxLog.Items.Add("Registering to Autostart failed!");
             else
                 listBoxLog.Items.Add("Registered to Autostart!");
         }
     }
     else
     {
         bool success = autostartController.unregisterProgram(appName);
         if (!success)
             listBoxLog.Items.Add("Unregistering from Autostart failed!");
         else
             listBoxLog.Items.Add("Unregistered from Autostart!");
     }
 }
Beispiel #4
0
        private void readVibranceSettings(out int vibranceIngameLevel, out int vibranceWindowsLevel, out bool keepActive, out int refreshRate, out bool multipleMonitors)
        {
            registryController = new RegistryController();
            this.checkBoxAutostart.Checked = registryController.isProgramRegistered(appName);

            SettingsController settingsController = new SettingsController();
            settingsController.readVibranceSettings(out vibranceIngameLevel, out vibranceWindowsLevel, out keepActive, out refreshRate, out multipleMonitors);

            labelWindowsLevel.Text = "" + vibranceWindowsLevel;
            labelIngameLevel.Text = "" + vibranceIngameLevel;
            trackBarWindowsLevel.Value = vibranceWindowsLevel;
            trackBarIngameLevel.Value = vibranceIngameLevel;
            checkBoxKeepActive.Checked = keepActive;
            checkBoxMonitors.Checked = multipleMonitors;
            textBoxRefreshRate.Text = refreshRate.ToString();
        }
        private void readVibranceSettings(out int vibranceIngameLevel, out int vibranceWindowsLevel, out bool keepActive, out int refreshRate)
        {
            registryController = new RegistryController();
            this.checkBoxAutostart.Checked = registryController.isProgramRegistered(appName);

            vibranceIngameLevel = v.amdViewModel.VibranceSettingsViewModel.Model.IngameVibranceLevel;
            vibranceWindowsLevel = v.amdViewModel.VibranceSettingsViewModel.Model.WindowsVibranceLevel;
            keepActive = v.amdViewModel.VibranceSettingsViewModel.Model.KeepVibranceOnWhenCsGoIsStarted;
            refreshRate = v.amdViewModel.VibranceSettingsViewModel.Model.RefreshRate;

            labelWindowsLevel.Text = vibranceWindowsLevel.ToString();
            labelIngameLevel.Text = vibranceIngameLevel.ToString();

            trackBarWindowsLevel.Value = vibranceWindowsLevel;
            trackBarIngameLevel.Value = vibranceIngameLevel;
            checkBoxKeepActive.Checked = keepActive;
            textBoxRefreshRate.Text = refreshRate.ToString();
        }
 private void checkBoxAutostart_CheckedChanged(object sender, EventArgs e)
 {
     RegistryController autostartController = new RegistryController();
     if (this.checkBoxAutostart.Checked)
     {
         string pathToExe = "\"" + Application.ExecutablePath.ToString() + "\" -minimized";
         if (!autostartController.isProgramRegistered(appName))
         {
             if (autostartController.registerProgram(appName, pathToExe))
                 listBoxLog.Items.Add("Registered to Autostart!");
             else
                 listBoxLog.Items.Add("Registering to Autostart failed!");
         }
         else if (!autostartController.isStartupPathUnchanged(appName, pathToExe))
         {
             if (autostartController.registerProgram(appName, pathToExe))
                 listBoxLog.Items.Add("Updated Autostart Path!");
             else
                 listBoxLog.Items.Add("Updating Autostart Path failed!");
         }
     }
     else
     {
         if (autostartController.unregisterProgram(appName))
             listBoxLog.Items.Add("Unregistered from Autostart!");
         else
             listBoxLog.Items.Add("Unregistering from Autostart failed!");
     }
 }
        private void readVibranceSettings(out int vibranceIngameLevel, out int vibranceWindowsLevel, out bool keepActive, out int refreshRate, out bool affectPrimaryMonitorOnly)
        {
            registryController = new RegistryController();
            this.checkBoxAutostart.Checked = registryController.isProgramRegistered(appName);

            SettingsController settingsController = new SettingsController();
            settingsController.readVibranceSettings(GraphicsAdapter.NVIDIA, out vibranceIngameLevel, out vibranceWindowsLevel, out keepActive, out refreshRate, out affectPrimaryMonitorOnly);

            if (this.IsHandleCreated)
            {
                //no null check needed, SettingsController will always return matching values.
                labelWindowsLevel.Text = NvidiaSettingsWrapper.find(vibranceWindowsLevel).getPercentage;
                labelIngameLevel.Text = NvidiaSettingsWrapper.find(vibranceIngameLevel).getPercentage;

                trackBarWindowsLevel.Value = vibranceWindowsLevel;
                trackBarIngameLevel.Value = vibranceIngameLevel;
                checkBoxKeepActive.Checked = keepActive;
                textBoxRefreshRate.Text = refreshRate.ToString();
                checkBoxPrimaryMonitorOnly.Checked = affectPrimaryMonitorOnly;
            }
        }
        private void readVibranceSettings(out int vibranceIngameLevel, out int vibranceWindowsLevel, out bool keepActive, out int refreshRate, out bool multipleMonitors)
        {
            registryController = new RegistryController();
            this.checkBoxAutostart.Checked = registryController.isProgramRegistered(appName);

            SettingsController settingsController = new SettingsController();
            settingsController.readVibranceSettings(out vibranceIngameLevel, out vibranceWindowsLevel, out keepActive, out refreshRate, out multipleMonitors);

            //no null check needed, SettingsController will always return matching values.
            labelWindowsLevel.Text = NvidiaSettingsWrapper.find(vibranceWindowsLevel).getPercentage;
            labelIngameLevel.Text = NvidiaSettingsWrapper.find(vibranceIngameLevel).getPercentage;

            trackBarWindowsLevel.Value = vibranceWindowsLevel;
            trackBarIngameLevel.Value = vibranceIngameLevel;
            checkBoxKeepActive.Checked = keepActive;
            checkBoxMonitors.Checked = multipleMonitors;
            textBoxRefreshRate.Text = refreshRate.ToString();
        }