/// <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) { if ((this._parent.DeliveryPointFor == item)) { this._parent.DeliveryPointFor = null; return(true); } ITransmissionService transmissionServiceItem = item.As <ITransmissionService>(); if (((transmissionServiceItem != null) && this._parent.OfferedOn.Remove(transmissionServiceItem))) { return(true); } if ((this._parent.PointOfReceiptFor == item)) { this._parent.PointOfReceiptFor = null; return(true); } if ((this._parent.For == item)) { this._parent.For = null; return(true); } ITransmissionProduct transmissionProductItem = item.As <ITransmissionProduct>(); if (((transmissionProductItem != null) && this._parent.LocatedOn.Remove(transmissionProductItem))) { return(true); } return(false); }
/// <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) { IServicePoint servicePointItem = item.As <IServicePoint>(); if (((servicePointItem != null) && this._parent.ServicePoint.Remove(servicePointItem))) { return(true); } IAncillaryService ancillaryServiceItem = item.As <IAncillaryService>(); if (((ancillaryServiceItem != null) && this._parent.AncillaryServices.Remove(ancillaryServiceItem))) { return(true); } ILossProfile lossProfileItem = item.As <ILossProfile>(); if (((lossProfileItem != null) && this._parent.For.Remove(lossProfileItem))) { return(true); } ITransmissionService transmissionServiceItem = item.As <ITransmissionService>(); if (((transmissionServiceItem != null) && this._parent.OfferedBy.Remove(transmissionServiceItem))) { return(true); } IFlowgate flowgateItem = item.As <IFlowgate>(); if (((flowgateItem != null) && this._parent.Flowgate.Remove(flowgateItem))) { return(true); } IServiceReservation serviceReservationItem = item.As <IServiceReservation>(); if (((serviceReservationItem != null) && this._parent.SoldBy.Remove(serviceReservationItem))) { return(true); } ITransmissionProduct transmissionProductItem = item.As <ITransmissionProduct>(); if (((transmissionProductItem != null) && this._parent.TransmissionProducts.Remove(transmissionProductItem))) { 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) { IServicePoint servicePointCasted = item.As <IServicePoint>(); if ((servicePointCasted != null)) { this._parent.ServicePoint.Add(servicePointCasted); } IAncillaryService ancillaryServicesCasted = item.As <IAncillaryService>(); if ((ancillaryServicesCasted != null)) { this._parent.AncillaryServices.Add(ancillaryServicesCasted); } ILossProfile forCasted = item.As <ILossProfile>(); if ((forCasted != null)) { this._parent.For.Add(forCasted); } ITransmissionService offeredByCasted = item.As <ITransmissionService>(); if ((offeredByCasted != null)) { this._parent.OfferedBy.Add(offeredByCasted); } IFlowgate flowgateCasted = item.As <IFlowgate>(); if ((flowgateCasted != null)) { this._parent.Flowgate.Add(flowgateCasted); } IServiceReservation soldByCasted = item.As <IServiceReservation>(); if ((soldByCasted != null)) { this._parent.SoldBy.Add(soldByCasted); } ITransmissionProduct transmissionProductsCasted = item.As <ITransmissionProduct>(); if ((transmissionProductsCasted != null)) { this._parent.TransmissionProducts.Add(transmissionProductsCasted); } }
/// <summary> /// Adds the given element to the collection /// </summary> /// <param name="item">The item to add</param> public override void Add(IModelElement item) { ITransmissionPath offeringCasted = item.As <ITransmissionPath>(); if ((offeringCasted != null)) { this._parent.Offering.Add(offeringCasted); } ITransmissionProduct offeredAsCasted = item.As <ITransmissionProduct>(); if ((offeredAsCasted != null)) { this._parent.OfferedAs.Add(offeredAsCasted); } IAvailableTransmissionCapacity scheduledByCasted = item.As <IAvailableTransmissionCapacity>(); if ((scheduledByCasted != null)) { this._parent.ScheduledBy.Add(scheduledByCasted); } IServiceReservation reservedBy_ServiceReservationCasted = item.As <IServiceReservation>(); if ((reservedBy_ServiceReservationCasted != null)) { this._parent.ReservedBy_ServiceReservation.Add(reservedBy_ServiceReservationCasted); } if ((this._parent.TransContractFor == null)) { IOpenAccessProduct transContractForCasted = item.As <IOpenAccessProduct>(); if ((transContractForCasted != null)) { this._parent.TransContractFor = transContractForCasted; return; } } if ((this._parent.Offers == null)) { ITransmissionProvider offersCasted = item.As <ITransmissionProvider>(); if ((offersCasted != null)) { this._parent.Offers = offersCasted; return; } } }
/// <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) { ITransmissionPath transmissionPathItem = item.As <ITransmissionPath>(); if (((transmissionPathItem != null) && this._parent.Offering.Remove(transmissionPathItem))) { return(true); } ITransmissionProduct transmissionProductItem = item.As <ITransmissionProduct>(); if (((transmissionProductItem != null) && this._parent.OfferedAs.Remove(transmissionProductItem))) { return(true); } IAvailableTransmissionCapacity availableTransmissionCapacityItem = item.As <IAvailableTransmissionCapacity>(); if (((availableTransmissionCapacityItem != null) && this._parent.ScheduledBy.Remove(availableTransmissionCapacityItem))) { return(true); } IServiceReservation serviceReservationItem = item.As <IServiceReservation>(); if (((serviceReservationItem != null) && this._parent.ReservedBy_ServiceReservation.Remove(serviceReservationItem))) { return(true); } if ((this._parent.TransContractFor == item)) { this._parent.TransContractFor = null; return(true); } if ((this._parent.Offers == item)) { this._parent.Offers = null; 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) { if ((this._parent.DeliveryPointFor == null)) { IServicePoint deliveryPointForCasted = item.As <IServicePoint>(); if ((deliveryPointForCasted != null)) { this._parent.DeliveryPointFor = deliveryPointForCasted; return; } } ITransmissionService offeredOnCasted = item.As <ITransmissionService>(); if ((offeredOnCasted != null)) { this._parent.OfferedOn.Add(offeredOnCasted); } if ((this._parent.PointOfReceiptFor == null)) { IServicePoint pointOfReceiptForCasted = item.As <IServicePoint>(); if ((pointOfReceiptForCasted != null)) { this._parent.PointOfReceiptFor = pointOfReceiptForCasted; return; } } if ((this._parent.For == null)) { ITransmissionCorridor forCasted = item.As <ITransmissionCorridor>(); if ((forCasted != null)) { this._parent.For = forCasted; return; } } ITransmissionProduct locatedOnCasted = item.As <ITransmissionProduct>(); if ((locatedOnCasted != null)) { this._parent.LocatedOn.Add(locatedOnCasted); } }