Condividi tramite


WebUIBackgroundTaskInstanceRuntimeClass.Canceled Evento

Definizione

Collega un gestore eventi di annullamento all'istanza dell'attività in background.

public:
 virtual event BackgroundTaskCanceledEventHandler ^ Canceled;
// Register
event_token Canceled(BackgroundTaskCanceledEventHandler const& handler) const;

// Revoke with event_token
void Canceled(event_token const* cookie) const;

// Revoke with event_revoker
WebUIBackgroundTaskInstanceRuntimeClass::Canceled_revoker Canceled(auto_revoke_t, BackgroundTaskCanceledEventHandler const& handler) const;
public event BackgroundTaskCanceledEventHandler Canceled;
function onCanceled(eventArgs) { /* Your code */ }
webUIBackgroundTaskInstanceRuntimeClass.addEventListener("canceled", onCanceled);
webUIBackgroundTaskInstanceRuntimeClass.removeEventListener("canceled", onCanceled);
- or -
webUIBackgroundTaskInstanceRuntimeClass.oncanceled = onCanceled;
Public Custom Event Canceled As BackgroundTaskCanceledEventHandler Implements Canceled

Tipo evento

Implementazioni

Commenti

Nella maggior parte dei casi, le attività in background JavaScript continuano a essere eseguite fino a quando non viene chiamato il metodo close di Web Worker. Il sistema arresta un'attività in background solo quando tutte le app vengono chiuse, ad esempio la disconnessione dell'utente o l'arresto del sistema. In tal caso, Windows attiva l'evento annullato, consentendo all'attività in background di completare qualsiasi attività finale prima della chiusura.

Si applica a