示例#1
0
 public PSMSchemaClass(Project p, Guid g, PSMSchema schema)
     : base(p, g)
 {
     schema.Roots.Add(this);
     this.Schema = schema;
     schema.RegisterPSMSchemaClass(this);
 }
示例#2
0
 public PSMClass(Project p, PSMSchema schema, bool isRoot) : base(p)
 {
     InitializeCollections();
     if (isRoot)
     {
         schema.Roots.Add(this);
     }
     schema.PSMClasses.Add(this);
 }
示例#3
0
 public PSMGeneralization(Project p, PSMClass general, PSMClass specific, PSMSchema schema)
     : base(p)
 {
     General  = general;
     Specific = specific;
     General.GeneralizationsAsGeneral.Add(this);
     Specific.GeneralizationAsSpecific = this;
     schema.PSMGeneralizations.Add(this);
 }
示例#4
0
 public PSMContentModel(Project p, PSMSchema schema, bool isRoot)
     : base(p)
 {
     schema.PSMContentModels.Add(this);
     if (isRoot)
     {
         schema.Roots.Add(this);
     }
 }
示例#5
0
 public PSMContentModel(Project p, Guid g, PSMSchema schema, int rootIndex = -1)
     : base(p, g)
 {
     if (rootIndex == -1)
     {
         schema.Roots.Add(this);
     }
     else
     {
         schema.Roots.Insert(this, rootIndex);
     }
     schema.PSMContentModels.Add(this);
 }
示例#6
0
 public PSMClass(Project p, Guid g, PSMSchema schema, int rootIndex = -1)
     : base(p, g)
 {
     InitializeCollections();
     if (rootIndex == -1)
     {
         schema.Roots.Add(this);
     }
     else
     {
         schema.Roots.Insert(this, rootIndex);
     }
     schema.PSMClasses.Add(this);
 }
示例#7
0
 public PSMAttribute(Project p, Guid g, PSMClass c, PSMSchema schema, int index = -1)
     : base(p, g)
 {
     schema.PSMAttributes.Add(this);
     if (index == -1)
     {
         c.PSMAttributes.Add(this);
     }
     else
     {
         c.PSMAttributes.Insert(this, index);
     }
     PSMClass = c;
 }
示例#8
0
        public override void FillCopy(IExolutioCloneable copyComponent, ProjectVersion projectVersion,
                                      ElementCopiesMap createdCopies)
        {
            base.FillCopy(copyComponent, projectVersion, createdCopies);

            PSMSchema copyPSMSchema = (PSMSchema)copyComponent;

            copyPSMSchema.SetProjectVersion(projectVersion);

            if (PSMSchemaClass != null)
            {
                PSMSchemaClass psmSchemaClass = PSMSchemaClass.CreateTypedCopy(projectVersion, createdCopies);
                copyPSMSchema.RegisterPSMSchemaClass(psmSchemaClass);
            }
            this.CopyCollection(PSMClasses, copyPSMSchema.PSMClasses, projectVersion, createdCopies);
            this.CopyCollection(PSMAssociations, copyPSMSchema.PSMAssociations, projectVersion, createdCopies);
            this.CopyCollection(PSMContentModels, copyPSMSchema.PSMContentModels, projectVersion, createdCopies);
            this.CopyRefCollection(PSMAttributes, copyPSMSchema.PSMAttributes, projectVersion, createdCopies);
            this.CopyRefCollection(Roots, copyPSMSchema.Roots, projectVersion, createdCopies);
        }
示例#9
0
        /// <summary>
        /// Associates schema with diagram. When <paramref name="bindingOnly"/> is set to false (default),
        /// adds all components of the schema to the diagram. Binds diagram to the <see cref="PSM.PSMSchema.ComponentAdded"/>
        /// and <see cref="PSM.PSMSchema.ComponentRemoved"/> so that every component added or removed to/from the schema
        /// in the future is correspondingly added/removed from the diagram.
        /// </summary>
        public override void LoadSchemaToDiagram(Schema schema, bool bindingOnly = false)
        {
            base.LoadSchemaToDiagram(schema, bindingOnly);
            PSMSchema psmSchema = (PSMSchema)schema;

            if (!bindingOnly)
            {
                Caption = psmSchema.Caption;

                foreach (PSMComponent psmComponent in ModelIterator.GetPSMComponents(psmSchema))
                {
                    if (psmComponent.IsOfType(typeof(PSMClass), typeof(PSMAssociation), typeof(PSMContentModel),
                                              typeof(PSMSchemaClass)))
                    {
                        Components.Add(psmComponent);
                    }
                }
            }

            PSMSchema.ComponentAdded   += Components_ComponentAdded;
            PSMSchema.ComponentRemoved += Components_ComponentRemoved;
        }
示例#10
0
 public PSMSchemaReference(Project p, PSMSchema referencedPSMSchema)
     : base(p)
 {
     ReferencedPSMSchema = referencedPSMSchema;
 }
示例#11
0
 public PSMSchemaReference(Project p, Guid g, PSMSchema referencedPSMSchema)
     : base(p, g)
 {
     ReferencedPSMSchema = referencedPSMSchema;
 }
示例#12
0
 public PSMAssociation(Project p, Guid g, PSMAssociationMember parent, PSMAssociationMember child, int index, PSMSchema schema, bool setChildParentAssociation = true)
     : base(p, g)
 {
     Parent = parent;
     Child  = child;
     if (Parent != null)
     {
         Parent.ChildPSMAssociations.Insert(this, index);
     }
     if (Child != null && setChildParentAssociation)
     {
         Child.ParentAssociation = this;
     }
     schema.PSMAssociations.Add(this);
 }
示例#13
0
 public PSMAssociation(Project p, PSMAssociationMember parent, PSMAssociationMember child, PSMSchema schema)
     : base(p)
 {
     Parent = parent;
     Child  = child;
     if (Parent != null)
     {
         Parent.ChildPSMAssociations.Add(this);
     }
     if (Child != null)
     {
         Child.ParentAssociation = this;
     }
     schema.PSMAssociations.Add(this);
 }