示例#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);
                }
                IGeneratingUnit generatingUnitItem = item.As <IGeneratingUnit>();

                if (((generatingUnitItem != null) &&
                     this._parent.GeneratingUnits.Remove(generatingUnitItem)))
                {
                    return(true);
                }
                IEnergyProduct energyProductItem = item.As <IEnergyProduct>();

                if (((energyProductItem != null) &&
                     this._parent.EnergyProducts.Remove(energyProductItem)))
                {
                    return(true);
                }
                return(false);
            }
示例#2
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)
            {
                IEnergyProduct energyProductItem = item.As <IEnergyProduct>();

                if (((energyProductItem != null) &&
                     this._parent.Resells_EnergyProduct.Remove(energyProductItem)))
                {
                    return(true);
                }
                IServiceReservation serviceReservationItem = item.As <IServiceReservation>();

                if (((serviceReservationItem != null) &&
                     this._parent.HeldBy.Remove(serviceReservationItem)))
                {
                    return(true);
                }
                if (((energyProductItem != null) &&
                     this._parent.HoldsTitleTo_EnergyProducts.Remove(energyProductItem)))
                {
                    return(true);
                }
                if ((this._parent.ResoldBy == item))
                {
                    this._parent.ResoldBy = null;
                    return(true);
                }
                return(false);
            }
示例#3
0
            /// <summary>
            /// Adds the given element to the collection
            /// </summary>
            /// <param name="item">The item to add</param>
            public override void Add(IModelElement item)
            {
                IEnergyProduct resells_EnergyProductCasted = item.As <IEnergyProduct>();

                if ((resells_EnergyProductCasted != null))
                {
                    this._parent.Resells_EnergyProduct.Add(resells_EnergyProductCasted);
                }
                IServiceReservation heldByCasted = item.As <IServiceReservation>();

                if ((heldByCasted != null))
                {
                    this._parent.HeldBy.Add(heldByCasted);
                }
                IEnergyProduct holdsTitleTo_EnergyProductsCasted = item.As <IEnergyProduct>();

                if ((holdsTitleTo_EnergyProductsCasted != null))
                {
                    this._parent.HoldsTitleTo_EnergyProducts.Add(holdsTitleTo_EnergyProductsCasted);
                }
                if ((this._parent.ResoldBy == null))
                {
                    IServiceReservation resoldByCasted = item.As <IServiceReservation>();
                    if ((resoldByCasted != null))
                    {
                        this._parent.ResoldBy = resoldByCasted;
                        return;
                    }
                }
            }
示例#4
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);
                }
                IGeneratingUnit generatingUnitsCasted = item.As <IGeneratingUnit>();

                if ((generatingUnitsCasted != null))
                {
                    this._parent.GeneratingUnits.Add(generatingUnitsCasted);
                }
                IEnergyProduct energyProductsCasted = item.As <IEnergyProduct>();

                if ((energyProductsCasted != null))
                {
                    this._parent.EnergyProducts.Add(energyProductsCasted);
                }
            }