Events
Facility
Location: igium / Igium.Web / gotype.js / Events
Examples: Igium.Web Examples
Public
Facility | Test | Description |
---|---|---|
[Event], function <eventName>(){} |
N | Defines an instance multicast event |
[Static, Event], function <eventName>(){} |
N | Defines a static multicast event |
this.<eventName>([sender [, eventArgs]]); |
N | Fires an instance event and passes both arguments to all event handlers; sender and eventArgs are optional; by convention, when firing instance events, set sender to this , and when firing static events, set sender to the System.Type of the fireing type, e.g. typeinfo(MyNamespace.MyType) (see Type Info) |
<Type>.<eventName>([sender [, eventArgs]]); |
N | Fires a static event and passes both arguments to all event handlers, e.g. MyNamespace.MyType.<eventName>(typeinfo(MyNamespace.MyType), {}) |
obj/type.<eventName>.subscribe(handler: Function): Number |
N | Adds an event handler; returns a subscriber id required for removing the event handler later |
obj/type.<eventName>.subscribe(this.<obj_eventName>.bind(this)): Number |
N | Adds an instance event handler |
obj/type.<eventName>.unsubscribe(subscriberId: Number) |
N | Removes an event handler; throws an exception if the subscriberId is not registered with this event |
obj/type.<eventName>.getSubscriberCount() |
N | Returns the number of event handler currently registered with the event |
Unit tests: TODO