public void writeName(StateContext context, string name)
 {
     System.Console.WriteLine(name.ToUpper());
     /* Change state after StateMultipleUpperCase's writeName() gets invoked twice */
     if (++count > 1)
     {
         context.setState(new StateLowerCase());
     }
 }
Example #2
0
 public void writeName(StateContext context, string name)
 {
     System.Console.WriteLine(name.ToUpper());
     /* Change state after StateMultipleUpperCase's writeName() gets invoked twice */
     if (++count > 1)
     {
         context.setState(new StateLowerCase());
     }
 }
Example #3
0
        public void Run()
        {
            StateContext sc = new StateContext();

            sc.writeName("Monday");
            sc.writeName("Tuesday");
            sc.writeName("Wednesday");
            sc.writeName("Thursday");
            sc.writeName("Friday");
            sc.writeName("Saturday");
            sc.writeName("Sunday");
        }
        public void Run()
        {
            StateContext sc = new StateContext();

            sc.writeName("Monday");
            sc.writeName("Tuesday");
            sc.writeName("Wednesday");
            sc.writeName("Thursday");
            sc.writeName("Friday");
            sc.writeName("Saturday");
            sc.writeName("Sunday");
        }
Example #5
0
 public void writeName(StateContext context, string name)
 {
     System.Console.WriteLine(name.ToLower());
     context.setState(new StateMultipleUpperCase());
 }
Example #6
0
 public void writeName( StateContext context, string name)
 {
     System.Console.WriteLine(name.ToLower());
     context.setState(new StateMultipleUpperCase());
 }