Exemplo n.º 1
0
        /// <summary>
        /// This Function will update the active/shown Panels on a DockPanel based on the current active panel.
        /// </summary>
        /// <param name="a_oDockPanel">The Dockpanel</param>
        public void DockPanelActiveDocumentChanged(DockPanel a_oDockPanel)
        {
            if (SuspendAutoPanelDisplay)
            {
                return; // do nothing because we dont want to :)
            }

            if (a_oDockPanel == null || m_oSystemGenAndDisplay == null || m_oSystemMap == null ||
                m_oEconomics == null || m_oShips == null || m_oClassDesign == null || m_oTaskGroup == null ||
                m_oComponentRP == null || m_oFastOOB == null || m_oMissileDesign == null || m_oTurretDesign == null)
            {
                return; // do nothing if we dont have the full UI!!
            }

            if (a_oDockPanel.ActiveDocument == null)
            {
                return; // another sainty check.
            }

            if (a_oDockPanel.ActiveDocument.GetType() == typeof(Panels.SGaD_DataPanel))
            {
                m_oSystemGenAndDisplay.ActivateControlsPanel();
            }
            else if (a_oDockPanel.ActiveDocument.GetType() == typeof(Panels.SysMap_ViewPort))
            {
                m_oSystemMap.ActivateControlsPanel();
            }
            else if (a_oDockPanel.ActiveDocument.GetType() == typeof(Panels.Eco_Summary))
            {
                m_oEconomics.ActivateSummaryPanel();
            }
            else if (a_oDockPanel.ActiveDocument.GetType() == typeof(Panels.Ships_Design) || a_oDockPanel.ActiveDocument.GetType() == typeof(Panels.Individual_Unit_Details_Panel))
            {
                m_oShips.ActivateShipListPanel();
            }
            else if (a_oDockPanel.ActiveDocument.GetType() == typeof(Panels.ClassDes_DesignAndInfo))
            {
                m_oClassDesign.ActivateOptionsPanel();
                //m_oClassDesign.ActivatePropertiesPanel();
            }
            else if (a_oDockPanel.ActiveDocument.GetType() == typeof(Panels.TaskGroup_Panel))
            {
                m_oTaskGroup.ShowAllPanels(a_oDockPanel);
            }
        }