Exemple #1
0
        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. ");
        }
Exemple #2
0
    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");
    }