/// <summary> /// Adds the given element to the collection /// </summary> /// <param name="item">The item to add</param> public override void Add(IModelElement item) { ISwitchedAddress addressesCasted = item.As <ISwitchedAddress>(); if ((addressesCasted != null)) { this._parent.Addresses.Add(addressesCasted); } }
/// <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) { ISwitchedAddress switchedAddressItem = item.As <ISwitchedAddress>(); if (((switchedAddressItem != null) && this._parent.Addresses.Remove(switchedAddressItem))) { return(true); } return(false); }