Ejemplo n.º 1
0
        public virtual void FinishedCallback <T>(T resp, BmobException ex)
        {
            if (resp != null)
            {
                var pObjectId = resp.GetType().GetProperty("objectId");
                if (pObjectId != null)
                {
                    var value = (String)pObjectId.GetValue(resp, null);
                    if (!Utilities.Empty(value))
                    {
                        LatestObjectId = value;
                    }
                }

                var pSessionToken = resp.GetType().GetProperty("sessionToken");
                if (pSessionToken != null)
                {
                    var value = (String)pSessionToken.GetValue(resp, null);
                    if (!Utilities.Empty(value))
                    {
                        LatestSessionToken = value;
                    }
                }
            }

            Console.WriteLine();
            Console.WriteLine("\n返回结果打印输出(用户可以获取的数据): " + JsonAdapter.JSON.ToDebugJsonString(resp));
            Console.WriteLine("\n返回结果: " + JsonAdapter.JSON.ToDebugJsonString(resp));
            Console.WriteLine("\n返回结果异常信息输出: " + ex);

            if (ex != null)
            {
                Assert.Fail(ex.Message);
            }
        }
Ejemplo n.º 2
0
        protected void onPostExecute(String result, Status status, BmobException exception, BmobCallback <T> fCallback)
        {
            T             data;
            BmobException ex;

            if (exception != null)
            {
                data = default(T);
                if (result == null)
                {
                    ex = exception;
                }
                else
                {
                    ex = new BmobException(exception.Message + ", and response content is " + result, exception.InnerException);
                }
            }
            else
            {
                BmobResponseParser <T> parser = getResponseParser(status);
                parser.parse(result);

                data = parser.data;
                ex   = parser.exception;
            }

            if (ex != null)
            {
                BmobDebug.T("[ BmobCommand ] after parse response, error: '" + ex.Message + "'");
            }

            fCallback(data, ex);
        }
Ejemplo n.º 3
0
        //~WaitRequestFinishTest()
        //{
        //    WaitUnitFinish.Close();
        //}

        public override void FinishedCallback <T>(T resp, BmobException ex)
        {
            try
            {
                base.FinishedCallback(resp, ex);
            }
            finally
            {
                releaseLock();
            }
        }
Ejemplo n.º 4
0
 private void NonCallback <T>(T resp, BmobException ex)
 {
 }