C# Класс Microsoft.Practices.Prism.Events.EventBase

Defines a base class to publish and subscribe to events.
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
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.

Защищенные методы

Метод Описание
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.

Приватные методы

Метод Описание
PruneAndReturnStrategies ( ) : List>

Описание методов

Contains() публичный Метод

Returns if there is a subscriber matching SubscriptionToken.
public Contains ( SubscriptionToken token ) : bool
token SubscriptionToken The returned by while subscribing to the event.
Результат bool

InitializeDispatcher() публичный статический Метод

Initializes Dispatcher.
Can be run only once.
public static InitializeDispatcher ( Lazy dispatcher ) : void
dispatcher Lazy
Результат void

InternalPublish() защищенный Метод

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
Результат void

InternalSubscribe() защищенный Метод

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.
Результат SubscriptionToken

Unsubscribe() публичный Метод

Removes the subscriber matching the SubscriptionToken.
public Unsubscribe ( SubscriptionToken token ) : void
token SubscriptionToken The returned by while subscribing to the event.
Результат void