Class DispatcherObject
A DispatcherObject is an object associated with a Dispatcher. A DispatcherObject instance should only be access by the dispatcher's thread.
Inheritance
Inherited Members
Namespace: nanoFramework.UI.Threading
Assembly: nanoFramework.Graphics.dll
Syntax
public abstract class DispatcherObject
Remarks
Subclasses of DispatcherObject should enforce thread safety by calling VerifyAccess() on all their public methods to ensure the calling thread is the appropriate thread.
DispatcherObject cannot be independently instantiated; that is, all constructors are protected.Constructors
DispatcherObject()
Instantiate this object associated with the current Dispatcher.
Declaration
protected DispatcherObject()
Fields
Dispatcher
The Dispatcher that this DispatcherObject is associated with.
Declaration
public readonly Dispatcher Dispatcher
Field Value
Type | Description |
---|---|
Dispatcher |
Methods
CheckAccess()
Checks that the calling thread has access to this object.
Declaration
public bool CheckAccess()
Returns
Type | Description |
---|---|
bool | True if the calling thread has access to this object. |
Remarks
Only the dispatcher thread may access DispatcherObjects.
This method is public so that any thread can probe to see if it has access to the DispatcherObject.VerifyAccess()
Verifies that the calling thread has access to this object.
Declaration
public void VerifyAccess()
Remarks
Only the dispatcher thread may access DispatcherObjects.
This method is public so that derived classes can probe to see if the calling thread has access to itself.This is only verified in debug builds.