/// <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.EndDeviceAsset == item)) { this._parent.EndDeviceAsset = null; return(true); } IReadingQuality readingQualityItem = item.As <IReadingQuality>(); if (((readingQualityItem != null) && this._parent.ReadingQualities.Remove(readingQualityItem))) { return(true); } IMeterReading meterReadingItem = item.As <IMeterReading>(); if (((meterReadingItem != null) && this._parent.MeterReadings.Remove(meterReadingItem))) { return(true); } if ((this._parent.ReadingType == item)) { this._parent.ReadingType = 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.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; } } }
/// <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.MeterAssetModel == item)) { this._parent.MeterAssetModel = null; return(true); } ITransaction transactionItem = item.As <ITransaction>(); if (((transactionItem != null) && this._parent.VendingTransactions.Remove(transactionItem))) { return(true); } IMeterServiceWork meterServiceWorkItem = item.As <IMeterServiceWork>(); if (((meterServiceWorkItem != null) && this._parent.MeterServiceWorks.Remove(meterServiceWorkItem))) { return(true); } IMeterReading meterReadingItem = item.As <IMeterReading>(); if (((meterReadingItem != null) && this._parent.MeterReadings.Remove(meterReadingItem))) { return(true); } if (((meterServiceWorkItem != null) && this._parent.MeterReplacementWorks.Remove(meterServiceWorkItem))) { 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.MeterReading == null)) { IMeterReading meterReadingCasted = item.As <IMeterReading>(); if ((meterReadingCasted != null)) { this._parent.MeterReading = meterReadingCasted; return; } } if ((this._parent.DeviceFunction == null)) { IDeviceFunction deviceFunctionCasted = item.As <IDeviceFunction>(); if ((deviceFunctionCasted != null)) { this._parent.DeviceFunction = deviceFunctionCasted; return; } } }
/// <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.MeterAssetModel == null)) { IMeterAssetModel meterAssetModelCasted = item.As <IMeterAssetModel>(); if ((meterAssetModelCasted != null)) { this._parent.MeterAssetModel = meterAssetModelCasted; return; } } ITransaction vendingTransactionsCasted = item.As <ITransaction>(); if ((vendingTransactionsCasted != null)) { this._parent.VendingTransactions.Add(vendingTransactionsCasted); } IMeterServiceWork meterServiceWorksCasted = item.As <IMeterServiceWork>(); if ((meterServiceWorksCasted != null)) { this._parent.MeterServiceWorks.Add(meterServiceWorksCasted); } IMeterReading meterReadingsCasted = item.As <IMeterReading>(); if ((meterReadingsCasted != null)) { this._parent.MeterReadings.Add(meterReadingsCasted); } IMeterServiceWork meterReplacementWorksCasted = item.As <IMeterServiceWork>(); if ((meterReplacementWorksCasted != null)) { this._parent.MeterReplacementWorks.Add(meterReplacementWorksCasted); } }
/// <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.MeterReading == null)) { IMeterReading meterReadingCasted = item.As <IMeterReading>(); if ((meterReadingCasted != null)) { this._parent.MeterReading = meterReadingCasted; return; } } IIntervalReading intervalReadingsCasted = item.As <IIntervalReading>(); if ((intervalReadingsCasted != null)) { this._parent.IntervalReadings.Add(intervalReadingsCasted); } if ((this._parent.Pending == null)) { IPending pendingCasted = item.As <IPending>(); if ((pendingCasted != null)) { this._parent.Pending = pendingCasted; return; } } if ((this._parent.ReadingType == null)) { IReadingType readingTypeCasted = item.As <IReadingType>(); if ((readingTypeCasted != null)) { this._parent.ReadingType = readingTypeCasted; return; } } }