C# Class Contrive.Common.EventAggregator

Enables loosely-coupled publication of and subscription to events.
Inheritance: IEventAggregator
Mostra file Open project: alanstevens/Contrive

Public Properties

Property Type Description
DefaultPublicationThreadMarshaller Action

Public Methods

Method Description
EventAggregator ( ) : System

Initializes a new instance of the EventAggregator class.

Publish ( object message ) : void

Publishes a message.

Does not marshall the the publication to any special thread by default.

Publish ( object message, Action marshal ) : void

Publishes a message.

Subscribe ( object instance ) : void

Subscribes an instance to all events declared through implementations of IHandle{T}

Unsubscribe ( object instance ) : void

Unsubscribes the instance from all events.

Method Details

EventAggregator() public method

Initializes a new instance of the EventAggregator class.
public EventAggregator ( ) : System
return System

Publish() public method

Publishes a message.
Does not marshall the the publication to any special thread by default.
public Publish ( object message ) : void
message object The message instance.
return void

Publish() public method

Publishes a message.
public Publish ( object message, Action marshal ) : void
message object The message instance.
marshal Action Allows the publisher to provide a custom thread marshaller for the message publication.
return void

Subscribe() public method

Subscribes an instance to all events declared through implementations of IHandle{T}
public Subscribe ( object instance ) : void
instance object The instance to subscribe for event publication.
return void

Unsubscribe() public method

Unsubscribes the instance from all events.
public Unsubscribe ( object instance ) : void
instance object The instance to unsubscribe.
return void

Property Details

DefaultPublicationThreadMarshaller public_oe static_oe property

The default thread marshaller used for publication;
public static Action DefaultPublicationThreadMarshaller
return Action