public static void LoadItemsFromJson() { _items = new Dictionary<Guid, KnownDescriptor> (); //TODO: switch over to DescriptorStack.Text when it gets bound. KnownDescriptor descriptor; string itemsJson = ResourceLoader.GetEmbeddedResourceString (typeof(KnownDescriptors).GetTypeInfo ().Assembly, "KnownDescriptors.json"); var json = JValue.Parse (itemsJson); foreach (var item in json.Children() ) { JProperty prop = item as JProperty; descriptor = new KnownDescriptor () { Name = prop.Value.ToString(), ID = Guid.ParseExact (prop.Name, "d") }; _items.Add (descriptor.ID, descriptor); } }
public static void LoadItemsFromJson() { _items = new Dictionary <Guid, KnownDescriptor> (); //TODO: switch over to DescriptorStack.Text when it gets bound. KnownDescriptor descriptor; string itemsJson = ResourceLoader.GetEmbeddedResourceString(typeof(KnownDescriptors).GetTypeInfo().Assembly, "KnownDescriptors.json"); var json = JValue.Parse(itemsJson); foreach (var item in json.Children()) { JProperty prop = item as JProperty; descriptor = new KnownDescriptor() { Name = prop.Value.ToString(), ID = Guid.ParseExact(prop.Name, "d") }; _items.Add(descriptor.ID, descriptor); } }