예제 #1
0
        static void Main(string[] args)
        {
            AlertStateContext stateContext = new AlertStateContext();

            stateContext.Alert();
            stateContext.Alert();
            stateContext.SetState(new Silent());
            stateContext.Alert();
            stateContext.Alert();
            stateContext.Alert();
        }
예제 #2
0
 public void Alert(AlertStateContext ctx)
 {
     Console.WriteLine("Vibration");
 }
예제 #3
0
 public void Alert(AlertStateContext ctx)
 {
     Console.WriteLine("Silent");
 }