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(); } }
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(); } }