Beispiel #1
0
 /// <include file='CodeDoc\DockPane.xml' path='//CodeDoc/Class[@name="DockPane"]/Method[@name="SetNestedDockingProportion(double)"]/*'/>
 public void SetNestedDockingProportion(double proportion)
 {
     NestedDockingStatus.SetStatus(NestedDockingStatus.DockList, NestedDockingStatus.PrevPane, NestedDockingStatus.Alignment, proportion);
     if (DockListContainer != null)
     {
         ((Control)DockListContainer).PerformLayout();
     }
 }
Beispiel #2
0
        private void InternalRemove(DockPane pane)
        {
            if (!Contains(pane))
            {
                return;
            }

            NestedDockingStatus statusPane     = pane.NestedDockingStatus;
            DockPane            lastNestedPane = null;

            for (int i = Count - 1; i > IndexOf(pane); i--)
            {
                if (this[i].NestedDockingStatus.PrevPane == pane)
                {
                    lastNestedPane = this[i];
                    break;
                }
            }

            if (lastNestedPane != null)
            {
                int indexLastNestedPane = IndexOf(lastNestedPane);
                InnerList.Remove(lastNestedPane);
                InnerList[IndexOf(pane)] = lastNestedPane;
                NestedDockingStatus lastNestedDock = lastNestedPane.NestedDockingStatus;
                lastNestedDock.SetStatus(this, statusPane.PrevPane, statusPane.Alignment, statusPane.Proportion);
                for (int i = indexLastNestedPane - 1; i > IndexOf(lastNestedPane); i--)
                {
                    NestedDockingStatus status = this[i].NestedDockingStatus;
                    if (status.PrevPane == pane)
                    {
                        status.SetStatus(this, lastNestedPane, status.Alignment, status.Proportion);
                    }
                }
            }
            else
            {
                InnerList.Remove(pane);
            }

            statusPane.SetStatus(null, null, DockAlignment.Left, 0.5);
            statusPane.SetDisplayingStatus(false, null, DockAlignment.Left, 0.5);
            statusPane.SetDisplayingBounds(Rectangle.Empty, Rectangle.Empty, Rectangle.Empty);
        }
Beispiel #3
0
        private void InternalAddToDockList(IDockListContainer container, DockPane prevPane, DockAlignment alignment, double proportion)
        {
            if ((container.DockState == DockState.Float) != IsFloat)
            {
                throw new InvalidOperationException(ResourceHelper.GetString("DockPane.AddToDockList.InvalidContainer"));
            }

            int count = container.DockList.Count;

            if (container.DockList.Contains(this))
            {
                count--;
            }
            if (prevPane == null && count > 0)
            {
                throw new InvalidOperationException(ResourceHelper.GetString("DockPane.AddToDockList.NullPrevPane"));
            }

            if (prevPane != null && !container.DockList.Contains(prevPane))
            {
                throw new InvalidOperationException(ResourceHelper.GetString("DockPane.AddToDockList.NoPrevPane"));
            }

            if (prevPane == this)
            {
                throw new InvalidOperationException(ResourceHelper.GetString("DockPane.AddToDockList.SelfPrevPane"));
            }

            IDockListContainer oldContainer = DockListContainer;
            DockState          oldDockState = DockState;

            container.DockList.Add(this);
            NestedDockingStatus.SetStatus(container.DockList, prevPane, alignment, proportion);

            if (DockHelper.IsDockWindowState(DockState))
            {
                m_dockState = container.DockState;
            }

            RefreshStateChange(oldContainer, oldDockState);
        }