PowerManager.EffectivePowerModeChanged 事件
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
当设备的有效电源模式发生更改时引发。
// 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 属性。