public ConsolePowerEventArguments(PowerModes powerMode) { switch (powerMode) { case PowerModes.Resume: _eventCode = PowerEventCode.ResumeAutomatic; break; case PowerModes.StatusChange: _eventCode = PowerEventCode.PowerStatusChange; break; case PowerModes.Suspend: _eventCode = PowerEventCode.Suspend; break; default: throw new ArgumentOutOfRangeException(nameof(powerMode), powerMode, null); } }
public WindowsPowerEventArguments(PowerBroadcastStatus powerStatus) { _eventCode = (PowerEventCode)Enum.ToObject(typeof(PowerEventCode), (int)powerStatus); }
public WindowsPowerEventArguments(PowerBroadcastStatus powerStatus) { _eventCode = (PowerEventCode) Enum.ToObject(typeof(PowerEventCode), (int)powerStatus); }