/// <summary> /// Muestra los paneles /// </summary> private void ShowPanes() { // Muestra los paneles foreach (Libraries.PluginsStudio.Views.Base.Models.PaneModel pane in DbStudioViewsManager.GetPanes()) { if (pane != null) { dckManager.AddPane(pane.Id, pane.Title, pane.View, pane.ViewModel, ConvertPosition(pane.Position)); } } // Abre los paneles predefinidos dckManager.OpenGroup(Controls.DockLayout.DockLayoutManager.DockPosition.Left); }
/// <summary> /// Muestra el menú de espacios de trabajo /// </summary> private void ShowMenuWorkspaces() { int startIndex = mnuWorkspace.Items.IndexOf(mnuStartWorkspaces); int indexEnd = mnuWorkspace.Items.IndexOf(mnuEndWorkspaces); // Borra las opciones de menú que se hubiesen creado anteriormente DeleteMenusBetween(mnuWorkspace, startIndex, indexEnd); // Muestra los menús foreach (Libraries.PluginsStudio.ViewModels.Tools.Workspaces.WorkSpaceViewModel workspace in ViewModel.WorkspacesViewModel.Items) { MenuItem mnuNewWorkspace = CreateMenu(workspace.Name, string.Empty, false, null, workspace); // Inserta el menú tras el separador mnuWorkspace.Items.Insert(++startIndex, mnuNewWorkspace); // Añade el manejador mnuNewWorkspace.Click += (sender, args) => { Libraries.PluginsStudio.ViewModels.Tools.Workspaces.WorkSpaceViewModel workSpace = (sender as MenuItem).Tag as Libraries.PluginsStudio.ViewModels.Tools.Workspaces.WorkSpaceViewModel; // Selecciona el espacio de trabajo if (workSpace != null) { DbStudioViewsManager.SelectWorkspace(workSpace.Name); } // Cambia las marcas de check de los menús CheckWorkSpaceMenu(); }; mnuNewWorkspace.Checked += (sender, args) => CheckWorkSpaceMenu(); mnuNewWorkspace.IsChecked = false; } // Muestra el separador if (ViewModel.WorkspacesViewModel.Items.Count == 0) { mnuEndWorkspaces.Visibility = Visibility.Collapsed; } else { mnuEndWorkspaces.Visibility = Visibility.Visible; } // Selecciona el menú adecuado CheckWorkSpaceMenu(); }
/// <summary> /// Abre una ventana con un archivo /// </summary> private void OpenFile(string fileName) { DbStudioViewsManager.OpenFile(fileName); }
/// <summary> /// Muestra los menús /// </summary> private void ShowMenus() { foreach (Libraries.PluginsStudio.ViewModels.Base.Models.MenuListModel menu in DbStudioViewsManager.GetMenus()) { switch (menu.Section) { case Libraries.PluginsStudio.ViewModels.Base.Models.MenuListModel.SectionType.NewItem: CreateChildMenus(mnuFilesNewItem, mnuStartFileNewItems, menu); break; case Libraries.PluginsStudio.ViewModels.Base.Models.MenuListModel.SectionType.Tools: CreateChildMenus(mnuTools, mnuToolsStart, menu); break; } } }
/// <summary> /// Muestra las barras de herramientas /// </summary> private void ShowToolbars() { foreach (Libraries.PluginsStudio.Views.Base.Models.ToolBarModel toolbar in DbStudioViewsManager.GetToolBars()) { if (toolbar?.ToolBar != null) { tbMain.ToolBars.Add(toolbar.ToolBar); } } }
internal PluginsManager(DbStudioViewsManager dbStudioViewManager) { DbStudioViewManager = dbStudioViewManager; }