Exemple #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)
            {
                IServiceDeliveryPoint serviceDeliveryPointItem = item.As <IServiceDeliveryPoint>();

                if (((serviceDeliveryPointItem != null) &&
                     this._parent.ServiceDeliveryPoints.Remove(serviceDeliveryPointItem)))
                {
                    return(true);
                }
                IErpPerson erpPersonItem = item.As <IErpPerson>();

                if (((erpPersonItem != null) &&
                     this._parent.ErpPersons.Remove(erpPersonItem)))
                {
                    return(true);
                }
                ICustomerAgreement customerAgreementItem = item.As <ICustomerAgreement>();

                if (((customerAgreementItem != null) &&
                     this._parent.CustomerAgreements.Remove(customerAgreementItem)))
                {
                    return(true);
                }
                IEndDeviceAsset endDeviceAssetItem = item.As <IEndDeviceAsset>();

                if (((endDeviceAssetItem != null) &&
                     this._parent.EndDeviceAssets.Remove(endDeviceAssetItem)))
                {
                    return(true);
                }
                return(false);
            }
Exemple #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)
            {
                if ((this._parent.EndDeviceAsset == null))
                {
                    IEndDeviceAsset endDeviceAssetCasted = item.As <IEndDeviceAsset>();
                    if ((endDeviceAssetCasted != null))
                    {
                        this._parent.EndDeviceAsset = endDeviceAssetCasted;
                        return;
                    }
                }
                IReadingQuality readingQualitiesCasted = item.As <IReadingQuality>();

                if ((readingQualitiesCasted != null))
                {
                    this._parent.ReadingQualities.Add(readingQualitiesCasted);
                }
                IMeterReading meterReadingsCasted = item.As <IMeterReading>();

                if ((meterReadingsCasted != null))
                {
                    this._parent.MeterReadings.Add(meterReadingsCasted);
                }
                if ((this._parent.ReadingType == null))
                {
                    IReadingType readingTypeCasted = item.As <IReadingType>();
                    if ((readingTypeCasted != null))
                    {
                        this._parent.ReadingType = readingTypeCasted;
                        return;
                    }
                }
            }
Exemple #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)
            {
                IServiceDeliveryPoint serviceDeliveryPointsCasted = item.As <IServiceDeliveryPoint>();

                if ((serviceDeliveryPointsCasted != null))
                {
                    this._parent.ServiceDeliveryPoints.Add(serviceDeliveryPointsCasted);
                }
                IErpPerson erpPersonsCasted = item.As <IErpPerson>();

                if ((erpPersonsCasted != null))
                {
                    this._parent.ErpPersons.Add(erpPersonsCasted);
                }
                ICustomerAgreement customerAgreementsCasted = item.As <ICustomerAgreement>();

                if ((customerAgreementsCasted != null))
                {
                    this._parent.CustomerAgreements.Add(customerAgreementsCasted);
                }
                IEndDeviceAsset endDeviceAssetsCasted = item.As <IEndDeviceAsset>();

                if ((endDeviceAssetsCasted != null))
                {
                    this._parent.EndDeviceAssets.Add(endDeviceAssetsCasted);
                }
            }
Exemple #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)
            {
                if ((this._parent.ComEquipmentAsset == null))
                {
                    IComEquipmentInfo comEquipmentAssetCasted = item.As <IComEquipmentInfo>();
                    if ((comEquipmentAssetCasted != null))
                    {
                        this._parent.ComEquipmentAsset = comEquipmentAssetCasted;
                        return;
                    }
                }
                if ((this._parent.EndDeviceAsset == null))
                {
                    IEndDeviceAsset endDeviceAssetCasted = item.As <IEndDeviceAsset>();
                    if ((endDeviceAssetCasted != null))
                    {
                        this._parent.EndDeviceAsset = endDeviceAssetCasted;
                        return;
                    }
                }
                IEndDeviceEvent endDeviceEventsCasted = item.As <IEndDeviceEvent>();

                if ((endDeviceEventsCasted != null))
                {
                    this._parent.EndDeviceEvents.Add(endDeviceEventsCasted);
                }
                IRegister registersCasted = item.As <IRegister>();

                if ((registersCasted != null))
                {
                    this._parent.Registers.Add(registersCasted);
                }
            }
Exemple #5
0
            /// <summary>
            /// Adds the given element to the collection
            /// </summary>
            /// <param name="item">The item to add</param>
            public override void Add(IModelElement item)
            {
                IEndDeviceAsset endDeviceAssetsCasted = item.As <IEndDeviceAsset>();

                if ((endDeviceAssetsCasted != null))
                {
                    this._parent.EndDeviceAssets.Add(endDeviceAssetsCasted);
                }
            }
Exemple #6
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)
            {
                IEndDeviceAsset endDeviceAssetItem = item.As <IEndDeviceAsset>();

                if (((endDeviceAssetItem != null) &&
                     this._parent.EndDeviceAssets.Remove(endDeviceAssetItem)))
                {
                    return(true);
                }
                return(false);
            }
Exemple #7
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)
            {
                if ((this._parent.DemandResponseProgram == item))
                {
                    this._parent.DemandResponseProgram = null;
                    return(true);
                }
                IEndDeviceAsset endDeviceAssetItem = item.As <IEndDeviceAsset>();

                if (((endDeviceAssetItem != null) &&
                     this._parent.EndDeviceAssets.Remove(endDeviceAssetItem)))
                {
                    return(true);
                }
                IEndDeviceControl endDeviceControlItem = item.As <IEndDeviceControl>();

                if (((endDeviceControlItem != null) &&
                     this._parent.EndDeviceControls.Remove(endDeviceControlItem)))
                {
                    return(true);
                }
                return(false);
            }
Exemple #8
0
            /// <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.DemandResponseProgram == null))
                {
                    IDemandResponseProgram demandResponseProgramCasted = item.As <IDemandResponseProgram>();
                    if ((demandResponseProgramCasted != null))
                    {
                        this._parent.DemandResponseProgram = demandResponseProgramCasted;
                        return;
                    }
                }
                IEndDeviceAsset endDeviceAssetsCasted = item.As <IEndDeviceAsset>();

                if ((endDeviceAssetsCasted != null))
                {
                    this._parent.EndDeviceAssets.Add(endDeviceAssetsCasted);
                }
                IEndDeviceControl endDeviceControlsCasted = item.As <IEndDeviceControl>();

                if ((endDeviceControlsCasted != null))
                {
                    this._parent.EndDeviceControls.Add(endDeviceControlsCasted);
                }
            }