/// <summary> /// Adds the given element to the collection /// </summary> /// <param name="item">The item to add</param> public override void Add(IModelElement item) { IProductBid productBidsCasted = item.As <IProductBid>(); if ((productBidsCasted != null)) { this._parent.ProductBids.Add(productBidsCasted); } if ((this._parent.BidClearing == null)) { IBidClearing bidClearingCasted = item.As <IBidClearing>(); if ((bidClearingCasted != null)) { this._parent.BidClearing = bidClearingCasted; return; } } if ((this._parent.Market == null)) { IMarket marketCasted = item.As <IMarket>(); if ((marketCasted != null)) { this._parent.Market = marketCasted; return; } } }
/// <summary> /// Adds the given element to the collection /// </summary> /// <param name="item">The item to add</param> public override void Add(IModelElement item) { IProductBid productBidsCasted = item.As <IProductBid>(); if ((productBidsCasted != null)) { this._parent.ProductBids.Add(productBidsCasted); } }
/// <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) { IProductBid productBidItem = item.As <IProductBid>(); if (((productBidItem != null) && this._parent.ProductBids.Remove(productBidItem))) { return(true); } return(false); }