static void Main(string[] args) { AlertStateContext stateContext = new AlertStateContext(); stateContext.Alert(); stateContext.Alert(); stateContext.SetState(new Silent()); stateContext.Alert(); stateContext.Alert(); stateContext.Alert(); }
public void Alert(AlertStateContext ctx) { Console.WriteLine("Vibration"); }
public void Alert(AlertStateContext ctx) { Console.WriteLine("Silent"); }