C# Class Milkman.Common.SmartDispatcher

A smart dispatcher system for routing actions to the user interface thread.
显示文件 Open project: mbmccormick/Milkman

Public Methods

Method Description
BeginInvoke ( System.Action a ) : void

Executes the specified delegate asynchronously on the user interface thread. If the current thread is the user interface thread, the dispatcher if not used and the operation happens immediately.

CheckAccess ( ) : bool

Initialize ( ) : void

Initializes the SmartDispatcher system, attempting to use the RootVisual of the plugin to retrieve a Dispatcher instance.

Initialize ( CoreDispatcher dispatcher ) : void

Initializes the SmartDispatcher system with the dispatcher instance.

Private Methods

Method Description
RequireInstance ( ) : void

Requires an instance and attempts to find a Dispatcher if one has not yet been set.

Method Details

BeginInvoke() public static method

Executes the specified delegate asynchronously on the user interface thread. If the current thread is the user interface thread, the dispatcher if not used and the operation happens immediately.
public static BeginInvoke ( System.Action a ) : void
a System.Action A delegate to a method that takes no arguments and /// does not return a value, which is either pushed onto the Dispatcher /// event queue or immediately run, depending on the current thread.
return void

CheckAccess() public static method

public static CheckAccess ( ) : bool
return bool

Initialize() public static method

Initializes the SmartDispatcher system, attempting to use the RootVisual of the plugin to retrieve a Dispatcher instance.
public static Initialize ( ) : void
return void

Initialize() public static method

Initializes the SmartDispatcher system with the dispatcher instance.
public static Initialize ( CoreDispatcher dispatcher ) : void
dispatcher Windows.UI.Core.CoreDispatcher The dispatcher instance.
return void