Ejemplo n.º 1
0
        public static async Task <Episode> LoadEpisodeAsync(String path)
        {
            try
            {
                Episode episode = new Episode();

                StorageFolder folder = await StorageFolder.GetFolderFromPathAsync(path);

                IReadOnlyList <StorageFile> fileList = await folder.GetFilesAsync();

                foreach (StorageFile file in fileList)
                {
                    episode.AddPage(file.Path);
                }
                DirectoryInfo info = new DirectoryInfo(path);
                episode.SetDirectory(info.Name);
                return(episode);
            }
            catch (DirectoryNotFoundException)
            {
                await CreateMessageAsync("Ocurrió un error al leer el archivo: " + path);

                return(null);
            }
        }