private void trackBarIngameLevel_Scroll(object sender, EventArgs e) { NvidiaSettingsWrapper setting = NvidiaSettingsWrapper.find(trackBarIngameLevel.Value); if (setting == null) { return; } v.setVibranceIngameLevel(trackBarIngameLevel.Value); labelIngameLevel.Text = setting.getPercentage; if (!settingsBackgroundWorker.IsBusy) { settingsBackgroundWorker.RunWorkerAsync(); } }
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(); }