Show / Hide Table of Contents

Class NotificationBase<TMessage>

Defines base functionality for pushing and subscribing to notifications.

Inheritance
System.Object
NotificationService
NotificationBase<TMessage>
Implements
INotificationService
NotificationService.DoPublish<T>(T)
NotificationService.DoSubscribe<T>(Action<T>, Boolean, Predicate<T>)
NotificationService.DoUnsubscribe(SubscriptionToken)
NotificationService.INotificationService.Publish<T>(T)
NotificationService.INotificationService.Subscribe<T>(Action<T>)
NotificationService.INotificationService.Subscribe<T>(Action<T>, Predicate<T>)
NotificationService.INotificationService.Unsubscribe(SubscriptionToken)
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Sartorius.SAF.Notification
Assembly: Sartorius.SAF.dll
Syntax
public abstract class NotificationBase<TMessage> : NotificationService, INotificationService
Type Parameters
Name Description
TMessage

The type of the message that is pushed to the subscribers.

Methods

View Source

Publish(TMessage)

Publishes the given message to all subscribers.

Declaration
public virtual void Publish(TMessage message)
Parameters
Type Name Description
TMessage message

The message to push.

View Source

Subscribe(Action<TMessage>)

Subscribes a delegate to an event that will be published on the PublisherThread.

Declaration
public virtual SubscriptionToken Subscribe(Action<TMessage> publishAction)
Parameters
Type Name Description
System.Action<TMessage> publishAction

The delegate that gets executed when the event is published.

Returns
Type Description
SubscriptionToken

A SubscriptionToken that uniquely identifies the added subscription.

View Source

Subscribe(Action<TMessage>, Predicate<TMessage>)

Subscribes a delegate to an event that will be published on the PublisherThread.

Declaration
public virtual SubscriptionToken Subscribe(Action<TMessage> publishAction, Predicate<TMessage> filter)
Parameters
Type Name Description
System.Action<TMessage> publishAction

The delegate that gets executed when the event is published.

System.Predicate<TMessage> filter

The filter.

Returns
Type Description
SubscriptionToken

A SubscriptionToken that uniquely identifies the added subscription.

View Source

Unsubscribe(SubscriptionToken)

Removes the subscriber matching SubscriptionToken from the subscribers' list.

Declaration
public virtual void Unsubscribe(SubscriptionToken subscriptionToken)
Parameters
Type Name Description
SubscriptionToken subscriptionToken

Implements

INotificationService

Extension Methods

CollectionExtensions.AddRange<T, TCollection>(TCollection, IEnumerable<T>)
SerializableObjectCloneExtension.Clone<T>(T)
  • View Source
Back to top Generated by DocFX