/// <summary>
    /// 订阅事件
    /// </summary>
    public void Regist(string eventName, MyEventHandler handler)
    {
        if (handler == null)
        {
            return;
        }

        if (!listeners.ContainsKey(eventName))
        {
            listeners.Add(eventName, new Dictionary <int, MyEventHandler>());
        }
        var handlerDic  = listeners[eventName];
        var handlerHash = handler.GetHashCode();

        if (handlerDic.ContainsKey(handlerHash))
        {
            handlerDic.Remove(handlerHash);
        }
        listeners[eventName].Add(handler.GetHashCode(), handler);
    }
    /// <summary>
    /// 注销事件
    /// </summary>
    public void UnRegist(string eventName, MyEventHandler handler)
    {
        if (handler == null)
        {
            return;
        }

        if (listeners.ContainsKey(eventName))
        {
            listeners[eventName].Remove(handler.GetHashCode());
            if (null == listeners[eventName] || 0 == listeners[eventName].Count)
            {
                listeners.Remove(eventName);
            }
        }
    }