Beispiel #1
0
        static void Main(string[] args)
        {
            Printer p = new Printer()
            {
                SerialNumber = "1080"
            };

            p.ProcessDoc("My letter");
            p.Print("My printer");

            Scanner s = new Scanner()
            {
                SerialNumber = "2003"
            };

            s.ProcessDoc("My email");
            Console.WriteLine(s.Scan());

            ComboDevice c = new ComboDevice()
            {
                SerialNumber = "2019"
            };

            c.ProcessDoc("My test");
            c.Print("My combo device printer");
            Console.WriteLine(c.Scan());
        }
        static void Main(string[] args)
        {
            Printer p = new Printer()
            {
                SerialNumber = 1080
            };

            p.ProcessDoc("My letter");
            p.Print("My Letter");

            Scanner s = new Scanner()
            {
                SerialNumber = 2003
            };

            s.ProcessDoc("My Email");
            Console.WriteLine(s.Scan());

            ComboDevice c = new ComboDevice()
            {
                SerialNumber = 3921
            };

            c.ProcessDoc("My dissertation");
            c.Print("My dissertation");
            Console.WriteLine(c.Scan());


            Console.ReadLine();
        }
Beispiel #3
0
        static void Main(string[] args)
        {
            // Exemplo:
            // classe Device tem o metodo de processDoc
            // as classes Scanner e Printer herdam de Device
            // a classe ComboDevice precisa ter o mesmo comportamento da Scanner e Print
            // não é possível herdar das duas classes, pois ocasiona o problema do diamante
            // porque as classes já herdam de Device, então o método processDoc ira repetir

            Printer printer = new Printer()
            {
                SerialNumber = 1002
            };

            printer.ProcessDoc("My letter");
            printer.Print("My letter");

            Scanner scanner = new Scanner()
            {
                SerialNumber = 1003
            };

            scanner.ProcessDoc("My email");
            Console.WriteLine(scanner.Scan());

            ComboDevice comboDevice = new ComboDevice()
            {
                SerialNumber = 1004
            };

            comboDevice.ProcessDoc("My dissertation");
            comboDevice.Print("My dissertation");
            Console.WriteLine(comboDevice.Scan());
        }
Beispiel #4
0
        static void Main(string[] args)
        {
            Printer printer = new Printer()
            {
                SerialNumber = 1080
            };

            printer.ProcessDoc("My letter");
            printer.Print("My letter");

            Scanner scanner = new Scanner()
            {
                SerialNumber = 2020
            };

            scanner.ProcessDoc("My email");
            Console.WriteLine(scanner.Scan());

            ComboDevice c = new ComboDevice()
            {
                SerialNumber = 3921
            };

            c.ProcessDoc("My dissertation");
            c.Print("My dissertation");
            Console.WriteLine(c.Scan());
        }
Beispiel #5
0
        static void Main(string[] args)
        {
            Printer p = new Printer()
            {
                SerialNumber = 1080
            };

            p.ProcessDoc("My letter");
            p.Print("My letter");

            Scanner s = new Scanner()
            {
                SerialNumber = 2003
            };

            s.ProcessDoc("My email");
            Console.WriteLine(s.Scan());

            //Neste caso o combo device herda os métodos Scan e Print do Scanner e Printer respectivamente, e herda o ProcessDoc de Device.
            //Se ComboDevice herdasse da classe Scanner e Printer por eles terem seus respectivos ProcessDocs, ocorreria um erro.
            //Por esta razão é necessário criar duas interfaces separadamente para criar um contrato que os métodos Scan e Print sejam devidamente criados


            ComboDevice c = new ComboDevice()
            {
                SerialNumber = 3921
            };

            c.ProcessDoc("My dissertation");
            c.Print("My dissertation");
            Console.WriteLine(c.Scan());
        }
        static void Main(string[] args)
        {
            Printer p = new Printer()
            {
                SerialNumber = 2457
            };

            p.ProcessDoc("DjPrinter");
            p.Print("Printer Djr");

            Scanner s = new Scanner()
            {
                SerialNumber = 5781
            };

            s.ProcessDoc("DjScanner");
            Console.WriteLine(s.Scan());

            ComboDevice cd = new ComboDevice()
            {
                SerialNumber = 8641
            };

            cd.ProcessDoc("My work DJR");
            cd.Print("My work DJR");
            Console.WriteLine(cd.Scan());
        }
Beispiel #7
0
        static void Main(string[] args)
        {
            Printer printer = new Printer()
            {
                SerialNumber = 1080
            };

            printer.ProcessDoc("My letter");

            printer.Print("Print: My letter");

            Scanner scanner = new Scanner()
            {
                SerialNumber = 2003
            };

            scanner.ProcessDoc("Scan: My Email");

            Console.WriteLine(scanner.Scan());


            ComboDevice comboDevice = new ComboDevice()
            {
                SerialNumber = 3921
            };

            comboDevice.Print("Combo device Print");

            Console.WriteLine(comboDevice.Scan());

            comboDevice.ProcessDoc("ProcessDoc ComboDevice");

            Console.ReadKey();
        }
        static void Main(string[] args)
        {
            Scanner s = new Scanner();

            s.SerialNumber = "2020";
            s.ProcessDoc("processando");
            Console.WriteLine(s.Scan());

            Console.WriteLine();

            Printer p = new Printer();

            p.SerialNumber = "3030";
            p.ProcessDoc("processando");
            p.Print("doc");

            Console.WriteLine();

            ComboDevice cd = new ComboDevice();

            cd.SerialNumber = "4040";
            cd.ProcessDoc("processando");
            Console.WriteLine(cd.Scan());
            cd.Print("doc");
        }
Beispiel #9
0
        static void x()
        {
            Printer p = new Printer()
            {
                SerialNumber = 540
            };

            p.ProcessDoc("My letter");
            p.Print("My letter");

            Scanner s = new Scanner()
            {
                SerialNumber = 0800
            };

            s.ProcessDoc("My Email");
            Console.WriteLine(s.Scan());

            ComboDevice c = new ComboDevice()
            {
                SerialNumber = 795
            };

            c.ProcessDoc("My dissertation");
            c.Print("My dissertation");
            Console.WriteLine(c.Scan());
        }
Beispiel #10
0
        static void Main(string[] args)
        {
            Printer printer = new Printer()
            {
                SerialNumber = 1080
            };

            printer.ProcessDoc("My letter");
            printer.Print("My letter");

            Scanner scanner = new Scanner {
                SerialNumber = 2112
            };

            scanner.ProcessDoc("My email");
            System.Console.WriteLine(scanner.Scan());

            ComboDevice combo = new ComboDevice()
            {
                SerialNumber = 2124
            };

            combo.ProcessDoc("My dissertation");
            combo.Print("My dissertation");
            Console.WriteLine(combo.Scan());
        }
Beispiel #11
0
        static void Main(string[] args)
        {
            Printer printer = new Printer()
            {
                SerialNumber = 1080
            };

            printer.ProcessDoc("teste 1");
            printer.Print("teste 1");



            Scanner scanner = new Scanner()
            {
                SerialNumber = 2080
            };

            scanner.ProcessDoc("teste 2 ");
            Console.WriteLine(scanner.Scan());


            ComboDevice cbDevice = new ComboDevice()
            {
                SerialNumber = 3080
            };

            cbDevice.ProcessDoc("muito loko");
            cbDevice.Print("lokura");
            Console.WriteLine(cbDevice.Scan());
        }
Beispiel #12
0
        static void Main(string[] args)
        {
            Printer p = new Printer()
            {
                SerialNumber = 1080
            };

            p.ProcessDoc("Minha carta");
            p.Print("Minha carta");

            Scanner s = new Scanner()
            {
                SerialNumber = 2003
            };

            s.ProcessDoc("Meu email");
            Console.WriteLine(s.Scan());

            ComboDevice c = new ComboDevice()
            {
                SerialNumber = 3921
            };

            c.ProcessDoc("Meu resumo");
            c.Print("Meu resumo");

            Console.ReadLine();
        }
Beispiel #13
0
        static void Main(string[] args)
        {
            Printer p = new Printer(1080);

            p.ProcessDoc("My letter");
            p.Print("My letter");

            Scanner s = new Scanner(2003);

            s.ProcessDoc("My E-mail");
            Console.WriteLine(s.Scan());

            ComboDevice cv = new ComboDevice(3921);

            cv.ProcessDoc("My dissertation");
            cv.Print("My dissertation");
            Console.WriteLine(cv.Scan());
        }
Beispiel #14
0
        private static void Diamond()
        {
            //IPrinter p = new IPrinter() { SerialNumber = 1080 };
            //p.ProcessDoc("My letter");
            //p.Print("My letter");

            //Scanner s = new Scanner() { SerialNumber = 2003 };
            //p.ProcessDoc("My email");
            //Console.WriteLine(s.Scan());

            ComboDevice c = new ComboDevice()
            {
                SerialNumber = 2434
            };

            c.ProcessDoc("curriculo");
            c.Print("My letter");
            Console.WriteLine(c.Scan());
        }
Beispiel #15
0
        static void Main(string[] args)
        {
            Printer p1 = new Printer()
            {
                SerialNumber = "1080"
            };

            p1.ProcessDoc("DOC 1");
            p1.Print("My letter");

            Scanner s1 = new Scanner()
            {
                SerialNumber = "3028"
            };

            s1.ProcessDoc("TESTE3");
            Console.WriteLine(s1.Scan());

            ComboDevice cb = new ComboDevice();

            cb.ProcessDoc("CB TESTE");
            cb.Print("cb print");
            Console.WriteLine(cb.Scan());
        }