private void B_Delete_Click(object sender, EventArgs e) { //Delete Profile DialogResult ProfConfirm; //Cannot Edit (Global) Profile if (V_Profiles.Text == DefGlobalProf) { MessageBox.Show("Cannot Delete the Global Profile", "", MessageBoxButtons.OK); return; } ProfConfirm = MessageBox.Show("Are you sure you want to delete this profile and its related Keymap (" + V_Profiles.Text + ".pgm)?", "", MessageBoxButtons.YesNo); if (ProfConfirm == DialogResult.Yes) { //Delete the file if it exists if (System.IO.File.Exists(Globals.ProfileSavePath + V_Profiles.Text + ".pgm")) { System.IO.File.Delete(Globals.ProfileSavePath + V_Profiles.Text + ".pgm"); } ProfileList.RemoveAll((x) => x.ProfName == V_Profiles.Text); V_Profiles.Items.Remove(V_Profiles.Text); SaveProfiles(); SelectProfile(DefGlobalProf); G_KeyMap.Invalidate(); } }
private void MacroList_SelectedIndexChanged(object sender, EventArgs e) { if (mKeyProgrammer.Active) { int index = MacroList.SelectedIndex; if (index != 0 && index != -1) { mKeyProgrammer.AssignMacro(MacroList.SelectedItem.ToString(), ref KeyMaps); B_QuickPrg.Text = "Programming"; G_KeyMap.Invalidate(); } } }
private void V_Profiles_SelectionChangeCommitted(object sender, EventArgs e) { StopQuickProgram(); //ProfileSearcher Searcher = new ProfileSearcher(); if (V_Profiles.SelectedItem.ToString() != DefCreateProf) { SelectProfile(V_Profiles.SelectedItem.ToString()); G_KeyMap.Invalidate(); } else { //Set Current Profile to Blank CurrentProfile = new Profiles(); EditProfile(V_Profiles.SelectedItem.ToString()); } ProfileManuallySelected = true; //Set Focus to Grid G_KeyMap.Focus(); }