DispatcherObject DispatcherObject DispatcherObject DispatcherObject Class

Definition

Represents an object that is associated with a Dispatcher.

public ref class DispatcherObject abstract
public abstract class DispatcherObject
type DispatcherObject = class
Public MustInherit Class DispatcherObject
Inheritance
DispatcherObjectDispatcherObjectDispatcherObjectDispatcherObject
Derived

Remarks

Only the thread that the Dispatcher was created on may access the DispatcherObject directly. To access a DispatcherObject from a thread other than the thread the DispatcherObject was created on, call Invoke or BeginInvoke on the Dispatcher the DispatcherObject is associated with.

Subclasses of DispatcherObject that need to enforce thread safety can do so by calling VerifyAccess on all public methods. This guarantees the calling thread is the thread that the DispatcherObject was created on.

A DispatcherObject cannot be independently instantiated; that is, all constructors are protected.

Objects that derive from DispatcherObject have thread affinity.

Objects that derive from Freezable are free-threaded when they are frozen. For more information, see the Freezable Objects Overview.

Constructors

DispatcherObject() DispatcherObject() DispatcherObject() DispatcherObject()

Initializes a new instance of the DispatcherObject class.

Properties

Dispatcher Dispatcher Dispatcher Dispatcher

Gets the Dispatcher this DispatcherObject is associated with.

Methods

CheckAccess() CheckAccess() CheckAccess() CheckAccess()

Determines whether the calling thread has access to this DispatcherObject.

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetHashCode() GetHashCode() GetHashCode() GetHashCode()

Serves as the default hash function.

(Inherited from Object)
GetType() GetType() GetType() GetType()

Gets the Type of the current instance.

(Inherited from Object)
MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

Creates a shallow copy of the current Object.

(Inherited from Object)
ToString() ToString() ToString() ToString()

Returns a string that represents the current object.

(Inherited from Object)
VerifyAccess() VerifyAccess() VerifyAccess() VerifyAccess()

Enforces that the calling thread has access to this DispatcherObject.

Applies to

Thread Safety

Any public static members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

This object can be accessed only from the thread on which it was created. Attempts to access it from other threads will throw an InvalidOperationException. Invoke(DispatcherPriority, Delegate) or BeginInvoke(DispatcherPriority, Delegate) provide support for marshalling work to the correct thread.