Beispiel #1
0
        internal void Refresh()
        {
            InnerList.Clear();
            for (int i = 0; i < DockList.Count; i++)
            {
                DockPane            pane   = DockList[i];
                NestedDockingStatus status = pane.NestedDockingStatus;
                status.SetDisplayingStatus(true, status.PrevPane, status.Alignment, status.Proportion);
                InnerList.Add(pane);
            }

            foreach (DockPane pane in DockList)
            {
                if (pane.DockState != DockState || pane.IsHidden)
                {
                    pane.Bounds          = Rectangle.Empty;
                    pane.Splitter.Bounds = Rectangle.Empty;
                    Remove(pane);
                }
            }

            CalculateBounds();

            foreach (DockPane pane in this)
            {
                NestedDockingStatus status = pane.NestedDockingStatus;
                pane.Bounds             = status.PaneBounds;
                pane.Splitter.Bounds    = status.SplitterBounds;
                pane.Splitter.Alignment = status.Alignment;
            }
        }
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);
        }