public static async Task <string> PageSplit(string html, NavigationRecord record) { string localPath = "ms-appx-web:///Assets/"; string cb = "cb.png"; string cbcc = "cbcc.gif"; string nz = "nzcitator.gif"; string cautionary = "cautionary.png"; string citation = "citation.png"; string negative = "negative.png"; string neutral = "neutral.png"; string positive = "positive.png"; html = html.Replace(cb, localPath + cb); html = html.Replace(cbcc, localPath + cbcc); html = html.Replace(nz, localPath + nz); html = html.Replace(cautionary, localPath + cautionary); html = html.Replace(citation, localPath + citation); html = html.Replace(negative, localPath + negative); html = html.Replace(neutral, localPath + neutral); html = html.Replace(positive, localPath + positive); html = string.Format("<div id=\"tocId{0}\" class=\"layouttoc\">", record.TOCId) + html + "</div>"; html = await ImageToBase64(html, localPath); return(html); }
public void Record(int bookId, int tocID, NavigationType type = NavigationType.TOCDocument, int pageNum = 0, object tag = null) { NavigationRecord record = new NavigationRecord { BookId = bookId, TOCId = tocID, PageNum = pageNum, Type = type, Tag = tag }; if (CurrenRecordIndex == HistoryRecords.Count - 1) { CurrenRecordIndex++; HistoryRecords.Add(record); } else if (CurrenRecordIndex < HistoryRecords.Count - 1) { CurrenRecordIndex++; HistoryRecords.RemoveRange(CurrenRecordIndex, HistoryRecords.Count - CurrenRecordIndex); HistoryRecords.Add(record); } BackWard = CurrenRecordIndex > 0 ? true : false; ForWard = false; }