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

                LogAccess();
            }
        }
Exemple #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();
        }