/// <summary> /// Adds the given element to the collection /// </summary> /// <param name="item">The item to add</param> public override void Add(IModelElement item) { MDEMGTT.ArchitectureCRA.IAttribute dataDependencyCasted = item.As <MDEMGTT.ArchitectureCRA.IAttribute>(); if ((dataDependencyCasted != null)) { this._parent.DataDependency.Add(dataDependencyCasted); } IMethod functionalDependencyCasted = item.As <IMethod>(); if ((functionalDependencyCasted != null)) { this._parent.FunctionalDependency.Add(functionalDependencyCasted); } }
/// <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) { MDEMGTT.ArchitectureCRA.IAttribute attributeItem = item.As <MDEMGTT.ArchitectureCRA.IAttribute>(); if (((attributeItem != null) && this._parent.DataDependency.Remove(attributeItem))) { return(true); } IMethod methodItem = item.As <IMethod>(); if (((methodItem != null) && this._parent.FunctionalDependency.Remove(methodItem))) { return(true); } return(false); }