示例#1
0
        /// <summary>
        /// Return the current visible Page
        /// </summary>
        private bool ShowPage(CustomTabPage tab)
        {
            if (tab == null)
            {
                // just view an empty page
                m_PagePanel.SelectedTab = tab;
                m_LastPage    = m_CurrentPage;
                m_CurrentPage = tab;
                return(true);
            }

            if (tab.Equals(m_CurrentPage))
            {
                return(false);
            }

            if (!m_PagePanel.TabPages.Contains(tab))
            {
                m_PagePanel.TabPages.Add(tab);
            }

            if (m_PagePanel.SelectedTab != tab)
            {
                m_PagePanel.SelectedTab = tab;
            }

            m_LastPage    = m_CurrentPage;
            m_CurrentPage = tab;
            (m_CurrentPage.Page as IPage).ActivatePage();

            return(true);
        }