Request() public abstract method

public abstract Request ( ) : void
return void
示例#1
0
 public override void Request()
 {
     if (realSubject == null)
     {
         LoadRealSubject();
     }
     realSubject.Request();
 }
示例#2
0
 public override void Request()
 {
     //throw new NotImplementedException();
     if (proxy == null)
     {
         proxy = new RealSubject();
     }
     proxy.Request();
 }
示例#3
0
            public string Request()
            {
                if (_subject == null)
                {
                    return("Protection Proxy: Authenticate first");
                }

                return("Protection Proxy: Call to " + _subject.Request());
            }
        public override void Request()
        {
            /*Use 'lazy initialization'*/
            if (_realSubject == null)
            {
                _realSubject = new Subject();
            }

            _realSubject.Request();
        }
 public string Request()
 {
     if (subject == null)
     {
         Console.WriteLine("Subject inactive");
         subject = new Subject();
     }
     Console.WriteLine("Subject active");
     return("Proxy: Call to " + subject.Request());
 }
示例#6
0
            public string Request()
            {
                //a virtual proxy creates the object only on its first method call
                if (_subject == null)
                {
                    Console.WriteLine("Subject inactive");
                    _subject = new Subject();
                }

                Console.WriteLine("Subject active");
                return("Proxy: Call to " + _subject.Request());
            }
示例#7
0
        public void Request()
        {
            Console.WriteLine($"This method is being called on : {this.ToString()}");

            //create a lazy loader for the Subject
            if (_subject == null)
            {
                _subject = new Subject();
            }

            Console.WriteLine("  |");
            Console.Write("  ---");

            _subject.Request();
        }
示例#8
0
        public void Request()
        {
            var counter = 0;

            while (true)
            {
                Console.WriteLine("Enter your password:"******"ivan", StringComparison.CurrentCultureIgnoreCase))
                {
                    _subject.Request();
                    break;
                }
                else
                {
                    Console.WriteLine("No Subject for you :(");
                }
                counter++;
                if (counter == 3)
                {
                    break;
                }
            }
        }
示例#9
0
 public static void UseSubject(Subject subject)
 {
     subject.Request();
 }