Esempio n. 1
0
            /// <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);
            }
Esempio n. 2
0
            /// <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);
                }
            }