コード例 #1
0
ファイル: wfrm_User_MessageRule.cs プロジェクト: dioptre/nkd
 private void m_pActions_DoubleClick(object sender, EventArgs e)
 {
     if(m_pTab_Actions_Actions.SelectedItems.Count > 0){
         UserMessageRuleActionBase action = (UserMessageRuleActionBase)m_pTab_Actions_Actions.SelectedItems[0].Tag;
         wfrm_UserMessageRule_Action frm = new wfrm_UserMessageRule_Action(m_pRule,action);
         frm.Text = "Add/Edit User Message Rule Action";
         if(frm.ShowDialog(this) == DialogResult.OK){
             LoadActions();
         }
     }
 }
コード例 #2
0
ファイル: wfrm_User_MessageRule.cs プロジェクト: dioptre/nkd
        private void m_pTab_Actions_ActionsToolbar_ItemClicked(object sender,ToolStripItemClickedEventArgs e)
        {
            if(e.ClickedItem.Tag == null){
                return;
            }

            if(e.ClickedItem.Tag.ToString() == "add"){                
                wfrm_UserMessageRule_Action frm = new wfrm_UserMessageRule_Action(m_pRule);
                frm.Text = "Add/Edit User Message Rule Action";
                if(frm.ShowDialog(this) == DialogResult.OK){
                    LoadActions();
                }
            }
            else if(e.ClickedItem.Tag.ToString() == "edit"){
                if(m_pTab_Actions_Actions.SelectedItems.Count > 0){
                    UserMessageRuleActionBase action = (UserMessageRuleActionBase)m_pTab_Actions_Actions.SelectedItems[0].Tag;
                    wfrm_UserMessageRule_Action frm = new wfrm_UserMessageRule_Action(m_pRule,action);
                    frm.Text = "Add/Edit User Message Rule Action";
                    if(frm.ShowDialog(this) == DialogResult.OK){
                        LoadActions();
                    }
                }
            }
            else if(e.ClickedItem.Tag.ToString() == "delete"){
                if(m_pTab_Actions_Actions.SelectedItems.Count > 0){
                    UserMessageRuleActionBase action = (UserMessageRuleActionBase)m_pTab_Actions_Actions.SelectedItems[0].Tag;
                    if(MessageBox.Show(this,"Are you sure you want to delete Action '" + action.Description + "' !","Confirm Delete",MessageBoxButtons.YesNo,MessageBoxIcon.Question,MessageBoxDefaultButton.Button2) == DialogResult.Yes){
                        action.Owner.Remove(action);
                        LoadActions();
                    }
                }
            }
        }