public DockPaneTabEnumerator(DockPaneTabCollection tabs)
 {
     m_tabs = tabs;
     Reset();
 }
예제 #2
0
파일: DockPane.cs 프로젝트: VE-2016/VE-2016
        private void InternalConstruct(IDockableWindow 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(ResourceHelper.GetString("DockPane.DockState.InvalidState"));
            }

            if (content == null)
            {
                throw new ArgumentNullException(ResourceHelper.GetString("DockPane.Constructor.NullContent"));
            }

            if (content.DockHandler.DockPanel == null)
            {
                throw new ArgumentException(ResourceHelper.GetString("DockPane.Constructor.NullDockPanel"));
            }


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

            _isFloat = (dockState == DockState.Float);

            _contents           = new DockContentCollection();
            _displayingContents = new DockContentCollection(this);
            _tabs      = new DockPaneTabCollection(this);
            _dockPanel = content.DockHandler.DockPanel;
            _dockPanel.AddPane(this);

            _splitter = new DockPaneSplitter(this);

            _nestedDockingStatus = new NestedDockingStatus(this);

            _autoHidePane    = DockPanel.AutoHidePaneFactory.CreateAutoHidePane(this);
            _captionControl  = DockPanel.DockPaneCaptionFactory.CreateDockPaneCaption(this);
            _tabStripControl = DockPanel.DockPaneStripFactory.CreateDockPaneStrip(this);
            Controls.AddRange(new Control[] { _captionControl, _tabStripControl });

            DockPanel.SuspendLayout(true);
            if (flagBounds)
            {
                FloatWindow = DockPanel.FloatWindowFactory.CreateFloatWindow(DockPanel, this, floatWindowBounds);
            }
            else if (prevPane != null)
            {
                AddToDockList(prevPane.DockListContainer, 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);
        }