예제 #1
0
 public void UnRegisterHandler(int id, GUIMsgHandler handler)
 {
     if ((handler != null) && m_handlerDic.ContainsKey(id))
     {
         m_handlerDic[id] = (GUIMsgHandler)Delegate.Remove((GUIMsgHandler)m_handlerDic[id], handler);
         if (m_handlerDic[id] == null)
         {
             m_handlerDic.Remove(id);
         }
     }
 }
예제 #2
0
 public void RegisterHandler(int id, GUIMsgHandler handler)
 {
     if (handler == null)
     {
         Logger.LogWarning("handler is null");
     }
     else
     {
         if (!m_handlerDic.ContainsKey(id))
         {
             m_handlerDic.Add(id, null);
         }
         m_handlerDic[id] = (GUIMsgHandler)Delegate.Combine((GUIMsgHandler)m_handlerDic[id], handler);
     }
 }