Class NotificationService
Implements a simple notification service.
Implements
Namespace: Sartorius.SAF.Notification
Assembly: Sartorius.SAF.dll
Syntax
[Export(typeof(INotificationService))]
public class NotificationService : INotificationService
Methods
View SourceDoPublish<T>(T)
Publishes the notification to all subscribers.
Declaration
protected virtual void DoPublish<T>(T notification)
Parameters
| Type | Name | Description |
|---|---|---|
| T | notification | The arguments that are passed to the subscribers. |
Type Parameters
| Name | Description |
|---|---|
| T |
DoSubscribe<T>(Action<T>, bool, Predicate<T>)
Subscribes a delegate to an event.
Declaration
protected virtual SubscriptionToken DoSubscribe<T>(Action<T> action, bool keepSubscriberReferenceAlive, Predicate<T> filter)
Parameters
| Type | Name | Description |
|---|---|---|
| Action<T> | action | The delegate that gets executed when the payload is published. |
| bool | keepSubscriberReferenceAlive | When true, the CompositePresentationEvent keeps a reference to the subscriber so it does not get garbage collected. |
| Predicate<T> | filter | Filter to evaluate if the subscriber should receive the event. |
Returns
| Type | Description |
|---|---|
| SubscriptionToken | A SubscriptionToken that uniquely identifies the added subscription. |
Type Parameters
| Name | Description |
|---|---|
| T |
DoUnsubscribe(SubscriptionToken)
Removes the subscriber matching the SubscriptionToken.
Declaration
protected virtual void DoUnsubscribe(SubscriptionToken subscriptionToken)
Parameters
| Type | Name | Description |
|---|---|---|
| SubscriptionToken | subscriptionToken | The SubscriptionToken. |