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