private void m_pRules_DoubleClick(object sender, EventArgs e) { if (m_pRules.SelectedItems.Count > 0) { GlobalMessageRule rule = (GlobalMessageRule)m_pRules.SelectedItems[0].Tag; wfrm_GlobalMessageRule frm = new wfrm_GlobalMessageRule(m_pVirtualServer, rule); if (frm.ShowDialog(this) == DialogResult.OK) { LoadRules(rule.ID); } } }
/// <summary> /// Executes specified tool bar task. /// </summary> /// <param name="taskID">Task ID.</param> private void SwitchToolBarTask(string taskID) { if (taskID == "add") { wfrm_GlobalMessageRule frm = new wfrm_GlobalMessageRule(m_pVirtualServer); if (frm.ShowDialog(this) == DialogResult.OK) { LoadRules(""); } } else if (taskID == "edit") { GlobalMessageRule rule = (GlobalMessageRule)m_pRules.SelectedItems[0].Tag; wfrm_GlobalMessageRule frm = new wfrm_GlobalMessageRule(m_pVirtualServer, rule); if (frm.ShowDialog(this) == DialogResult.OK) { LoadRules(rule.ID); } } else if (taskID == "delete") { GlobalMessageRule rule = (GlobalMessageRule)m_pRules.SelectedItems[0].Tag; if (MessageBox.Show(this, "Are you sure you want to delete Rule '" + rule.Description + "' !", "Confirm Delete", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.Yes) { rule.Owner.Remove(rule); m_pRules.SelectedItems[0].Remove(); } } else if (taskID == "refresh") { LoadRules(""); } else if (taskID == "up") { if (m_pRules.SelectedItems.Count > 0 && m_pRules.SelectedItems[0].Index > 0) { SwapRules(m_pRules.SelectedItems[0], m_pRules.Items[m_pRules.SelectedItems[0].Index - 1]); } } else if (taskID == "down") { if (m_pRules.SelectedItems.Count > 0 && m_pRules.SelectedItems[0].Index < m_pRules.Items.Count - 1) { SwapRules(m_pRules.SelectedItems[0], m_pRules.Items[m_pRules.SelectedItems[0].Index + 1]); } } }
/// <summary> /// Executes specified tool bar task. /// </summary> /// <param name="taskID">Task ID.</param> private void SwitchToolBarTask(string taskID) { if(taskID == "add"){ wfrm_GlobalMessageRule frm = new wfrm_GlobalMessageRule(m_pVirtualServer); if(frm.ShowDialog(this) == DialogResult.OK){ LoadRules(""); } } else if(taskID == "edit"){ GlobalMessageRule rule = (GlobalMessageRule)m_pRules.SelectedItems[0].Tag; wfrm_GlobalMessageRule frm = new wfrm_GlobalMessageRule(m_pVirtualServer,rule); if(frm.ShowDialog(this) == DialogResult.OK){ LoadRules(rule.ID); } } else if(taskID == "delete"){ GlobalMessageRule rule = (GlobalMessageRule)m_pRules.SelectedItems[0].Tag; if(MessageBox.Show(this,"Are you sure you want to delete Rule '" + rule.Description + "' !","Confirm Delete",MessageBoxButtons.YesNo,MessageBoxIcon.Question,MessageBoxDefaultButton.Button2) == DialogResult.Yes){ rule.Owner.Remove(rule); m_pRules.SelectedItems[0].Remove(); } } else if(taskID == "refresh"){ LoadRules(""); } else if(taskID == "up"){ if(m_pRules.SelectedItems.Count > 0 && m_pRules.SelectedItems[0].Index > 0){ SwapRules(m_pRules.SelectedItems[0],m_pRules.Items[m_pRules.SelectedItems[0].Index - 1]); } } else if(taskID == "down"){ if(m_pRules.SelectedItems.Count > 0 && m_pRules.SelectedItems[0].Index < m_pRules.Items.Count - 1){ SwapRules(m_pRules.SelectedItems[0],m_pRules.Items[m_pRules.SelectedItems[0].Index + 1]); } } }
private void m_pRules_DoubleClick(object sender, EventArgs e) { if(m_pRules.SelectedItems.Count > 0){ GlobalMessageRule rule = (GlobalMessageRule)m_pRules.SelectedItems[0].Tag; wfrm_GlobalMessageRule frm = new wfrm_GlobalMessageRule(m_pVirtualServer,rule); if(frm.ShowDialog(this) == DialogResult.OK){ LoadRules(rule.ID); } } }