PeanutButter
Loading...
Searching...
No Matches
PeanutButter.TinyEventAggregator.Subscription< TPayload > Class Template Reference

Represents a subscription for a specific event and payload. More...

Public Types

enum  FuturePublicationsStates { Infinite , NotExpired , Expired }
 States for future publication. More...

Public Member Functions

 Subscription (Action< TPayload > receiver, int limit=0)
 Create a subscription with the provided receiver and an optional limit. If the limit is set to zero or lower then the subscription is fired until unsubscribed.
bool OnlyOneCallLeft ()
 Helper: if there's only one call left.
void DecrementRemainingCallCount ()
 Decrements the remaining allowed call count, if applicable.

Properties

SubscriptionToken Token [get, protected set]
 The token representing this subscription.
Action< TPayload > Receiver [get, protected set]
 The receiver when this subscription is fired.
int RemainingCalls [get, protected set]
 How many times this subscription can be called in the future.

Detailed Description

Represents a subscription for a specific event and payload.

Template Parameters
TPayload

Member Enumeration Documentation

◆ FuturePublicationsStates

enum PeanutButter.TinyEventAggregator.Subscription-1-g.FuturePublicationsStates

States for future publication.

Enumerator
Infinite 

Infinite.

NotExpired 

Not expired.

Expired 

Has expired.

Member Function Documentation

◆ OnlyOneCallLeft()

bool PeanutButter.TinyEventAggregator.Subscription< TPayload >.OnlyOneCallLeft ( )

Helper: if there's only one call left.

Returns

◆ Subscription()

PeanutButter.TinyEventAggregator.Subscription< TPayload >.Subscription ( Action< TPayload > receiver,
int limit = 0 )

Create a subscription with the provided receiver and an optional limit. If the limit is set to zero or lower then the subscription is fired until unsubscribed.

Parameters
receiver
limit

The documentation for this class was generated from the following file:
  • source/TinyEventAggregator/PeanutButter.TinyEventAggregator/Subscription.cs