/// <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) { IEStringToStringMapEntry eStringToStringMapEntryItem = item.As <IEStringToStringMapEntry>(); if (((eStringToStringMapEntryItem != null) && this._parent.Details.Remove(eStringToStringMapEntryItem))) { return(true); } if ((this._parent.EModelElement == item)) { this._parent.EModelElement = null; return(true); } IEObject eObjectItem = item.As <IEObject>(); if (((eObjectItem != null) && this._parent.Contents.Remove(eObjectItem))) { return(true); } if (((eObjectItem != null) && this._parent.References.Remove(eObjectItem))) { 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(IModelElement item) { IEStringToStringMapEntry detailsCasted = item.As <IEStringToStringMapEntry>(); if ((detailsCasted != null)) { this._parent.Details.Add(detailsCasted); } if ((this._parent.EModelElement == null)) { IEModelElement eModelElementCasted = item.As <IEModelElement>(); if ((eModelElementCasted != null)) { this._parent.EModelElement = eModelElementCasted; return; } } IEObject contentsCasted = item.As <IEObject>(); if ((contentsCasted != null)) { this._parent.Contents.Add(contentsCasted); } IEObject referencesCasted = item.As <IEObject>(); if ((referencesCasted != null)) { this._parent.References.Add(referencesCasted); } }
/// <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.Object == null)) { IEObject objectCasted = item.As <IEObject>(); if ((objectCasted != null)) { this._parent.Object = objectCasted; return; } } }
/// <summary> /// Adds the given element to the collection /// </summary> /// <param name="item">The item to add</param> public override void Add(IModelElement item) { IEStringToStringMapEntry detailsCasted = item.As <IEStringToStringMapEntry>(); if ((detailsCasted != null)) { this._parent.Details.Add(detailsCasted); } IEObject contentsCasted = item.As <IEObject>(); if ((contentsCasted != null)) { this._parent.Contents.Add(contentsCasted); } }