Ejemplo n.º 1
0
        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();
        }
Ejemplo n.º 2
0
 internal override void CommandOperation()
 {
     if (Diagram == null)
     {
         Diagram = new PIMDiagram(NameSuggestor <PIMDiagram> .SuggestUniqueName(Project.PIMDiagrams, "PIM Diagram", diagram => diagram.Caption));
     }
     Project.AddDiagram(Diagram);
 }
Ejemplo n.º 3
0
        public void CreateDiagramsForSchemas()
        {
            if (PIMDiagrams.Count == 0)
            {
                PIMDiagram pimDiagram = new PIMDiagram(Project);
                PIMDiagrams.Add(pimDiagram);
                pimDiagram.LoadSchemaToDiagram(PIMSchema);
            }

            if (PSMDiagrams.Count == 0)
            {
                foreach (PSMSchema psmSchema in PSMSchemas)
                {
                    PSMDiagram psmDiagram = new PSMDiagram(Project);
                    PSMDiagrams.Add(psmDiagram);
                    psmDiagram.LoadSchemaToDiagram(psmSchema);
                }
            }

            if (Project.UsesVersioning)
            {
                // Create version links between diagrams where schemas are linked
                foreach (ProjectVersion otherVersion in Project.ProjectVersions)
                {
                    if (otherVersion == this)
                    {
                        continue;
                    }
                    foreach (Diagram diagramFromOtherVersion in otherVersion.Diagrams)
                    {
                        foreach (Diagram diagramFromThisVersion in Diagrams)
                        {
                            if (Project.VersionManager.AreItemsLinked(diagramFromOtherVersion.Schema, diagramFromThisVersion.Schema) &&
                                !Project.VersionManager.AreItemsLinked(diagramFromOtherVersion, diagramFromThisVersion))
                            {
                                Project.VersionManager.RegisterVersionLink(this.Version, otherVersion.Version, diagramFromThisVersion, diagramFromOtherVersion);
                            }
                        }
                    }
                }
            }
        }