DispatcherTimer 构造函数

定义

初始化 DispatcherTimer 类的新实例。

重载

名称 说明
DispatcherTimer()

初始化 DispatcherTimer 类的新实例。

DispatcherTimer(DispatcherPriority)

初始化类的新实例,该实例 DispatcherTimer 处理指定优先级处的计时器事件。

DispatcherTimer(DispatcherPriority, Dispatcher)

初始化在指定优先级处运行的DispatcherTimer类的新实例Dispatcher

DispatcherTimer(TimeSpan, DispatcherPriority, EventHandler, Dispatcher)

初始化类的新实例,该实例 DispatcherTimer 使用指定的时间间隔、优先级、事件处理程序和 Dispatcher

DispatcherTimer()

初始化 DispatcherTimer 类的新实例。

public:
 DispatcherTimer();
public DispatcherTimer();
Public Sub New ()

注解

DispatcherTimer在当前线程Dispatcher的优先级上运行Background。 若要指定其他Dispatcher函数,请使用以下构造函数: DispatcherTimer.DispatcherTimer(DispatcherPriority, Dispatcher)

适用于

DispatcherTimer(DispatcherPriority)

初始化类的新实例,该实例 DispatcherTimer 处理指定优先级处的计时器事件。

public:
 DispatcherTimer(System::Windows::Threading::DispatcherPriority priority);
public DispatcherTimer(System.Windows.Threading.DispatcherPriority priority);
new System.Windows.Threading.DispatcherTimer : System.Windows.Threading.DispatcherPriority -> System.Windows.Threading.DispatcherTimer
Public Sub New (priority As DispatcherPriority)

参数

priority
DispatcherPriority

调用计时器的优先级。

注解

DispatcherTimerDispatcher 当前线程上运行。 若要指定其他Dispatcher函数,请使用以下构造函数: DispatcherTimer(DispatcherPriority, Dispatcher)

适用于

DispatcherTimer(DispatcherPriority, Dispatcher)

初始化在指定优先级处运行的DispatcherTimer类的新实例Dispatcher

public:
 DispatcherTimer(System::Windows::Threading::DispatcherPriority priority, System::Windows::Threading::Dispatcher ^ dispatcher);
public DispatcherTimer(System.Windows.Threading.DispatcherPriority priority, System.Windows.Threading.Dispatcher dispatcher);
new System.Windows.Threading.DispatcherTimer : System.Windows.Threading.DispatcherPriority * System.Windows.Threading.Dispatcher -> System.Windows.Threading.DispatcherTimer
Public Sub New (priority As DispatcherPriority, dispatcher As Dispatcher)

参数

priority
DispatcherPriority

调用计时器的优先级。

dispatcher
Dispatcher

计时器与之关联的调度程序。

例外

dispatchernull

适用于

DispatcherTimer(TimeSpan, DispatcherPriority, EventHandler, Dispatcher)

初始化类的新实例,该实例 DispatcherTimer 使用指定的时间间隔、优先级、事件处理程序和 Dispatcher

public:
 DispatcherTimer(TimeSpan interval, System::Windows::Threading::DispatcherPriority priority, EventHandler ^ callback, System::Windows::Threading::Dispatcher ^ dispatcher);
public DispatcherTimer(TimeSpan interval, System.Windows.Threading.DispatcherPriority priority, EventHandler callback, System.Windows.Threading.Dispatcher dispatcher);
new System.Windows.Threading.DispatcherTimer : TimeSpan * System.Windows.Threading.DispatcherPriority * EventHandler * System.Windows.Threading.Dispatcher -> System.Windows.Threading.DispatcherTimer
Public Sub New (interval As TimeSpan, priority As DispatcherPriority, callback As EventHandler, dispatcher As Dispatcher)

参数

interval
TimeSpan

时钟周期之间的时间段。

priority
DispatcherPriority

调用计时器的优先级。

callback
EventHandler

事件发生时要调用的 Tick 事件处理程序。

dispatcher
Dispatcher

计时器与之关联的调度程序。

例外

callbacknull

-或-

dispatchernull

interval 小于 0 或大于 Int32.MaxValue

适用于