public static void RemoveMyAnnotation(Annotation ann, bool lastItem) { try { BackgroundWorker worker = new BackgroundWorker(); worker.DoWork += delegate { SaveMyStuff_2 webService = new SaveMyStuff_2(Server.GenerateContentSyncURL(Settings.ServerURL)); if (Settings.UseFormsAuth) { webService.CookieContainer = Authenticate.GetCookieContainer(); } else { webService.Credentials = KeychainAccessor.NetworkCredential; } webService.RemoveMyPenAnnotation(ann.BookID, ann.PageID, "iOS", ann.ModifiedUtc); }; worker.RunWorkerCompleted += delegate { if (SetMyAnnotationEvent != null) { SetMyAnnotationEvent(lastItem); } }; worker.RunWorkerAsync(); } catch (Exception ex) { Logger.WriteLineDebugging("SaveMyStuff - RemoveMyAnnotation: {0}", ex.ToString()); } }
public static void DeleteMyStuff() { try { BackgroundWorker worker = new BackgroundWorker(); worker.DoWork += delegate { SaveMyStuff_2 webService = new SaveMyStuff_2(Server.GenerateContentSyncURL(Settings.ServerURL)); if (Settings.UseFormsAuth) { webService.CookieContainer = Authenticate.GetCookieContainer(); } else { webService.Credentials = KeychainAccessor.NetworkCredential; } webService.DeleteMyStuff(); }; worker.RunWorkerAsync(); } catch (Exception ex) { Logger.WriteLineDebugging("SaveMyStuff - DeleteMyStuff: {0}", ex.ToString()); } }
public static SaveMyStuff_2 GenerateSaveMyStuffClient() { var client = new SaveMyStuff_2(URL.ContentSyncURL); if (Settings.UseFormsAuth) { client.CookieContainer = Authenticate.GetCookieContainer(); } else { client.Credentials = KeychainAccessor.NetworkCredential; } return(client); }
public static void GetMyBooks() { try { List <Book> bookList = null; BackgroundWorker worker = new BackgroundWorker(); worker.DoWork += delegate { SaveMyStuff_2 webService = new SaveMyStuff_2(Server.GenerateContentSyncURL(Settings.ServerURL)); if (Settings.UseFormsAuth) { webService.CookieContainer = Authenticate.GetCookieContainer(); } else { webService.Credentials = KeychainAccessor.NetworkCredential; } MyBookObj[] results = webService.GetMyBooks(); if (results != null && results.Length > 0) { bookList = new List <Book>(); foreach (MyBookObj mb in results) { Book book = GenerateBook(mb); bookList.Add(book); } } }; worker.RunWorkerCompleted += delegate { if (GetMyBooksEvent != null) { GetMyBooksEvent(bookList); } }; worker.RunWorkerAsync(); } catch (Exception ex) { Logger.WriteLineDebugging("SaveMyStuff - GetMyBooks: {0}", ex.ToString()); } }
public static void GetMyAnnotations(String bookID, bool lastItem) { try { List <Annotation> annotationList = null; BackgroundWorker worker = new BackgroundWorker(); worker.DoWork += delegate { SaveMyStuff_2 webService = new SaveMyStuff_2(Server.GenerateContentSyncURL(Settings.ServerURL)); if (Settings.UseFormsAuth) { webService.CookieContainer = Authenticate.GetCookieContainer(); } else { webService.Credentials = KeychainAccessor.NetworkCredential; } PenAnnotationObj[] results = webService.GetMyPenAnnotations(bookID, "iOS"); if (results != null && results.Length > 0) { annotationList = new List <Annotation>(); foreach (PenAnnotationObj pa in results) { Annotation ann = GenerateAnnotation(pa); annotationList.Add(ann); } } }; worker.RunWorkerCompleted += delegate { if (GetMyAnnotationsEvent != null) { GetMyAnnotationsEvent(bookID, annotationList, lastItem); } }; worker.RunWorkerAsync(); } catch (Exception ex) { Logger.WriteLineDebugging("SaveMyStuff - GetMyAnnotations: {0}", ex.ToString()); } }
public static void SetMyBooks(List <Book> bookList) { try { BackgroundWorker worker = new BackgroundWorker(); worker.DoWork += delegate { SaveMyStuff_2 webService = new SaveMyStuff_2(Server.GenerateContentSyncURL(Settings.ServerURL)); if (Settings.UseFormsAuth) { webService.CookieContainer = Authenticate.GetCookieContainer(); } else { webService.Credentials = KeychainAccessor.NetworkCredential; } MyBookObj[] myBooks = new MyBookObj[bookList.Count]; for (Int32 i = 0; i < bookList.Count; i++) { MyBookObj mb = GenerateBookObj(bookList[i]); myBooks[i] = mb; } webService.SetMyBooks(myBooks); }; worker.RunWorkerCompleted += delegate { if (SetMyBooksEvent != null) { SetMyBooksEvent(); } }; worker.RunWorkerAsync(); } catch (Exception ex) { Logger.WriteLineDebugging("SaveMyStuff - SetMyBooks: {0}", ex.ToString()); } }
public static void DeleteMyAnnotationsFromCloud() { SaveMyStuff_2 client = GenerateSaveMyStuffClient(); client.DeleteMyPenAnnotations(); }
public static void RemoveMyAnnotationFromCloud(String bookID, String pageID, DateTime modifiedUtc) { SaveMyStuff_2 client = GenerateSaveMyStuffClient(); client.RemoveMyPenAnnotation(bookID, pageID, "iOS", modifiedUtc); }
public static void SetMyAnnotationToCloud(String bookID, int bookVersion, String pageID, DateTime modifiedUtc, String content) { SaveMyStuff_2 client = GenerateSaveMyStuffClient(); client.SetMyPenAnnotation(bookID, bookVersion, pageID, "iOS", modifiedUtc, content, null); }
public static PenAnnotationObj[] GetMyAnnotationsFromCloud(String bookID) { SaveMyStuff_2 client = GenerateSaveMyStuffClient(); return(client.GetMyPenAnnotations(bookID, "iOS")); }
public static void SetMyNoteToCloud(Note note) { SaveMyStuff_2 client = GenerateSaveMyStuffClient(); client.SetMyTextAnnotation(note.BookID, note.BookVersion, note.PageID, note.ModifiedUtc, note.Text); }
public static TextAnnotationObj[] GetMyNotesFromCloud(String bookID) { SaveMyStuff_2 client = GenerateSaveMyStuffClient(); return(client.GetMyTextAnnotations(bookID)); }
public static void DeleteMyBookmarksFromCloud() { SaveMyStuff_2 client = GenerateSaveMyStuffClient(); client.DeleteMyBookmarks(); }
public static void SetMyBookmarksToCloud(BookmarkObj[] myBookmarks) { SaveMyStuff_2 client = GenerateSaveMyStuffClient(); client.SetMyBookmarks(myBookmarks); }
public static BookmarkObj[] GetMyBookmarksFromCloud(String bookID) { SaveMyStuff_2 client = GenerateSaveMyStuffClient(); return(client.GetMyBookmarks(bookID)); }
public static MyBookObj[] GetMyBooksFromCloud() { SaveMyStuff_2 client = GenerateSaveMyStuffClient(); return(client.GetMyBooks()); }