void display_PowerStatusChange(IDeviceWithPower device, DevicePowerStatusEventArgs args) { if (args.PreviousPowerStatus == DevicePowerStatus.PowerOff && ( args.NewPowerStatus == DevicePowerStatus.PowerOn || args.NewPowerStatus == DevicePowerStatus.PowerWarming)) { Down(); } else if (args.PreviousPowerStatus == DevicePowerStatus.PowerOn && ( args.NewPowerStatus == DevicePowerStatus.PowerOff || args.NewPowerStatus == DevicePowerStatus.PowerCooling)) { Up(); } }
protected ElectricScreen(UpDownRelays relays, IDeviceWithPower display) : this(relays) { display.PowerStatusChange += display_PowerStatusChange; }