Share via


DispatcherQueueController 类

定义

管理 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
继承
Object Platform::Object IInspectable DispatcherQueueController
属性

注解

对象和线程生存期

在事件循环运行时,DispatcherQueueController 及其关联的 DispatcherQueue 将保持活动状态。 关闭完成后,循环将终止,专用线程将展开。 但是, DispatcherQueueController 和关联的 DispatcherQueue 对象可以超过线程的生存期,并在释放其所有引用时被释放。

属性

DispatcherQueue

获取与此 DispatcherQueueController 关联的 DispatcherQueue

方法

CreateOnCurrentThread()

在调用线程上,创建与 USER32 消息循环互操作 的 DispatcherQueue

CreateOnDedicatedThread()

创建可用于在专用线程上运行任务的 DispatcherQueue

ShutdownQueue()

ShutdownQueueAsync 的同步版本。 有关详细信息,请参阅该方法的文档,包括备注。

此方法在关闭操作完成时返回。

ShutdownQueueAsync()

异步停止与此 DispatcherQueueController 关联的 DispatcherQueue,如果 DispatcherQueueController 是由 CreateOnDedicatedThread 创建的,则关闭线程。

此方法在启动关闭操作后立即返回异步操作 () ;但异步操作在关闭操作完成之前不会完成。

适用于