/// <summary> /// Get the OPF file out from zip package /// Parse the OPF file for generating the hyperlink - list (mainView glossary) of the Bible's / book's chapters. /// Set the content to static String parameter /// </summary> /// <returns></returns> private void setGlossaryView() { // idea parsing content.opf (as EPUB specs says: http://stackoverflow.com/questions/4283170/iphone-reading-epub-files) Stream tocFileStream = getFileStreamFromEPub(_tocPath); StreamReader contentTocreader = new StreamReader(tocFileStream); string tocContent = contentTocreader.ReadToEnd(); Parser parser = new Parser(); string glossaryContent = parser.mainGlossaryViewFromTOCfile(tocContent); HTML_Content_onMainPage.NavigateToString(glossaryContent); StaticDataForPageChange.htmlMainViewContent = glossaryContent; }
/// <summary> /// Initializing the glossary view for choosed book /// </summary> /// <param name="firstInit"></param> public void initializeGlossaryView() { _zipPackageResInfo = getPackageInfo(); bool getPathOK = false; _tocPath = getPath(_zipPackageResInfo, "toc.ncx", out getPathOK); if (!getPathOK) { Parser parser = new Parser(); string errorNote = "<p><center>Error: Cant set path to toc.nxc file, file is propably not part of ePub</center></p>"; HTML_Content_onMainPage.NavigateToString(errorNote); StaticDataForPageChange.htmlMainViewContent = errorNote; } else setGlossaryView(); }