Exemplo n.º 1
0
 private static void RefreshDockPane(DockPane pane)
 {
     pane.RefreshChanges();
     pane.ValidateActiveContent();
 }
Exemplo n.º 2
0
 internal void SetPaneAndVisible(DockPane pane)
 {
     SetPane(pane);
     SetVisible();
 }
Exemplo n.º 3
0
 private void ResumeSetDockState(bool isHidden, DockState visibleState, DockPane oldPane)
 {
     ResumeSetDockState();
     SetDockState(isHidden, visibleState, oldPane);
 }
Exemplo n.º 4
0
        internal void SetDockState(bool isHidden, DockState visibleState, DockPane oldPane)
        {
            if (IsSuspendSetDockState)
            {
                return;
            }

            if (DockPanel == null && visibleState != DockState.Unknown)
            {
                throw new InvalidOperationException(Strings.DockContentHandler_SetDockState_NullPanel);
            }

            if (visibleState == DockState.Hidden || (visibleState != DockState.Unknown && !IsDockStateValid(visibleState)))
            {
                throw new InvalidOperationException(Strings.DockContentHandler_SetDockState_InvalidState);
            }

            DockPanel dockPanel = DockPanel;

            if (dockPanel != null)
            {
                dockPanel.SuspendLayout(true);
            }

            SuspendSetDockState();

            DockState oldDockState = DockState;

            if (m_isHidden != isHidden || oldDockState == DockState.Unknown)
            {
                m_isHidden = isHidden;
            }
            m_visibleState = visibleState;
            m_dockState    = isHidden ? DockState.Hidden : visibleState;

            if (visibleState == DockState.Unknown)
            {
                Pane = null;
            }
            else
            {
                m_isFloat = (m_visibleState == DockState.Float);

                if (Pane == null)
                {
                    Pane = DockPanel.DockPaneFactory.CreateDockPane(Content, visibleState, true);
                }
                else if (Pane.DockState != visibleState)
                {
                    if (Pane.Contents.Count == 1)
                    {
                        Pane.SetDockState(visibleState);
                    }
                    else
                    {
                        Pane = DockPanel.DockPaneFactory.CreateDockPane(Content, visibleState, true);
                    }
                }
            }

            if (Form.ContainsFocus)
            {
                if (DockState == DockState.Hidden || DockState == DockState.Unknown)
                {
                    DockPanel.ContentFocusManager.GiveUpFocus(Content);
                }
            }

            SetPaneAndVisible(Pane);

            if (oldPane != null && !oldPane.IsDisposed && oldDockState == oldPane.DockState)
            {
                RefreshDockPane(oldPane);
            }

            if (Pane != null && DockState == Pane.DockState)
            {
                if ((Pane != oldPane) ||
                    (Pane == oldPane && oldDockState != oldPane.DockState))
                {
                    /*
                     * Without this an early refresh can be triggered while the dimensions of the form
                     * aren't calculated completely because the form could be still hidden although
                     * isHidden says FALSE.
                     */
                    if (Pane.DockWindow == null || Pane.DockWindow.Visible || Pane.DockState == DockState.Document)
                    {
                        RefreshDockPane(Pane);
                    }
                }
            }

            if (oldDockState != DockState)
            {
                if (DockState == DockState.Hidden || DockState == DockState.Unknown ||
                    DockHelper.IsDockStateAutoHide(DockState))
                {
                    DockPanel.ContentFocusManager.RemoveFromList(Content);
                }
                else
                {
                    DockPanel.ContentFocusManager.AddToList(Content);
                }

                OnDockStateChanged(EventArgs.Empty);
            }
            ResumeSetDockState();

            if (dockPanel != null)
            {
                dockPanel.ResumeLayout(true, true);
            }
        }
Exemplo n.º 5
0
 public void FloatAt(Rectangle floatWindowBounds)
 {
     DockPane pane = DockPanel.DockPaneFactory.CreateDockPane(Content, floatWindowBounds, true);
 }
Exemplo n.º 6
0
 protected void ShowTabPageContextMenu(Point position)
 {
     DockPane.ShowTabPageContextMenu(this, position);
 }
Exemplo n.º 7
0
 internal TabCollection(DockPane pane)
 {
     m_dockPane = pane;
 }
Exemplo n.º 8
0
 protected virtual Pane CreatePane(DockPane dockPane)
 {
     return(new Pane(dockPane));
 }
Exemplo n.º 9
0
 protected internal Pane(DockPane dockPane)
 {
     m_dockPane = dockPane;
 }