コード例 #1
0
ファイル: PIMClass.cs プロジェクト: mff-uk/exolutio
 public void InitCollections()
 {
     PIMAssociationEnds       = new UndirectCollection <PIMAssociationEnd>(Project);
     PIMAttributes            = new UndirectCollection <PIMAttribute>(Project);
     PIMOperations            = new UndirectCollection <ModelOperation>(Project);
     GeneralizationsAsGeneral = new UndirectCollection <PIMGeneralization>(Project);
 }
コード例 #2
0
ファイル: PSMSchema.cs プロジェクト: mff-uk/exolutio
        public void InitCollections()
        {
            PSMAssociations                = new UndirectCollection <PSMAssociation>(Project);
            PSMAssociations.MemberAdded   += RegisterPSMComponent;
            PSMAssociations.MemberRemoved += UnregisterPSMComponent;

            PSMAttributes                = new UndirectCollection <PSMAttribute>(Project);
            PSMAttributes.MemberAdded   += RegisterPSMComponent;
            PSMAttributes.MemberRemoved += UnregisterPSMComponent;

            PSMSchemaReferences                = new UndirectCollection <PSMSchemaReference>(Project);
            PSMSchemaReferences.MemberAdded   += RegisterPSMComponent;
            PSMSchemaReferences.MemberRemoved += UnregisterPSMComponent;

            PSMClasses                = new UndirectCollection <PSMClass>(Project);
            PSMClasses.MemberAdded   += RegisterPSMComponent;
            PSMClasses.MemberRemoved += UnregisterPSMComponent;

            PSMGeneralizations                = new UndirectCollection <PSMGeneralization>(Project);
            PSMGeneralizations.MemberAdded   += RegisterPSMComponent;
            PSMGeneralizations.MemberRemoved += UnregisterPSMComponent;

            PSMContentModels                = new UndirectCollection <PSMContentModel>(Project);
            PSMContentModels.MemberAdded   += RegisterPSMComponent;
            PSMContentModels.MemberRemoved += UnregisterPSMComponent;

            PSMSchemaDefinedTypes = new UndirectCollection <AttributeType>(Project);

            Roots = new UndirectCollection <PSMAssociationMember>(Project);
        }
コード例 #3
0
ファイル: IEvoXCloneable.cs プロジェクト: mff-uk/exolutio
 /// <summary>
 /// Clones all the members of <paramref name="sourceCollection"/>, calls FillCopy for each cloned member and
 /// </summary>
 public static void CopyCollection <T>(this IExolutioCloneable cloneable, UndirectCollection <T> sourceCollection, UndirectCollection <T> targetCollection, ProjectVersion projectVersion, ElementCopiesMap createdCopies)
     where T : ExolutioObject
 {
     foreach (T collectionItem in sourceCollection)
     {
         T itemCopy = (T)collectionItem.Clone(projectVersion, createdCopies);
         collectionItem.FillCopy(itemCopy, projectVersion, createdCopies);
         targetCollection.Add(itemCopy);
     }
 }
コード例 #4
0
ファイル: PIMAssociation.cs プロジェクト: mff-uk/exolutio
 public void InitializeCollections()
 {
     PIMAssociationEnds              = new UndirectCollection <PIMAssociationEnd>(Project);
     PIMAssociationEnds.MemberAdded += delegate
     {
         NotifyPropertyChanged("PIMAssociationEnds");
         NotifyPropertyChanged("PIMClasses");
     };
     PIMAssociationEnds.MemberRemoved += delegate
     {
         NotifyPropertyChanged("PIMAssociationEnds");
         NotifyPropertyChanged("PIMClasses");
     };
 }
コード例 #5
0
        public void InitCollections()
        {
            PIMAssociations                = new UndirectCollection <PIMAssociation>(Project);
            PIMAssociations.MemberAdded   += RegisterPIMComponent;
            PIMAssociations.MemberRemoved += UnregisterPIMComponent;

            PIMAttributes                = new UndirectCollection <PIMAttribute>(Project);
            PIMAttributes.MemberAdded   += RegisterPIMComponent;
            PIMAttributes.MemberRemoved += UnregisterPIMComponent;

            PIMAssociationEnds                = new UndirectCollection <PIMAssociationEnd>(Project);
            PIMAssociationEnds.MemberAdded   += RegisterPIMComponent;
            PIMAssociationEnds.MemberRemoved += UnregisterPIMComponent;

            PIMClasses                = new UndirectCollection <PIMClass>(Project);
            PIMClasses.MemberAdded   += RegisterPIMComponent;
            PIMClasses.MemberRemoved += UnregisterPIMComponent;

            PIMGeneralizations                = new UndirectCollection <PIMGeneralization>(Project);
            PIMGeneralizations.MemberAdded   += RegisterPIMComponent;
            PIMGeneralizations.MemberRemoved += UnregisterPIMComponent;
        }
コード例 #6
0
 private void InitializeCollections()
 {
     PSMAttributes            = new UndirectCollection <PSMAttribute>(Project);
     GeneralizationsAsGeneral = new UndirectCollection <PSMGeneralization>(Project);
 }
コード例 #7
0
 private void InitializeCollections()
 {
     Versions = new UndirectCollection <Version>(Project);
 }
コード例 #8
0
 public acmdReorderComponents(Controller c, UndirectCollection <TComponentType> ownerCollection, List <Guid> componentGuids)
     : base(c)
 {
     ComponentGuids  = componentGuids;
     OwnerCollection = ownerCollection;
 }
コード例 #9
0
ファイル: IEvoXSerializable.cs プロジェクト: mff-uk/exolutio
        public static void DeserializeWrappedIDRefCollection <T>(this IExolutioSerializable component, [NotNull] string collectionNodeName,
                                                                 [NotNull] string idRefAttribute, UndirectCollection <T> idRefCollection,
                                                                 XElement parentNode, SerializationContext context) where T : ExolutioObject
        {
            XElement collectionNode = parentNode.Element(context.ExolutioNS + collectionNodeName);

            if (collectionNode == null)
            {
                context.Log.AddErrorFormat(SerializationLogMessages.Collection_node__0__not_found_in_node__1__,
                                           collectionNodeName, parentNode);
                return;
            }

            int?count = null;

            if (collectionNode.Attribute("Count") == null)
            {
                context.Log.AddWarningFormat(SerializationLogMessages.Collection_node__0__missing_attribute__Count__,
                                             collectionNode);
            }
            else
            {
                count = int.Parse(collectionNode.Attribute("Count").Value);
            }

            int subelementsCount = 0;

            foreach (XElement xmlElement in collectionNode.Elements())
            {
                Guid deserializedIdRef = component.DeserializeIDRef(idRefAttribute, xmlElement, context);
                idRefCollection.AddAsGuidSilent(deserializedIdRef);
                subelementsCount++;
            }

            if (count.HasValue && count != subelementsCount)
            {
                context.Log.AddWarningFormat(SerializationLogMessages.InconsistentCount, count, collectionNode, subelementsCount);
            }
        }
コード例 #10
0
ファイル: IEvoXSerializable.cs プロジェクト: mff-uk/exolutio
        public static void DeserializeWrappedCollection <T>(this IExolutioSerializable component, [NotNull] string collectionNodeName, UndirectCollection <T> collection, CreateComponentDelegate <T> createAction, XElement parentNode, SerializationContext context, bool missingAsEmpty = false)
            where T : ExolutioObject
        {
            XElement collectionNode = parentNode.Element(context.ExolutioNS + collectionNodeName);

            if (collectionNode == null && missingAsEmpty)
            {
                return;
            }

            if (collectionNode == null)
            {
                context.Log.AddErrorFormat(SerializationLogMessages.Collection_node__0__not_found_in_node__1__,
                                           collectionNodeName, parentNode);
                return;
            }

            int?count = null;

            if (collectionNode.Attribute("Count") == null)
            {
                context.Log.AddWarningFormat(SerializationLogMessages.Collection_node__0__missing_attribute__Count__,
                                             collectionNode);
            }
            else
            {
                count = int.Parse(collectionNode.Attribute("Count").Value);
            }

            int subelementsCount = 0;

            foreach (XElement xmlElement in collectionNode.Elements())
            {
                T member = createAction(component.Project);
                member.Deserialize(xmlElement, context);
                collection.Add(member);
                subelementsCount++;
            }

            if (count.HasValue && count != subelementsCount)
            {
                context.Log.AddWarningFormat(SerializationLogMessages.InconsistentCount, count, collectionNode, subelementsCount);
            }
        }
コード例 #11
0
 private void InitializeCollections()
 {
     ChildPSMAssociations = new UndirectCollection <PSMAssociation>(Project);
 }
コード例 #12
0
 public void Set(UndirectCollection <TComponentType> ownerCollection, List <Guid> componentGuids)
 {
     ComponentGuids  = componentGuids;
     OwnerCollection = ownerCollection;
 }
コード例 #13
0
ファイル: IEvoXCloneable.cs プロジェクト: mff-uk/exolutio
 /// <summary>
 /// Registers (already existing) copies of the members of <paramref name="sourceCollection"/> into <paramref name="targetCollection"/>.
 /// </summary>
 public static void CopyRefCollection <T>(this IExolutioCloneable cloneable, IEnumerable <T> sourceCollection, UndirectCollection <T> targetCollection,
                                          ProjectVersion projectVersion, ElementCopiesMap createdCopies, bool asGuid = false)
     where T : ExolutioObject
 {
     foreach (T collectionItem in sourceCollection)
     {
         Guid guid = createdCopies.GetGuidForCopyOf(collectionItem);
         if (!asGuid)
         {
             targetCollection.Add(targetCollection.Project.TranslateComponent <T>(guid));
         }
         else
         {
             targetCollection.AddAsGuidSilent(guid);
         }
     }
 }
コード例 #14
0
 private void InitializeCollections()
 {
     UsedGeneralizations = new UndirectCollection <PIMGeneralization>(Project);
 }