Esempio n. 1
0
 public static void Show(WindowType windowType)
 {
     try
     {
         if (windowType.Equals(WindowType.About))
         {
             if (aboutForm == null || aboutForm.IsDisposed)
             {
                 aboutForm  = new AboutWindow(aboutPanel);
                 aboutPanel = aboutForm;
             }
             aboutForm.Show(frmMain.Default.pnlDock);
         }
         else if (windowType.Equals(WindowType.ActiveDirectoryImport))
         {
             if (adimportForm == null || adimportForm.IsDisposed)
             {
                 adimportForm  = new ActiveDirectoryImportWindow(adimportPanel);
                 adimportPanel = adimportForm;
             }
             adimportPanel.Show(frmMain.Default.pnlDock);
         }
         else if (windowType.Equals(WindowType.Options))
         {
             using (var optionsForm = new frmOptions())
             {
                 optionsForm.ShowDialog(frmMain.Default.pnlDock);
             }
         }
         else if (windowType.Equals(WindowType.SSHTransfer))
         {
             sshtransferForm  = new SSHTransferWindow(sshtransferPanel);
             sshtransferPanel = sshtransferForm;
             sshtransferForm.Show(frmMain.Default.pnlDock);
         }
         else if (windowType.Equals(WindowType.Update))
         {
             if (updateForm == null || updateForm.IsDisposed)
             {
                 updateForm  = new UpdateWindow(updatePanel);
                 updatePanel = updateForm;
             }
             updateForm.Show(frmMain.Default.pnlDock);
         }
         else if (windowType.Equals(WindowType.Help))
         {
             if (helpForm == null || helpForm.IsDisposed)
             {
                 helpForm  = new HelpWindow(helpPanel);
                 helpPanel = helpForm;
             }
             helpForm.Show(frmMain.Default.pnlDock);
         }
         else if (windowType.Equals(WindowType.ExternalApps))
         {
             if (externalappsForm == null || externalappsForm.IsDisposed)
             {
                 externalappsForm  = new ExternalToolsWindow(externalappsPanel);
                 externalappsPanel = externalappsForm;
             }
             externalappsForm.Show(frmMain.Default.pnlDock);
         }
         else if (windowType.Equals(WindowType.PortScan))
         {
             portscanForm  = new PortScanWindow(portscanPanel);
             portscanPanel = portscanForm;
             portscanForm.Show(frmMain.Default.pnlDock);
         }
         else if (windowType.Equals(WindowType.UltraVNCSC))
         {
             if (ultravncscForm == null || ultravncscForm.IsDisposed)
             {
                 ultravncscForm  = new UltraVNCWindow(ultravncscPanel);
                 ultravncscPanel = ultravncscForm;
             }
             ultravncscForm.Show(frmMain.Default.pnlDock);
         }
         else if (windowType.Equals(WindowType.ComponentsCheck))
         {
             if (componentscheckForm == null || componentscheckForm.IsDisposed)
             {
                 componentscheckForm  = new ComponentsCheckWindow(componentscheckPanel);
                 componentscheckPanel = componentscheckForm;
             }
             componentscheckForm.Show(frmMain.Default.pnlDock);
         }
         else if (windowType.Equals(WindowType.Announcement))
         {
             if (AnnouncementForm == null || AnnouncementForm.IsDisposed)
             {
                 AnnouncementForm  = new AnnouncementWindow(AnnouncementPanel);
                 AnnouncementPanel = AnnouncementForm;
             }
             AnnouncementForm.Show(frmMain.Default.pnlDock);
         }
     }
     catch (Exception ex)
     {
         Runtime.MessageCollector.AddExceptionStackTrace("App.Runtime.Windows.Show() failed.", ex);
     }
 }
Esempio n. 2
0
 public static void Show(WindowType windowType)
 {
     try
     {
         if (windowType.Equals(WindowType.About))
         {
             if (_aboutForm == null || _aboutForm.IsDisposed)
             {
                 _aboutForm  = new AboutWindow(_aboutPanel);
                 _aboutPanel = _aboutForm;
             }
             _aboutForm.Show(frmMain.Default.pnlDock);
         }
         else if (windowType.Equals(WindowType.ActiveDirectoryImport))
         {
             if (_adimportForm == null || _adimportForm.IsDisposed)
             {
                 _adimportForm  = new ActiveDirectoryImportWindow(_adimportPanel);
                 _adimportPanel = _adimportForm;
             }
             _adimportPanel.Show(frmMain.Default.pnlDock);
         }
         else if (windowType.Equals(WindowType.Options))
         {
             using (var optionsForm = new frmOptions())
             {
                 optionsForm.ShowDialog(frmMain.Default.pnlDock);
             }
         }
         else if (windowType.Equals(WindowType.SSHTransfer))
         {
             SshtransferForm   = new SSHTransferWindow(_sshtransferPanel);
             _sshtransferPanel = SshtransferForm;
             SshtransferForm.Show(frmMain.Default.pnlDock);
         }
         else if (windowType.Equals(WindowType.Update))
         {
             if (UpdateForm == null || UpdateForm.IsDisposed)
             {
                 UpdateForm  = new UpdateWindow(UpdatePanel);
                 UpdatePanel = UpdateForm;
             }
             UpdateForm.Show(frmMain.Default.pnlDock);
         }
         else if (windowType.Equals(WindowType.Help))
         {
             if (_helpForm == null || _helpForm.IsDisposed)
             {
                 _helpForm  = new HelpWindow(_helpPanel);
                 _helpPanel = _helpForm;
             }
             _helpForm.Show(frmMain.Default.pnlDock);
         }
         else if (windowType.Equals(WindowType.ExternalApps))
         {
             if (_externalappsForm == null || _externalappsForm.IsDisposed)
             {
                 _externalappsForm  = new ExternalToolsWindow(_externalappsPanel);
                 _externalappsPanel = _externalappsForm;
             }
             _externalappsForm.Show(frmMain.Default.pnlDock);
         }
         else if (windowType.Equals(WindowType.PortScan))
         {
             _portscanForm  = new PortScanWindow(_portscanPanel);
             _portscanPanel = _portscanForm;
             _portscanForm.Show(frmMain.Default.pnlDock);
         }
         else if (windowType.Equals(WindowType.UltraVNCSC))
         {
             if (_ultravncscForm == null || _ultravncscForm.IsDisposed)
             {
                 _ultravncscForm  = new UltraVNCWindow(_ultravncscPanel);
                 _ultravncscPanel = _ultravncscForm;
             }
             _ultravncscForm.Show(frmMain.Default.pnlDock);
         }
         else if (windowType.Equals(WindowType.ComponentsCheck))
         {
             Runtime.MessageCollector.AddMessage(MessageClass.InformationMsg, "Showing ComponentsCheck window", true);
             if (_componentscheckForm == null || _componentscheckForm.IsDisposed)
             {
                 _componentscheckForm  = new ComponentsCheckWindow(_componentscheckPanel);
                 _componentscheckPanel = _componentscheckForm;
             }
             _componentscheckForm.Show(frmMain.Default.pnlDock);
         }
     }
     catch (Exception ex)
     {
         Runtime.MessageCollector.AddExceptionStackTrace("App.Runtime.Windows.Show() failed.", ex);
     }
 }