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

            stateContext.Alert();
            stateContext.setState(new Vibration());
            stateContext.Alert();
            stateContext.Alert();
            stateContext.setState(new Silent());
            stateContext.Alert();
            stateContext.Alert();
        }
示例#2
0
 public void Alert(AlertStateContext ctx)
 {
     Console.WriteLine("Vibrating...");
 }
示例#3
0
 public void Alert(AlertStateContext ctx)
 {
     Console.WriteLine("Silent...");
 }