Exemple #1
0
    static public void Dispatch <T1, T2>(string evt, T1 param1, T2 param2)
    {
        HashSet <Delegate> hashSet;

        if (!callbackFuncs.TryGetValue(evt, out hashSet))
        {
            return;
        }
        HashSet <Delegate> .Enumerator em = hashSet.GetEnumerator();
        do
        {
            CALLBACK_FUNC_2 <T1, T2> handler = (em.Current as CALLBACK_FUNC_2 <T1, T2>);
            if (handler == null)
            {
                continue;
            }
            handler.Invoke(param1, param2);
        } while (em.MoveNext());
    }
Exemple #2
0
 static public void RemoveListener <T1, T2>(string evt, CALLBACK_FUNC_2 <T1, T2> func)
 {
     TryRemoveDelegate(evt, func);
 }
Exemple #3
0
 static public void AddListener <T1, T2>(string evt, CALLBACK_FUNC_2 <T1, T2> func)
 {
     TryAddDelegate(evt, func);
 }