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