Beispiel #1
0
        static void Main(string[] args)
        {
            SimpleRemoteControl remote = new SimpleRemoteControl();
            Light          light       = new Light();
            LightOnCommand lightOn     = new LightOnCommand(light);

            GarageDoor            garageDoor     = new GarageDoor();
            GarageDoorOpenCommand garageDoorOpen = new GarageDoorOpenCommand(garageDoor);

            remote.SetCommand(lightOn);
            remote.ButtonWasPressed();

            remote.SetCommand(garageDoorOpen);
            remote.ButtonWasPressed();

            Console.ReadLine();
        }
Beispiel #2
0
 public GarageDoorOpenCommand(GarageDoor door)
 {
     this.door = door;
 }