Exemplo n.º 1
0
        static void Main(string[] args)
        {
            IBeverage b = new Coffe();

            b = new Milk(b);
            b = new Milk(b);

            b = new Chocolate(b);

            var formater = new DefaultOutputFormatDecorator(b);

            formater.Print();

            //PrintBeverage(b);
        }
Exemplo n.º 2
0
        static void Main(string[] args)
        {
            int big    = (int)SizesOfPortion.big;
            int medium = (int)SizesOfPortion.medium;
            int small  = (int)SizesOfPortion.small;



            IBeverage beverage = new Coffe(size: medium);

            beverage = new Milk(beverage, size: big);
            beverage = new Chocolate(beverage, size: small);

            var formater = new DefaultOutputFormatDecorator(beverage);

            formater.Print();
            Console.ReadLine();
        }