コード例 #1
0
        static void Main(string[] args)
        {
            Client client = new Client();

            Console.WriteLine("Executing the client code with a real subject:");
            RealSubject realSubject = new RealSubject();

            client.ClientCode(realSubject);

            Console.WriteLine();

            Console.WriteLine("Executing the same client code with a proxy:");
            Proxy proxy = new Proxy(realSubject);

            client.ClientCode(proxy);
        }
コード例 #2
0
 public Proxy(RealSubject realSubject)
 {
     this._realSubject = realSubject;
 }