Click or drag to resize

MessageQueue Methods

The MessageQueue type exposes the following members.

Methods
  NameDescription
Public methodDispose
Releases any resources associated with this instance.
Protected methodDispose(Boolean)
Releases any resources associated with this instance.
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodPost(Object)
Adds a generic message that is asynchronously sent to any functions that subscribe to MessageReceived.
Public methodPost(SendOrPostCallback, Object)
Adds a delegate to the message queue and immediately returns
Public methodSend(Object)
Adds a generic message to the message queue that is synchronously sent to any functions that subscribe to MessageReceived.
Public methodSend(SendOrPostCallback, Object)
Adds a delegate to the message queue and waits until all currently queued delegates and the recently added delegate are executed before returning.
Public methodStart
Runs the message queue in the current thread and does not return until Terminate is called
Public methodStartInAnotherThread
Public methodStartInNewThread
Runs the message queue in a newly spawned worker thread and immediately returns. The worker thread will not be terminated until Terminate is called.
Public methodStartInNewThread(String)
Runs the message queue in a newly spawned worker thread and immediately returns. The worker thread will not be terminated until Terminate is called.
Public methodStartInThreadPoolThread
Runs the message queue in a thread pool thread and immediately returns. The worker thread will not be released back to the thread pool until Terminate is called.
Public methodTerminate
Terminates the message queue. Any messages that are already in the queue when this method is called will be processed before the queue is terminated. This method initiates the termination and returns immediately; it does NOT wait for the termination to complete before returning. It is safe to call this method from any thread, including the thread that is processing the message queue. To wait for termination to complete, call TerminateAndWait instead. If the queue is not running when this method is called, the termination request will still be posted. That means that queue processing, once restarted, will terminate once it reaches this point in the queue.
Public methodTerminateAndWait
Terminates the message queue and waits for termination to complete. Any messages that are already in the queue when this method is called will be processed before the queue is terminated. Unlike Terminate, this method does not return until the message queue is terminated. This method must not be called from the thread that is running the message queue. Doing so will cause a dead-lock because this method cannot return until the message queue terminates and the queue cannot terminate until this method returns.
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Top
See Also