using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Drawing; using System.Windows.Forms; namespace WeifenLuo.WinFormsUI.Docking { public sealed class VisibleNestedPaneCollection : ReadOnlyCollection { private NestedPaneCollection m_nestedPanes; internal VisibleNestedPaneCollection(NestedPaneCollection nestedPanes) : base(new List()) { m_nestedPanes = nestedPanes; } public NestedPaneCollection NestedPanes { get { return m_nestedPanes; } } public INestedPanesContainer Container { get { return NestedPanes.Container; } } public DockState DockState { get { return NestedPanes.DockState; } } public bool IsFloat { get { return NestedPanes.IsFloat; } } internal void Refresh() { Items.Clear(); for (int i=0; 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.SetDisplayingStatus(true, statusPane.DisplayingPreviousPane, statusPane.DisplayingAlignment, statusPane.DisplayingProportion); for (int i=indexLastNestedPane - 1; i>IndexOf(lastNestedPane); i--) { NestedDockingStatus status = this[i].NestedDockingStatus; if (status.PreviousPane == pane) status.SetDisplayingStatus(true, lastNestedPane, status.DisplayingAlignment, status.DisplayingProportion); } } else Items.Remove(pane); statusPane.SetDisplayingStatus(false, null, DockAlignment.Left, 0.5); } private void CalculateBounds() { if (Count == 0) return; this[0].NestedDockingStatus.SetDisplayingBounds(Container.DisplayingRectangle, Container.DisplayingRectangle, Rectangle.Empty); for (int i=1; i