public static List <Manga> CargarDatos() { List <Manga> Mangas = new List <Manga>(); List <List <String> > arregloMangas = Clases.XmlIO.ReadJsonEpisodios(); List <List <String> > arregloDatos = Clases.XmlIO.ReadJsonData(); int cont = 0; if (arregloMangas != null && arregloDatos != null) { foreach (List <String> value in arregloDatos) { Manga manga = new Manga(); manga.SetDirectory(value.ElementAt(1)); manga.SetName(value.ElementAt(2)); Int32.TryParse(value.ElementAt(0), out int result); manga.SetUltimoEpisodioLeido(result); Int32.TryParse(value.ElementAt(3), out result); manga.SetDirección(result); foreach (String value2 in arregloMangas.ElementAt(cont)) { Episode episode = new Episode(); episode.SetDirectory(value2); manga.SetEpisode(episode); } cont++; Mangas.Add(manga); } } return(Mangas); }
public static async Task <Manga> LoadAllAsync(StorageFolder folder, String path, String name, String Actual, String direccion) { var boolean = StorageApplicationPermissions.FutureAccessList.ContainsItem(folder.Name); if (!boolean) { Debug.WriteLine("No tiene acceso" + folder.Name); } try { IReadOnlyList <StorageFolder> fileList = await folder.GetFoldersAsync(); if (fileList.Count() > 0) { Manga manga = new Manga(); manga.SetDirectory(path); manga.SetName(name); Int32.TryParse(Actual, out int result); manga.SetUltimoEpisodioLeido(result); Int32.TryParse(direccion, out result); manga.SetDirección(result); foreach (StorageFolder file in fileList) { Episode episode = new Episode(); episode.SetDirectory(file.Path); manga.SetEpisode(episode); } return(manga); } } catch (UnauthorizedAccessException) { return(null); } return(null); }