/// <summary> /// Adds the given element to the collection /// </summary> /// <param name="item">The item to add</param> public override void Add(NMF.Models.IModelElement item) { NMF.Models.Meta.IOperation operationsCasted = item.As <NMF.Models.Meta.IOperation>(); if ((operationsCasted != null)) { this._parent.Operations.Add(operationsCasted); } NMF.Models.Meta.IAttribute attributesCasted = item.As <NMF.Models.Meta.IAttribute>(); if ((attributesCasted != null)) { this._parent.Attributes.Add(attributesCasted); } }
/// <summary> /// Removes the given item from the collection /// </summary> /// <returns>True, if the item was removed, otherwise False</returns> /// <param name="item">The item that should be removed</param> public override bool Remove(NMF.Models.IModelElement item) { NMF.Models.Meta.IOperation operationItem = item.As <NMF.Models.Meta.IOperation>(); if (((operationItem != null) && this._parent.Operations.Remove(operationItem))) { return(true); } NMF.Models.Meta.IAttribute attributeItem = item.As <NMF.Models.Meta.IAttribute>(); if (((attributeItem != null) && this._parent.Attributes.Remove(attributeItem))) { return(true); } return(false); }
/// <summary> /// Adds the given element to the collection /// </summary> /// <param name="item">The item to add</param> public override void Add(NMF.Models.IModelElement item) { if ((this._parent.DeclaringType == null)) { NMF.Models.Meta.IClass declaringTypeCasted = item.As <NMF.Models.Meta.IClass>(); if ((declaringTypeCasted != null)) { this._parent.DeclaringType = declaringTypeCasted; return; } } if ((this._parent.Constrains == null)) { NMF.Models.Meta.IAttribute constrainsCasted = item.As <NMF.Models.Meta.IAttribute>(); if ((constrainsCasted != null)) { this._parent.Constrains = constrainsCasted; return; } } }
/// <summary> /// Adds the given element to the collection /// </summary> /// <param name="item">The item to add</param> public override void Add(NMF.Models.IModelElement item) { if ((this._parent.DeclaringType == null)) { NMF.Models.Meta.IStructuredType declaringTypeCasted = item.As <NMF.Models.Meta.IStructuredType>(); if ((declaringTypeCasted != null)) { this._parent.DeclaringType = declaringTypeCasted; return; } } if ((this._parent.Refines == null)) { NMF.Models.Meta.IAttribute refinesCasted = item.As <NMF.Models.Meta.IAttribute>(); if ((refinesCasted != null)) { this._parent.Refines = refinesCasted; return; } } }
/// <summary> /// Adds the given element to the collection /// </summary> /// <param name="item">The item to add</param> public override void Add(NMF.Models.IModelElement item) { NMF.Models.Meta.IClass baseTypesCasted = item.As <NMF.Models.Meta.IClass>(); if ((baseTypesCasted != null)) { this._parent.BaseTypes.Add(baseTypesCasted); } if ((this._parent.InstanceOf == null)) { NMF.Models.Meta.IClass instanceOfCasted = item.As <NMF.Models.Meta.IClass>(); if ((instanceOfCasted != null)) { this._parent.InstanceOf = instanceOfCasted; return; } } if ((this._parent.Identifier == null)) { NMF.Models.Meta.IAttribute identifierCasted = item.As <NMF.Models.Meta.IAttribute>(); if ((identifierCasted != null)) { this._parent.Identifier = identifierCasted; return; } } NMF.Models.Meta.IAttributeConstraint attributeConstraintsCasted = item.As <NMF.Models.Meta.IAttributeConstraint>(); if ((attributeConstraintsCasted != null)) { this._parent.AttributeConstraints.Add(attributeConstraintsCasted); } NMF.Models.Meta.IReferenceConstraint referenceConstraintsCasted = item.As <NMF.Models.Meta.IReferenceConstraint>(); if ((referenceConstraintsCasted != null)) { this._parent.ReferenceConstraints.Add(referenceConstraintsCasted); } }