Show / Hide Table of Contents

Class Event<TArg0, TArg1, TArg2>

A three argument event.

Inheritance
System.Object
EventBase
Event<TArg0, TArg1, TArg2>
Namespace: FasterGames.Whiskey.Events
Assembly: cs.temp.dll.dll
Syntax
public abstract class Event<TArg0, TArg1, TArg2> : EventBase
Type Parameters
Name Description
TArg0

Argument type 1

TArg1

Argument type 2

TArg2

Argument type 3

Fields

Listeners

Storage for the bound listeners.

Declaration
protected readonly List<Action<TArg0, TArg1, TArg2>> Listeners
Field Value
Type Description
System.Collections.Generic.List<Action<TArg0, TArg1, TArg2>>

Properties

EventTypes

The argument types of the event.

Declaration
public override List<Type> EventTypes { get; }
Property Value
Type Description
System.Collections.Generic.List<Type>
Overrides
EventBase.EventTypes

ListenerCount

The number of currently listening listeners.

Declaration
public override int ListenerCount { get; }
Property Value
Type Description
System.Int32
Overrides
EventBase.ListenerCount

Methods

AddListener(Action<TArg0, TArg1, TArg2>)

Add a listener to be invoked when the event is raised with Raise(TArg0, TArg1, TArg2).

Declaration
public void AddListener(Action<TArg0, TArg1, TArg2> listener)
Parameters
Type Name Description
Action<TArg0, TArg1, TArg2> listener

listener

Raise(TArg0, TArg1, TArg2)

Raise the event, invoking all listeners.

Declaration
public void Raise(TArg0 arg0, TArg1 arg1, TArg2 arg2)
Parameters
Type Name Description
TArg0 arg0

first argument

TArg1 arg1

second argument

TArg2 arg2

third argument

Raise(Box<TArg0>, Box<TArg1>, Box<TArg2>)

Raise the event with a box, invoking all listeners.

Declaration
public void Raise(Box<TArg0> arg0, Box<TArg1> arg1, Box<TArg2> arg2)
Parameters
Type Name Description
Box<TArg0> arg0

first argument, boxed

Box<TArg1> arg1

second argument, boxed

Box<TArg2> arg2

third argument, boxed

Remarks

The value inside the box will be used to raise the event.

RemoveListener(Action<TArg0, TArg1, TArg2>)

Remove a listener, so it will no longer be invoked when the event is raised with Raise(TArg0, TArg1, TArg2)

Declaration
public void RemoveListener(Action<TArg0, TArg1, TArg2> listener)
Parameters
Type Name Description
Action<TArg0, TArg1, TArg2> listener

listener

UnsafeRaise(Object[])

An unsafe (can fail at runtime) hook to raise events. Do not use.

Declaration
public override void UnsafeRaise(params object[] args)
Parameters
Type Name Description
System.Object[] args

event arguments

Overrides
EventBase.UnsafeRaise(Object[])
Remarks

This exists to expose a hook for generic code (e.g. editors) that may want to invoke events knowing only the base type.

In This Article
Back to top Copyright FasterGames ©