Esempio n. 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)
            {
                IPowerRating powerRatingsCasted = item.As <IPowerRating>();

                if ((powerRatingsCasted != null))
                {
                    this._parent.PowerRatings.Add(powerRatingsCasted);
                }
                ITransformerObservation transformerObservationsCasted = item.As <ITransformerObservation>();

                if ((transformerObservationsCasted != null))
                {
                    this._parent.TransformerObservations.Add(transformerObservationsCasted);
                }
                if ((this._parent.TransformerAssetModel == null))
                {
                    ITransformerAssetModel transformerAssetModelCasted = item.As <ITransformerAssetModel>();
                    if ((transformerAssetModelCasted != null))
                    {
                        this._parent.TransformerAssetModel = transformerAssetModelCasted;
                        return;
                    }
                }
                if ((this._parent.TransformerInfo == null))
                {
                    ITransformerInfo transformerInfoCasted = item.As <ITransformerInfo>();
                    if ((transformerInfoCasted != null))
                    {
                        this._parent.TransformerInfo = transformerInfoCasted;
                        return;
                    }
                }
            }
Esempio n. 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)
            {
                IPowerRating powerRatingItem = item.As <IPowerRating>();

                if (((powerRatingItem != null) &&
                     this._parent.PowerRatings.Remove(powerRatingItem)))
                {
                    return(true);
                }
                ITransformerObservation transformerObservationItem = item.As <ITransformerObservation>();

                if (((transformerObservationItem != null) &&
                     this._parent.TransformerObservations.Remove(transformerObservationItem)))
                {
                    return(true);
                }
                if ((this._parent.TransformerAssetModel == item))
                {
                    this._parent.TransformerAssetModel = null;
                    return(true);
                }
                if ((this._parent.TransformerInfo == item))
                {
                    this._parent.TransformerInfo = null;
                    return(true);
                }
                return(false);
            }
Esempio n. 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)
            {
                IMeasurementValue measurementValueItem = item.As <IMeasurementValue>();

                if (((measurementValueItem != null) &&
                     this._parent.MeasurementValues.Remove(measurementValueItem)))
                {
                    return(true);
                }
                ITransformerObservation transformerObservationItem = item.As <ITransformerObservation>();

                if (((transformerObservationItem != null) &&
                     this._parent.TransformerObservations.Remove(transformerObservationItem)))
                {
                    return(true);
                }
                IUserAttribute userAttributeItem = item.As <IUserAttribute>();

                if (((userAttributeItem != null) &&
                     this._parent.Properties.Remove(userAttributeItem)))
                {
                    return(true);
                }
                if ((this._parent.Procedure == item))
                {
                    this._parent.Procedure = null;
                    return(true);
                }
                return(false);
            }
Esempio n. 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)
            {
                IMeasurementValue measurementValuesCasted = item.As <IMeasurementValue>();

                if ((measurementValuesCasted != null))
                {
                    this._parent.MeasurementValues.Add(measurementValuesCasted);
                }
                ITransformerObservation transformerObservationsCasted = item.As <ITransformerObservation>();

                if ((transformerObservationsCasted != null))
                {
                    this._parent.TransformerObservations.Add(transformerObservationsCasted);
                }
                IUserAttribute propertiesCasted = item.As <IUserAttribute>();

                if ((propertiesCasted != null))
                {
                    this._parent.Properties.Add(propertiesCasted);
                }
                if ((this._parent.Procedure == null))
                {
                    IProcedure procedureCasted = item.As <IProcedure>();
                    if ((procedureCasted != null))
                    {
                        this._parent.Procedure = procedureCasted;
                        return;
                    }
                }
            }
Esempio n. 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)
            {
                if ((this._parent.TransformerBank == item))
                {
                    this._parent.TransformerBank = null;
                    return(true);
                }
                ITransformerObservation transformerObservationItem = item.As <ITransformerObservation>();

                if (((transformerObservationItem != null) &&
                     this._parent.TransformerObservations.Remove(transformerObservationItem)))
                {
                    return(true);
                }
                if ((this._parent.TransformerInfo == item))
                {
                    this._parent.TransformerInfo = null;
                    return(true);
                }
                IServiceDeliveryPoint serviceDeliveryPointItem = item.As <IServiceDeliveryPoint>();

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

                if (((distributionTransformerWindingItem != null) &&
                     this._parent.Windings.Remove(distributionTransformerWindingItem)))
                {
                    return(true);
                }
                return(false);
            }
Esempio n. 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.BushingInfo == null))
     {
         IBushingInfo bushingInfoCasted = item.As <IBushingInfo>();
         if ((bushingInfoCasted != null))
         {
             this._parent.BushingInfo = bushingInfoCasted;
             return;
         }
     }
     if ((this._parent.Status == null))
     {
         IStatus statusCasted = item.As <IStatus>();
         if ((statusCasted != null))
         {
             this._parent.Status = statusCasted;
             return;
         }
     }
     if ((this._parent.TransformerObservation == null))
     {
         ITransformerObservation transformerObservationCasted = item.As <ITransformerObservation>();
         if ((transformerObservationCasted != null))
         {
             this._parent.TransformerObservation = transformerObservationCasted;
             return;
         }
     }
 }
Esempio n. 7
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.TransformerBank == null))
                {
                    ITransformerBank transformerBankCasted = item.As <ITransformerBank>();
                    if ((transformerBankCasted != null))
                    {
                        this._parent.TransformerBank = transformerBankCasted;
                        return;
                    }
                }
                ITransformerObservation transformerObservationsCasted = item.As <ITransformerObservation>();

                if ((transformerObservationsCasted != null))
                {
                    this._parent.TransformerObservations.Add(transformerObservationsCasted);
                }
                if ((this._parent.TransformerInfo == null))
                {
                    ITransformerInfo transformerInfoCasted = item.As <ITransformerInfo>();
                    if ((transformerInfoCasted != null))
                    {
                        this._parent.TransformerInfo = transformerInfoCasted;
                        return;
                    }
                }
                IServiceDeliveryPoint serviceDeliveryPointsCasted = item.As <IServiceDeliveryPoint>();

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

                if ((windingsCasted != null))
                {
                    this._parent.Windings.Add(windingsCasted);
                }
            }