Beispiel #1
0
    public bool RemoveEvent(string eventName, EventDispatcherDelegate handler)
    {
        bool ret = false;

        if (_optionalParamEventDic.ContainsKey(eventName))
        {
            ret = _optionalParamEventDic[eventName].Remove(handler);
            if (_optionalParamEventDic[eventName].Count == 0)
            {
                _optionalParamEventDic.Remove(eventName);
            }
        }
        return(ret);
    }
Beispiel #2
0
    public void RegistEvent(string eventName, EventDispatcherDelegate handler)
    {
        List <EventDispatcherDelegate> handlerList;

        if (false == _optionalParamEventDic.TryGetValue(eventName, out handlerList))
        {
            handlerList = new List <EventDispatcherDelegate>();
            _optionalParamEventDic.Add(eventName, handlerList);
        }

        if (false == handlerList.Contains(handler))
        {
            handlerList.Add(handler);
        }
    }
Beispiel #3
0
 public bool RemoveEvent(int eventID, EventDispatcherDelegate handler)
 {
     return(RemoveEvent(eventID.ToString(), handler));
 }
Beispiel #4
0
 public void RegistEvent <T0, T1, T2, T3>(string eventName, EventDispatcherDelegate <T0, T1, T2, T3> handler)
 {
     RegistSpecificEvent(eventName, handler);
 }
Beispiel #5
0
 public void RegistEvent <T>(EventDispatcherDelegate handler)
 {
     RegistEvent(typeof(T).Name, handler);
 }
Beispiel #6
0
 public void RegistEvent(int eventID, EventDispatcherDelegate handler)
 {
     RegistEvent(eventID.ToString(), handler);
 }
Beispiel #7
0
 public bool RemoveEvent <T0, T1, T2, T3>(string eventName, EventDispatcherDelegate <T0, T1, T2, T3> handler)
 {
     return(DoRemoveEvent(eventName, handler));
 }
Beispiel #8
0
 public bool RemoveEvent <T>(EventDispatcherDelegate handler)
 {
     return(DoRemoveEvent(typeof(T).Name, handler));
 }