示例#1
0
        /// <summary>
        /// Constructor.
        /// </summary>
        /// <param name="workspace"></param>
        /// <param name="desktopView"></param>
        protected internal WorkspaceView(Workspace workspace, DesktopWindowView desktopView)
        {
            var componentView = (IApplicationComponentView)ViewFactory.CreateAssociatedView(workspace.Component.GetType());

            componentView.SetComponent((IApplicationComponent)workspace.Component);

            _control = (Control)componentView.GuiElement;
            _tabPage = new Crownwood.DotNetMagic.Controls.TabPage {
                Control = _control, Tag = this
            };
            this.DesktopView = desktopView;

            _dialogBoxManager = new WorkspaceDialogBoxViewManager(this, _control);
        }
示例#2
0
        /// <summary>
        /// Disposes of this object.
        /// </summary>
        /// <param name="disposing"></param>
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                if (_tabPage != null)
                {
                    // Remove the tab
                    this.DesktopView.RemoveWorkspaceView(this);

                    _dialogBoxManager.Dispose();
                    _dialogBoxManager = null;
                    _control.Dispose();
                    _control = null;
                    _tabPage.Dispose();
                    _tabPage = null;
                }
            }
            base.Dispose(disposing);
        }