PowerManager.SystemSuspendStatusChanged 事件

定义

当设备的挂起状态发生更改时引发。

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

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

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

事件类型

注解

若要获取当前挂起状态以响应此事件,请使用 SystemSuspendStatus 属性。

适用于

另请参阅