Пример #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)
            {
                IRegisteredGenerator generatingUnitCasted = item.As <IRegisteredGenerator>();

                if ((generatingUnitCasted != null))
                {
                    this._parent.GeneratingUnit.Add(generatingUnitCasted);
                }
            }
Пример #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)
            {
                IRegisteredGenerator registeredGeneratorItem = item.As <IRegisteredGenerator>();

                if (((registeredGeneratorItem != null) &&
                     this._parent.GeneratingUnit.Remove(registeredGeneratorItem)))
                {
                    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)
            {
                IGeneratingBid generatingBidsCasted = item.As <IGeneratingBid>();

                if ((generatingBidsCasted != null))
                {
                    this._parent.GeneratingBids.Add(generatingBidsCasted);
                }
                IRegisteredGenerator registeredGeneratorsCasted = item.As <IRegisteredGenerator>();

                if ((registeredGeneratorsCasted != null))
                {
                    this._parent.RegisteredGenerators.Add(registeredGeneratorsCasted);
                }
            }