Exemplo n.º 1
0
        void AddWindowToDockPanelWithoutSwitching(SdiWorkspaceWindow sdiWorkspaceWindow)
        {
            sdiWorkspaceWindow.DockPanel = dockPanel;
            SdiWorkspaceWindow otherWindow = dockPanel.ActiveContent as SdiWorkspaceWindow;

            if (otherWindow == null)
            {
                otherWindow = dockPanel.Contents.OfType <SdiWorkspaceWindow>().FirstOrDefault(c => c.Pane != null);
            }
            if (otherWindow != null)
            {
                sdiWorkspaceWindow.Pane = otherWindow.Pane;
            }
            sdiWorkspaceWindow.DockState = DockState.Document;
        }
Exemplo n.º 2
0
        void CloseWindowEvent(object sender, EventArgs e)
        {
            SdiWorkspaceWindow f = (SdiWorkspaceWindow)sender;

            f.CloseEvent -= CloseWindowEvent;
            foreach (IViewContent vc in f.ViewContents.ToArray())
            {
                ((IWorkbench)wbForm).CloseContent(vc);
            }
            if (f == oldSelectedWindow)
            {
                oldSelectedWindow = null;
            }
            ActiveMdiChanged(this, null);
        }
Exemplo n.º 3
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);
        }
Exemplo n.º 4
0
 internal ViewContentCollection(SdiWorkspaceWindow window)
 {
     this.window = window;
 }