Beispiel #1
0
        static void Main(string[] args)
        {
            LightControl ctrl = new LightControl(new OnState());

            ctrl.PressSwich();
            ctrl.PressSwich();
            ctrl.PressSwich();
            ctrl.PressSwich();
            Console.ReadKey();
        }
Beispiel #2
0
 public void PressSwich(LightControl lightctrl)
 {
     Console.WriteLine("Turn off the light.");
     lightctrl.State = new CloseState();
 }