public override void Handle(Context context) { Console.WriteLine(Name + " is handling context."); // change context state51 context.SetState(new ConcreteStateA()); }
public void Run() { var context = new Context(); context.SetState(new ConcreteStateA()); context.Request(); // context.SetState(new ConcreteStateB()); context.Request(); }