/// <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.TransmissionRightOfWay == null)) { ITransmissionRightOfWay transmissionRightOfWayCasted = item.As <ITransmissionRightOfWay>(); if ((transmissionRightOfWayCasted != null)) { this._parent.TransmissionRightOfWay = transmissionRightOfWayCasted; return; } } IFlowgate flowgatesCasted = item.As <IFlowgate>(); if ((flowgatesCasted != null)) { this._parent.Flowgates.Add(flowgatesCasted); } if ((this._parent.Region == null)) { ISubGeographicalRegion regionCasted = item.As <ISubGeographicalRegion>(); if ((regionCasted != null)) { this._parent.Region = regionCasted; return; } } }
/// <summary> /// Adds the given element to the collection /// </summary> /// <param name="item">The item to add</param> public override void Add(IModelElement item) { ITransmissionRightOfWay transmissionRightOfWaysCasted = item.As <ITransmissionRightOfWay>(); if ((transmissionRightOfWaysCasted != null)) { this._parent.TransmissionRightOfWays.Add(transmissionRightOfWaysCasted); } ITransmissionPath containedInCasted = item.As <ITransmissionPath>(); if ((containedInCasted != null)) { this._parent.ContainedIn.Add(containedInCasted); } }
/// <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) { ITransmissionRightOfWay transmissionRightOfWayItem = item.As <ITransmissionRightOfWay>(); if (((transmissionRightOfWayItem != null) && this._parent.TransmissionRightOfWays.Remove(transmissionRightOfWayItem))) { return(true); } ITransmissionPath transmissionPathItem = item.As <ITransmissionPath>(); if (((transmissionPathItem != null) && this._parent.ContainedIn.Remove(transmissionPathItem))) { return(true); } return(false); }