Click or drag to resize

cMessagePublisher Class

This class provides a single interface for dealing with different types of messages. It uses a Publisher/Subscriber or Observer pattern
Inheritance Hierarchy
SystemObject
  EwECorecMessagePublisher

Namespace:  EwECore
Assembly:  EwECore (in EwECore.dll) Version: 6.6.15981.0 (6.6.15981.0)
Syntax
public class cMessagePublisher : IDisposable

The cMessagePublisher type exposes the following members.

Constructors
  NameDescription
Public methodcMessagePublisher
Initializes a new instance of the cMessagePublisher class
Top
Properties
  NameDescription
Public propertyPluginManager
Get/set the cPluginManager to use.
Top
Methods
  NameDescription
Public methodAddMessage
Add a message to the message publisher.
Public methodAddMessageHandler
Add a Message Handler to list of message handlers
Public methodDispose
Releases all resources used by the cMessagePublisher
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 methodRemoveMessageHandler
Remove ALL instances of a Message Handler
Public methodRemoveMessageLock
Decrease the Messages lock count. While this lock count is active, no messages will be sent. When the lock reaches zero, any obstructed SendMessage call will be completed.
Public methodSendMessage
Send the message to the all handlers that can handle this type of message or to the default handler for this eCoreComponentType.
Public methodSetMessageLock
Increase the Messages lock count. While this lock count is active, no messages will be sent.
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Top
Extension Methods
  NameDescription
Public Extension MethodValue
Extension method; extract a value from an object by property name.
(Defined by Extensions.)
Top
Remarks
How to use: For a given message create a new cMessageHandler object and add it to the message handlers via the cMessagePublisher.AddMessageHandler(...) method Then when you want to send a message create a new cMessage object with the information you want sent and call the cMessagePublisher.SendMessage(cMessage) method This will send the message to any message handler that has been set-up to listen for this type of message. If no handler was defined for this type of message then the default handler will be used. If no default handler has been created then cMessagePublisher.SendMessage will return False.
See Also