void ButtonNewClick(object sender, EventArgs e) { using (ModuleCommandForm f = new ModuleCommandForm()) { if (WorkbenchSingleton.AddDialog(f) == DialogResult.OK) { module.AddCommand(f.Command); } } }
void ButtonEditClick(object sender, EventArgs e) { if (listView1.SelectedItems.Count > 0) { ModuleCommand command = module.Commands[listView1.SelectedItems[0].Index]; using (ModuleCommandForm f = new ModuleCommandForm(command)) { f.Text = "Edit Module Command"; if (WorkbenchSingleton.AddDialog(f) == DialogResult.OK) { ModuleCommandsChanged(this, null); } } } }