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); } } }
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); } }