Esempio n. 1
0
 private void m_pToolbar_ItemClicked(object sender, ToolStripItemClickedEventArgs e)
 {
     if (e.ClickedItem.Tag == null)
     {
         return;
     }
     if (e.ClickedItem.Tag.ToString() == "add")
     {
         AddEditRootFolderForm addEditRootFolderForm = new AddEditRootFolderForm(this.m_pVirtualServer);
         if (addEditRootFolderForm.ShowDialog(this) == DialogResult.OK)
         {
             this.LoadRoots(addEditRootFolderForm.RootID);
             return;
         }
     }
     else if (e.ClickedItem.Tag.ToString() == "edit")
     {
         SharedRootFolder      sharedRootFolder       = (SharedRootFolder)this.m_pRootFolders.SelectedItems[0].Tag;
         AddEditRootFolderForm addEditRootFolderForm2 = new AddEditRootFolderForm(this.m_pVirtualServer, sharedRootFolder);
         if (addEditRootFolderForm2.ShowDialog(this) == DialogResult.OK)
         {
             this.LoadRoots(sharedRootFolder.ID);
             return;
         }
     }
     else if (e.ClickedItem.Tag.ToString() == "delete")
     {
         SharedRootFolder sharedRootFolder2 = (SharedRootFolder)this.m_pRootFolders.SelectedItems[0].Tag;
         if (MessageBox.Show(this, "Are you sure you want to delete Root folder '" + sharedRootFolder2.Name + "' !", "Confirm Delete", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.Yes)
         {
             sharedRootFolder2.Owner.Remove(sharedRootFolder2);
             this.LoadRoots("");
         }
     }
 }
Esempio n. 2
0
 private void m_pRootFolders_DoubleClick(object sender, EventArgs e)
 {
     if (this.m_pRootFolders.SelectedItems.Count > 0)
     {
         SharedRootFolder      sharedRootFolder      = (SharedRootFolder)this.m_pRootFolders.SelectedItems[0].Tag;
         AddEditRootFolderForm addEditRootFolderForm = new AddEditRootFolderForm(this.m_pVirtualServer, sharedRootFolder);
         if (addEditRootFolderForm.ShowDialog(this) == DialogResult.OK)
         {
             this.LoadRoots(sharedRootFolder.ID);
         }
     }
 }