コード例 #1
0
 public void AddItemToBag(BagItem addItem)
 {
     if (addItem == null)
     {
         throw new ArgumentNullException("addItem");
     }
     mItemsInBag.Add(addItem);
 }
コード例 #2
0
 public void RemoveItemFromBag(BagItem removeItem)
 {
     if (removeItem == null)
     {
         throw new ArgumentNullException("removeItem");
     }
     if (!mItemsInBag.Remove(removeItem))
     {
         throw new InvalidOperationException("removeItem(" + removeItem.ItemName + ") Was not in the shopping bag.");
     }
 }
コード例 #3
0
 public BagItem(BagItem copy)
 {
     mItemName = copy.ItemName;
 }