public void AddItemToBag(BagItem addItem) { if (addItem == null) { throw new ArgumentNullException("addItem"); } mItemsInBag.Add(addItem); }
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."); } }
public BagItem(BagItem copy) { mItemName = copy.ItemName; }