Attempts to add a listener.
The registered Id of the listener.
Id
ArgumentNullException if the listener is null.
ArgumentNullException
ArgumentException if the listener already exists.
ArgumentException
Clears all listeners.
The number of listeners cleared.
Registers a listener. If the listener already exists, nothing changes and the original Id is returned.
Removes a listener by Id.
The listener or undefined if not found.
Attempts to add a listener.