public static WallpaperManifest GetWallpaper(string path) { string settingsFile = SettingsUtil.ReadSettingsAsString(path); WallpaperManifest result; result = JsonConvert.DeserializeObject <WallpaperManifest>(settingsFile); return(result); }
public static WallpapersManifest GetWallpapersList(string path) { string jsonData = SettingsUtil.ReadSettingsAsString(path); List <WallpaperManifestItem> list = new List <WallpaperManifestItem>(); JObject obj = JObject.Parse(jsonData); JArray data = (JArray)obj["wallpapers"]; if (data != null && data.Count > 0) { foreach (var item in data) { list.Add(JsonConvert.DeserializeObject <WallpaperManifestItem>(item.ToString())); } } WallpapersManifest wallpaperManifest = new WallpapersManifest(); wallpaperManifest.list = list; wallpaperManifest.nextID = (int)obj["nextID"]; return(wallpaperManifest); }