Exemplo n.º 1
0
        static void Main()
        {
            var simpleDuck = new SimpleDuck();
            var simpleTurkey = new SimpleTurkey();

            var duckAdapter = new DuckAdapter(simpleDuck);
            var turkeyAdapter = new TurkeyAdapter(simpleTurkey);

            var duckFacade = new DuckAndTurkeyFacade(simpleDuck, simpleTurkey);

            Console.WriteLine("\nTurkey:");
            TestTurkey(simpleTurkey);

            Console.WriteLine("\nDuck:");
            TestDuck(simpleDuck);

            Console.WriteLine("\nTurkey w/ adapter:");
            TestDuck(turkeyAdapter);

            Console.WriteLine("\nDuck w/ adapter:");
            TestTurkey(duckAdapter);

            Console.WriteLine("\n");

            duckFacade.IsWorking();

            Console.ReadKey();
        }
Exemplo n.º 2
0
 public DuckAndTurkeyFacade(SimpleDuck duck, SimpleTurkey turkey)
 {
     _duck = duck;
     _turkey = turkey;
 }
Exemplo n.º 3
0
 public DuckAndTurkeyFacade(SimpleDuck duck, SimpleTurkey turkey)
 {
     _duck   = duck;
     _turkey = turkey;
 }