Show / Hide Table of Contents

Class EventSubscriber

A disposable class for subscribing to Phoenix events.

Inheritance
System.Object
EventSubscriber
Implements
System.IDisposable
Inherited Members
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: Phoenix.Controls
Assembly: Phoenix.Controls.dll
Syntax
public class EventSubscriber : IDisposable

Constructors

View Source

EventSubscriber(IEventAggregator)

Initializes a new instance of the EventSubscriber class.

Declaration
public EventSubscriber(IEventAggregator eventAggregator)
Parameters
Type Name Description
IEventAggregator eventAggregator

The event aggregator.

Methods

View Source

Add(SubscriptionToken)

Adds a subscription token.

Declaration
public void Add(SubscriptionToken token)
Parameters
Type Name Description
SubscriptionToken token

The token.

View Source

Add<TEvent>(Action, ThreadOption, Boolean)

Adds an event subscription.

Declaration
public void Add<TEvent>(Action action, ThreadOption threadOption = null, bool keepSubscriberReferenceAlive = false)
    where TEvent : PubSubEvent, new()
Parameters
Type Name Description
System.Action action

The action to run.

ThreadOption threadOption

Specifies on which thread to receive the delegate callback.

System.Boolean keepSubscriberReferenceAlive

When true, the PubSubEvent keeps a reference to the subscriber so it does not get garbage collected.

Type Parameters
Name Description
TEvent

The event type.

View Source

Add<TEvent, TArgs>(Action<TArgs>)

Adds an event subscription.

Declaration
public void Add<TEvent, TArgs>(Action<TArgs> action)
    where TEvent : PubSubEvent<TArgs>, new()
Parameters
Type Name Description
System.Action<TArgs> action

The action to run.

Type Parameters
Name Description
TEvent

The event type.

TArgs

The event args type.

View Source

Add<TEvent, TArgs>(Action<TArgs>, ThreadOption, Boolean, Predicate<TArgs>)

Adds an event subscription.

Declaration
public void Add<TEvent, TArgs>(Action<TArgs> action, ThreadOption threadOption, bool keepSubscriberReferenceAlive = false, Predicate<TArgs> filter = null)
    where TEvent : PubSubEvent<TArgs>, new()
Parameters
Type Name Description
System.Action<TArgs> action

The action to run.

ThreadOption threadOption

Specifies on which thread to receive the delegate callback.

System.Boolean keepSubscriberReferenceAlive

When true, the PubSubEvent keeps a reference to the subscriber so it does not get garbage collected.

System.Predicate<TArgs> filter

Filter to evaluate if the subscriber should receive the event.

Type Parameters
Name Description
TEvent

The event type.

TArgs

The event args type.

View Source

Dispose()

Declaration
public void Dispose()

Implements

System.IDisposable
  • View Source
In This Article
Back to top Generated by DocFX