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 可能会导致广播应用的后台任务被终止。