private void AddButton_Click(object sender, EventArgs e) { var c = CommandEditDialog.CreateNewCommandFromDialog(); if (c != null) { this.Commands.Add(new CommandWrapper(c)); } }
private void CommandsDataGridView_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { var current = this.Commands[e.RowIndex].Command; var cNew = CommandEditDialog.CreateNewCommandFromDialog(current); if (cNew != null) { this.Commands[e.RowIndex] = new CommandWrapper(cNew); } }
private void EditButton_Click(object sender, EventArgs e) { if (this.Commands.Count > 0) { var current = this.Commands[CommandsDataGridView.CurrentCell.RowIndex].Command; var cNew = CommandEditDialog.CreateNewCommandFromDialog(current); if (cNew != null) { this.Commands[CommandsDataGridView.CurrentCell.RowIndex] = new CommandWrapper(cNew); } } }
private void InsertButton_Click(object sender, EventArgs e) { if (this.Commands.Count < 1) { this.AddButton_Click(sender, e); } else { var c = CommandEditDialog.CreateNewCommandFromDialog(); if (c != null) { this.Commands.Insert(CommandsDataGridView.CurrentCell.RowIndex, new CommandWrapper(c)); } } }
/// <summary> /// Initializes a new instance by opening a CommandEditDialog, holding the instance that it returns. /// </summary> public CommandWrapper() : this(CommandEditDialog.CreateNewCommandFromDialog()) { }