예제 #1
0
 public static void SaveItems(IEnumerable<string> regionItems, IEnumerable<string> themeItems)
 {
     var toJsonObject = new MenuItemsJson (){ Region = regionItems, Theme = themeItems };
     string serialized = JsonConvert.SerializeObject(toJsonObject);
     File.WriteAllText("menuitems.txt", serialized);
 }
예제 #2
0
 static MenuItemsReader()
 {
     string menuItemsJson = File.ReadAllText("menuitems.txt");
     _menuItems = JsonConvert.DeserializeObject<MenuItemsJson>(menuItemsJson);
 }