コード例 #1
0
ファイル: MainPage.xaml.cs プロジェクト: mff-uk/exolutio
 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;
 }
コード例 #2
0
ファイル: MainPage.xaml.cs プロジェクト: mff-uk/exolutio
        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();
        }