Exemplo n.º 1
0
        private void AddButton_Click(object sender, EventArgs e)
        {
            var c = CommandEditDialog.CreateNewCommandFromDialog();

            if (c != null)
            {
                this.Commands.Add(new CommandWrapper(c));
            }
        }
Exemplo n.º 2
0
        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);
            }
        }
Exemplo n.º 3
0
 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);
         }
     }
 }
Exemplo n.º 4
0
 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));
         }
     }
 }
Exemplo n.º 5
0
 /// <summary>
 /// Initializes a new instance by opening a CommandEditDialog, holding the instance that it returns.
 /// </summary>
 public CommandWrapper() : this(CommandEditDialog.CreateNewCommandFromDialog())
 {
 }