GuiDispatcher
Dispatcher implementation that marshals actions to the WPF UI thread with batching and periodic execution support.
継承元: Disposable
実装: IDispatcher
コンストラクター
GuiDispatcher()
Initializes a new instance of the GuiDispatcher class using the current thread dispatcher.
GuiDispatcher(Dispatcher)
Initializes a new instance of the GuiDispatcher class.
- dispatcher
- The UI thread dispatcher instance.
プロパティ
Dispatcher : Dispatcher
Gets the UI thread dispatcher instance.
GlobalDispatcher : GuiDispatcher
Gets the global singleton instance of GuiDispatcher.
MaxPeriodicalActionErrors : int
Gets or sets the maximum number of errors allowed for a periodic action before it is removed. Use -1 to disable the limit.
PendingActionsCount : int
Gets the number of actions waiting to be processed.
メソッド
AddPeriodicalAction(Action) : IDisposable
Adds a periodic action that will be executed on each dispatcher tick. Returns a token that can be used to remove it.
- action
- The action to execute.
戻り値: A token that can be used to remove the action.
AddSyncAction(Action) : T
Executes the specified action synchronously on the UI thread.
- action
- The action to execute.
AddSyncAction``1(Func<T>)
Executes the specified function synchronously on the UI thread and returns its result.
- action
- The function to execute.
戻り値: The function result.
CheckAccess() : bool
DisposeManaged()
Releases managed resources.
FlushPendingActions()
Requests immediate processing of all queued actions.
InitGlobalDispatcher()
Initializes the global dispatcher if it has not been created yet.