示例#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;
 }