/// <summary>
        /// Called as we switch the tab view to one associated with the currently selected item in the
        /// explorer view noting that we must force the current active tab view to save its data before
        /// we switch to ensure that we are always up to date
        ///
        /// This is typically required when we switch between items in the currently selected group but can
        /// also be indirectly invoked as we switch groups as we may select an item as part of this process
        /// </summary>
        /// <param name="newTabView"></param>
        public void SwitchActiveTabView(ILaytonView newTabView)
        {
            // Get the current tab view as we need to force it to save it's data before we move
            // off to another tab
            IAdministrationView activeAdministrationTabView = (IAdministrationView)workItem.RootWorkItem.Workspaces[WorkspaceNames.TabWorkspace].ActiveSmartPart;

            //activeAdministrationTabView.Save();

            // All done if no new tab
            if (newTabView == null)
            {
                return;
            }

            // tell the work item what the new tab view will be
            workItem.Controller.SetTabView(newTabView);

            // Request the new view to activate itself (this initializes the data displayed)
            activeAdministrationTabView = (IAdministrationView)workItem.RootWorkItem.Workspaces[WorkspaceNames.TabWorkspace].ActiveSmartPart;
            activeAdministrationTabView.Activate();
            ((AdministrationWorkItem)workItem).ActiveTabView = activeAdministrationTabView;

            // Ask the toolbars controller to display the correct ribbons for the displayed tab
            AdministrationToolbarsController toolbarsController = workItem.ToolbarsController as AdministrationToolbarsController;

            toolbarsController.ResetRibbon(newTabView);
        }
        public void SwitchActiveTabView(ILaytonView newTabView)
        {
            LaytonToolbarsController tbController = WorkItem.ToolbarsController;

            // Are we going to be displaying the Applications Tab View?
            RibbonGroup ribbonGroup = tbController.RibbonTab.Groups[RibbonNames.licensingGroupName];

            if (newTabView is ApplicationsTabView)
            {
                // We allow 'New License' but disable 'Edit License' and 'Delete License'
                ButtonTool buttonTool = (ButtonTool)ribbonGroup.Tools[ToolNames.NewLicense];
                buttonTool.SharedProps.Enabled = true;
                buttonTool = (ButtonTool)tbController.RibbonTab.Groups[RibbonNames.licensingGroupName].Tools[ToolNames.EditLicense];
                buttonTool.SharedProps.Enabled = false;
                buttonTool = (ButtonTool)tbController.RibbonTab.Groups[RibbonNames.licensingGroupName].Tools[ToolNames.DeleteLicense];
                buttonTool.SharedProps.Enabled = false;
            }

            // Are we going to display the Licenses Tab View?
            else if (newTabView is LicensesTabView)
            {
                // Allow all licensing buttons to operate
                ButtonTool buttonTool = (ButtonTool)tbController.RibbonTab.Groups[RibbonNames.licensingGroupName].Tools[ToolNames.NewLicense];
                buttonTool.SharedProps.Enabled = true;
                buttonTool = (ButtonTool)tbController.RibbonTab.Groups[RibbonNames.licensingGroupName].Tools[ToolNames.EditLicense];
                buttonTool.SharedProps.Enabled = true;
                buttonTool = (ButtonTool)tbController.RibbonTab.Groups[RibbonNames.licensingGroupName].Tools[ToolNames.DeleteLicense];
                buttonTool.SharedProps.Enabled = true;
            }

            base.SetTabView(newTabView);
        }
Пример #3
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();
        }
        public void NewLicenses(List <InstalledApplication> aForApplications)
        {
            // Create a new license and then call the license form to define it
            ApplicationLicense newLicense = new ApplicationLicense();

            FormLicenseProperties form = new FormLicenseProperties("Multiple Applications", newLicense);

            if (form.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                ApplicationLicense lNewApplicationLicense = form.GetLicense;
                foreach (InstalledApplication lForApplication in aForApplications)
                {
                    lNewApplicationLicense.LicenseID       = 0;
                    lNewApplicationLicense.ApplicationID   = lForApplication.ApplicationID;
                    lNewApplicationLicense.ApplicationName = lForApplication.Name;
                    lNewApplicationLicense.Add();

                    // Update this installed application with the new license
                    lForApplication.LoadData();
                }

                // The license will have been added to the application already so we simply refresh the views
                workItem.ExplorerView.RefreshView();
                workItem.GetActiveTabView().RefreshView();

                ILaytonView applicationsTabView = WorkItem.Items[Layton.Cab.Interface.ViewNames.MainTabView] as ILaytonView;
                ((ApplicationsTabView)applicationsTabView).Presenter.DisplayPublishers();
            }
        }
        public void AlertsSelectionChangedHandler(object sender, AlertsEventArgs e)
        {
            // Set the Actions tab view to be the active view
            ILaytonView newView = WorkItem.Items[Properties.Settings.Default.AlertsTabView] as ILaytonView;

            SwitchActiveTabView(newView);
        }
Пример #6
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();
                }
            }
        }
        public void ApplicationSelectionChangedHandler(object sender, ApplicationsEventArgs e)
        {
            _listApplications = e.Applications;
            ILaytonView applicationsTabView = WorkItem.Items[Layton.Cab.Interface.ViewNames.MainTabView] as ILaytonView;

            SwitchActiveTabView(applicationsTabView);
            ((ApplicationsTabView)applicationsTabView).Presenter.ShowApplication(_listApplications[0]);
        }
Пример #8
0
        public virtual void Initialize()
        {
            // Create the SmartPartInfo object for the default ExplorerView to be put in the ExplorerWorkspace
            UltraExplorerBarSmartPartInfo explorerInfo = new UltraExplorerBarSmartPartInfo();

            explorerInfo.Image       = WorkItem.Image;
            explorerInfo.Title       = WorkItem.Title;
            explorerInfo.Description = WorkItem.Description;

            // Create the SmartPartInfo object for default TabView to be put in the TabWorkspace
            UltraTabSmartPartInfo tabInfo = new UltraTabSmartPartInfo();

            tabInfo.Image       = WorkItem.Image;
            tabInfo.Title       = WorkItem.Title;
            tabInfo.Description = WorkItem.Description;

            // Create the SmartPartInfo object for the default SettingsTabView
            UltraTabSmartPartInfo settingsInfo = new UltraTabSmartPartInfo();

            settingsInfo.Image       = WorkItem.Image;
            settingsInfo.Title       = WorkItem.Title;
            settingsInfo.ActivateTab = false;

            WorkItem.ToolbarsController.Initialize();

            if (WorkItem.ExplorerView != null)
            {
                // Show the ExplorerView
                try
                {
                    WorkItem.RootWorkItem.Workspaces[WorkspaceNames.ExplorerWorkspace].Show(WorkItem.ExplorerView, explorerInfo);
                    currentExplorerView = WorkItem.ExplorerView;
                }
                catch (Exception)
                {
                }
            }
            if (WorkItem.TabView != null)
            {
                // Show the TabView
                WorkItem.RootWorkItem.Workspaces[WorkspaceNames.TabWorkspace].Show(WorkItem.TabView, tabInfo);
                currentTabView = WorkItem.TabView;
            }
            if (WorkItem.SettingsView != null)
            {
                // Show the SettingsTabView
                WorkItem.RootWorkItem.Workspaces[WorkspaceNames.SettingsTabWorkspace].Show(WorkItem.SettingsView, settingsInfo);
            }
            if (WorkItem.ToolbarsController != null)
            {
                // Get the Toolbars Workspace and set the RibbonTab
                UltraToolbarsManagerWorkspace toolbarsWorkspace = (UltraToolbarsManagerWorkspace)WorkItem.RootWorkItem.Workspaces[WorkspaceNames.ToolbarsWorkspace];
                toolbarsWorkspace.Ribbon.SelectedTab = WorkItem.ToolbarsController.RibbonTab;
            }

            // Activate the WorkItem
            WorkItem.Activate();
        }
Пример #9
0
        public void PrintPreviewGrid()
        {
            ILaytonView tabView = (ILaytonView)WorkItem.RootWorkItem.Workspaces[WorkspaceNames.TabWorkspace].ActiveSmartPart;

            if (tabView is ReportsTabView)
            {
                ((ReportsTabView)tabView).PrintPreviewGrid();
            }
        }
        /// <summary>
        /// This is the tool click handler for the Applications>Report ribbon group
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void reportNonCompliantPublishers_ToolClick(object sender, ToolClickEventArgs e)
        {
            ILaytonView applicationsTabView = WorkItem.Items[Layton.Cab.Interface.ViewNames.MainTabView] as ILaytonView;

            ((ApplicationsTabView)applicationsTabView).ReportNonCompliantPublishers();

            //ILaytonView tabView = (ILaytonView)WorkItem.RootWorkItem.Workspaces[WorkspaceNames.TabWorkspace].ActiveSmartPart;
            //((ApplicationsTabView)tabView).ReportNonCompliantPublishers();
        }
Пример #11
0
 public virtual void SetTabView(ILaytonView tabView)
 {
     if (workItem.Status == WorkItemStatus.Inactive)
     {
         ActivateWorkItem();
     }
     WorkItem.RootWorkItem.Workspaces[WorkspaceNames.TabWorkspace].Show(tabView);
     currentTabView = tabView;
 }
Пример #12
0
        //protected override void OnTerminating()
        //{
        //    // We need to now save the layouts for all tab views which may have been displayed
        //    ApplicationsTabView applicationsView = this.Items[Properties.Settings.Default.MainTabView] as ApplicationsTabView;
        //    if (applicationsView != null)
        //        applicationsView.SaveLayout();
        //    //
        //    InstancesTabView instancesTabView = this.Items[Properties.Settings.Default.InstancesTabView] as InstancesTabView;
        //    if (instancesTabView != null)
        //        instancesTabView.SaveLayout();
        //    //
        //    LicensesTabView licensesView = this.Items[Properties.Settings.Default.LicensesTabView] as LicensesTabView;
        //    licensesView.SaveLayout();
        //    //
        //    OSTabView osView = this.Items[Properties.Settings.Default.OSTabView] as OSTabView;
        //    osView.SaveLayout();

        //    // Call the base class implementation
        //    base.OnTerminating();
        //}



        #region Export Menu Functions

        /// <summary>
        /// Export to PDF format
        /// We call the appropriate grid view to handle this request themselves
        /// </summary>
        public void ExportToPDF()
        {
            ILaytonView tabView = (ILaytonView)WorkItem.RootWorkItem.Workspaces[WorkspaceNames.TabWorkspace].ActiveSmartPart;

            if (tabView is AuditTrailTabView)
            {
                ((AuditTrailTabView)tabView).ExportToPDF();
            }
        }
Пример #13
0
 public virtual void SetExplorerView(ILaytonView explorerView)
 {
     if (workItem.Status == WorkItemStatus.Inactive)
     {
         ActivateWorkItem();
     }
     WorkItem.RootWorkItem.Workspaces[WorkspaceNames.ExplorerWorkspace].Show(explorerView);
     currentExplorerView = explorerView;
 }
Пример #14
0
        /// <summary>
        /// Export to XPS format
        /// We call the appropriate grid view to handle this request themselves
        /// </summary>
        public void ExportToXPS()
        {
            ILaytonView tabView = (ILaytonView)WorkItem.RootWorkItem.Workspaces[WorkspaceNames.TabWorkspace].ActiveSmartPart;

            if (tabView is ReportsTabView)
            {
                ((ReportsTabView)tabView).ExportToXPS();
            }
        }
Пример #15
0
        public void ReportNonCompliantPublishers()
        {
            Cursor.Current = Cursors.WaitCursor;

            ILaytonView applicationsTabView = WorkItem.Items[ViewNames.MainTabView] as ILaytonView;

            ((ApplicationsTabView)applicationsTabView).Presenter.ShowPublisher(2);

            ((ApplicationsTabView)applicationsTabView).workItem.Controller.SetTabView(applicationsTabView);

            Cursor.Current = Cursors.Default;
        }
Пример #16
0
        /// <summary>
        /// Called to load the layout for the rid from file
        /// </summary>
        //private void LoadLayout()
        //{
        //    try
        //    {
        //        string layoutFile = Path.Combine(Application.StartupPath, _gridLayoutFile);
        //        this.applicationsGridView.DisplayLayout.LoadFromXml(layoutFile);
        //    }
        //    catch (Exception)
        //    {
        //        return;
        //    }
        //}


        ///// <summary>
        ///// Called to request the grid to save it's layout to disk
        ///// </summary>
        //public void SaveLayout()
        //{
        //    if (this.applicationsGridView != null)
        //    {
        //        string layoutFile = Path.Combine(Application.StartupPath, _gridLayoutFile);
        //        this.applicationsGridView.DisplayLayout.SaveAsXml(layoutFile);
        //    }
        //}

        #endregion Load/Save Layout

        public void ReportAllPublishers()
        {
            Cursor.Current = Cursors.WaitCursor;

            ILaytonView applicationsTabView = WorkItem.Items[Layton.Cab.Interface.ViewNames.MainTabView] as ILaytonView;

            ((ApplicationsTabView)applicationsTabView).Presenter.ShowPublisher(0);

            ((ApplicationsTabView)applicationsTabView).workItem.Controller.SetTabView(applicationsTabView);

            Cursor.Current = Cursors.Default;
        }
Пример #17
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();
     }
 }
        public void PublisherSelectionChangedHandler(object sender, PublishersEventArgs e)
        {
            ILaytonView applicationsTabView = WorkItem.Items[Layton.Cab.Interface.ViewNames.MainTabView] as ILaytonView;

            SwitchActiveTabView(applicationsTabView);

            // Clear our internal applications list first
            _listApplications.Clear();
            _selectedOSs.Clear();

            if (e.ApplicationPublishers[0] == null)
            {
                // We have selected the 'All Publishers' branch - so display All publishers
                ((ApplicationsTabView)applicationsTabView).Presenter.ShowPublisher(null);
            }
            else if (e.ApplicationPublishers.Count == 1)
            {
                // We have selected a specific publisher - add that publishers applications to our internal
                // list so that any operations on this publisher operate on its applications
                _listApplications = e.ApplicationPublishers[0].Applications;

                //// ...and initiate the tab view refresh
                ((ApplicationsTabView)applicationsTabView).Presenter.ShowPublisher(e.ApplicationPublishers[0].Name);
            }
            else if (e.ApplicationPublishers.Count > 1)
            {
                // use a temp list to stop the collection becoming corrupted
                _tmpListApplications.Clear();

                //e.ApplicationPublishers[0].Populate(true, true);

                foreach (ApplicationPublisher appPub in e.ApplicationPublishers)
                {
                    if (appPub.Applications.Count == 0)
                    {
                        appPub.Populate(true, true);
                    }

                    foreach (InstalledApplication app in appPub.Applications)
                    {
                        _tmpListApplications.Add(app);
                    }
                }

                _listApplications = _tmpListApplications;

                // display the publisher information for each selection
                ((ApplicationsTabView)applicationsTabView).Presenter.ShowMultiplePublishers(_tmpListApplications);
            }
        }
        public void PublisherFilterChangedHandler(object sender, PublisherFilterEventArgs e)
        {
            // Simply update our internal publisher filter with that specified
            _publisherFilter = e.PublisherFilter;

            // ...and force a refresh if we are the active explorer view
            ILaytonView activeExplorerView = (ILaytonView)WorkItem.RootWorkItem.Workspaces[WorkspaceNames.ExplorerWorkspace].ActiveSmartPart;

            if (activeExplorerView == WorkItem.ExplorerView)
            {
                WorkItem.TabView.RefreshView();
                WorkItem.ExplorerView.RefreshView();
            }
        }
Пример #20
0
        public virtual void ActivateWorkItem()
        {
            if (WorkItem.ExplorerView != null && WorkItem.TabView != null && WorkItem.ToolbarsController != null)
            {
                // AC:  For some reason the explorerbar for the last module loaded, has issues when activating for the first time
                // it appears that the ActiveSmartPart value for the ExplorerWorkspace is always set to the last module - even though
                // a different WorkItem's Explorer Workspace view is displayed - the code below works around the issue
                if (WorkItem.RootWorkItem.Workspaces[WorkspaceNames.ExplorerWorkspace].ActiveSmartPart == WorkItem.ExplorerView)
                {
                    WorkItem.RootWorkItem.Workspaces[WorkspaceNames.ExplorerWorkspace].Hide(WorkItem.ExplorerView);
                }

                // Show the TabView and ExplorerView
                // First try setting the ExplorerWorkspace/TabWorkspace to use the last shown views for this WorkItem
                // ...otherwise set the main view to the default ExplorerView/TabView
                if (currentExplorerView != null)
                {
                    try
                    {
                        WorkItem.RootWorkItem.Workspaces[WorkspaceNames.ExplorerWorkspace].Show(currentExplorerView);
                    }
                    catch (Exception)
                    {
                    }
                }
                else
                {
                    WorkItem.RootWorkItem.Workspaces[WorkspaceNames.ExplorerWorkspace].Show(WorkItem.ExplorerView);
                    currentExplorerView = WorkItem.ExplorerView;
                }

                // Now the TabWorkspace...
                if (currentTabView != null)
                {
                    WorkItem.RootWorkItem.Workspaces[WorkspaceNames.TabWorkspace].Show(currentTabView);
                }
                else
                {
                    WorkItem.RootWorkItem.Workspaces[WorkspaceNames.TabWorkspace].Show(WorkItem.TabView);
                    currentTabView = WorkItem.TabView;
                }

                // Get the Toolbars Workspace and set the RibbonTab
                UltraToolbarsManagerWorkspace toolbarsWorkspace = (UltraToolbarsManagerWorkspace)WorkItem.RootWorkItem.Workspaces[WorkspaceNames.ToolbarsWorkspace];
                toolbarsWorkspace.Ribbon.SelectedTab = WorkItem.ToolbarsController.RibbonTab;

                // Activate the WorkItem
                WorkItem.Activate();
            }
        }
        /// <summary>
        /// Clear the 'hidden' flag for the selected computer(s) within the database
        /// </summary>
        /// <param name="listApplications">list of applications to act on</param>
        public void SetIncluded(List <InstalledApplication> listApplications)
        {
            ILaytonView     applicationsTabView = WorkItem.Items[ViewNames.MainTabView] as ILaytonView;
            ApplicationsDAO lwDataAccess        = new ApplicationsDAO();

            foreach (InstalledApplication application in listApplications)
            {
                lwDataAccess.ApplicationSetIgnored(application.ApplicationID, false);
            }

            if (applicationsTabView != null)
            {
                ((ApplicationsTabView)applicationsTabView).Presenter.DisplayPublishers();
            }
        }
        /// <summary>
        /// Wrapper around the main EditLicense function which does the work.  Here we simply recover
        /// the licencse currently selected in the explorer view.  The tab view call the extended version
        /// of this function which takes the license itself as a parameter
        /// </summary>
        public void EditLicense()
        {
            // Recover the license that is to be edited from the LicenseTabView
            ILaytonView tabView = (ILaytonView)WorkItem.RootWorkItem.Workspaces[WorkspaceNames.TabWorkspace].ActiveSmartPart;

            if (tabView is LicensesTabView)
            {
                LicensesTabView    licensesTabView = (LicensesTabView)tabView;
                ApplicationLicense theLicense      = licensesTabView.GetSelectedLicense();
                if (theLicense == null)
                {
                    return;
                }
                EditLicense(theLicense);
            }
        }
Пример #23
0
 protected void FirePublisherFilterChangedEvent()
 {
     // If the settings were changed from this tab then we should fire an event to let all other
     // tabs know of the change - if however we are not the active tab then we have been informed
     // of the change ourselves and do not need to pass it on.
     if (PublisherFilterChanged != null)
     {
         // relay the filter change if we are the active explorer view and hence we have changed
         // the filter ourselves
         ILaytonView activeExplorerView = (ILaytonView)WorkItem.RootWorkItem.Workspaces[WorkspaceNames.ExplorerWorkspace].ActiveSmartPart;
         if (activeExplorerView == WorkItem.ExplorerView)
         {
             PublisherFilterChanged(this, new PublisherFilterEventArgs(_publisherFilter, _ShowIncludedApplications, _showIgnoredApplications));
         }
     }
 }
        public void PublisherFilterChangedHandler(object sender, PublisherFilterEventArgs e)
        {
            // Simply update our internal filters with those specified
            _publisherFilter          = e.PublisherFilter;
            _showIncludedApplications = e.ViewIncludedApplications;
            _showIgnoredApplications  = e.ViewIgnoredApplications;

            // ...and force a refresh if we are the active explorer view
            ILaytonView activeExplorerView = (ILaytonView)WorkItem.RootWorkItem.Workspaces[WorkspaceNames.ExplorerWorkspace].ActiveSmartPart;

            if (activeExplorerView == WorkItem.ExplorerView)
            {
                Trace.Write("Refreshing Applications Views\n");
                workItem.GetActiveTabView().RefreshView();
                WorkItem.ExplorerView.RefreshView();
            }
        }
        private void FindSelectedApplications()
        {
            _listApplications.Clear();

            ILaytonView applicationsTabView = WorkItem.Items[ViewNames.MainTabView] as ILaytonView;

            if (applicationsTabView != null)
            {
                List <InstalledApplication> listApplications = ((ApplicationsTabView)applicationsTabView).CheckSelectedApplications();

                if (listApplications.Count > 0)
                {
                    _listApplications = listApplications;
                }
                else
                {
                    // check if we have selected a publisher (bug #623)
                    ApplicationsExplorerView explorerView = WorkItem.ExplorerView as ApplicationsExplorerView;
                    if (explorerView != null)
                    {
                        foreach (UltraTreeNode selectedNode in explorerView.ApplicationsTree.SelectedNodes)
                        {
                            if (selectedNode.Tag.ToString() != "PUBLISHER")
                            {
                                // applications selected
                                _listApplications.Add(selectedNode.Tag as InstalledApplication);
                            }
                            else
                            {
                                // publishers selected
                                if (selectedNode.Nodes.Count == 0)
                                {
                                    explorerView.Presenter.ExpandApplications(selectedNode);
                                }

                                foreach (UltraTreeNode node in selectedNode.Nodes)
                                {
                                    _listApplications.Add(node.Tag as InstalledApplication);
                                }
                            }
                        }
                    }
                }
            }
        }
Пример #26
0
        /// <summary>
        /// Save any changes made to the current report
        /// </summary>
        public void SaveReport()
        {
            // Ensure that we save any options not saved in to the report defintion now
            //((ReportsExplorerView)WorkItem.ExplorerView).UpdateReportOptions();

            //// Simply call the relevent function in the tab view to do the work
            //// Display the 'Save Report' form
            //FormSaveReport form = new FormSaveReport(_currentReport);
            //if (form.ShowDialog() == DialogResult.OK)
            //    FireReportSavedEvent();

            ILaytonView tabView = (ILaytonView)WorkItem.RootWorkItem.Workspaces[WorkspaceNames.TabWorkspace].ActiveSmartPart;

            if (tabView is ReportsTabView)
            {
                ((ReportsTabView)tabView).SaveCustomReport();
            }
        }
        /// <summary>
        /// Export to XLS format
        /// We call the appropriate grid view to handle this request themselves
        /// </summary>
        public void ExportToXLS()
        {
            ILaytonView tabView = (ILaytonView)WorkItem.RootWorkItem.Workspaces[WorkspaceNames.TabWorkspace].ActiveSmartPart;

            if (tabView is ApplicationsTabView)
            {
                ((ApplicationsTabView)tabView).ExportToXLS();
            }

            else if (tabView is InstancesTabView)
            {
                ((InstancesTabView)tabView).ExportToXLS();
            }

            else if (tabView is LicensesTabView)
            {
                ((LicensesTabView)tabView).ExportToXLS();
            }
        }
Пример #28
0
        /// <summary>
        /// Populate the ribbon groups displayed to be applicable to the tab selected
        /// </summary>
        /// <param name="activeTabView"></param>
        public void ResetRibbon(ILaytonView activeTabView)
        {
            // Handle the display of the various sub-toolbars
            suppliersRibbonGroup.Visible = (activeTabView is SuppliersTabView);
            locationsRibbonGroup.Visible = (activeTabView is LocationsTabView);
            assettypeRibbonGroup.Visible = false;                                       // (activeTabView is AssetTypesTabView);
            picklistRibbonGroup.Visible  = false;                                       // (activeTabView is PickListTabView);
            userdataRibbonGroup.Visible  = (activeTabView is UserDefinedDataTabView);

            // Scanner Configuration ribbon valid if the scanner tab view is displayed
            scannerConfigurationRibbonGroup.Visible = (activeTabView is ScannerConfigurationTabView || activeTabView is AuditAgentTabView);

            // Scanner Deployment is valid when we are displaying the 'Auditing' menu
            scannerDeploymentRibbonGroup.Visible = activeTabView is ScannerConfigurationTabView;

            scannerDeploymentAuditAgentRibbonGroup.Visible = activeTabView is AuditAgentTabView;

            // Users toolbar only displayed when displaying the Users Tab View
            usersRibbonGroup.Visible = (activeTabView is SecurityTabView);
        }
        /// <summary>
        /// Wrapper around the main EditLicense function which does the work.  Here we simply recover
        /// the licencse currently selected in the explorer view.  The tab view call the extended version
        /// of this function which takes the license itself as a parameter
        /// </summary>
        public void DeleteLicense()
        {
            ILaytonView tabView = (ILaytonView)WorkItem.RootWorkItem.Workspaces[WorkspaceNames.TabWorkspace].ActiveSmartPart;

            if (tabView is LicensesTabView)
            {
                // Recover the license that is to be edited from the LicenseTabView
                LicensesTabView    licensesTabView = (LicensesTabView)tabView;
                ApplicationLicense theLicense      = licensesTabView.GetSelectedLicense();
                if (theLicense == null)
                {
                    return;
                }
                DeleteLicense(theLicense);
            }

            // refresh the tab view
            workItem.ExplorerView.RefreshView();
            workItem.GetActiveTabView().RefreshView();
        }
        public void OperatingSystemSelectionChangedHandler(object sender, OperatingSystemEventArgs e)
        {
            // Save (any) Operating System which is currently selected.
            _selectedOSs.Clear();
            _selectedOSs = e.SelectedOS;
            _listApplications.Clear();

            // Set the Operating System tab view to be the active view
            ILaytonView newView = WorkItem.Items[Properties.Settings.Default.OSTabView] as ILaytonView;

            SwitchActiveTabView(newView);

            if (e.SelectedOS == null)
            {
                // We have selected the 'All Publishers' branch - so display All publishers
                ((OSTabView)newView).Presenter.ShowOS(null);
            }
            else
            {
                ((OSTabView)newView).Presenter.ShowOS(_selectedOSs[0]);
            }
        }