private void GetPages(PatternSearcher searcher) { for (PatternFound found = searcher.NextPattern(_PagePattern); found.EndOfStreamReached == false; found = searcher.NextPattern(_PagePattern)) { string page = ProcessHtmlPage(found.TextBeforePattern); if (string.IsNullOrEmpty(page) == false) { _Writer.AddPage(page); } } }
private string GetHeader(PatternSearcher searcher) { PatternFound found = searcher.NextPattern(_BodyPattern); if (found.EndOfStreamReached == true) { throw new ApplicationException("Tag <Body> is not found."); } return(found.TextBeforePattern); }
private void ProcessFile(string fileName) { try { using (StreamReader reader = new StreamReader(fileName)) { PatternSearcher searcher = new PatternSearcher(reader, 8192); BuildHeader(searcher); _Writer = new HtmlWriter(_HtmlHeader, _HtmlFooter); GetPages(searcher); } } catch (Exception) { } }
private void BuildHeader(PatternSearcher searcher) { string header = GetHeader(searcher); _HtmlHeader = _BodyStartTag; }
private string GetHeader(PatternSearcher searcher) { PatternFound found = searcher.NextPattern(_BodyPattern); if (found.EndOfStreamReached == true) { throw new ApplicationException("Tag <Body> is not found."); } return found.TextBeforePattern; }