コード例 #1
0
 private void m_pRoutes_DoubleClick(object sender, EventArgs e)
 {
     if (m_pRoutes.SelectedItems.Count > 0)
     {
         Route route            = (Route)m_pRoutes.SelectedItems[0].Tag;
         wfrm_Routing_Route frm = new wfrm_Routing_Route(m_pVirtualServer, route);
         if (frm.ShowDialog(this) == DialogResult.OK)
         {
             LoadRoutes(route.ID);
         }
     }
 }
コード例 #2
0
 /// <summary>
 /// Executes specified tool bar task.
 /// </summary>
 /// <param name="taskID">Task ID.</param>
 private void SwitchToolBarTask(string taskID)
 {
     if (taskID == "add")
     {
         wfrm_Routing_Route frm = new wfrm_Routing_Route(m_pVirtualServer);
         if (frm.ShowDialog(this) == DialogResult.OK)
         {
             LoadRoutes(frm.RouteID);
         }
     }
     else if (taskID == "edit")
     {
         Route route            = (Route)m_pRoutes.SelectedItems[0].Tag;
         wfrm_Routing_Route frm = new wfrm_Routing_Route(m_pVirtualServer, route);
         if (frm.ShowDialog(this) == DialogResult.OK)
         {
             LoadRoutes(route.ID);
         }
     }
     else if (taskID == "delete")
     {
         Route route = (Route)m_pRoutes.SelectedItems[0].Tag;
         if (MessageBox.Show(this, "Are you sure you want to delete Route '" + route.Pattern + "' !", "Confirm Delete", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.Yes)
         {
             route.Owner.Remove(route);
             m_pRoutes.SelectedItems[0].Remove();
         }
     }
     else if (taskID == "refresh")
     {
         LoadRoutes("");
     }
     else if (taskID == "up")
     {
         if (m_pRoutes.SelectedItems.Count > 0 && m_pRoutes.SelectedItems[0].Index > 0)
         {
             SwapRoutes(m_pRoutes.SelectedItems[0], m_pRoutes.Items[m_pRoutes.SelectedItems[0].Index - 1]);
         }
     }
     else if (taskID == "down")
     {
         if (m_pRoutes.SelectedItems.Count > 0 && m_pRoutes.SelectedItems[0].Index < m_pRoutes.Items.Count - 1)
         {
             SwapRoutes(m_pRoutes.SelectedItems[0], m_pRoutes.Items[m_pRoutes.SelectedItems[0].Index + 1]);
         }
     }
 }
コード例 #3
0
ファイル: wfrm_Routing_Routes.cs プロジェクト: dioptre/nkd
 /// <summary>
 /// Executes specified tool bar task.
 /// </summary>
 /// <param name="taskID">Task ID.</param>
 private void SwitchToolBarTask(string taskID)
 {
     if(taskID == "add"){
         wfrm_Routing_Route frm = new wfrm_Routing_Route(m_pVirtualServer);
         if(frm.ShowDialog(this) == DialogResult.OK){
             LoadRoutes(frm.RouteID);
         }
     }
     else if(taskID == "edit"){
         Route route = (Route)m_pRoutes.SelectedItems[0].Tag;
         wfrm_Routing_Route frm = new wfrm_Routing_Route(m_pVirtualServer,route);
         if(frm.ShowDialog(this) == DialogResult.OK){
             LoadRoutes(route.ID);
         }
     }
     else if(taskID == "delete"){
         Route route = (Route)m_pRoutes.SelectedItems[0].Tag;
         if(MessageBox.Show(this,"Are you sure you want to delete Route '" + route.Pattern + "' !","Confirm Delete",MessageBoxButtons.YesNo,MessageBoxIcon.Question,MessageBoxDefaultButton.Button2) == DialogResult.Yes){
             route.Owner.Remove(route);
             m_pRoutes.SelectedItems[0].Remove();
         }
     }
     else if(taskID == "refresh"){                
         LoadRoutes("");
     }
     else if(taskID == "up"){
         if(m_pRoutes.SelectedItems.Count > 0 && m_pRoutes.SelectedItems[0].Index > 0){
             SwapRoutes(m_pRoutes.SelectedItems[0],m_pRoutes.Items[m_pRoutes.SelectedItems[0].Index - 1]);
         }
     }
     else if(taskID == "down"){
         if(m_pRoutes.SelectedItems.Count > 0 && m_pRoutes.SelectedItems[0].Index < m_pRoutes.Items.Count - 1){
             SwapRoutes(m_pRoutes.SelectedItems[0],m_pRoutes.Items[m_pRoutes.SelectedItems[0].Index + 1]);
         }
     }
 }
コード例 #4
0
ファイル: wfrm_Routing_Routes.cs プロジェクト: dioptre/nkd
 private void m_pRoutes_DoubleClick(object sender, EventArgs e)
 {
     if(m_pRoutes.SelectedItems.Count > 0){
         Route route = (Route)m_pRoutes.SelectedItems[0].Tag;
         wfrm_Routing_Route frm = new wfrm_Routing_Route(m_pVirtualServer,route);
         if(frm.ShowDialog(this) == DialogResult.OK){
             LoadRoutes(route.ID);
         }
     }
 }