private void uiNewKeyButton_Click(object sender, EventArgs e) { using (AddOrEditKeyCommandDialog dialog = new AddOrEditKeyCommandDialog()) { if (dialog.ShowDialog() == DialogResult.OK) { this.AddOrEditCommand(dialog.GetKeyCommandEntry()); } } }
private void uiEditButton_Click(object sender, EventArgs e) { using (AddOrEditKeyCommandDialog dialog = new AddOrEditKeyCommandDialog()) { if (this.uiKeyCommandsListView.SelectedItems.Count > 0) { dialog.SetKeyCommandEntry(this.commands[this.uiKeyCommandsListView.SelectedItems[0]]); } if (dialog.ShowDialog() == DialogResult.OK) { this.AddOrEditCommand(dialog.GetKeyCommandEntry()); } } }