Пример #1
0
        public async void TestBookParsingAsync(string filePath)
        {
            // Create the book and start testing it
            EpubBook book = await EpubReader.ReadBookAsync(filePath);

            TestBook(book);
        }
Пример #2
0
        private static async Task Main()
        {
            const string filename = "1.epub";
            var          bytes    = await File.ReadAllBytesAsync(filename);

            var stream = new MemoryStream(bytes);

            var book = await EpubReader.ReadBookAsync(stream);

            var bookFromFile = await EpubReader.ReadBookAsync(filename);

            var contentAsPlainText        = book.ContentAsPlainText;
            var chaptersAsPlainText       = book.ChaptersAsPlainTexts;
            var totalCharactersCount      = book.TotalCharactersCount;
            var totalWordsCount           = book.TotalWordsCount;
            var wordsCountInChapters      = book.WordsCountInChapters;
            var charactersCountInChapters = book.CharactersCountInChapters;
        }
Пример #3
0
        public async Task <EpubBook> OpenBookAsync(int bookId)
        {
            EpubBook epubBook = await EpubReader.ReadBookAsync(settings.Books.First(book => book.Id == bookId).FilePath);

            return(epubBook);
        }
Пример #4
0
        public async Task <EpubBook> OpenBookAsync(int bookId)
        {
            EpubBook epubBook = await EpubReader.ReadBookAsync("C:\\Users\\edoua\\OneDrive\\Documents\\Livres\\Private Prince\\Private Prince 1.epub");

            return(epubBook);
        }