Joutsen  v0.4.1
Public Member Functions | Properties | Events | List of all members
Joutsen.System.Events.PayloadEvent< TPayload > Class Template Reference

A simple event class that can be used to fire an receive events. More...

Public Member Functions

 PayloadEvent (String eventName)
 Creates a new instance of an event. More...
 
virtual void Fire (TPayload payload)
 Fires the event with the payload. More...
 

Properties

string Name [get]
 The name of the event which will also be passed to the listeners when the event is fired. More...
 
- Properties inherited from Joutsen.System.Events.Event< TPayload >
String Name [get]
 The name of the event which will also be passed to the listeners when the event is fired. More...
 

Events

Action< string, TPayload > Fired
 The .NET event that will be fired if the event is fired. More...
 
- Events inherited from Joutsen.System.Events.Event< TPayload >
Action< string, TPayload > Fired
 The .NET event that will be fired if the event is fired. More...
 

Detailed Description

A simple event class that can be used to fire an receive events.

Template Parameters
TPayloadthe type of the payload of the event. The payload will be transfered to the listeners when the event is fired.
Remarks
this class is most commonly used with the Framework.System.Events.EventBus.
Since
0.2.0

Constructor & Destructor Documentation

◆ PayloadEvent()

Joutsen.System.Events.PayloadEvent< TPayload >.PayloadEvent ( String  eventName)

Creates a new instance of an event.

Parameters
namethe name of the event
Exceptions
System.ArgumentExceptionif the name is empty, null or consists only of wihtespace characters

Member Function Documentation

◆ Fire()

virtual void Joutsen.System.Events.PayloadEvent< TPayload >.Fire ( TPayload  payload)
virtual

Fires the event with the payload.

Parameters
payloadthe payload to send

Implements Joutsen.System.Events.Event< TPayload >.

Reimplemented in Joutsen.System.Events.AggregatingEvent< TPayload >.

Property Documentation

◆ Name

string Joutsen.System.Events.PayloadEvent< TPayload >.Name
get

The name of the event which will also be passed to the listeners when the event is fired.

Event Documentation

◆ Fired

Action<string, TPayload> Joutsen.System.Events.PayloadEvent< TPayload >.Fired

The .NET event that will be fired if the event is fired.