/// <summary> /// Adds the given element to the collection /// </summary> /// <param name="item">The item to add</param> public override void Add(IModelElement item) { if ((this._parent.IsEncapsulatedBy == null)) { MDEMGTT.ArchitectureCRA.IClass isEncapsulatedByCasted = item.As <MDEMGTT.ArchitectureCRA.IClass>(); if ((isEncapsulatedByCasted != null)) { this._parent.IsEncapsulatedBy = isEncapsulatedByCasted; return; } } }
/// <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.IClass classesCasted = item.As <MDEMGTT.ArchitectureCRA.IClass>(); if ((classesCasted != null)) { this._parent.Classes.Add(classesCasted); } IFeature featuresCasted = item.As <IFeature>(); if ((featuresCasted != null)) { this._parent.Features.Add(featuresCasted); } }
/// <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.IClass classItem = item.As <MDEMGTT.ArchitectureCRA.IClass>(); if (((classItem != null) && this._parent.Classes.Remove(classItem))) { return(true); } IFeature featureItem = item.As <IFeature>(); if (((featureItem != null) && this._parent.Features.Remove(featureItem))) { return(true); } return(false); }