WinForms implementation of IWorkspaceView.

This class may subclassed if customization is desired. In this case, the DesktopWindowView class must also be subclassed in order to instantiate the subclass from its DesktopWindowView.CreateWorkspaceView method.

Reasons for subclassing may include: overriding SetTitle to customize the display of the workspace title.

Inheritance: ClearCanvas.Desktop.View.WinForms.DesktopObjectView, IWorkspaceView
コード例 #1
0
ファイル: DesktopWindowView.cs プロジェクト: hksonngan/Xian
        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();
        }
コード例 #2
0
		/// <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;
		}
コード例 #3
0
		/// <summary>
		/// Constructor.
		/// </summary>
		/// <param name="dialogBox"></param>
		/// <param name="owner"></param>
		protected internal WorkspaceDialogBoxView(WorkspaceDialogBox dialogBox, WorkspaceView owner)
		{
			_owner = owner;

			var componentView = dialogBox.ComponentView;

			_content = (Control) componentView.GuiElement;
			_form = CreateDialogBoxForm(dialogBox, _content);
			_form.FormClosing += DialogBoxFormClosing;
		}
コード例 #4
0
ファイル: DesktopWindowView.cs プロジェクト: hksonngan/Xian
        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;
        }
コード例 #5
0
        /// <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;
        }
コード例 #6
0
		/// <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;
		}
コード例 #7
0
        /// <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;
        }
コード例 #8
0
ファイル: DesktopWindowView.cs プロジェクト: nhannd/Xian
        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();
        }
コード例 #9
0
ファイル: DesktopWindowView.cs プロジェクト: nhannd/Xian
        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;
        }