예제 #1
0
 private void m_pServers_DoubleClick(object sender, EventArgs e)
 {
     if (this.m_pServers.SelectedItems.Count > 0)
     {
         VirtualServer            virtualServer            = (VirtualServer)this.m_pServers.SelectedItems[0].Tag;
         AddEditVirtualServerForm addEditVirtualServerForm = new AddEditVirtualServerForm(this.m_pServer, virtualServer);
         if (addEditVirtualServerForm.ShowDialog(this) == DialogResult.OK)
         {
             this.LoadVirtualServers();
             this.m_pFrmMain.LoadVirtualServers(this.m_pVirtualServersNode, this.m_pServer);
         }
     }
 }
예제 #2
0
 private void m_pToolbar_ItemClicked(object sender, ToolStripItemClickedEventArgs e)
 {
     if (e.ClickedItem.Tag == null)
     {
         return;
     }
     if (e.ClickedItem.Tag.ToString() == "add")
     {
         AddEditVirtualServerForm addEditVirtualServerForm = new AddEditVirtualServerForm(this.m_pServer);
         if (addEditVirtualServerForm.ShowDialog(this) == DialogResult.OK)
         {
             this.LoadVirtualServers();
             this.m_pFrmMain.LoadVirtualServers(this.m_pVirtualServersNode, this.m_pServer);
             return;
         }
     }
     else if (e.ClickedItem.Tag.ToString() == "edit")
     {
         VirtualServer            virtualServer             = (VirtualServer)this.m_pServers.SelectedItems[0].Tag;
         AddEditVirtualServerForm addEditVirtualServerForm2 = new AddEditVirtualServerForm(this.m_pServer, virtualServer);
         if (addEditVirtualServerForm2.ShowDialog(this) == DialogResult.OK)
         {
             this.LoadVirtualServers();
             this.m_pFrmMain.LoadVirtualServers(this.m_pVirtualServersNode, this.m_pServer);
             return;
         }
     }
     else if (e.ClickedItem.Tag.ToString() == "delete")
     {
         VirtualServer virtualServer2 = (VirtualServer)this.m_pServers.SelectedItems[0].Tag;
         if (MessageBox.Show(this, "Are you sure you want to delete Virtual server '" + virtualServer2.Name + "' !", "Confirm Delete", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.Yes)
         {
             virtualServer2.Owner.Remove(virtualServer2);
             this.LoadVirtualServers();
             this.m_pFrmMain.LoadVirtualServers(this.m_pVirtualServersNode, this.m_pServer);
         }
     }
 }