public static void UpdateAnnotations(String bookID, List <Page> newPageList) { List <Page> oldPageList = PagesOnDeviceDataAccessor.GetPages(bookID); if (oldPageList != null) { foreach (Page oldPage in oldPageList) { bool notFound = true; foreach (Page newPage in newPageList) { if (oldPage.ID == newPage.ID) { notFound = false; break; } } if (notFound) { RemoveAnnotation(bookID, oldPage.ID); } } } }
public static void RemoveOrphanBookmarks(String bookID, List <Page> newPageList) { List <Page> oldPageList = PagesOnDeviceDataAccessor.GetPages(bookID); if (oldPageList != null) { foreach (Page oldPage in oldPageList) { var item = newPageList.Where(i => i.ID == oldPage.ID).FirstOrDefault(); if (item == null) { RemoveBookmark(bookID, oldPage.ID); } } } }
public static int GetNumAnnotationsInBook(String bookID) { return(GetNumAnnotations(bookID, PagesOnDeviceDataAccessor.GetPages(bookID))); }
public static List <Page> GetPages(String bookID) { return(PagesOnDeviceDataAccessor.GetPages(bookID)); }