コード例 #1
0
 public static TradeHistory ReadFromJObject(JObject o)
 {
     return(new TradeHistory
     {
         List =
             ((IDictionary <string, JToken>)o).ToDictionary(item => int.Parse(item.Key),
                                                            item =>
                                                            Trade.ReadFromJObject(item.Value as JObject))
     });
 }
コード例 #2
0
ファイル: TradeHistory.cs プロジェクト: pepyakin/BtceApi
        public static TradeHistory ReadFromJObject(JObject o)
        {
            var r = new TradeHistory();

            r.List = new Dictionary <int, Trade>();
            foreach (var item in o)
            {
                var tradeId = int.Parse(item.Key);
                var trade   = Trade.ReadFromJObject(item.Value as JObject);
                r.List.Add(tradeId, trade);
            }

            return(r);
        }
コード例 #3
0
        public static TradeHistory ReadFromJObject(JObject o)
        {
            var list = new TradeHistory();

            list.List = new Dictionary <int, Trade>();
            foreach (var VARIABLE in o)
            {
                list.List.Add(key: int.Parse(VARIABLE.Key.ToString()), value: Trade.ReadFromJObject(VARIABLE.Value as JObject));
            }
            return(list);
            //return new TradeHistory() {
            //    List = o.OfType<KeyValuePair<string, JToken>>().ToDictionary(item => int.Parse(item.Key), item => Trade.ReadFromJObject(item.Value as JObject))
            //};
        }
コード例 #4
0
 public static TradeHistory ReadFromJObject(JObject o)
 {
     return(new TradeHistory()
     {
         List = o.OfType <KeyValuePair <string, JToken> >().ToDictionary(item => int.Parse(item.Key), item => Trade.ReadFromJObject(item.Value as JObject))
     });
 }