public static IList <EvolutionChange> Detect(Version v1, Version v2, PSMAssociationChild associationChild)
        {
            List <EvolutionChange> result = new List <EvolutionChange>();

            PSMAssociationChild associationChildOldVersion = (PSMAssociationChild)associationChild.GetInVersion(v2);

            if (associationChild.ParentUnion != null && associationChildOldVersion.ParentUnion != null &&
                associationChild.ParentUnion.GetInVersion(v1) == associationChildOldVersion.ParentUnion &&
                associationChild.ComponentIndex() != associationChildOldVersion.ComponentIndex())
            {
                AssociationChildClassUnionIndexChange change = new AssociationChildClassUnionIndexChange(associationChild)
                {
                    OldVersion = v1, NewVersion = v2
                };
                result.Add(change);
            }

            return(result);
        }
Пример #2
0
        private EvoX.Model.PSM.PSMAssociation CreateLeadingAssociationForUnionComponents(PSMAssociationChild associationChild, PSMAssociationMember childAssociationMember)
        {
            PSMAssociationMember parent = (PSMAssociationMember)translatedElements[associationChild.ParentUnion];

            EvoX.Model.PSM.PSMAssociation psmAssociation = new EvoX.Model.PSM.PSMAssociation(
                evoxProject, parent, childAssociationMember, psmSchema);
            PSMClass psmClass = associationChild as PSMClass;

            if (psmClass != null && psmClass.HasElementLabel)
            {
                psmAssociation.Name = psmClass.ElementName;
            }
            else
            {
                psmAssociation.Name = null;
            }
            associationOrder[psmAssociation] = associationChild.ComponentIndex();
            return(psmAssociation);
        }