/// <summary> /// Checks if this panel contains give panel /// </summary> /// <param name="panel">panel to check</param> /// <returns>true if this panel contains given pane</returns> public bool ContainsPanel(AutoHidePanel panel) { for (int index = ButtonsCount - 1; index >= 0; index--) { UnitButton button = GetButtonAt(index); FormsTabbedView view = HierarchyUtility.GetTabbedView((Form)button.Page); if (view.Parent == panel) { return(true); } } return(false); }
/// <summary> /// Move all the pages to given view /// </summary> /// <param name="view">view where to move the pages</param> /// <returns>moved pages</returns> public DockableFormInfo[] MovePagesTo(FormsTabbedView view) { List <DockableFormInfo> movedPages = new List <DockableFormInfo>(); if (view == this) { return(movedPages.ToArray()); } for (int index = _cachedInfos.Count - 1; index >= 0; index--) { DockableFormInfo info = _cachedInfos[index]; Remove(info); view.Add(info); movedPages.Add(info); } return(movedPages.ToArray()); }
/// <summary> /// Removes the panel if is contained here /// </summary> /// <param name="panel">panel to remove</param> /// <returns>true if is removed the panel</returns> public bool Remove(AutoHidePanel panel) { bool removed = false; for (int index = ButtonsCount - 1; index >= 0; index--) { UnitButton button = GetButtonAt(index); FormsTabbedView view = HierarchyUtility.GetTabbedView((Form)button.Page); if (view.Parent == panel) { RemoveButton(button); removed = true; } } panel.View.FormAdded -= OnFormAddedToPanel; panel.View.FormRemoved -= OnFormRemovedFromPanel; panel.View.FormSelected -= OnFormSelectedIntoView; return(removed); }
/// <summary> /// Set mode vertical split /// </summary> /// <param name="topPane">left pane</param> /// <param name="bottomPane">right pane</param> public void SetModeVSplit(DockingContainer topPane, DockingContainer bottomPane) { _linkedView = null; InternalControls.SetModeVSplit(topPane, bottomPane); }
/// <summary> /// Set mode horizontal split /// </summary> /// <param name="leftPane">left pane</param> /// <param name="rightPane">right pane</param> public void SetModeHSplit(DockingContainer leftPane, DockingContainer rightPane) { _linkedView = null; InternalControls.SetModeHSplit(leftPane, rightPane); }
/// <summary> /// Set mode single child control /// </summary> /// <param name="singleChild">single child</param> public void SetModeSingleChild(FormsTabbedView singleChild) { _linkedView = null; InternalControls.SetModeSingleChild(singleChild); }
/// <summary> /// Set mode linked /// </summary> /// <param name="link">link</param> public void SetModeLinked(FormsTabbedView link) { InternalControls.SetModeEmpty(); _linkedView = link; }
/// <summary> /// Set mode empty /// </summary> public void SetModeEmpty() { _linkedView = null; InternalControls.SetModeEmpty(); }