Ejemplo 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)
 {
     if ((this._parent.RatioVariationCurve == null))
     {
         IRatioVariationCurve ratioVariationCurveCasted = item.As <IRatioVariationCurve>();
         if ((ratioVariationCurveCasted != null))
         {
             this._parent.RatioVariationCurve = ratioVariationCurveCasted;
             return;
         }
     }
     if ((this._parent.TransformerWinding == null))
     {
         ITransformerWinding transformerWindingCasted = item.As <ITransformerWinding>();
         if ((transformerWindingCasted != null))
         {
             this._parent.TransformerWinding = transformerWindingCasted;
             return;
         }
     }
     if ((this._parent.Winding == null))
     {
         IDistributionTransformerWinding windingCasted = item.As <IDistributionTransformerWinding>();
         if ((windingCasted != null))
         {
             this._parent.Winding = windingCasted;
             return;
         }
     }
 }
Ejemplo 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)
            {
                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);
            }
Ejemplo n.º 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)
            {
                IDistributionTransformerWinding windingsCasted = item.As <IDistributionTransformerWinding>();

                if ((windingsCasted != null))
                {
                    this._parent.Windings.Add(windingsCasted);
                }
            }
Ejemplo n.º 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)
            {
                IDistributionTransformerWinding distributionTransformerWindingItem = item.As <IDistributionTransformerWinding>();

                if (((distributionTransformerWindingItem != null) &&
                     this._parent.Windings.Remove(distributionTransformerWindingItem)))
                {
                    return(true);
                }
                return(false);
            }
Ejemplo n.º 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)
            {
                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);
                }
            }