/// <summary>
 ///     获取函数
 /// </summary>
 /// <param name="eventType"></param>
 /// <returns></returns>
 public Func <object, object> GetFunc(WeChatFrameworkFuncTypes eventType)
 {
     if (Funcs.ContainsKey(eventType))
     {
         return(Funcs[eventType]);
     }
     return(null);
 }
 /// <summary>
 ///     注册函数
 /// </summary>
 /// <param name="eventType"></param>
 /// <param name="func"></param>
 public void Register(WeChatFrameworkFuncTypes eventType, Func <object, object> func)
 {
     if (Funcs.ContainsKey(eventType))
     {
         throw new Exception(string.Format("{0}已经注册,不能重复注册!", eventType));
     }
     Funcs.AddOrUpdate(eventType, func, (tKey, existingVal) => { return(func); });
 }
 /// <summary>
 /// 获取函数
 /// </summary>
 /// <param name="eventType"></param>
 /// <returns></returns>
 public Func <object, object> GetFunc(WeChatFrameworkFuncTypes eventType)
 {
     if (IsRegister(eventType))
     {
         return(Funcs[eventType]);
     }
     return(null);
 }
        /// <summary>
        ///     执行函数 支付
        /// </summary>
        /// <param name="eventType"></param>
        /// <param name="obj"></param>
        public object InvokeFunc(WeChatFrameworkFuncTypes eventType, WeChatPayCallbackFuncArgInfo obj)
        {
            var func = GetFunc(eventType);

            if (func != null)
            {
                return(func.Invoke(obj));
            }
            return(null);
        }
 public WeChatSDKBuilder Register(WeChatFrameworkFuncTypes type, Func <object, object> func)
 {
     FuncDics.Add(type, func);
     return(this);
 }
 /// <summary>
 /// 是否已注册
 /// </summary>
 /// <param name="eventType"></param>
 /// <returns></returns>
 public bool IsRegister(WeChatFrameworkFuncTypes eventType)
 {
     return(Funcs.ContainsKey(eventType));
 }