C# Class refw.Dispatcher

This class models a basic cross-thread dispatcher as used in WinForms and WPF. One thread executes code through InvokeInvokes, while other threads queue up functions to be called in the main thread asynchronously with BeginInvoke or synchronously with Invoke.
Mostra file Open project: fry/refw

Public Methods

Method Description
BeginInvoke ( System.Action action ) : EventWaitHandle

Queue up a delegate without waiting for it to finish.

Invoke ( System.Action action ) : void

Queue up a delegate and return once it finishes

InvokeInvokes ( ) : void

Call all pending delegates and invoke their listening thread of their completion afterwards.

Method Details

BeginInvoke() public method

Queue up a delegate without waiting for it to finish.
public BeginInvoke ( System.Action action ) : EventWaitHandle
action System.Action delegate to be called by the owning thread
return System.Threading.EventWaitHandle

Invoke() public method

Queue up a delegate and return once it finishes
public Invoke ( System.Action action ) : void
action System.Action delegate to be called by the owning thread
return void

InvokeInvokes() public method

Call all pending delegates and invoke their listening thread of their completion afterwards.
public InvokeInvokes ( ) : void
return void