Пример #1
0
            internal static _Get Get()
            {
                if (_GetFunc == null)
                {
                    _GetFunc =
                        (_Get)Marshal.GetDelegateForFunctionPointer(
                            NativeLibrary.GetExport(
                                Torque3D.Torque3DLibHandle,
                                "fnHTTPObject_get"), typeof(_Get));
                }

                return(_GetFunc);
            }
Пример #2
0
            internal static _Get Get()
            {
                if (_GetFunc == null)
                {
                    _GetFunc =
                        (_Get)Marshal.GetDelegateForFunctionPointer(
                            Torque3D.DllLoadUtils.GetProcAddress(
                                Torque3D.Torque3DLibHandle,
                                "fnHTTPObject_get"), typeof(_Get));
                }

                return(_GetFunc);
            }
Пример #3
0
        /// <summary>
        /// 查询卡卷,调试
        /// </summary>
        /// <param name="carid">卡卷ID</param>
        /// <param name="access_token">access_token</param>
        /// <param name="_json">返回的json字符串</param>
        /// <returns>_Get_Card_Back.ok = true 返回正确 _Get_Card_Back.cardtype 卡卷类型</returns>
        public static _Get_Card Get_Debug(string carid, string access_token, out string _json)
        {
            _Get m = new _Get();

            m.card_id = carid;

            string jsonStr = JsonConvert.SerializeObject(m);
            string url     = string.Format(Misc.getcard, access_token);
            string json    = Http.HttpWebResponseUtility.PostHttpsString(url, jsonStr);

            _json = json;

            Dictionary <string, string> dicback = new Dictionary <string, string>();

            dicback = cheWeiXin.BackReader.get(json);

            _Get_Card getres = new _Get_Card();

            if (dicback.ContainsKey(CodeName.errcode))
            {
                getres.errcode = dicback[CodeName.errcode];
                getres.errmsg  = dicback[CodeName.errmsg];
                if (getres.errcode.Equals("0"))
                {
                    getres.ok = true;


                    if (json.IndexOf(CardType.GENERAL_COUPON.ToString()) > 0)
                    {
                        //是普通卡卷
                        _Get_Back_coupon get = new _Get_Back_coupon();
                        get = (_Get_Back_coupon)JsonConvert.DeserializeObject(json, typeof(_Get_Back_coupon));

                        getres.cardtype    = CardType.GENERAL_COUPON;
                        getres.base_info   = get.card.general_coupon.base_info;
                        getres.deal_detail = get.card.default_detail;
                    }
                    else if (json.IndexOf(CardType.CASH.ToString()) > 0)
                    {
                        //是现金卷
                        getres.cardtype = CardType.CASH;

                        _Get_Back_cash get = new _Get_Back_cash();
                        get = (_Get_Back_cash)JsonConvert.DeserializeObject(json, typeof(_Get_Back_cash));

                        getres.base_info   = get.card.cash.base_info;
                        getres.least_cost  = get.card.least_cost;
                        getres.reduce_cost = get.card.reduce_cost;
                    }
                    else if (json.IndexOf(CardType.DISCOUNT.ToString()) > 0)
                    {
                        getres.cardtype = CardType.DISCOUNT;

                        _Get_Back_discount get = new _Get_Back_discount();
                        get = (_Get_Back_discount)JsonConvert.DeserializeObject(json, typeof(_Get_Back_discount));

                        getres.base_info = get.card.discount.base_info;
                        getres.discount  = get.card.idiscount;
                    }
                    else if (json.IndexOf(CardType.GROUPON.ToString()) > 0)
                    {
                        getres.cardtype = CardType.GROUPON;

                        _Get_Back_groupon get = new _Get_Back_groupon();
                        get = (_Get_Back_groupon)JsonConvert.DeserializeObject(json, typeof(_Get_Back_groupon));

                        getres.base_info   = get.card.groupon.base_info;
                        getres.deal_detail = get.card.deal_detail;
                    }
                    else if (json.IndexOf(CardType.GIFT.ToString()) > 0)
                    {
                        getres.cardtype = CardType.GIFT;

                        _Get_Back_gift get = new _Get_Back_gift();
                        get = (_Get_Back_gift)JsonConvert.DeserializeObject(json, typeof(_Get_Back_gift));

                        getres.base_info = get.card.gift.base_info;
                        getres.gift      = get.card.sgift;
                    }
                }
            }


            return(getres);
        }
Пример #4
0
 static FAssetRegistryModule()
 {
     // Acquire functions
     _get = AcquireFunction<_Get>("FAssetRegistryModule::Get");
 }
 static FOutputDeviceRedirector()
 {
     // Acquire functions
     _get = AcquireFunction<_Get>("FOutputDeviceRedirector::Get");
 }