예제 #1
0
        private static List <MarketBuyOrder> ReadMarketBuyOrders(string result)
        {
            dynamic responseServerD = JsonConvert.DeserializeObject(result);
            dynamic ordersD         = responseServerD.data.orders;

            List <MarketBuyOrder> marketBuyOrders = new List <MarketBuyOrder>();

            if (ordersD != null)
            {
                foreach (dynamic order in ordersD)
                {
                    MarketBuyOrder marketBuyOrder = ReadMarketBuyOrder(order);
                    marketBuyOrders.Add(marketBuyOrder);
                }
            }

            return(marketBuyOrders);
        }
예제 #2
0
        private static MarketBuyOrder ReadMarketBuyOrder(dynamic order)
        {
            string   buyOrderId     = order.buy_order_id ?? null;
            string   marketHashName = order.market_hash_name ?? null;
            double?  price          = order.price ?? null;
            double?  suggestedPrice = order.suggested_price ?? null;
            bool?    isMine         = order.is_mine ?? null;
            DateTime?createdAt      = null;

            if (order.created_at != null)
            {
                createdAt = DateTimeExtension.FromUnixTime((long)order.created_at);
            }
            int?placeInQueue = order.place_in_queue ?? null;

            MarketBuyOrder marketBuyOrder = new MarketBuyOrder(buyOrderId, marketHashName, price, suggestedPrice, isMine, createdAt, placeInQueue);

            return(marketBuyOrder);
        }