private void saveProfile() { var processName = getProcessName(); if (processName == null | processName.Length == 0) { return; } GameProfile gameProfile = new GameProfile(); gameProfile.shortcutIndex = cmbShortcut.SelectedIndex; gameProfile.volumeAValue = volumeA.Text; gameProfile.volumeBValue = volumeB.Text; if (profiles.profiles.ContainsKey(processName)) { profiles.profiles.Remove(processName); } profiles.profiles.Add(processName, gameProfile); if (cmbProcessName.SelectedIndex == 0) { var index = Properties.Settings.Default.Processes.Add(processName); InitialiseProcessSelector(); cmbProcessName.SelectedIndex = index + 1; txtProcessName.Clear(); } }
private void loadProfile() { var processName = getProcessName(); if (processName == null | processName.Length == 0 || !profiles.profiles.ContainsKey(processName)) { cmbShortcut.SelectedIndex = 0; volumeA.Text = "100"; volumeB.Text = "25"; return; } GameProfile profile = profiles.profiles[processName]; cmbShortcut.SelectedIndex = profile.shortcutIndex; volumeA.Text = profile.volumeAValue; volumeB.Text = profile.volumeBValue; }