語言

DispatcherTimer 建構函式

定義

初始化 DispatcherTimer 類別的新執行個體。

多載

名稱 Description
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

計時器所關聯的調度器。

例外狀況

callback 是 null。

-或-

dispatcher 是 null。

interval 小於 0 或大於 Int32.MaxValue。

適用於