PowerManager.EffectivePowerModeChanged 事件

定义

当设备的有效电源模式发生更改时引发。

// Register
static event_token EffectivePowerModeChanged(EventHandler<IInspectable> const& handler) const;

// Revoke with event_token
static void EffectivePowerModeChanged(event_token const* cookie) const;

// Revoke with event_revoker
static PowerManager::EffectivePowerModeChanged_revoker EffectivePowerModeChanged(auto_revoke_t, EventHandler<IInspectable> const& handler) const;
public static event System.EventHandler<object> EffectivePowerModeChanged;
function onEffectivePowerModeChanged(eventArgs) { /* Your code */ }
Microsoft.Windows.System.Power.PowerManager.addEventListener("effectivepowermodechanged", onEffectivePowerModeChanged);
Microsoft.Windows.System.Power.PowerManager.removeEventListener("effectivepowermodechanged", onEffectivePowerModeChanged);
- or -
Microsoft.Windows.System.Power.PowerManager.oneffectivepowermodechanged = onEffectivePowerModeChanged;
Public Shared Custom Event EffectivePowerModeChanged As EventHandler(Of Object) 

事件类型

注解

若要获取当前有效电源模式以响应此事件,请使用 EffectivePowerMode 属性。

适用于

另请参阅