Class EpubBookRef
Represents a EPUB book with its metadata. An instance of this class holds a reference to the EPUB file to load book's content on demand.
Implements
Inherited Members
Namespace: VersOne.Epub
Assembly: VersOne.Epub.dll
Syntax
public class EpubBookRef : IDisposable
Constructors
View SourceEpubBookRef(IZipFile, string?, string, string, List<string>?, string?, EpubSchema, EpubContentRef, EpubReaderOptions?)
Initializes a new instance of the EpubBookRef class.
Declaration
public EpubBookRef(IZipFile epubFile, string? filePath, string title, string author, List<string>? authorList, string? description, EpubSchema schema, EpubContentRef content, EpubReaderOptions? epubReaderOptions = null)
Parameters
Type | Name | Description |
---|---|---|
IZipFile | epubFile | Reference to the EPUB file. |
string | filePath | The path to the EPUB file or |
string | title | The title of the book. |
string | author | The comma separated list of the book's authors. |
List<string> | authorList | The list of book's authors names. |
string | description | The book's description or |
EpubSchema | schema | The parsed EPUB schema of the book. |
EpubContentRef | content | The collection of references to the book's content files within the EPUB archive. |
EpubReaderOptions | epubReaderOptions | Various options to configure the behavior of the EPUB reader. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException | The |
ArgumentNullException | The |
ArgumentNullException | The |
ArgumentNullException | The |
ArgumentNullException | The |
Properties
View SourceAuthor
Gets the comma separated list of the book's authors.
Declaration
public string Author { get; }
Property type: string
View SourceAuthorList
Gets the list of book's authors names.
Declaration
public List<string> AuthorList { get; }
Property type: List<string>
View SourceContent
Gets the collection of references to the book's content files within the EPUB archive.
Declaration
public EpubContentRef Content { get; }
Property type: EpubContentRef
View SourceDescription
Gets the book's description or null
if the description is not present in the book.
Declaration
public string? Description { get; }
Property type: string
View SourceEpubFile
Gets the reference to the EPUB file.
Declaration
public IZipFile EpubFile { get; }
Property type: IZipFile
View SourceEpubReaderOptions
Gets the options that configure the behavior of the EPUB reader.
Declaration
public EpubReaderOptions EpubReaderOptions { get; }
Property type: EpubReaderOptions
View SourceFilePath
Gets the path to the EPUB file or null
if the EPUB file was loaded from a stream.
Declaration
public string? FilePath { get; }
Property type: string
View SourceSchema
Gets the parsed EPUB schema of the book.
Declaration
public EpubSchema Schema { get; }
Property type: EpubSchema
View SourceTitle
Gets the title of the book.
Declaration
public string Title { get; }
Property type: string
Methods
View SourceDispose()
Releases the managed resources used by the EpubBookRef.
Declaration
public void Dispose()
Dispose(bool)
Releases the resources used by the EpubBookRef.
Declaration
protected virtual void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
bool | disposing |
|
~EpubBookRef()
Finalizes an instance of the EpubBookRef class.
Declaration
protected ~EpubBookRef()
GetNavigation()
Processes the navigational information of the EPUB book and returns a list of its navigation elements (typically the table of contents).
Declaration
public List<EpubNavigationItemRef>? GetNavigation()
Returns
Type | Description |
---|---|
List<EpubNavigationItemRef> | A list of navigation elements of the book or |
GetNavigationAsync()
Asynchronously processes the navigational information of the EPUB book and returns a list of its navigation elements (typically the table of contents).
Declaration
public Task<List<EpubNavigationItemRef>?> GetNavigationAsync()
Returns
Type | Description |
---|---|
Task<List<EpubNavigationItemRef>> | A task that represents the asynchronous processing operation.
The value of the TResult parameter contains a list of navigation elements of the book or |
GetReadingOrder()
Processes the reading order of the EPUB book and returns a list of text content file references in the order of reading intended by the author.
Declaration
public List<EpubLocalTextContentFileRef> GetReadingOrder()
Returns
Type | Description |
---|---|
List<EpubLocalTextContentFileRef> | A list of text content file references in the order of reading. |
GetReadingOrderAsync()
Asynchronously processes the reading order of the EPUB book and returns a list of text content file references in the order of reading intended by the author.
Declaration
public Task<List<EpubLocalTextContentFileRef>> GetReadingOrderAsync()
Returns
Type | Description |
---|---|
Task<List<EpubLocalTextContentFileRef>> | A task that represents the asynchronous processing operation. The value of the TResult parameter contains a list of text content file references in the order of reading. |
ReadCover()
Loads the book's cover image from the EPUB file.
Declaration
public byte[]? ReadCover()
Returns
Type | Description |
---|---|
byte[] | Book's cover image or |
ReadCoverAsync()
Asynchronously loads the book's cover image from the EPUB file.
Declaration
public Task<byte[]?> ReadCoverAsync()
Returns
Type | Description |
---|---|
Task<byte[]> | A task that represents the asynchronous load operation. The value of the TResult parameter contains the book's cover image or |