Ejemplo n.º 1
0
        static void Main(string[] args)
        {
            var str = "string";
            var p1  = new Printer();

            p1.Print(str);
            p1 = new ColourPrinter();
            p1.Print(str, "Green");
            p1.Print(str);
            p1 = new PhotoPrinter();
            p1.Print(str);
        }
Ejemplo n.º 2
0
        static void Main(string[] args)
        {
            Photo photo = new Photo();

            ColorPrinter.Print("Some message", Color.Yellow);
            PhotoPrinter.Print(photo);

            PhotoPrinter photoPrinter = new PhotoPrinter();

            photoPrinter.Print("qwe");

            ColorPrinter colorPrinter = new ColorPrinter();

            colorPrinter.Print("123");

            Console.ReadLine();
        }