Exemple #1
0
        public static void Test()
        {
            ProxyUser user = new ProxyUser();

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

            user.CallSubjectRequest(realSubject);

            Console.WriteLine("\nClient: Executing the same client code with a proxy");
            user.CallSubjectRequest(new Proxy(realSubject));
        }
Exemple #2
0
 public Proxy(RealSubject realSubject)
 {
     this._realSubject = realSubject;
 }