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

Defines a base class to publish and subscribe to events.
Afficher le fichier Open project: xperiandri/PortablePrism Class Usage Examples

Méthodes publiques

Méthode 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.

Méthodes protégées

Méthode 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

Méthode Description
PruneAndReturnStrategies ( ) : List>

Method Details

Contains() public méthode

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

InitializeDispatcher() public static méthode

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

InternalPublish() protected méthode

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
Résultat void

InternalSubscribe() protected méthode

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.
Résultat SubscriptionToken

Unsubscribe() public méthode

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