Beispiel #1
0
        static void Main(string[] args)
        {
            prints printer = new prints();

            printer.nama   = "Printer";
            printer.ukuran = "0*0";


            IPrinterWindows convert;

            Console.WriteLine("Pilih Printer: ");
            Console.WriteLine("1. Epson");
            Console.WriteLine("2. Canon");
            Console.WriteLine("3. LaserJet\n");

            Console.Write("Nomer Printer [1..3] : ");
            int nomorPrinter = Convert.ToInt32(Console.ReadLine());

            if (nomorPrinter == 1)
            {
                convert = new ConvertToEpson();
            }
            else if (nomorPrinter == 2)
            {
                convert = new ConvertToCanon();
            }
            else
            {
                convert = new ConvertToLaserjet();
            }

            convert.show(printer);
            convert.print(printer);

            Console.ReadKey();
        }
Beispiel #2
0
 public void print(prints printer)
 {
     printer.nama   = "LeserJet";
     printer.ukuran = "12*12";
     Console.WriteLine("{0} printer printing...", printer.nama);
 }
Beispiel #3
0
 public void show(prints printer)
 {
     printer.nama   = "LeserJet";
     printer.ukuran = "12*12";
     Console.WriteLine("{0} display dimension : {1}", printer.nama, printer.ukuran);
 }
Beispiel #4
0
 public void print(prints printer)
 {
     printer.nama   = "Canon";
     printer.ukuran = "9.5*12";
     Console.WriteLine("{0} printer printing...", printer.nama);
 }
Beispiel #5
0
 public void show(prints printer)
 {
     printer.nama   = "Canon";
     printer.ukuran = "9.5*12";
     Console.WriteLine("{0} display dimension : {1}", printer.nama, printer.ukuran);
 }
Beispiel #6
0
 public void print(prints printer)
 {
     printer.nama   = "Epson";
     printer.ukuran = "10*11";
     Console.WriteLine("{0} printer printing...", printer.nama);
 }
Beispiel #7
0
 public void show(prints printer)
 {
     printer.nama   = "Epson";
     printer.ukuran = "10*11";
     Console.WriteLine("{0} display dimension : {1}", printer.nama, printer.ukuran);
 }