static public void Broadcast(string eventType, DispatchMode mode) { DispatcherInternal.OnBroadcasting(eventType, mode); Delegate d; if (eventTable.TryGetValue(eventType, out d)) { Callback callback = d as Callback; if (callback != null) { callback(); } else { throw DispatcherInternal.CreateBroadcastSignatureException(eventType); } } }
static public void RemoveListener(string eventType, Callback handler) { DispatcherInternal.OnListenerRemoving(eventType, handler); eventTable[eventType] = (Callback)eventTable[eventType] - handler; DispatcherInternal.OnListenerRemoved(eventType); }
static public void AddListener(string eventType, Callback handler) { DispatcherInternal.OnListenerAdding(eventType, handler); eventTable[eventType] = (Callback)eventTable[eventType] + handler; }