예제 #1
0
 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();
     }
 }
예제 #2
0
 protected ElectricScreen(UpDownRelays relays, IDeviceWithPower display)
     : this(relays)
 {
     display.PowerStatusChange += display_PowerStatusChange;
 }