Event<TSource, TEventArgs> Class
The event object used for client-side events.
#Declaration
export class Event<TSource, TEventArgs extends EventArgs>
#Type Parameters
Name | Description | |
---|---|---|
TSource | The type of an event source. |
|
TEvent |
Event |
The type of an event argument. |
#Inheritance
#Methods
#addHandler(handler) Method
Dynamically connects the event with an appropriate event handler function.
#Declaration
addHandler(
handler: (s?: TSource,
e?: TEventArgs) => void,
executionContext?: TSource
): void
#Parameters
Name | Type | Description |
---|---|---|
handler | (s?: TSource, e?: TEvent |
The event handler function’s content. |
execution |
TSource | The source. |
#clearHandlers Method
Dynamically disconnects the event from all the associated event handler functions.
#Declaration
clearHandlers(): void
#isEmpty Method
Gets whether the event handler is empty.
#Declaration
isEmpty(): boolean
#Returns
Type | Description |
---|---|
boolean | true, if the event handler content is empty; otherwise, false |
#removeHandler(handler) Method
Dynamically disconnects the event from the associated event handler function.
#Declaration
removeHandler(
handler: (s?: TSource,
e?: TEventArgs) => void,
executionContext?: TSource
): void
#Parameters
Name | Type | Description |
---|---|---|
handler | (s?: TSource, e?: TEvent |
The event handler function’s content. |
execution |
TSource | The source. |