private void btAddAction_Click(object sender, EventArgs e) { var sap = new ShortcutActionProperties(ActionTypes.None.ToInstance()); if (sap.ShowDialog(this) == DialogResult.OK) { lvActions.Items.Add(new ListViewItem(new string[] { (lvActions.Items.Count + 1).ToString(), sap.ResultActionItem.ActionType.DisplayText() }) { Tag = sap.ResultActionItem }); lvActions.Items[lvActions.Items.Count - 1].Selected = true; } }
private void btEditAction_Click(object sender, EventArgs e) { if (lvActions.SelectedItems.Count > 0) { var sap = new ShortcutActionProperties(lvActions.SelectedItems[0].Tag as IActionItem); if (sap.ShowDialog(this) == DialogResult.OK) { lvActions.SelectedItems[0].Tag = sap.ResultActionItem; GroomActionLabels(); } } }