DispatcherQueue.ShutdownStarting Evento

Definizione

Generato quando viene chiamato ShutdownQueueAsync . Per un elenco completo degli eventi generati e in quale ordine, vedere la sezione Osservazioni per 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 evento

Esempio

_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
        });
};

Commenti

L'evento ShutdownStarting viene generato dal thread del ciclo di eventi prima dell'uscita del ciclo di eventi. Il gestore per questo evento può richiedere un rinvio e può continuare a pubblicare il lavoro fino al completamento del rinvio. Al termine del rinvio, DispatcherQueue non accetta più il lavoro e DispatcherQueue.TryEnqueue restituisce false.

Si applica a

Vedi anche