Ejemplo n.º 1
0
        public static TradeInventoryApp ProcessInventoryApp(IDictionary <string, object> inv)
        {
            var invApp = new TradeInventoryApp();

            invApp.appid             = (inv["appid"] as int?).Value;
            invApp.name              = inv["name"] as string;
            invApp.icon              = inv["icon"] as string;
            invApp.link              = inv["link"] as string;
            invApp.asset_count       = (inv["asset_count"] as int?).Value;
            invApp.inventory_logo    = inv["inventory_logo"] as string;
            invApp.trade_permissions = inv["trade_permissions"] as string;
            invApp.contexts          = new List <TradeInventoryAppContext>();

            foreach (var kvp in inv["rgContexts"] as IDictionary <string, object> )
            {
                var i   = kvp.Value as IDictionary <string, object>;
                var ctx = new TradeInventoryAppContext();
                var id  = i["id"] as string;
                ctx.id          = int.Parse(id);
                ctx.name        = i["name"] as string;
                ctx.asset_count = (i["asset_count"] as int?).Value;

                invApp.contexts.Add(ctx);
            }

            return(invApp);
        }
Ejemplo n.º 2
0
        public static TradeInventoryApp ProcessInventoryApp(IDictionary<string, object> inv)
        {
            var invApp = new TradeInventoryApp();

            invApp.appid = (inv["appid"] as int?).Value;
            invApp.name = inv["name"] as string;
            invApp.icon = inv["icon"] as string;
            invApp.link = inv["link"] as string;
            invApp.asset_count = (inv["asset_count"] as int?).Value;
            invApp.inventory_logo = inv["inventory_logo"] as string;
            invApp.trade_permissions = inv["trade_permissions"] as string;
            invApp.contexts = new List<TradeInventoryAppContext>();

            foreach (var kvp in inv["rgContexts"] as IDictionary<string, object>)
            {
                var i = kvp.Value as IDictionary<string, object>;
                var ctx = new TradeInventoryAppContext();
                var id = i["id"] as string;
                ctx.id = int.Parse(id);
                ctx.name = i["name"] as string;
                ctx.asset_count = (i["asset_count"] as int?).Value;

                invApp.contexts.Add(ctx);
            }

            return invApp;
        }