private void BindProjectVersion(ProjectVersion projectVersion) { if (projectVersion.PIMDiagrams.Count == 0) { PIMDiagram pimDiagram = new PIMDiagram(projectVersion.Project); projectVersion.PIMDiagrams.Add(pimDiagram); pimDiagram.LoadSchemaToDiagram(projectVersion.PIMSchema); } if (projectVersion.PSMDiagrams.Count == 0) { foreach (PSMSchema psmSchema in projectVersion.PSMSchemas) { PSMDiagram psmDiagram = new PSMDiagram(projectVersion.Project); projectVersion.PSMDiagrams.Add(psmDiagram); psmDiagram.LoadSchemaToDiagram(psmSchema); } } DiagramTabManager.BindToProjectVersion(projectVersion); if (DiagramTabManager.ActiveDiagram == null) { DiagramTabManager.OpenTabsForProjectVersion(Current.Project.LatestVersion); } //navigatorTab.PIMModelTreeView.BindToProjectVersion(projectVersion); RefreshMenu(); }
public void CurrentProjectChanged(object sender, CurrentProjectChangedEventArgs e) { CloseProject(); if (e.NewProject != null) { 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(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."); } }
public MainPage() { Current.MainWindow = this; GuiCommands.Init(this); InitializeComponent(); InitializeRibbon(); DiagramTabManager = new DiagramTabManager(this); this.Loaded += MainWindow_Loaded; //Current.ActiveDiagramChanged += Current_ActiveDiagramChanged; #if DEBUG #else ServerCommunication.ServerProjectListLoaded += ServerCommunication_ServerProjectListLoaded; ServerCommunication.GetServerProjects(); #endif }
public void FocusComponent(Diagram diagram, Component component, bool activateDiagramTab = true) { Component diagramComponent = component; DiagramTabManager.ActivateDiagramWithElement(diagram, diagramComponent, activateDiagramTab); }
public void CloseProject() { UnBindProjectVersion(Current.ProjectVersion); UnBindProject(Current.Project); DiagramTabManager.CloseAllTabs(); }
private void UnBindProjectVersion(ProjectVersion unloadedProjectVersion) { DiagramTabManager.UnBindFromProjectVersion(unloadedProjectVersion); //navigatorTab.PIMModelTreeView.UnBindFromProjectVersion(unloadedProjectVersion); RefreshMenu(); }