internal void Add(int items)
        {
            if (items <= 0)
            {
                Console.WriteLine(String.Format("Value {0} will not be added.", items));
                return;
            }

            var q = new Quantity(items);
            TotalNoOfItemsAdded += items;

            if (QuantityChangedEvent != null)
            {
                QuantityChangedEvent(this, q);
            }

        }
Exemple #2
0
 private void HandleNewQuantity(QuantityHandler handler, Quantity quantity)
 {
     Console.WriteLine(String.Format("There are {0} added for a total of {1}, added at {2}.", quantity.Items, handler.TotalNoOfItemsAdded, quantity.LastChangedDate));
 }