private SetDisplayingStatus ( bool isDisplaying, |
||
isDisplaying | bool | |
displayingPreviousPane | ||
displayingAlignment | DockAlignment | |
displayingProportion | double | |
return | void |
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; } }
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 Remove(DockPane pane) { if (!this.Contains(pane)) { return; } NestedDockingStatus statusPane = pane.NestedDockingStatus; DockPane lastNestedPane = null; for (int i = this.Count - 1; i > this.IndexOf(pane); i--) { if (this[i].NestedDockingStatus.PreviousPane == pane) { lastNestedPane = this[i]; break; } } if (lastNestedPane != null) { int indexLastNestedPane = this.IndexOf(lastNestedPane); this.Items.Remove(lastNestedPane); this.Items[this.IndexOf(pane)] = lastNestedPane; NestedDockingStatus lastNestedDock = lastNestedPane.NestedDockingStatus; lastNestedDock.SetDisplayingStatus(true, statusPane.DisplayingPreviousPane, statusPane.DisplayingAlignment, statusPane.DisplayingProportion); for (int i = indexLastNestedPane - 1; i > this.IndexOf(lastNestedPane); i--) { NestedDockingStatus status = this[i].NestedDockingStatus; if (status.PreviousPane == pane) { status.SetDisplayingStatus(true, lastNestedPane, status.DisplayingAlignment, status.DisplayingProportion); } } } else { this.Items.Remove(pane); } statusPane.SetDisplayingStatus(false, null, DockAlignment.Left, 0.5); }