Example #1
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)
            {
                IDistributionTransformer distributionTransformerItem = item.As <IDistributionTransformer>();

                if (((distributionTransformerItem != null) &&
                     this._parent.Transformers.Remove(distributionTransformerItem)))
                {
                    return(true);
                }
                IWindingInfo windingInfoItem = item.As <IWindingInfo>();

                if (((windingInfoItem != null) &&
                     this._parent.WindingInfos.Remove(windingInfoItem)))
                {
                    return(true);
                }
                ITransformerAssetModel transformerAssetModelItem = item.As <ITransformerAssetModel>();

                if (((transformerAssetModelItem != null) &&
                     this._parent.TransformerAssetModels.Remove(transformerAssetModelItem)))
                {
                    return(true);
                }
                ITransformerAsset transformerAssetItem = item.As <ITransformerAsset>();

                if (((transformerAssetItem != null) &&
                     this._parent.TransformerAssets.Remove(transformerAssetItem)))
                {
                    return(true);
                }
                return(false);
            }
Example #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)
            {
                IDistributionTransformer transformersCasted = item.As <IDistributionTransformer>();

                if ((transformersCasted != null))
                {
                    this._parent.Transformers.Add(transformersCasted);
                }
                IWindingInfo windingInfosCasted = item.As <IWindingInfo>();

                if ((windingInfosCasted != null))
                {
                    this._parent.WindingInfos.Add(windingInfosCasted);
                }
                ITransformerAssetModel transformerAssetModelsCasted = item.As <ITransformerAssetModel>();

                if ((transformerAssetModelsCasted != null))
                {
                    this._parent.TransformerAssetModels.Add(transformerAssetModelsCasted);
                }
                ITransformerAsset transformerAssetsCasted = item.As <ITransformerAsset>();

                if ((transformerAssetsCasted != null))
                {
                    this._parent.TransformerAssets.Add(transformerAssetsCasted);
                }
            }
Example #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.FromWinding == null))
     {
         IWindingInfo fromWindingCasted = item.As <IWindingInfo>();
         if ((fromWindingCasted != null))
         {
             this._parent.FromWinding = fromWindingCasted;
             return;
         }
     }
 }
Example #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)
            {
                IOpenCircuitTest openCircuitTestsCasted = item.As <IOpenCircuitTest>();

                if ((openCircuitTestsCasted != null))
                {
                    this._parent.OpenCircuitTests.Add(openCircuitTestsCasted);
                }
                if ((this._parent.ToWinding == null))
                {
                    IWindingInfo toWindingCasted = item.As <IWindingInfo>();
                    if ((toWindingCasted != null))
                    {
                        this._parent.ToWinding = toWindingCasted;
                        return;
                    }
                }
                IShortCircuitTest shortCircuitTestsCasted = item.As <IShortCircuitTest>();

                if ((shortCircuitTestsCasted != null))
                {
                    this._parent.ShortCircuitTests.Add(shortCircuitTestsCasted);
                }
            }