Example #1
0
        /// <summary>
        /// Load a new scanner configuration
        /// </summary>
        public void LoadScannerConfiguration()
        {
            ILaytonView tabView = (ILaytonView)WorkItem.RootWorkItem.Workspaces[WorkspaceNames.TabWorkspace].ActiveSmartPart;

            // Display the load configuration screen and if we click OK load the new configuration
            FormLoadScannerConfiguration form = new FormLoadScannerConfiguration(tabView is AuditAgentTabView);

            if (form.ShowDialog() == DialogResult.OK)
            {
                try
                {
                    // Use the Deserialize method to restore the object's state.
                    _auditScannerDefinition = AuditWizardSerialization.DeserializeObject(form.FileName);
                }
                catch (Exception ex)
                {
                    logger.Error("Error in LoadScannerConfiguration using " + form.FileName, ex);
                    MessageBox.Show("Unable to load scanner configuration file", "AuditWizard", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return;
                }

                // If the active tab is either the scanner configuration or alert monitor tab then calls
                // its refresh function to pick up the new scanner configuration
                if ((tabView is ScannerConfigurationTabView) || (tabView is AlertMonitorSettingsTabView) || tabView is AuditAgentTabView)
                {
                    tabView.RefreshView();
                }
            }
        }
Example #2
0
        /// <summary>
        /// Create a new scanner configuration
        /// </summary>
        public void NewScannerConfiguration()
        {
            // First ask the user if they would like to save any changes made to the current scanner configuration
            if (MessageBox.Show("Would you like to save the current scanner configuration before proceeding?", "Save Scanner Configuration", MessageBoxButtons.YesNo) == DialogResult.Yes)
            {
                SaveScannerConfiguration();
            }

            // Now create a new default configuration.
            _auditScannerDefinition             = new AuditScannerDefinition();
            _auditScannerDefinition.ScannerName = "new_scanner";
            _auditScannerDefinition.Description = "Enter new scanner description";

            _auditScannerDefinition.Hidden     = true;
            _auditScannerDefinition.AutoUpload = true;

            _auditScannerDefinition.SoftwareScanApplications = true;
            _auditScannerDefinition.SoftwareScanOs           = true;
            _auditScannerDefinition.HardwareScan             = true;
            _auditScannerDefinition.IEScan    = true;
            _auditScannerDefinition.IECookies = true;
            _auditScannerDefinition.IEHistory = true;
            _auditScannerDefinition.IEDays    = 7;

            _auditScannerDefinition.AlertMonitorAlertSecs   = 60;
            _auditScannerDefinition.AlertMonitorSettingSecs = 30;

            // ...and refresh the display
            ILaytonView tabView = (ILaytonView)WorkItem.RootWorkItem.Workspaces[WorkspaceNames.TabWorkspace].ActiveSmartPart;

            tabView.RefreshView();
        }
Example #3
0
 private void LaytonFormShell_KeyUp(object sender, KeyEventArgs e)
 {
     // check if the F5 key was pressed
     if (e.KeyCode == Keys.F5)
     {
         // Refresh the TabView and ExplorerView
         ILaytonView explorerView = (ILaytonView)explorerWorkspace.ActiveSmartPart;
         explorerView.RefreshView();
         ILaytonView tabView = (ILaytonView)tabWorkspace.ActiveSmartPart;
         tabView.RefreshView();
     }
 }
        private void toolbarsWorkspace_ToolClick(object sender, Infragistics.Win.UltraWinToolbars.ToolClickEventArgs e)
        {
            switch (e.Tool.Key)
            {
                case "Refresh":
                    ILaytonView explorerView = (ILaytonView)explorerWorkspace.ActiveSmartPart;
                    explorerView.RefreshView();
                    ILaytonView tabView = (ILaytonView)tabWorkspace.ActiveSmartPart;
                    tabView.RefreshView();
                    break;
                case "Settings":
                    this.WorkItem.RootWorkItem.WorkItems[WorkItemNames.SettingsWorkItem].Activate();
                    break;
                case "Help":
                    try
                    {
                        //System.Diagnostics.Process.Start(Properties.Settings.Default.appHelpFile);
                        FormUserGuide form = new FormUserGuide();
                        form.ShowDialog();
                    }
                    catch
                    {
                        MessageBox.Show("Could not load help file:  " + Properties.Settings.Default.appHelpFile + System.Environment.NewLine + "Be sure the help file is located in the root of the application folder.", "Error Loading Help File", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                    break;
                case "About":
                    LaytonAboutForm aboutForm = new LaytonAboutForm((LaytonCabShellWorkItem)WorkItem.RootWorkItem);
                    aboutForm.ShowDialog();

                    ILaytonView overviewExplorerView = (ILaytonView)explorerWorkspace.ActiveSmartPart;

                    if (overviewExplorerView is Layton.AuditWizard.Overview.OverviewExplorerView)
                        overviewExplorerView.RefreshView();

                    break;
                case "Visit Website":
                    try
                    {
                        System.Diagnostics.Process.Start("http://www.laytontechnology.com");
                    }
                    catch
                    {
                        MessageBox.Show("Unable to launch the default web browser.", "Error Opening Website", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                    break;
                case "Exit":
                    Application.Exit();
                    break;
                case "Expand Main View":
                    LaytonCabShellWorkItem rootWorkItem = WorkItem.RootWorkItem as LaytonCabShellWorkItem;
                    if (rootWorkItem.Shell.ExplorerWorkspaceCollapsed)
                    {
                        rootWorkItem.Shell.ExplorerWorkspaceCollapsed = false;
                        e.Tool.InstanceProps.AppearancesSmall.Appearance.Image = Properties.Resources.expand_view_16;
                        e.Tool.SharedProps.Caption = e.Tool.Key;
                    }
                    else
                    {
                        rootWorkItem.Shell.ExplorerWorkspaceCollapsed = true;
                        e.Tool.InstanceProps.AppearancesSmall.Appearance.Image = Properties.Resources.collapse_view_16;
                        e.Tool.SharedProps.Caption = "Default Layout";                        
                    }
                    break;
                default:
                    break;
            }
        }