示例#1
0
        public void RequestPassword()
        {
            if (CheckAccess())
            {
                realSubject = new RealSubject();
                realSubject.RequestPassword();

                LogAccess();
            }
        }
示例#2
0
        static void Main(string[] args)
        {
            Console.WriteLine($"Executing the method with a real subject:");
            RealSubject realSubject = new RealSubject();

            realSubject.RequestPassword();

            Console.WriteLine($"\nExecuting the method with a proxy:");
            Proxy proxy = new Proxy(realSubject);

            proxy.RequestPassword();
        }