Example #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();
        }
Example #2
0
        internal override CommandBase.OperationResult UndoOperation()
        {
            PSMSchema  psmSchema  = Project.TranslateComponent <PSMSchema>(SchemaGuid);
            PSMDiagram psmDiagram = new PSMDiagram(Project, DiagramGuid);

            psmDiagram.Schema = psmSchema;
            psmDiagram.LoadSchemaToDiagram(psmSchema);
            psmSchema.ProjectVersion.PSMDiagrams.Add(psmDiagram);
            return(OperationResult.OK);
        }
Example #3
0
        internal override void CommandOperation()
        {
            if (DiagramGuid == Guid.Empty)
            {
                DiagramGuid = Guid.NewGuid();
            }

            PSMSchema  psmSchema = Project.TranslateComponent <PSMSchema>(schemaGuid);
            PSMDiagram diagram   = new PSMDiagram(Project, DiagramGuid);

            diagram.LoadSchemaToDiagram(psmSchema);
            psmSchema.ProjectVersion.PSMDiagrams.Add(diagram);
            Report = new CommandReport(CommandReports.PSM_diagram_added, psmSchema);
        }
Example #4
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);
                            }
                        }
                    }
                }
            }
        }