DispatcherTimer 构造函数
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
初始化 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
调用计时器的优先级。
注解
DispatcherTimer 在 Dispatcher 当前线程上运行。 若要指定其他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
计时器与之关联的调度程序。
例外
dispatcher 是 null。
适用于
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
计时器与之关联的调度程序。
例外
interval 小于 0 或大于 Int32.MaxValue。