private void ReadBook() { switch (_selectedBook.FileType) { case ".pdf": _readersContext = new ReadersContext(new PDFReader()); _readersContext.Read(_selectedBook.Path); break; case ".djvu": _readersContext = new ReadersContext(new DJVuReader()); _readersContext.Read(_selectedBook.Path); break; } }
private void ReadBook() { if (_selectedBookInCategory == null) return; switch (_selectedBookInCategory.FileType) { case ".pdf": _readersContext = new ReadersContext(new PDFReader()); _readersContext.Read(SelectedBookInCategory.Path); break; case ".djvu": _readersContext = new ReadersContext(new DJVuReader()); _readersContext.Read(_selectedBookInCategory.Path); break; } }