コード例 #1
0
ファイル: StartUp.cs プロジェクト: PetarTolev/CSharp-DB
        public static void Main()
        {
            var modifyPrice = new ModifyPrice();
            var product     = new Product("Phone", 500);

            Execute(product, modifyPrice, new ProductCommand(product, PriceAction.Increase, 100));

            Console.WriteLine(product);
        }
コード例 #2
0
 private static void Execute(Product product, ModifyPrice modifyPrice, ICommand command)
 {
     modifyPrice.SetCommand(command);
     modifyPrice.Invoke();
 }