Ejemplo n.º 1
0
 public PIMAssociationEnd(Project p, Guid g, PIMAssociation a, PIMSchema schema)
     : base(p, g)
 {
     schema.PIMAssociationEnds.Add(this);
     a.PIMAssociationEnds.Add(this);
     PIMAssociation = a;
 }
Ejemplo n.º 2
0
 public PIMAssociationEnd(Project p, Guid g, PIMClass c, PIMSchema schema)
     : base(p, g)
 {
     schema.PIMAssociationEnds.Add(this);
     c.PIMAssociationEnds.Add(this);
     PIMClass = c;
 }
Ejemplo n.º 3
0
 public PIMAssociationEnd(Project p, PIMClass c, PIMAssociation a, PIMSchema schema)
     : base(p)
 {
     schema.PIMAssociationEnds.Add(this);
     c.PIMAssociationEnds.Add(this);
     a.PIMAssociationEnds.Add(this);
     PIMClass       = c;
     PIMAssociation = a;
 }
Ejemplo n.º 4
0
 public PIMGeneralization(Project p, Guid g, PIMSchema schema, PIMClass generalClass, PIMClass specificClass)
     : base(p, g)
 {
     schema.PIMGeneralizations.Add(this);
     General  = generalClass;
     Specific = specificClass;
     generalClass.GeneralizationsAsGeneral.Add(this);
     specificClass.GeneralizationAsSpecific = this;
 }
Ejemplo n.º 5
0
        public PIMAssociation(Project p, PIMSchema schema, params KeyValuePair <PIMClass, Guid>[] classesAndEnds)
            : base(p)
        {
            InitializeCollections();

            schema.PIMAssociations.Add(this);
            foreach (KeyValuePair <PIMClass, Guid> pair in classesAndEnds)
            {
                PIMAssociationEnd e = new PIMAssociationEnd(Project, pair.Value, pair.Key, this, schema);
            }
        }
Ejemplo n.º 6
0
        public PIMAssociation(Project p, Guid g, PIMSchema schema, params PIMClass[] classes)
            : base(p, g)
        {
            InitializeCollections();

            schema.PIMAssociations.Add(this);
            foreach (PIMClass c in classes)
            {
                PIMAssociationEnd e = new PIMAssociationEnd(Project, c, this, schema);
            }
        }
Ejemplo n.º 7
0
        public PIMAssociation(Project p, Guid g, PIMSchema schema, params PIMAssociationEnd[] ends)
            : base(p, g)
        {
            InitializeCollections();

            schema.PIMAssociations.Add(this);
            foreach (PIMAssociationEnd e in ends)
            {
                e.PIMAssociation = this;
                PIMAssociationEnds.Add(e);
            }
        }
Ejemplo n.º 8
0
 /// <summary>
 /// Constructs a PIMAttribute and registers it with schema <paramref name="schema"/> and inserts it into <see cref="PIMClass"/> <paramref name="c"/>. Also sets <see cref="Guid"/> to <paramref name="g"/>
 /// </summary>
 /// <param name="p">Project</param>
 /// <param name="g"><see cref="Guid"/> to be set</param>
 /// <param name="c"><see cref="PIMClass"/> to insert to</param>
 /// <param name="schema"><see cref="PIMSchema"/> to register with</param>
 public PIMAttribute(Project p, Guid g, PIMClass c, PIMSchema schema, int index = -1)
     : base(p, g)
 {
     schema.PIMAttributes.Add(this);
     if (index == -1)
     {
         c.PIMAttributes.Add(this);
     }
     else
     {
         c.PIMAttributes.Insert(this, index);
     }
     PIMClass = c;
 }
Ejemplo n.º 9
0
        public Tuple <PIMBridge, Exolutio.Model.PIM.PIMSchema> CreateTestEnv()
        {
            ProjectSerializationManager m = new ProjectSerializationManager();
            Project loadedProject         = m.LoadProject(@"..\..\..\Projects\tournaments.eXo");

            ModelIntegrity.ModelConsistency.CheckProject(loadedProject);

            Exolutio.Model.PIM.PIMSchema schema = (Exolutio.Model.PIM.PIMSchema)loadedProject.SingleVersion.PIMSchema.OCLScripts[0].Schema;

            return(new Tuple <PIMBridge, Exolutio.Model.PIM.PIMSchema>(
                       new PIMBridge(schema),
                       schema
                       ));
        }
Ejemplo n.º 10
0
        public override void FillCopy(IExolutioCloneable copyComponent, ProjectVersion projectVersion,
                                      ElementCopiesMap createdCopies)
        {
            base.FillCopy(copyComponent, projectVersion, createdCopies);

            PIMSchema copyPIMSchema = (PIMSchema)copyComponent;

            copyPIMSchema.SetProjectVersion(projectVersion);

            this.CopyCollection(PIMClasses, copyPIMSchema.PIMClasses, projectVersion, createdCopies);
            this.CopyCollection(PIMGeneralizations, copyPIMSchema.PIMGeneralizations, projectVersion, createdCopies);
            this.CopyCollection(PIMAssociations, copyPIMSchema.PIMAssociations, projectVersion, createdCopies);
            this.CopyRefCollection(PIMAttributes, copyPIMSchema.PIMAttributes, projectVersion, createdCopies);
            this.CopyRefCollection(PIMAssociationEnds, copyPIMSchema.PIMAssociationEnds, projectVersion, createdCopies);
        }
Ejemplo n.º 11
0
        public override void LoadSchemaToDiagram(Schema schema, bool bindingOnly = false)
        {
            base.LoadSchemaToDiagram(schema, bindingOnly);
            PIMSchema pimSchema = (PIMSchema)schema;

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

                foreach (PIMComponent pimComponent in ModelIterator.GetPIMComponents(pimSchema))
                {
                    if (pimComponent.IsOfType(typeof(PIMClass), typeof(PIMAssociation)))
                    {
                        Components.Add(pimComponent);
                    }
                }
            }

            PIMSchema.ComponentRemoved += Components_ComponentRemoved;
        }
Ejemplo n.º 12
0
 /// <summary>
 /// Constructs a PIMClass and registers it with the PIMSchema <paramref name="Schema"/>
 /// </summary>
 /// <param name="P">Project to wich this PIMClass belongs to</param>
 /// <param name="Schema">PIMSchema</param>
 public PIMClass(Project p, Guid g, PIMSchema schema)
     : base(p, g)
 {
     schema.PIMClasses.Add(this);
     InitCollections();
 }
Ejemplo n.º 13
0
 public PIMAssociation(Project p, PIMSchema schema)
     : this(p, schema, new PIMAssociationEnd[0])
 {
 }