示例#1
0
        /**
         * Ensures that the view pane with the specified ID is visible and sets the focus to it.
         */

        public void ActivateViewPane(string paneId)
        {
            if (_activeSidebar != null)
            {
                if (!_activeSidebar.ContainsPane(paneId))
                {
                    throw new ArgumentException("Pane ID " + paneId + " not found in sidebar of tab " + GetSidebarTab(_activeSidebar));
                }
                _activeSidebar.ActivatePane(paneId);
            }
        }
示例#2
0
        public AbstractViewPane ActivateViewPane(string tabId, string paneId)
        {
            VerticalSidebar sidebar = _activeSidebar;

            if (sidebar == null || sidebar != _tabSidebars [tabId])
            {
                return(null);
            }

            AbstractViewPane pane = sidebar.GetPane(paneId);

            if (pane == null)
            {
                return(null);
            }

            sidebar.ActivatePane(paneId);
            if (_activeSidebar != sidebar)
            {
                // one more check for tab switch caused by message processing during activation
                return(null);
            }
            return(pane);
        }
示例#3
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;
        }