예제 #1
0
 // The Context allows changing the State object at runtime.
 public void TransitionTo(IDocumentState state)
 {
     Console.WriteLine($"Context: Transition to {state.GetType().Name}.");
     _state = state;
     _state.SetContext(this);
 }
예제 #2
0
 public Document(IDocumentState state)
 {
     this.TransitionTo(state);
 }