DispatcherQueueController Class

Definition

Manages the lifetime of a DispatcherQueue.

public ref class DispatcherQueueController sealed
/// [Windows.Foundation.Metadata.ContractVersion(Microsoft.Foundation.LiftedContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
class DispatcherQueueController final
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
/// [Windows.Foundation.Metadata.ContractVersion(Microsoft.Foundation.WindowsAppSDKContract, 65536)]
class DispatcherQueueController final
[Windows.Foundation.Metadata.ContractVersion(typeof(Microsoft.Foundation.LiftedContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
public sealed class DispatcherQueueController
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
[Windows.Foundation.Metadata.ContractVersion(typeof(Microsoft.Foundation.WindowsAppSDKContract), 65536)]
public sealed class DispatcherQueueController
Public NotInheritable Class DispatcherQueueController
Inheritance
Object Platform::Object IInspectable DispatcherQueueController
Attributes

Remarks

Object and Thread Lifetime

DispatcherQueueController and its associated DispatcherQueue will be kept alive while the event loop is running. When Shutdown is completed, the loop is terminated and the dedicated thread will unwind. However, DispatcherQueueController and the associated DispatcherQueue object can outlive thread’s lifetime and will be disposed when all their references are released.

Properties

DispatcherQueue

Gets the DispatcherQueue that's associated with this DispatcherQueueController.

Methods

CreateOnCurrentThread()

On the calling thread, creates a DispatcherQueue that will interop with a USER32 message loop.

CreateOnDedicatedThread()

Creates a DispatcherQueue that you can use to run tasks on a dedicated thread.

ShutdownQueue()

Synchronous version of ShutdownQueueAsync. For details, see the documentation, including the Remarks, for that method.

This method returns when the shutdown operation is complete.

ShutdownQueueAsync()

Asynchronously stops the DispatcherQueue associated with this DispatcherQueueController, and shuts down the thread if the DispatcherQueueController was created by CreateOnDedicatedThread.

This method returns (an asynchronous operation) as soon as the shutdown operation is started; but the asynchronous operation doesn't complete until the shutdown operation is complete.

Applies to