Пример #1
0
        private void InternalConstruct(IDockContent content, DockState dockState, bool flagBounds, Rectangle floatWindowBounds, DockPane prevPane, DockAlignment alignment, double proportion, bool show)
        {
            if (dockState == DockState.Hidden || dockState == DockState.Unknown)
            {
                throw new ArgumentException(Strings.DockPane_SetDockState_InvalidState);
            }

            if (content == null)
            {
                throw new ArgumentNullException(Strings.DockPane_Constructor_NullContent);
            }

            if (content.DockHandler.DockPanel == null)
            {
                throw new ArgumentException(Strings.DockPane_Constructor_NullDockPanel);
            }


            SuspendLayout();
            SetStyle(ControlStyles.Selectable, false);

            m_isFloat = (dockState == DockState.Float);

            m_contents           = new DockContentCollection();
            m_displayingContents = new DockContentCollection(this);
            m_dockPanel          = content.DockHandler.DockPanel;
            m_dockPanel.AddPane(this);

            m_splitter = new SplitterControl(this);

            m_nestedDockingStatus = new NestedDockingStatus(this);

            m_captionControl  = DockPanel.DockPaneCaptionFactory.CreateDockPaneCaption(this);
            m_tabStripControl = DockPanel.DockPaneStripFactory.CreateDockPaneStrip(this);
            Controls.AddRange(new Control[] { m_captionControl, m_tabStripControl });

            DockPanel.SuspendLayout(true);
            if (flagBounds)
            {
                FloatWindow = DockPanel.FloatWindowFactory.CreateFloatWindow(DockPanel, this, floatWindowBounds);
            }
            else if (prevPane != null)
            {
                DockTo(prevPane.NestedPanesContainer, prevPane, alignment, proportion);
            }

            SetDockState(dockState);
            if (show)
            {
                content.DockHandler.Pane = this;
            }
            else if (this.IsFloat)
            {
                content.DockHandler.FloatPane = this;
            }
            else
            {
                content.DockHandler.PanelPane = this;
            }

            ResumeLayout();
            DockPanel.ResumeLayout(true, true);
        }
Пример #2
0
 private void ResumeRefreshStateChange()
 {
     m_countRefreshStateChange--;
     System.Diagnostics.Debug.Assert(m_countRefreshStateChange >= 0);
     DockPanel.ResumeLayout(true, true);
 }
Пример #3
0
        private void RefreshStateChange(INestedPanesContainer oldContainer, DockState oldDockState)
        {
            lock (this)
            {
                if (IsRefreshStateChangeSuspended)
                {
                    return;
                }

                SuspendRefreshStateChange();
            }

            DockPanel.SuspendLayout(true);

            IDockContent contentFocused = GetFocusedContent();

            if (contentFocused != null)
            {
                DockPanel.SaveFocus();
            }
            SetParent();

            if (ActiveContent != null)
            {
                ActiveContent.DockHandler.SetDockState(ActiveContent.DockHandler.IsHidden, DockState, ActiveContent.DockHandler.Pane);
            }
            foreach (IDockContent content in Contents)
            {
                if (content.DockHandler.Pane == this)
                {
                    content.DockHandler.SetDockState(content.DockHandler.IsHidden, DockState, content.DockHandler.Pane);
                }
            }

            if (oldContainer != null)
            {
                Control oldContainerControl = (Control)oldContainer;
                if (oldContainer.DockState == oldDockState && !oldContainerControl.IsDisposed)
                {
                    oldContainerControl.PerformLayout();
                }
            }
            if (DockHelper.IsDockStateAutoHide(oldDockState))
            {
                DockPanel.RefreshActiveAutoHideContent();
            }

            if (NestedPanesContainer.DockState == DockState)
            {
                ((Control)NestedPanesContainer).PerformLayout();
            }
            if (DockHelper.IsDockStateAutoHide(DockState))
            {
                DockPanel.RefreshActiveAutoHideContent();
            }

            if (DockHelper.IsDockStateAutoHide(oldDockState) ||
                DockHelper.IsDockStateAutoHide(DockState))
            {
                DockPanel.RefreshAutoHideStrip();
                DockPanel.PerformLayout();
            }

            ResumeRefreshStateChange();

            if (contentFocused != null)
            {
                contentFocused.DockHandler.Activate();
            }

            DockPanel.ResumeLayout(true, true);

            if (oldDockState != DockState)
            {
                OnDockStateChanged(EventArgs.Empty);
            }
        }
Пример #4
0
 private void SuspendRefreshStateChange()
 {
     m_countRefreshStateChange++;
     DockPanel.SuspendLayout(true);
 }