public PSMSchemaClass(Project p, Guid g, PSMSchema schema) : base(p, g) { schema.Roots.Add(this); this.Schema = schema; schema.RegisterPSMSchemaClass(this); }
public PSMClass(Project p, PSMSchema schema, bool isRoot) : base(p) { InitializeCollections(); if (isRoot) { schema.Roots.Add(this); } schema.PSMClasses.Add(this); }
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); }
public PSMContentModel(Project p, PSMSchema schema, bool isRoot) : base(p) { schema.PSMContentModels.Add(this); if (isRoot) { schema.Roots.Add(this); } }
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); }
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); }
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; }
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); }
/// <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; }
public PSMSchemaReference(Project p, PSMSchema referencedPSMSchema) : base(p) { ReferencedPSMSchema = referencedPSMSchema; }
public PSMSchemaReference(Project p, Guid g, PSMSchema referencedPSMSchema) : base(p, g) { ReferencedPSMSchema = referencedPSMSchema; }
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); }
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); }