AppBroadcastBackgroundService.HeartbeatRequested 事件

定義

由系統定期引發,以確認廣播背景工作目前為作用中。

// 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 可能會導致廣播應用程式的背景工作終止。

適用於