public void writeName(StateContext context, String name)
        {
            Console.WriteLine(name.ToUpper());

            /* Change state after StateMultipleUpperCase's writeName() gets invoked twice */
            if (++count > 1)
            {
                context.setState(new StateLowerCase());
            }
        }
Beispiel #2
0
 public void writeName(StateContext context, String name)
 {
     Console.WriteLine(name.ToLower());
     context.setState(new StateMultipleUpperCase());
 }