public static void ProxyMain() { IPrintable p = new PrinterProxy("Alice", "Printer"); Console.WriteLine("名前は現在" + p.GetPrinterName() + "です。"); p.SetPrintName("Bob"); Console.WriteLine("名前は現在" + p.GetPrinterName() + "です。"); p.Print("Hello, world. "); }
public static void Main(string[] args) { Printable p = new PrinterProxy("Alice"); System.Console.WriteLine("Name is " + p.GetPrinterName() + " now"); p.SetPrinterName("Bob"); System.Console.WriteLine("Name is " + p.GetPrinterName() + " now"); p.Print("Hello, world"); }