-
Notifications
You must be signed in to change notification settings - Fork 9
Usage
Yauheni Pakala edited this page Apr 26, 2016
·
2 revisions
Here is an example of loading FB2 file into FB2File class object:
private async Task ReadFB2FileStreamAsync(Stream stream)
{
// setup
var readerSettings = new XmlReaderSettings
{
DtdProcessing = DtdProcessing.Ignore
};
var loadSettings = new XmlLoadSettings(readerSettings);
try
{
// reading
FB2File file = await new FB2Reader().ReadAsync(stream, loadSettings);
}
catch (Exception ex)
{
Debug.WriteLine(string.Format("Error loading file : {0}", ex.Message));
}
}
// ... reading xml file and get string to `xml` ...
// read fb2 file as a string
FB2File file = await new FB2Reader().ReadAsync(xml)