Exemplo n.º 1
0
        public void CloseView(MockShellWindow window)
        {
            int i = windows.IndexOf(window);

            if (i != -1)
            {
                windows.RemoveAt(i);
                if (activeWindow == window)
                {
                    if (windows.Count == 0)
                    {
                        activeWindow = null;
                    }
                    else
                    {
                        if (i >= windows.Count)
                        {
                            i--;
                        }
                        activeWindow = (MockShellWindow)windows [i];
                    }
                    OnActiveWindowChanged();
                }
            }
        }
Exemplo n.º 2
0
        Task <IWorkbenchWindow> IShell.ShowView(DocumentController controller, IShellNotebook notebook, object viewCommandHandler)
        {
            var nb   = ((MockShellNotebook)notebook) ?? mainNotebook;
            var view = new MockShellWindow(this, controller, nb);

            windows.Add(view);
            if (nb.ActiveWindow == null)
            {
                nb.ActiveWindow = view;
            }
            return(Task.FromResult <IWorkbenchWindow> (view));
        }