DispatcherQueue.ShutdownStarting Ereignis

Definition

Wird ausgelöst, wenn ShutdownQueueAsync aufgerufen wird. Eine vollständige Liste der ausgelösten Ereignisse und in welcher Reihenfolge finden Sie in den Hinweise zu 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) 

Ereignistyp

Beispiele

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

Hinweise

Das ShutdownStarting-Ereignis wird aus dem Ereignisschleifenthread ausgelöst , bevor die Ereignisschleife beendet wird. Der Handler für dieses Ereignis kann eine Verzögerung durchführen und die Arbeit nach abschluss der Verzögerung fortsetzen. Sobald die Verzögerung abgeschlossen ist, nimmt die DispatcherQueue keine Arbeit mehr an, und DispatcherQueue.TryEnqueue gibt zurück false.

Gilt für:

Weitere Informationen