internal void RemoveWorkspaceView(WorkspaceView workspaceView) { // remove this page from the activation order _workspaceActivationOrder.Remove(workspaceView); // if the page being removed is the selected page and there are other workspaces, // select the last active one before removing this one if (workspaceView.TabPage.Selected && _workspaceActivationOrder.Count > 0) { _workspaceActivationOrder.LastElement.TabPage.Selected = true; } // Remove the tab TabPageCollection tabPages; var found = FindTabPageCollection(_form.TabbedGroups.RootSequence, workspaceView.TabPage, out tabPages); if (found) { tabPages.Remove(workspaceView.TabPage); } // notify that we are no longer visible workspaceView.SetVisibleStatus(false); // When there are no tabs left, turn off the tab control strip. // Done purely for aesthetic reasons. if (_form.TabbedGroups.ActiveLeaf.TabPages.Count == 0) { _form.TabbedGroups.DisplayTabMode = DisplayTabModes.HideAll; } _form.DockingManager.Container.Focus(); }
/// <summary> /// Constructor. /// </summary> /// <param name="owner"></param> /// <param name="workspaceContent"></param> internal WorkspaceDialogBoxViewManager(WorkspaceView owner, Control workspaceContent) { _owner = owner; _workspaceContent = workspaceContent; // subscribe to some events so we can keep workspace dialogs appropriately sized/visible _workspaceContent.VisibleChanged += WorkspaceContentVisibleChanged; _workspaceContent.SizeChanged += WorkspaceContentSizeChanged; _owner.DesktopView.DesktopForm.LocationChanged += DesktopFormLocationChanged; }
internal void AddWorkspaceView(WorkspaceView workspaceView) { // When we add a new workspace, we need to HideShelvesOnWorkspaceOpen(); _form.TabbedGroups.ActiveLeaf.TabPages.Add(workspaceView.TabPage); workspaceView.TabPage.Selected = true; _form.TabbedGroups.DisplayTabMode = DisplayTabModes.ShowAll; }
/// <summary> /// Constructor. /// </summary> /// <param name="dialogBox"></param> /// <param name="owner"></param> protected internal WorkspaceDialogBoxView(WorkspaceDialogBox dialogBox, WorkspaceView owner) { _owner = owner; var componentView = (IApplicationComponentView)ViewFactory.CreateAssociatedView(dialogBox.Component.GetType()); componentView.SetComponent((IApplicationComponent)dialogBox.Component); _content = (Control)componentView.GuiElement; _form = CreateDialogBoxForm(dialogBox, _content); _form.FormClosing += DialogBoxFormClosing; }