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