Пример #1
0
        /// <summary>
        /// Loads the pane switcher state for all tabs in the specified workspace.
        /// </summary>
        private void RestoreTabStatesForWorkspace(int workspaceID)
        {
            string workspaceText = (workspaceID == 0) ? "" : workspaceID + ".";

            for (int i = 0; i < _tabBar.TabCount; i++)
            {
                TabFilter    filter = (TabFilter)_tabBar.GetTabTag(i);
                SidebarState state  = SidebarState.RestoreFromIni("TabState." + workspaceText + filter.Id);
                if (state != null)
                {
                    TabState tabState = new TabState();
                    tabState.SidebarState = state;

                    WorkspaceTabState stateKey = new WorkspaceTabState(filter.Id, workspaceID);
                    _tabStates[stateKey] = tabState;
                }
            }
        }
Пример #2
0
        /// <summary>
        /// Shows the sidebar for the specified tab.
        /// </summary>
        public void ShowPanesForTab(string tabId, SidebarState state)
        {
            _currentTabID = tabId;
            Core.UIManager.BeginUpdateSidebar();

            VerticalSidebar sidebar = GetSidebar(tabId);

            if (sidebar != _activeSidebar)
            {
                _newActiveSidebar = sidebar;
                if (!_populatedSidebars.Contains(tabId))
                {
                    _populatedSidebars.Add(tabId);
                    sidebar.PopulateViewPanes();

                    if (state == null)
                    {
                        sidebar.BeginUpdate();
                        AbstractViewPane pane = sidebar.GetPane(StandardViewPanes.ViewsCategories);
                        if (pane != null)
                        {
                            sidebar.ActivatePane(StandardViewPanes.ViewsCategories);
                        }

                        string structurePaneID = (string)_resourceStructurePanes [tabId];
                        if (structurePaneID != null)
                        {
                            sidebar.ActivatePane(structurePaneID);
                        }
                        sidebar.EndUpdate();
                    }
                }
                sidebar.UpdateActiveWorkspace();
                if (state != null)
                {
                    sidebar.CurrentState = state;
                }

                if (_activeSidebar != null)
                {
                    _activeSidebar.ExpandedChanged -= OnActiveSidebarExpandedChanged;
                }
                sidebar.ExpandedChanged += OnActiveSidebarExpandedChanged;
                Expanded = sidebar.Expanded;
//                Width = Expanded ? ExpandedWidth : sidebar.CollapsedWidth;
                Width = Expanded ? ExpandedWidth : 0;
            }
            else
            {
                sidebar.UpdateActiveWorkspace();
                if (state != null)
                {
                    sidebar.CurrentState = state;
                }
            }

            if (sidebar != _activeSidebar)
            {
                sidebar.Visible = true;
                if (_activeSidebar != null)
                {
                    _activeSidebar.Visible = false;
                }
                _activeSidebar = sidebar;
                if (ContainsFocus)
                {
                    _activeSidebar.FocusActivePane();
                }
            }

            Core.UIManager.EndUpdateSidebar();
            _newActiveSidebar = null;
        }