static void Main(string[] args) { var bulb = new Bulb(); var controller = new RemoteController { OnCommand = new LightOnCommand(bulb), OffCommand = new LightOffCommand(bulb) }; controller.PressOnButton(); controller.PressOffButton(); }
public LightOffCommand(Bulb bulb) { _bulb = bulb; }