SynchronousEventT Class

Provides a way to raise events on another thread. The events will be raised on the thread that constructed this class.

Definition

Namespace: SnapDB.Threading
Assembly: SnapDB (in SnapDB.dll) Version: 1.0.102.0 -- Release Build+29075351d0e5aa4dea46a5c520805222f672dc2e
public class SynchronousEvent<T> : IDisposable
where T : EventArgs
Inheritance
Object    SynchronousEventT
Implements
IDisposable

Type Parameters

T
The type of EventArgs.

Remarks

This is useful when needing to process data on a certain thread. On instance is when preparing data that needs to then be processed on the UI thread. Just construct this class on the UI thread, then when any thread raises an event, this event will be queued on the UI thread.

Constructors

SynchronousEventT Initializes a new instance of the SynchronousEvent class.

Methods

Dispose Prevents any future events from processing and attempts to cancel a pending operation. Function returns before any attempts to cancel are successful.
EqualsDetermines whether the specified object is equal to the current object.
(Inherited from Object)
FinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object)
GetHashCodeServes as the default hash function.
(Inherited from Object)
GetTypeGets the Type of the current instance.
(Inherited from Object)
MemberwiseCloneCreates a shallow copy of the current Object.
(Inherited from Object)
RaiseEvent Raises the custom event with the provided event arguments.
ToStringReturns a string that represents the current object.
(Inherited from Object)

Events

CustomEvent Occurs when a custom event of type T is triggered.

See Also