Esempio n. 1
0
        public static void Run()
        {
            // Setup context in a state
            StateContext c = new StateContext(new ConcreteStateA());

            // Issue requests, which toggles state

            c.Request();
            c.Request();
            c.Request();
            c.Request();
        }
Esempio n. 2
0
 public override void Handle(StateContext context)
 {
     context.State = new ConcreteStateA();
 }
Esempio n. 3
0
 public abstract void Handle(StateContext context);