private void m_pActions_DoubleClick(object sender, EventArgs e) { if (this.m_pTab_Actions_Actions.SelectedItems.Count > 0) { GlobalMessageRuleActionBase action = (GlobalMessageRuleActionBase)this.m_pTab_Actions_Actions.SelectedItems[0].Tag; AddEditGlobalMessageRuleActionForm addEditGlobalMessageRuleActionForm = new AddEditGlobalMessageRuleActionForm(this.m_pRule, action); if (addEditGlobalMessageRuleActionForm.ShowDialog(this) == DialogResult.OK) { this.LoadActions(); } } }
private void m_pTab_Actions_ActionsToolbar_ItemClicked(object sender, ToolStripItemClickedEventArgs e) { if (e.ClickedItem.Tag == null) { return; } if (e.ClickedItem.Tag.ToString() == "add") { AddEditGlobalMessageRuleActionForm addEditGlobalMessageRuleActionForm = new AddEditGlobalMessageRuleActionForm(this.m_pRule); if (addEditGlobalMessageRuleActionForm.ShowDialog(this) == DialogResult.OK) { this.LoadActions(); return; } } else if (e.ClickedItem.Tag.ToString() == "edit") { if (this.m_pTab_Actions_Actions.SelectedItems.Count > 0) { GlobalMessageRuleActionBase action = (GlobalMessageRuleActionBase)this.m_pTab_Actions_Actions.SelectedItems[0].Tag; AddEditGlobalMessageRuleActionForm addEditGlobalMessageRuleActionForm2 = new AddEditGlobalMessageRuleActionForm(this.m_pRule, action); if (addEditGlobalMessageRuleActionForm2.ShowDialog(this) == DialogResult.OK) { this.LoadActions(); return; } } } else if (e.ClickedItem.Tag.ToString() == "delete" && this.m_pTab_Actions_Actions.SelectedItems.Count > 0) { GlobalMessageRuleActionBase globalMessageRuleActionBase = (GlobalMessageRuleActionBase)this.m_pTab_Actions_Actions.SelectedItems[0].Tag; if (MessageBox.Show(this, "Are you sure you want to delete Action '" + globalMessageRuleActionBase.Description + "' !", "Confirm Delete", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.Yes) { globalMessageRuleActionBase.Owner.Remove(globalMessageRuleActionBase); this.LoadActions(); } } }