internal static void Main(string[] args)
        {
            SimpleRemoteControl remote = new SimpleRemoteControl();

            Light          light   = new Light();
            LightOnCommand lightOn = new LightOnCommand(light);

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


            remote.SetCommand(lightOn);
            remote.ButtonWasPressed();
            remote.SetCommand(openCommand);
            remote.ButtonWasPressed();
        }
示例#2
0
 public GarageDoorOpenCommand(GarageDoor garageDoor)
 {
     GarageDoor = garageDoor;
 }