public void SetRootView(Utility.ExplorerBarGroup group, Utility.NodeTag nodeTagIn) { Stack <Control> stack = null; if (group == Utility.ExplorerBarGroup.SecuritySummary) { stack = m_SecuritySummaryViewStack; } else if (group == Utility.ExplorerBarGroup.ExplorePermissions) { stack = m_ExplorePermissionsViewStack; } else if (group == Utility.ExplorerBarGroup.Reports) { stack = m_ReportsViewStack; } else if (group == Utility.ExplorerBarGroup.ManageSQLsecure) { stack = m_ManageSQLsecureViewStack; } else { Debug.Assert(false, "Invalid Group Passed to SetRootView"); } SetRootView(stack, nodeTagIn); }
public void ShowRootView(Utility.NodeTag nodeTagIn) { using (logX.loggerX.DebugCall("Controller ShowRootView")) { // Put the view on top of the stack SetRootView(m_CurrentViewStack, nodeTagIn); // Display the control stack. logX.loggerX.Debug("Call displayCurrentView"); displayCurrentView(); } }
public void ShowChildView(Utility.NodeTag nodeTagIn) { Debug.Assert(m_CurrentViewStack.Count > 0, "View stack is empty"); // Get view node based on input node tag, // and set the data context of the view. Control vw = getView(m_CurrentViewStack, nodeTagIn); // Clear the current control stack and add the new view. m_CurrentViewStack.Push(vw); // Display the control stack. displayCurrentView(); }
private void SetRootView(Stack <Control> stack, Utility.NodeTag nodeTagIn) { // Clear the current view stack. // NOTE: if the stack is not cleared then it will // setup the bread crumbs. For the root view // there should not be any bread crumbs. stack.Clear(); // Get view node based on input node tag, // and set the data context of the view. Control vw = getView(stack, nodeTagIn); // Clear the current control stack and add the new view. stack.Push(vw); }
private Control getView( Stack <Control> stackIn, Utility.NodeTag nodeTagIn ) { Debug.Assert(nodeTagIn != null); // Identify the view. Control ret = null; switch (nodeTagIn.View) { // Security summary group views. case Utility.View.Main_SecuritySummary: ret = m_View_Main_SecuritySummary; break; case Utility.View.PolicyAssessment: ret = m_View_PolicyAssessment; break; // Explore permissions group views. case Utility.View.Main_ExplorePermissions: ret = m_View_Main_ExplorePermissions; break; case Utility.View.Server: ret = m_View_Server; break; case Utility.View.PermissionExplorer: ret = m_View_PermissionExplorer; break; // Manage SQLsecure group views. case Utility.View.Main_ManageSQLsecure: ret = m_View_Main_ManageSQLsecure; break; case Utility.View.SQLsecureActivity: ret = m_View_SQLsecureActivity; break; case Utility.View.Logins: ret = m_View_Logins; break; case Utility.View.ManagePolicies: ret = m_View_ManagePolicies; break; case Utility.View.ServerGroupTags: ret = m_View_ServerTags; break; // Reports group views case Utility.View.Main_Reports: ret = m_View_Main_Reports; break; case Utility.View.Report_AuditedServers: ret = m_View_Report_AuditedServers; break; case Utility.View.Report_Filters: ret = m_View_Report_Filters; break; case Utility.View.Report_GuestEnabledDatabases: ret = m_View_Report_GuestEnabledServers; break; case Utility.View.Report_CrossServerLoginCheck: ret = m_View_Report_CrossServerLoginCheck; break; case Utility.View.Report_MixedModeAuthentication: ret = m_View_Report_MixedModeAuthentication; break; case Utility.View.Report_ServersWithDangerousGroups: ret = m_View_Report_ServersWithDangerousGroups; break; case Utility.View.Report_SystemAdministratorVulnerability: ret = m_View_Report_SystemAdministratorVulnerability; break; case Utility.View.Report_SuspectWindowsAccounts: ret = m_View_Report_SuspectWindowsAccounts; break; case Utility.View.Report_SuspectSqlLogins: ret = m_View_Report_SuspectSqlLogins; break; case Utility.View.Report_VulnerableFixedRoles: ret = m_View_Report_VulnerableFixedRoles; break; case Utility.View.Report_MailVulnerability: ret = m_View_Report_MailVulnerability; break; case Utility.View.Report_LoginVulnerability: ret = m_View_Report_LoginVulnerability; break; case Utility.View.Report_ServerLoginsAndUserMappings: ret = m_View_Report_ServerLoginsAndUserMappings; break; case Utility.View.Report_DatabaseChaining: ret = m_View_Report_DatabaseChaining; break; case Utility.View.Report_OSVulnerability: ret = m_View_Report_SPsWithGuestAccess; break; case Utility.View.Report_UsersPermissions: ret = m_View_Report_UsersPermissions; break; case Utility.View.Report_AllObjectsWithPermissions: ret = m_View_Report_AllObjectsWithPermissions; break; case Utility.View.Report_DatabaseRoles: ret = m_View_Report_DatabaseRoles; break; case Utility.View.Report_ServerRoles: ret = m_View_Report_ServerRoles; break; case Utility.View.Report_Users: ret = m_View_Report_Users; break; case Utility.View.Report_ActivityHistory: ret = m_View_Report_ActivityHistory; break; case Utility.View.Report_RiskAssessment: ret = m_View_Report_RiskAssessment; break; case Utility.View.Report_CompareAssessments: ret = m_View_Report_CompareAssessments; break; case Utility.View.Report_CompareSnapshots: ret = m_View_Report_CompareSnapshots; break; default: Debug.Assert(false, "Unknown view"); break; } // Setup the view context. if (ret != null) { // Set the context. ((Interfaces.IView)ret).SetContext(nodeTagIn.DataContext); } return(ret); }
/// <summary> /// Change to the Reports Explorer Group and Show the requested Report /// </summary> /// <param name="nodeTagIn">The nodeTag used to setup the requested report</param> public void ShowReport(Utility.NodeTag nodeTagIn) { SetRootView(m_ReportsViewStack, nodeTagIn); SetCurrentReport(nodeTagIn.DataContext.Name); m_ExplorerBar.SelectedGroup = m_ExplorerBar.Groups[(int)Utility.ExplorerBarGroup.Reports]; }