override protected void OnEnablePanel() { base.OnEnablePanel(); m_CurrentPageFlipState = PageFlipState.TransitionIn; switch (m_EnabledCount) { case 0: // The panel is created at app start. We do not want to trigger any heavy work at this point // Current tab is set, but not enabled. m_CurrentTab = m_Tabs[0]; break; case 1: // The panel has been enabled for the first time. Enable the first tab. SwitchTab(m_Tabs[0]); break; default: // If we have no filewatcher, we need to check if any files have changed since the user // last had the panel open. if (!App.PlatformConfig.UseFileSystemWatcher) { m_CurrentTab.Catalog.ForceCatalogScan(); RefreshPage(); } break; } m_EnabledCount++; }
public void SwitchTab(ReferencePanelTab newTab) { m_CurrentTab.OnTabDisable(); m_CurrentTab = newTab; m_CurrentTab.OnTabEnable(); m_PanelText.text = m_CurrentTab.PanelName; m_NumPages = m_CurrentTab.PageCount; GotoPage(m_CurrentTab.PageIndex); foreach (var button in m_CurrentTab.Buttons) { button.ResetScale(); } RefreshPage(); }