/// <summary> /// Adds the given element to the collection /// </summary> /// <param name="item">The item to add</param> public override void Add(IModelElement item) { IAssociationEnd endsCasted = item.As <IAssociationEnd>(); if ((endsCasted != null)) { this._parent.Ends.Add(endsCasted); } TTC2021.OclToSql.Ocl.Dm.IAttribute attributesCasted = item.As <TTC2021.OclToSql.Ocl.Dm.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(IModelElement item) { IAssociationEnd associationEndItem = item.As <IAssociationEnd>(); if (((associationEndItem != null) && this._parent.Ends.Remove(associationEndItem))) { return(true); } TTC2021.OclToSql.Ocl.Dm.IAttribute attributeItem = item.As <TTC2021.OclToSql.Ocl.Dm.IAttribute>(); if (((attributeItem != null) && this._parent.Attributes.Remove(attributeItem))) { return(true); } return(false); }