PowerManager.PowerSourceKindChanged 事件

定義

裝置電源已變更時引發。

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

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

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

事件類型

備註

若要取得裝置目前的電源來源以回應此事件,請使用 PowerSourceKind 屬性。 此事件會對應至 GUID_ACDC_POWER_SOURCE電源設定 GUID

適用於

另請參閱