示例#1
0
            /// <summary>
            /// Adds the given element to the collection
            /// </summary>
            /// <param name="item">The item to add</param>
            public override void Add(IModelElement item)
            {
                IEndDeviceEvent endDeviceEventsCasted = item.As <IEndDeviceEvent>();

                if ((endDeviceEventsCasted != null))
                {
                    this._parent.EndDeviceEvents.Add(endDeviceEventsCasted);
                }
                if ((this._parent.ServiceDeliveryPoint == null))
                {
                    IServiceDeliveryPoint serviceDeliveryPointCasted = item.As <IServiceDeliveryPoint>();
                    if ((serviceDeliveryPointCasted != null))
                    {
                        this._parent.ServiceDeliveryPoint = serviceDeliveryPointCasted;
                        return;
                    }
                }
                if ((this._parent.CustomerAgreement == null))
                {
                    ICustomerAgreement customerAgreementCasted = item.As <ICustomerAgreement>();
                    if ((customerAgreementCasted != null))
                    {
                        this._parent.CustomerAgreement = customerAgreementCasted;
                        return;
                    }
                }
                if ((this._parent.MeterAsset == null))
                {
                    IMeterAsset meterAssetCasted = item.As <IMeterAsset>();
                    if ((meterAssetCasted != null))
                    {
                        this._parent.MeterAsset = meterAssetCasted;
                        return;
                    }
                }
                if ((this._parent.ValuesInterval == null))
                {
                    IDateTimeInterval valuesIntervalCasted = item.As <IDateTimeInterval>();
                    if ((valuesIntervalCasted != null))
                    {
                        this._parent.ValuesInterval = valuesIntervalCasted;
                        return;
                    }
                }
                IReading readingsCasted = item.As <IReading>();

                if ((readingsCasted != null))
                {
                    this._parent.Readings.Add(readingsCasted);
                }
                IIntervalBlock intervalBlocksCasted = item.As <IIntervalBlock>();

                if ((intervalBlocksCasted != null))
                {
                    this._parent.IntervalBlocks.Add(intervalBlocksCasted);
                }
            }
示例#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)
            {
                IReadingQuality readingQualitiesCasted = item.As <IReadingQuality>();

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

                if ((intervalBlocksCasted != null))
                {
                    this._parent.IntervalBlocks.Add(intervalBlocksCasted);
                }
            }
示例#3
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.ReadingType == item))
                {
                    this._parent.ReadingType = null;
                    return(true);
                }
                IIntervalBlock intervalBlockItem = item.As <IIntervalBlock>();

                if (((intervalBlockItem != null) &&
                     this._parent.IntervalBlocks.Remove(intervalBlockItem)))
                {
                    return(true);
                }
                return(false);
            }
示例#4
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)
            {
                IEndDeviceEvent endDeviceEventItem = item.As <IEndDeviceEvent>();

                if (((endDeviceEventItem != null) &&
                     this._parent.EndDeviceEvents.Remove(endDeviceEventItem)))
                {
                    return(true);
                }
                if ((this._parent.ServiceDeliveryPoint == item))
                {
                    this._parent.ServiceDeliveryPoint = null;
                    return(true);
                }
                if ((this._parent.CustomerAgreement == item))
                {
                    this._parent.CustomerAgreement = null;
                    return(true);
                }
                if ((this._parent.MeterAsset == item))
                {
                    this._parent.MeterAsset = null;
                    return(true);
                }
                if ((this._parent.ValuesInterval == item))
                {
                    this._parent.ValuesInterval = null;
                    return(true);
                }
                IReading readingItem = item.As <IReading>();

                if (((readingItem != null) &&
                     this._parent.Readings.Remove(readingItem)))
                {
                    return(true);
                }
                IIntervalBlock intervalBlockItem = item.As <IIntervalBlock>();

                if (((intervalBlockItem != null) &&
                     this._parent.IntervalBlocks.Remove(intervalBlockItem)))
                {
                    return(true);
                }
                return(false);
            }
示例#5
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)
            {
                IReadingQuality readingQualityItem = item.As <IReadingQuality>();

                if (((readingQualityItem != null) &&
                     this._parent.ReadingQualities.Remove(readingQualityItem)))
                {
                    return(true);
                }
                IIntervalBlock intervalBlockItem = item.As <IIntervalBlock>();

                if (((intervalBlockItem != null) &&
                     this._parent.IntervalBlocks.Remove(intervalBlockItem)))
                {
                    return(true);
                }
                return(false);
            }
示例#6
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.ReadingType == null))
                {
                    IReadingType readingTypeCasted = item.As <IReadingType>();
                    if ((readingTypeCasted != null))
                    {
                        this._parent.ReadingType = readingTypeCasted;
                        return;
                    }
                }
                IIntervalBlock intervalBlocksCasted = item.As <IIntervalBlock>();

                if ((intervalBlocksCasted != null))
                {
                    this._parent.IntervalBlocks.Add(intervalBlocksCasted);
                }
            }