public void InitCollections() { PIMAssociationEnds = new UndirectCollection <PIMAssociationEnd>(Project); PIMAttributes = new UndirectCollection <PIMAttribute>(Project); PIMOperations = new UndirectCollection <ModelOperation>(Project); GeneralizationsAsGeneral = new UndirectCollection <PIMGeneralization>(Project); }
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); }
/// <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); } }
public void InitializeCollections() { PIMAssociationEnds = new UndirectCollection <PIMAssociationEnd>(Project); PIMAssociationEnds.MemberAdded += delegate { NotifyPropertyChanged("PIMAssociationEnds"); NotifyPropertyChanged("PIMClasses"); }; PIMAssociationEnds.MemberRemoved += delegate { NotifyPropertyChanged("PIMAssociationEnds"); NotifyPropertyChanged("PIMClasses"); }; }
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; }
private void InitializeCollections() { PSMAttributes = new UndirectCollection <PSMAttribute>(Project); GeneralizationsAsGeneral = new UndirectCollection <PSMGeneralization>(Project); }
private void InitializeCollections() { Versions = new UndirectCollection <Version>(Project); }
public acmdReorderComponents(Controller c, UndirectCollection <TComponentType> ownerCollection, List <Guid> componentGuids) : base(c) { ComponentGuids = componentGuids; OwnerCollection = ownerCollection; }
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); } }
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); } }
private void InitializeCollections() { ChildPSMAssociations = new UndirectCollection <PSMAssociation>(Project); }
public void Set(UndirectCollection <TComponentType> ownerCollection, List <Guid> componentGuids) { ComponentGuids = componentGuids; OwnerCollection = ownerCollection; }
/// <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); } } }
private void InitializeCollections() { UsedGeneralizations = new UndirectCollection <PIMGeneralization>(Project); }