コード例 #1
0
        public IWorkbenchWindow ShowView(IViewContent content)
        {
            if (content.WorkbenchWindow is SdiWorkspaceWindow)
            {
                SdiWorkspaceWindow oldSdiWindow = (SdiWorkspaceWindow)content.WorkbenchWindow;
                if (!oldSdiWindow.IsDisposed)
                {
                    oldSdiWindow.Show(dockPanel);
                    return(oldSdiWindow);
                }
            }
            if (!content.Control.Visible)
            {
                content.Control.Visible = true;
            }
            content.Control.Dock = DockStyle.Fill;
            SdiWorkspaceWindow sdiWorkspaceWindow = new SdiWorkspaceWindow(content);

            sdiWorkspaceWindow.CloseEvent += new EventHandler(CloseWindowEvent);
            if (dockPanel != null)
            {
                sdiWorkspaceWindow.Show(dockPanel);
            }

            return(sdiWorkspaceWindow);
        }
コード例 #2
0
        public IWorkbenchWindow ShowView(IViewContent content, bool switchToOpenedView)
        {
            if (content.WorkbenchWindow is SdiWorkspaceWindow)
            {
                SdiWorkspaceWindow oldSdiWindow = (SdiWorkspaceWindow)content.WorkbenchWindow;
                if (!oldSdiWindow.IsDisposed)
                {
                    if (switchToOpenedView)
                    {
                        oldSdiWindow.Show(dockPanel);
                    }
                    else
                    {
                        this.AddWindowToDockPanelWithoutSwitching(oldSdiWindow);
                    }
                    return(oldSdiWindow);
                }
            }
            content.Control.Dock = DockStyle.Fill;
            SdiWorkspaceWindow sdiWorkspaceWindow = new SdiWorkspaceWindow();

            sdiWorkspaceWindow.ViewContents.Add(content);
            sdiWorkspaceWindow.ViewContents.AddRange(content.SecondaryViewContents);
            sdiWorkspaceWindow.CloseEvent += new EventHandler(CloseWindowEvent);
            if (dockPanel != null)
            {
                if (switchToOpenedView)
                {
                    sdiWorkspaceWindow.Show(dockPanel);
                }
                else
                {
                    this.AddWindowToDockPanelWithoutSwitching(sdiWorkspaceWindow);
                }
            }

            return(sdiWorkspaceWindow);
        }
コード例 #3
0
		public IWorkbenchWindow ShowView(IViewContent content)
		{
			if (content.WorkbenchWindow is SdiWorkspaceWindow) {
				SdiWorkspaceWindow oldSdiWindow = (SdiWorkspaceWindow)content.WorkbenchWindow;
				if (!oldSdiWindow.IsDisposed) {
					oldSdiWindow.Show(dockPanel);
					return oldSdiWindow;
				}
			}
			if (!content.Control.Visible) {
				content.Control.Visible = true;
			}
			content.Control.Dock = DockStyle.Fill;
			SdiWorkspaceWindow sdiWorkspaceWindow = new SdiWorkspaceWindow(content);
			sdiWorkspaceWindow.CloseEvent        += new EventHandler(CloseWindowEvent);
			if (dockPanel != null) {
				sdiWorkspaceWindow.Show(dockPanel);
			}
			
			return sdiWorkspaceWindow;
		}
コード例 #4
0
		public IWorkbenchWindow ShowView(IViewContent content, bool switchToOpenedView)
		{
			if (content.WorkbenchWindow is SdiWorkspaceWindow) {
				SdiWorkspaceWindow oldSdiWindow = (SdiWorkspaceWindow)content.WorkbenchWindow;
				if (!oldSdiWindow.IsDisposed) {
					if (switchToOpenedView) {
						oldSdiWindow.Show(dockPanel);
					} else {
						this.AddWindowToDockPanelWithoutSwitching(oldSdiWindow);
					}
					return oldSdiWindow;
				}
			}
			content.Control.Dock = DockStyle.Fill;
			SdiWorkspaceWindow sdiWorkspaceWindow = new SdiWorkspaceWindow();
			sdiWorkspaceWindow.ViewContents.Add(content);
			sdiWorkspaceWindow.ViewContents.AddRange(content.SecondaryViewContents);
			sdiWorkspaceWindow.CloseEvent += new EventHandler(CloseWindowEvent);
			if (dockPanel != null) {
				if (switchToOpenedView) {
					sdiWorkspaceWindow.Show(dockPanel);
				} else {
					this.AddWindowToDockPanelWithoutSwitching(sdiWorkspaceWindow);
				}
			}
			
			return sdiWorkspaceWindow;
		}