Esempio n. 1
0
 public Inventory(string json)
 {
     var j = new JSON(json);
     foreach (var entry in (List<object>)j.fields["purchaseMap"]) {
         List<object> pair = (List<object>) entry;
         string key = pair[0].ToString();
         Purchase value = new Purchase(pair[1].ToString());
         _purchaseMap.Add(key, value);
     }
     foreach (var entry in (List<object>) j.fields["skuMap"]) {
         List<object> pair = (List<object>) entry;
         string key = pair[0].ToString();
         SkuDetails value = new SkuDetails(pair[1].ToString());
         _skuMap.Add(key, value);
     }
 }
Esempio n. 2
0
        public Inventory(string json)
        {
            var j = new JSON(json);

            foreach (var entry in (List <object>)j.fields["purchaseMap"])
            {
                List <object> pair  = (List <object>)entry;
                string        key   = pair[0].ToString();
                Purchase      value = new Purchase(pair[1].ToString());
                _purchaseMap.Add(key, value);
            }
            foreach (var entry in (List <object>)j.fields["skuMap"])
            {
                List <object> pair  = (List <object>)entry;
                string        key   = pair[0].ToString();
                SkuDetails    value = new SkuDetails(pair[1].ToString());
                _skuMap.Add(key, value);
            }
        }
Esempio n. 3
0
 public void AddSkuDetails(SkuDetails d)
 {
     _skuMap.Add(d.Sku, d);
 }
Esempio n. 4
0
 public void AddSkuDetails(SkuDetails d)
 {
     _skuMap.Add(d.Sku, d);
 }