示例#1
0
        private static List <SellHistoryRecord> ReadSellHistoryRecors(string result)
        {
            dynamic responseServerD = JsonConvert.DeserializeObject(result);
            dynamic itemsD          = responseServerD.data.items;

            List <SellHistoryRecord> sellHistoryRecords = new List <SellHistoryRecord>();

            if (itemsD != null)
            {
                foreach (dynamic item in itemsD)
                {
                    SellHistoryRecord sellHistoryRecord = ReadSellHistoryRecord(item);
                    sellHistoryRecords.Add(sellHistoryRecord);
                }
            }

            return(sellHistoryRecords);
        }
示例#2
0
        private static SellHistoryRecord ReadSellHistoryRecord(dynamic item)
        {
            AppId.AppName?appId = null;
            if (item.app_id != null)
            {
                appId = (AppId.AppName)(int) item.app_id;
            }
            string   itemId         = item.item_id;
            string   marketHashName = item.market_hash_name;
            double?  salePrice      = item.sale_price ?? null;
            DateTime?time           = null;

            if (item.time != null)
            {
                time = DateTimeExtension.FromUnixTime((long)item.time);
            }

            SellHistoryRecord sellHistoryRecord = new SellHistoryRecord(appId, itemId, marketHashName, salePrice, time);

            return(sellHistoryRecord);
        }