public static void SetMyBookmarks(List <Bookmark> bookmarkList) { 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; } BookmarkObj[] myBookmarks = new BookmarkObj[bookmarkList.Count]; for (Int32 i = 0; i < bookmarkList.Count; i++) { BookmarkObj bm = GenerateBookmarkObj(bookmarkList[i]); myBookmarks[i] = bm; } webService.SetMyBookmarks(myBookmarks); }; worker.RunWorkerCompleted += delegate { if (SetMyBookmarksEvent != null) { SetMyBookmarksEvent(); } }; worker.RunWorkerAsync(); } catch (Exception ex) { Logger.WriteLineDebugging("SaveMyStuff - SetMyBookmarks: {0}", ex.ToString()); } }
public static void SetMyBookmarksToCloud(BookmarkObj[] myBookmarks) { SaveMyStuff_2 client = GenerateSaveMyStuffClient(); client.SetMyBookmarks(myBookmarks); }