DispatcherQueue.ShutdownStarting Evento

Definición

Se genera cuando se llama a ShutdownQueueAsync . Para obtener una lista completa de los eventos generados y en qué orden, vea comentarios para ShutdownQueueAsync.

// Register
event_token ShutdownStarting(TypedEventHandler<DispatcherQueue, DispatcherQueueShutdownStartingEventArgs const&> const& handler) const;

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

// Revoke with event_revoker
DispatcherQueue::ShutdownStarting_revoker ShutdownStarting(auto_revoke_t, TypedEventHandler<DispatcherQueue, DispatcherQueueShutdownStartingEventArgs const&> const& handler) const;
public event TypedEventHandler<DispatcherQueue,DispatcherQueueShutdownStartingEventArgs> ShutdownStarting;
function onShutdownStarting(eventArgs) { /* Your code */ }
dispatcherQueue.addEventListener("shutdownstarting", onShutdownStarting);
dispatcherQueue.removeEventListener("shutdownstarting", onShutdownStarting);
- or -
dispatcherQueue.onshutdownstarting = onShutdownStarting;
Public Custom Event ShutdownStarting As TypedEventHandler(Of DispatcherQueue, DispatcherQueueShutdownStartingEventArgs) 

Tipo de evento

Ejemplos

_dispatcherQueue.ShutdownStarting += (s, e) =>
{
    // Queue is shutting down, do this last operation to  
    // update state before the dispatcher loop exits
    _queue.TryEnqueue(
        () =>
        {
            // clean up state
        });
};

Comentarios

El evento ShutdownStarting se genera desde el subproceso de bucle de eventos antes de que se cierre el bucle de eventos. El controlador de este evento puede tomar un aplazamiento y puede continuar después del trabajo hasta que se complete el aplazamiento. Una vez completado el aplazamiento, DispatcherQueue ya no acepta trabajo y DispatcherQueue.TryEnqueue devuelve false.

Se aplica a

Consulte también