コード例 #1
0
        public void Show()
        {
            // Setup context in a state
            StateContext c = new StateContext(new ConcreteStateA());

            // Issue requests, which toggles state
            c.Request();
            c.Request();
            c.Request();
            c.Request();
        }
コード例 #2
0
 public override void Handle(StateContext context)
 {
     context.State = new ConcreteStateA();
 }
コード例 #3
0
 public abstract void Handle(StateContext context);