public void CloseProject() { UnBindProjectVersion(Current.ProjectVersion); UnBindProject(); DiagramTabManager.CloseAllTabs(); ExolutioRibbon.versionGallery.ItemsSource = null; }
public void LoadProjectLayout(string filePath) { if (dockManagerLoaded) { try { XDocument d = XDocument.Load(filePath); List <Guid> diagramIds = new List <Guid>(); ExtractDiagramIds((XElement)d.FirstNode, diagramIds); Diagram diagram = null; foreach (Guid diagramId in diagramIds) { diagram = (Diagram)Current.Project.TranslateComponent(diagramId); DiagramTabManager.ActivateDiagram(diagram, false); } dockManager.RestoreLayout(filePath); if (diagram != null) { DiagramTabManager.ActivateDiagram(diagram, true); } } catch { } } }
public void FocusComponent(IEnumerable <PIMDiagram> pimDiagrams, PIMComponent component, bool activateDiagramTab = true) { if (pimDiagrams.Count() == 1) { DiagramTabManager.ActivateDiagramWithElement(pimDiagrams.First(), component, activateDiagramTab); } else { throw new NotImplementedException("Focus component not implemented for the case where the component is present in zero or more than one diagram."); } }
private void BindProjectVersion(ProjectVersion projectVersion) { DiagramTabManager.BindToProjectVersion(projectVersion); if (DiagramTabManager.ActiveDiagram == null) { DiagramTabManager.OpenTabsForProjectVersion(Current.Project.LatestVersion); } navigatorTab.PIMModelTreeView.BindToProjectVersion(projectVersion); RefreshMenu(); }
public MainWindow() { Current.MainWindow = this; GuiCommands.Init(this); InitializeComponent(); this.Icon = ExolutioResourceNames.GetResourceImageSource(ExolutioResourceNames.ExolutioIcon); DiagramTabManager = new DiagramTabManager(this); ConfigurationManager.LoadConfiguration(); this.Loaded += MainWindow_Loaded; dockManager.Loaded += dockManager_Loaded; Current.RecentFile += OnRecentFile; ExolutioRibbon.FillRecent(ConfigurationManager.Configuration.RecentFiles, ConfigurationManager.Configuration.RecentDirectories); Application.Current.DispatcherUnhandledException += Current_DispatcherUnhandledException; }
public void CurrentProjectChanged(object sender, CurrentProjectChangedEventArgs e) { CloseProject(); if (e.NewProject != null) { if (e.NewProject.UsesVersioning) { foreach (ProjectVersion projectVersion in e.NewProject.ProjectVersions) { projectVersion.CreateDiagramsForSchemas(); } } else { e.NewProject.SingleVersion.CreateDiagramsForSchemas(); } BindProject(e.NewProject); if (e.NewProject.ProjectFile != null && e.NewProject.ProjectFile.Exists && File.Exists(UserFileForProjectFile(e.NewProject.ProjectFile.FullName))) { LoadProjectLayout(UserFileForProjectFile(e.NewProject.ProjectFile.FullName)); } else { if (Current.Project.LatestVersion.PIMDiagrams.Count > 0) { DiagramTabManager.ActivateDiagram(Current.Project.LatestVersion.PIMDiagrams[0]); } if (Current.Project.LatestVersion != null) { DiagramTabManager.OpenTabsForProjectVersion(Current.Project.LatestVersion); } } } Current.ExecutedCommand += ReportDisplay.ExecutedCommand; }
public void FocusComponent(Diagram diagram, Component component, bool activateDiagramTab = true) { Component diagramComponent = component; DiagramTabManager.ActivateDiagramWithElement(diagram, diagramComponent, activateDiagramTab); }
private void UnBindProjectVersion(ProjectVersion unloadedProjectVersion) { DiagramTabManager.UnBindFromProjectVersion(unloadedProjectVersion); navigatorTab.PIMModelTreeView.UnBindFromProjectVersion(unloadedProjectVersion); RefreshMenu(); }