C# Class Microsoft.Practices.Prism.Events.EventBase

Defines a base class to publish and subscribe to events.
Mostra file Open project: xperiandri/PortablePrism Class Usage Examples

Public Methods

Method Description
Contains ( SubscriptionToken token ) : bool

Returns if there is a subscriber matching SubscriptionToken.

InitializeDispatcher ( Lazy dispatcher ) : void

Initializes Dispatcher.

Can be run only once.

Unsubscribe ( SubscriptionToken token ) : void

Removes the subscriber matching the SubscriptionToken.

Protected Methods

Method Description
InternalPublish ( ) : void

Calls all the execution strategies exposed by the list of IEventSubscription.

Before executing the strategies, this class will prune all the subscribers from the list that return a Action{T} when calling the IEventSubscription.GetExecutionStrategy method.

InternalSubscribe ( IEventSubscription eventSubscription ) : SubscriptionToken

Adds the specified IEventSubscription to the subscribers' collection.

Adds the subscription to the internal list and assigns it a new SubscriptionToken.

Private Methods

Method Description
PruneAndReturnStrategies ( ) : List>

Method Details

Contains() public method

Returns if there is a subscriber matching SubscriptionToken.
public Contains ( SubscriptionToken token ) : bool
token SubscriptionToken The returned by while subscribing to the event.
return bool

InitializeDispatcher() public static method

Initializes Dispatcher.
Can be run only once.
public static InitializeDispatcher ( Lazy dispatcher ) : void
dispatcher Lazy
return void

InternalPublish() protected method

Calls all the execution strategies exposed by the list of IEventSubscription.
Before executing the strategies, this class will prune all the subscribers from the list that return a Action{T} when calling the IEventSubscription.GetExecutionStrategy method.
protected InternalPublish ( ) : void
return void

InternalSubscribe() protected method

Adds the specified IEventSubscription to the subscribers' collection.
Adds the subscription to the internal list and assigns it a new SubscriptionToken.
protected InternalSubscribe ( IEventSubscription eventSubscription ) : SubscriptionToken
eventSubscription IEventSubscription The subscriber.
return SubscriptionToken

Unsubscribe() public method

Removes the subscriber matching the SubscriptionToken.
public Unsubscribe ( SubscriptionToken token ) : void
token SubscriptionToken The returned by while subscribing to the event.
return void