static void Main(string[] args)
        {
            IPrinter newPrintClass    = new NewPrintClass();
            var      legacyPrintClass = new LegacyPrintClass();
            IPrinter adapter          = new Adapter(legacyPrintClass);

            List <string> strings = new List <string>()
            {
                "Hello", "World", "From"
            };

            newPrintClass.PrintData(strings);
            adapter.PrintData(strings);

            Console.Read();
        }
Example #2
0
 public Adapter(LegacyPrintClass legacy)
 {
     this.legacy = legacy;
 }