コード例 #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)
            {
                IDeviceFunction deviceFunctionsCasted = item.As <IDeviceFunction>();

                if ((deviceFunctionsCasted != null))
                {
                    this._parent.DeviceFunctions.Add(deviceFunctionsCasted);
                }
            }
コード例 #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)
            {
                IDeviceFunction deviceFunctionItem = item.As <IDeviceFunction>();

                if (((deviceFunctionItem != null) &&
                     this._parent.DeviceFunctions.Remove(deviceFunctionItem)))
                {
                    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)
 {
     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;
         }
     }
 }
コード例 #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.ReadingType == null))
     {
         IReadingType readingTypeCasted = item.As <IReadingType>();
         if ((readingTypeCasted != null))
         {
             this._parent.ReadingType = readingTypeCasted;
             return;
         }
     }
     if ((this._parent.DeviceFunction == null))
     {
         IDeviceFunction deviceFunctionCasted = item.As <IDeviceFunction>();
         if ((deviceFunctionCasted != null))
         {
             this._parent.DeviceFunction = deviceFunctionCasted;
             return;
         }
     }
 }