public static void HandleReply(string _reply, Model.Status _status, DataHandler _dataHandler)
    {
        try
        {
            JSONClass root = JSON.Parse(_reply).AsObject;
            _status.code = root["code"].AsInt;
            _status.message = root["message"].Value;

            if (0 == _status.code)
            {
                if(null != _dataHandler)
                    _dataHandler(root["data"].AsObject);
            }
            else
            {
                Log.Warning("ServiceUtility.HandleReply", "{0} : {1}", _status.code, _status.message);
            }
        }
        catch (System.Exception e)
        {
            Log.Warning("ServiceUtility.HandleReply", "{0}", e.Message);
            _status.code = -1;
            _status.message = e.Message;
        }
    }
Exemplo n.º 2
0
 partial void OnStatusChanging(Status value);
 public static void MergeBase(this Model.Status _this, Model.Status _status)
 {
     _this.code    = _status.code;
     _this.message = _status.message;
 }