コード例 #1
0
        /// <summary>
        /// Adds a new item to the offer.
        /// </summary>
        /// <param name="item"><see cref="OfferItem"/> that should be added to the offer.</param>
        protected internal virtual void AddItem(OfferItem item)
        {
            if (item == null)
            {
                throw new ArgumentNullException("item");
            }
            if (item.Offer != null)
            {
                throw new ArgumentException("Item is already contained in an offer.");
            }

            item.Offer = this;
            _items.Add(item);
        }
コード例 #2
0
ファイル: Offer.cs プロジェクト: patkec/Sparrow
        /// <summary>
        /// Adds a new item to the offer.
        /// </summary>
        /// <param name="item"><see cref="OfferItem"/> that should be added to the offer.</param>
        protected internal virtual void AddItem(OfferItem item)
        {
            if (item == null)
                throw new ArgumentNullException("item");
            if (item.Offer != null)
                throw new ArgumentException("Item is already contained in an offer.");

            item.Offer = this;
            _items.Add(item);
        }