Exemplo n.º 1
0
        protected static void Switch(bool next)
        {
            if (!IdeApp.Preferences.EnableDocumentSwitchDialog)
            {
                return;
            }

            var toplevel = Window.ListToplevels().FirstOrDefault(w => w.HasToplevelFocus)
                           ?? IdeApp.Workbench.RootWindow;

            bool hasContent;
            var  sw = new DocumentSwitcher(toplevel, GettextCatalog.GetString("Pads"), next, out hasContent);

            if (hasContent)
            {
                sw.Present();
            }
            else
            {
                sw.Destroy();
            }
        }
Exemplo n.º 2
0
        protected static void Switch(bool next)
        {
            if (!IdeApp.Preferences.EnableDocumentSwitchDialog)
            {
                IdeApp.CommandService.DispatchCommand(next? WindowCommands.NextDocument : WindowCommands.PrevDocument);
                return;
            }

            var toplevel = Window.ListToplevels().FirstOrDefault(w => w.HasToplevelFocus)
                           ?? IdeApp.Workbench.RootWindow;

            bool hasContent;
            var  sw = new DocumentSwitcher(toplevel, next, out hasContent);

            if (hasContent)
            {
                sw.Present();
            }
            else
            {
                sw.Destroy();
            }
        }