예제 #1
0
파일: Program.cs 프로젝트: hisatt/Interface
        static void Main(string[] args)
        {
            Tampilkan tampil = new Tampilkan();
            Mencetak  cetak  = new Mencetak();

            IPrinterWindows printer;


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

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

            if (nomorPrinter == 1)
            {
                printer = new Epson();
            }
            else if (nomorPrinter == 2)
            {
                printer = new Canon();
            }
            else
            {
                printer = new LaserJet();
            }

            printer.Show(tampil);
            printer.Print(cetak);

            Console.ReadKey();
        }
예제 #2
0
파일: Canon.cs 프로젝트: hisatt/Interface
 public void Show(Tampilkan tampil)
 {
     Console.WriteLine("Canon display dimension : 9.5*12 ");
 }
예제 #3
0
 public void Show(Tampilkan tampil)
 {
     Console.WriteLine("Epson display dimension : 10*11 ");
 }
예제 #4
0
 public void Show(Tampilkan tampil)
 {
     Console.WriteLine("LaserJet display dimension : 12*12 ");
 }