示例#1
0
        public void TranslationJsonEx(string json, Action <List <JsonTrainData> > callback)
        {
            var trainList = new List <JsonTrainData>();

            try
            {
                if (json != "")
                {
                    var obj = (JObject)JsonConvert.DeserializeObject(json);
                    if (obj["data"]["datas"].Any())
                    {
                        for (int i = 0; i < obj["data"]["datas"].Count(); i++)
                        {
                            var train     = obj["data"]["datas"][i] as JObject;
                            var trainData = new JsonTrainData();
                            trainData.QueryLeftNewDto = new QueryLeftNewDTO(train);
                            trainList.Add(trainData);
                        }
                    }
                }
            }
            catch (Exception ee)
            {
                new LogInfo().WriteLine(String.Format("Entry:HTML_Translation_TranslationJsonEx()\r\nException Catch:{0}\r\nSource:{1}\r\nException:{2}", ee.Message, ee.Source, ee.InnerException));
            }
            callback(trainList);
        }
示例#2
0
        public JsonTrainData CloneJsonTrainData()
        {
            var _data = new JsonTrainData();

            _data.ButtonTextInfo  = buttonTextInfo;
            _data.QueryLeftNewDto = queryLeftNewDto;
            _data.SecretStr       = secretStr;
            return(_data);
        }