导出 (0) 打印
全部展开
信息
您所需的主题如下所示。但此主题未包含在此库中。

CoreDispatcher Class

提供 Windows 运行时核心事件消息调度程序。此类型的实例负责处理窗口消息和为客户端调度事件。

语法


public sealed class CoreDispatcher : ICoreAcceleratorKeys

特性

[MarshalingBehavior(Agile)]
[Muse()]
[Version(0x06020000)]
[WebHostHidden()]

成员

CoreDispatcher类 具有这些类型的成员:

事件

CoreDispatcher类 具有这些事件。

事件说明
AcceleratorKeyActivated Fired when an accelerator key is activated (pressed or held down).

 

方法

The CoreDispatcher 类 具有这些方法。 它还继承方法于Object 类.

方法说明
ProcessEvents Starts the dispatcher processing the input event queue for this instance of CoreWindow.
RunAsync Schedules the provided callback on the UI thread from a worker thread, and returns the results asynchronously.
RunIdleAsync Schedules a callback on the UI thread from a worker thread at idle priority, and returns the results asynchronously.
ShouldYield() Queries whether the caller should yield if there are items in the task queue of higher priority than the current task.
ShouldYield(CoreDispatcherPriority) Queries whether the caller should yield if there are items in the task queue of the specified priority or higher.
StopProcessEvents Stops the dispatcher from processing any queued events.

 

属性

CoreDispatcher类 具有这些属性。

属性访问类型说明

CurrentPriority

读/写Gets and sets the priority of the current task.

HasThreadAccess

只读Gets a value that specifies whether the event dispatcher provided by this instance of CoreWindow has access to the current thread or not.

 

备注

可以从 CoreWindow.Dispatcher 属性获得此类型的实例。当前 CoreWindow 实例可通过调用 CoreWindow.GetForCurrentThread 获取。


void MyCoreWindowEvents::Run() // this is an implementation of IFrameworkView::Run() used to show context. It is called by CoreApplication::Run().
{
    CoreWindow::GetForCurrentThread()->Activate();

    /...

    CoreWindow::GetForCurrentThread()->Dispatcher->ProcessEvents(CoreProcessEventsOption::ProcessUntilQuit);
}

要求

最低支持客户端

Windows 8 [仅 Windows 应用商店应用程序]

最低支持服务器

Windows Server 2012 [仅 Windows 应用商店应用程序]

最低支持电话

Windows Phone 8

命名空间

Windows.UI.Core
Windows::UI::Core [C++]

元数据

Windows.winmd

 

 

显示:
© 2015 Microsoft