예제 #1
0
        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);
                }
            }
        }
예제 #2
0
 public static void RemoveListener(string eventType, Callback handler)
 {
     ListenerInternal.OnListenerRemoving(eventType, handler);
     eventTable[eventType] = (Callback)eventTable[eventType] - handler;
     ListenerInternal.OnListenerRemoved(eventType);
 }
예제 #3
0
 public static void AddListener(string eventType, Callback handler)
 {
     ListenerInternal.OnListenerAdding(eventType, handler);
     eventTable[eventType] = (Callback)eventTable[eventType] + handler;
 }