public SecurityDoor(IDoor door, IAlarm alarm, int alarmTimeout) { _door = door; _alarm = alarm; _timer = new Timer(); _timer.Interval = alarmTimeout; _timer.Elapsed += (o, e) => _alarm.Alert("Alarm!"); }
public void Alert() { _alarm.Alert(); }
public SecurityDoor(IDoor door, IAlarm alarm, int alarmTimeout) { _door = door; _alarm = alarm; _timer = new Timer(); _timer.Interval = alarmTimeout; _timer.Elapsed += (o, e) => _alarm.Alert("Alarm!"); }
public void Alert() { _alarm.Alert(); }