/// <summary> /// Entry point into console application. /// </summary> static void Main() { // Setup context in a state Context c = new Context(new ConcreteStateA()); // Issue requests, which toggles state c.Request(); c.Request(); c.Request(); c.Request(); // Wait for user Console.ReadKey(); }
public override void Handle(Context context) { context.State = new ConcreteStateA(); }
public abstract void Handle(Context context);