Пример #1
0
 /// <summary>
 /// Handles the Click event of System.Windows.Forms.Button.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">The event arguments.</param>
 private void EditCommandButton_Click(object sender, EventArgs e)
 {
     using (CommandDialog dialog = new CommandDialog(this.commandsListBox.SelectedItem.ToString()))
     {
         if (dialog.ShowDialog() == DialogResult.OK)
         {
             this.commandsListBox.Items[this.commandsListBox.SelectedIndex] = dialog.Command;
             this.IsDirty = true;
         }
     }
 }
Пример #2
0
 /// <summary>
 /// Handles the Click event of System.Windows.Forms.Button.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">The event arguments.</param>
 private void AddCommandButton_Click(object sender, EventArgs e)
 {
     using (CommandDialog dialog = new CommandDialog())
     {
         if (dialog.ShowDialog() == DialogResult.OK)
         {
             this.commandsListBox.Items.Add(dialog.Command);
             this.IsDirty = true;
         }
     }
 }
Пример #3
0
 /// <summary>
 /// Handles the Click event of System.Windows.Forms.Button.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">The event arguments.</param>
 private void EditCommandButton_Click(object sender, EventArgs e)
 {
     using (CommandDialog dialog = new CommandDialog(this.commandsListBox.SelectedItem.ToString()))
     {
         if (dialog.ShowDialog() == DialogResult.OK)
         {
             this.commandsListBox.Items[this.commandsListBox.SelectedIndex] = dialog.Command;
             this.IsDirty = true;
         }
     }
 }
Пример #4
0
 /// <summary>
 /// Handles the Click event of System.Windows.Forms.Button.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">The event arguments.</param>
 private void AddCommandButton_Click(object sender, EventArgs e)
 {
     using (CommandDialog dialog = new CommandDialog())
     {
         if (dialog.ShowDialog() == DialogResult.OK)
         {
             this.commandsListBox.Items.Add(dialog.Command);
             this.IsDirty = true;
         }
     }
 }