Exemplo n.º 1
0
        internal void Refresh()
        {
            Items.Clear();
            for (int i = 0; i < NestedPanes.Count; i++)
            {
                DockPane            pane   = NestedPanes[i];
                NestedDockingStatus status = pane.NestedDockingStatus;
                status.SetDisplayingStatus(true, status.PreviousPane, status.Alignment, status.Proportion);
                Items.Add(pane);
            }

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

            CalculateBounds();

            foreach (DockPane pane in this)
            {
                NestedDockingStatus status = pane.NestedDockingStatus;
                pane.Bounds            = status.PaneBounds;
                pane.SplitterBounds    = status.SplitterBounds;
                pane.SplitterAlignment = status.Alignment;
            }
        }
Exemplo n.º 2
0
 internal void Refresh()
 {
     base.Items.Clear();
     checked
     {
         for (int i = 0; i < this.NestedPanes.Count; i++)
         {
             DockPane            dockPane            = this.NestedPanes[i];
             NestedDockingStatus nestedDockingStatus = dockPane.NestedDockingStatus;
             nestedDockingStatus.SetDisplayingStatus(true, nestedDockingStatus.PreviousPane, nestedDockingStatus.Alignment, nestedDockingStatus.Proportion);
             base.Items.Add(dockPane);
         }
         foreach (DockPane dockPane in this.NestedPanes)
         {
             if (dockPane.DockState != this.DockState || dockPane.IsHidden)
             {
                 dockPane.Bounds         = Rectangle.Empty;
                 dockPane.SplitterBounds = Rectangle.Empty;
                 this.Remove(dockPane);
             }
         }
         this.CalculateBounds();
         foreach (DockPane dockPane in this)
         {
             NestedDockingStatus nestedDockingStatus = dockPane.NestedDockingStatus;
             dockPane.Bounds            = nestedDockingStatus.PaneBounds;
             dockPane.SplitterBounds    = nestedDockingStatus.SplitterBounds;
             dockPane.SplitterAlignment = nestedDockingStatus.Alignment;
         }
     }
 }
Exemplo n.º 3
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.PreviousPane == pane)
                {
                    lastNestedPane = this[i];
                    break;
                }
            }

            if (lastNestedPane != null)
            {
                int indexLastNestedPane = IndexOf(lastNestedPane);
                Items.Remove(lastNestedPane);
                Items[IndexOf(pane)] = lastNestedPane;
                NestedDockingStatus lastNestedDock = lastNestedPane.NestedDockingStatus;
                lastNestedDock.SetStatus(this, statusPane.PreviousPane, statusPane.Alignment, statusPane.Proportion);
                for (int i = indexLastNestedPane - 1; i > IndexOf(lastNestedPane); i--)
                {
                    NestedDockingStatus status = this[i].NestedDockingStatus;
                    if (status.PreviousPane == pane)
                    {
                        status.SetStatus(this, lastNestedPane, status.Alignment, status.Proportion);
                    }
                }
            }
            else
            {
                Items.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);
        }
 private void InternalRemove(DockPane pane)
 {
     checked
     {
         if (base.Contains(pane))
         {
             NestedDockingStatus nestedDockingStatus = pane.NestedDockingStatus;
             DockPane            dockPane            = null;
             for (int i = base.Count - 1; i > base.IndexOf(pane); i--)
             {
                 if (base[i].NestedDockingStatus.PreviousPane == pane)
                 {
                     dockPane = base[i];
                     break;
                 }
             }
             if (dockPane != null)
             {
                 int num = base.IndexOf(dockPane);
                 base.Items.Remove(dockPane);
                 base.Items[base.IndexOf(pane)] = dockPane;
                 NestedDockingStatus nestedDockingStatus2 = dockPane.NestedDockingStatus;
                 nestedDockingStatus2.SetStatus(this, nestedDockingStatus.PreviousPane, nestedDockingStatus.Alignment, nestedDockingStatus.Proportion);
                 for (int i = num - 1; i > base.IndexOf(dockPane); i--)
                 {
                     NestedDockingStatus nestedDockingStatus3 = base[i].NestedDockingStatus;
                     if (nestedDockingStatus3.PreviousPane == pane)
                     {
                         nestedDockingStatus3.SetStatus(this, dockPane, nestedDockingStatus3.Alignment, nestedDockingStatus3.Proportion);
                     }
                 }
             }
             else
             {
                 base.Items.Remove(pane);
             }
             nestedDockingStatus.SetStatus(null, null, DockAlignment.Left, 0.5);
             nestedDockingStatus.SetDisplayingStatus(false, null, DockAlignment.Left, 0.5);
             nestedDockingStatus.SetDisplayingBounds(Rectangle.Empty, Rectangle.Empty, Rectangle.Empty);
         }
     }
 }