Exemplo n.º 1
0
        static void Main(string[] args)
        {
            ModifyPrice modifier = new ModifyPrice();
            Product     prod     = new Product("Phone", 500);

            Execute(prod, modifier, new ProductCommand(prod, PriceAction.Increase, 100));
            Execute(prod, modifier, new ProductCommand(prod, PriceAction.Decrease, 12));
        }
Exemplo n.º 2
0
 private static void Execute(Product product, ModifyPrice modifier, ICommand cmd)
 {
     modifier.SetCommand(cmd);
     modifier.Invoke();
 }