Table of Contents

TEvent<T> Record

Generic multicast event record that implements the observer pattern, allowing multiple listeners to subscribe to and unsubscribe from an event.

Remarks

TEvent<T> provides a lightweight multicast delegate mechanism. The type parameter T is typically a method reference or event handler type. Listeners are stored in a dynamic array for efficient iteration when the event is raised.

Syntax

Unit: Bcl.Types

TEvent<T> = record;

Methods

Name Description
Subscribe Adds a listener to the event's subscription list.
Unsubscribe Removes a listener from the event's subscription list.
Listeners Returns an array containing all currently subscribed listeners.
HasListeners Indicates whether there are any listeners currently subscribed to this event.