/// <summary> /// Handles the Click event of the NewMI control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param> private void NewMI_Click(object sender, EventArgs e) { try { KeyValuePair <string, string> parameter = new ParameterEditDlg().ShowDialog(new KeyValuePair <string, string>()); if (String.IsNullOrEmpty(parameter.Key)) { return; } AddItem(parameter); AdjustColumns(); } catch (Exception exception) { GuiUtils.HandleException(this.Text, MethodBase.GetCurrentMethod(), exception); } }
/// <summary> /// Handles the Click event of the EditMI control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param> /// TODO Edit XML Comment Template for EditMI_Click private void EditMI_Click(object sender, EventArgs e) { try { if (ItemsLV.SelectedItems.Count != 1) { return; } KeyValuePair <string, string> parameter = new ParameterEditDlg().ShowDialog((KeyValuePair <string, string>)ItemsLV.SelectedItems[0].Tag); if (String.IsNullOrEmpty(parameter.Key)) { return; } UpdateItem(ItemsLV.SelectedItems[0], parameter); AdjustColumns(); } catch (Exception exception) { GuiUtils.HandleException(this.Text, MethodBase.GetCurrentMethod(), exception); } }