static void Main(string[] args)
        {
            printable p = new  PrinterProxy("Alice", "Printer");

            Console.WriteLine("现在的名字是" + p.getPrinterName() + "。");
            p.setPrinterName("Bob");
            Console.WriteLine("现在的名字是" + p.getPrinterName() + "。");
            p.Print("Helle,world.");
        }
Ejemplo n.º 2
0
        static void Main(string[] args)
        {
            IPrintable p = new PrinterProxy("Alice");

            Console.WriteLine("名前は現在" + p.GetPrinterName() + "です。");
            p.SetPrinterName("Bob");
            Console.WriteLine("名前は現在" + p.GetPrinterName() + "です。");
            p.Print("Hello, world.");
        }
Ejemplo n.º 3
0
        static void Main(string[] args)
        {
            IPrintable iPrintable = new PrinterProxy("佐藤");

            Console.WriteLine($"名前は現在{iPrintable.GetPrinterName()}です。");

            iPrintable.SetPrinterName("田中");
            Console.WriteLine($"名前は現在{iPrintable.GetPrinterName()}です。");
            iPrintable.Print("Hello World!");
        }