Click or drag to resize

BackgroundThreadWithDispatcher Class

A dedicated thread hosting an active dispatcher. The thread will be created as background thread, so it does not need to be shut down explicitly.
Inheritance Hierarchy
SystemObject
  TomsToolbox.DesktopThreadWithDispatcher
    TomsToolbox.DesktopBackgroundThreadWithDispatcher

Namespace:  TomsToolbox.Desktop
Assembly:  TomsToolbox.Desktop (in TomsToolbox.Desktop.dll) Version: 1.0.64.0 (1.0.64.0)
Syntax
public class BackgroundThreadWithDispatcher : ThreadWithDispatcher

The BackgroundThreadWithDispatcher type exposes the following members.

Constructors
  NameDescription
Public methodBackgroundThreadWithDispatcher(String, ApartmentState)
Initializes a new instance of the BackgroundThreadWithDispatcher class.
Public methodBackgroundThreadWithDispatcher(String, ApartmentState, ThreadPriority)
Initializes a new instance of the BackgroundThreadWithDispatcher class.
Top
Properties
  NameDescription
Public propertyDispatcher
Gets the dispatcher of the thread.
(Inherited from ThreadWithDispatcher.)
Public propertyTaskScheduler
Gets the task scheduler associated with the Dispatcher
(Inherited from ThreadWithDispatcher.)
Top
Methods
  NameDescription
Public methodAbort
Aborts this instance.
(Inherited from ThreadWithDispatcher.)
Public methodBeginInvoke(Action)
Invokes the specified method asynchronously in the dispatcher thread.
(Inherited from ThreadWithDispatcher.)
Public methodBeginInvoke(DispatcherPriority, Action)
Invokes the specified method asynchronously in the dispatcher thread.
(Inherited from ThreadWithDispatcher.)
Public methodBeginShutdown
Initiates shutdown of the Dispatcher asynchronously.
(Inherited from ThreadWithDispatcher.)
Public methodCheckAccess
Determines whether the calling thread is the thread associated with this Dispatcher.
(Inherited from ThreadWithDispatcher.)
Public methodInvoke(Action)
Invokes the specified method in the dispatcher thread.
(Inherited from ThreadWithDispatcher.)
Public methodInvokeT(FuncT)
Invokes the specified method in the dispatcher thread.
(Inherited from ThreadWithDispatcher.)
Public methodJoin
Blocks the calling thread until the Dispatcher terminates.
(Inherited from ThreadWithDispatcher.)
Public methodJoin(TimeSpan)
Blocks the calling thread until the Dispatcher terminates.
(Inherited from ThreadWithDispatcher.)
Public methodVerifyAccess
Determines whether the calling thread has access to this Dispatcher.
(Inherited from ThreadWithDispatcher.)
Top
Events
  NameDescription
Public eventTerminated
Occurs when the dispatcher is terminated.
(Inherited from ThreadWithDispatcher.)
Top
Extension Methods
Remarks
Use this thread to dispatch or serialize background operations, or to performant host COM objects that don't have a free threaded marshaller. A background thread will be killed by the system when the application terminates, so do not host objects in a background thread that need cleanup!
See Also