DispatcherQueue Class

Definition

Manages a prioritized queue on which tasks execute in a serial fashion on a thread.

public ref class DispatcherQueue sealed
/// [Windows.Foundation.Metadata.ContractVersion(Microsoft.Foundation.LiftedContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Static(Microsoft.System.IDispatcherQueueStatics, 65536, "Microsoft.Foundation.LiftedContract")]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
/// [Windows.Foundation.Metadata.WebHostHidden]
class DispatcherQueue final
[Windows.Foundation.Metadata.ContractVersion(typeof(Microsoft.Foundation.LiftedContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Static(typeof(Microsoft.System.IDispatcherQueueStatics), 65536, "Microsoft.Foundation.LiftedContract")]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
[Windows.Foundation.Metadata.WebHostHidden]
public sealed class DispatcherQueue
Public NotInheritable Class DispatcherQueue
Inheritance
DispatcherQueue
Attributes
Windows.Foundation.Metadata.ContractVersionAttribute Windows.Foundation.Metadata.MarshalingBehaviorAttribute Windows.Foundation.Metadata.StaticAttribute Windows.Foundation.Metadata.ThreadingAttribute Windows.Foundation.Metadata.WebHostHiddenAttribute

Remarks

All tasks dispatched to a queue execute on the same thread.

Properties

HasThreadAccess

Gets a value indicating whether the DispatcherQueue has access to the current thread.

Methods

CreateTimer()

Creates a DispatcherQueueTimer on the DispatcherQueue to execute a task periodically after a time interval has elapsed.

GetForCurrentThread()

Gets the DispatcherQueue associated with the current thread.

TryEnqueue(DispatcherQueueHandler)

Adds a task to the DispatcherQueue which will be executed on the thread associated with the DispatcherQueue.

TryEnqueue(DispatcherQueuePriority, DispatcherQueueHandler)

Adds a task to the DispatcherQueue which will be executed on the thread associated with the DispatcherQueue.

Events

ShutdownCompleted

Fires after the DispatcherQueue event loop stops which is the last step in the DispatcherQueue shutdown process.

ShutdownStarting

Fires before the dispatcher queue initiates an exit from its event loop.

Applies to