AppBroadcastBackgroundService.HeartbeatRequested 事件
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
由系統定期引發,以確認廣播背景工作目前為作用中。
// Register
event_token HeartbeatRequested(TypedEventHandler<AppBroadcastBackgroundService, AppBroadcastHeartbeatRequestedEventArgs const&> const& handler) const;
// Revoke with event_token
void HeartbeatRequested(event_token const* cookie) const;
// Revoke with event_revoker
AppBroadcastBackgroundService::HeartbeatRequested_revoker HeartbeatRequested(auto_revoke_t, TypedEventHandler<AppBroadcastBackgroundService, AppBroadcastHeartbeatRequestedEventArgs const&> const& handler) const;
public event TypedEventHandler<AppBroadcastBackgroundService,AppBroadcastHeartbeatRequestedEventArgs> HeartbeatRequested;
function onHeartbeatRequested(eventArgs) { /* Your code */ }
appBroadcastBackgroundService.addEventListener("heartbeatrequested", onHeartbeatRequested);
appBroadcastBackgroundService.removeEventListener("heartbeatrequested", onHeartbeatRequested);
- or -
appBroadcastBackgroundService.onheartbeatrequested = onHeartbeatRequested;
Public Custom Event HeartbeatRequested As TypedEventHandler(Of AppBroadcastBackgroundService, AppBroadcastHeartbeatRequestedEventArgs)
事件類型
Windows 需求
應用程式功能 |
appBroadcast
appBroadcastSettings
|
備註
將 Handled 屬性設定為 true,以確認背景工作目前為使用中。 無法回應此事件,並將 Handled 屬性設定為 true 可能會導致廣播應用程式的背景工作終止。