예제 #1
0
        public static void GetMyBookmarks(String bookID, bool lastItem)
        {
            try
            {
                List <Bookmark>  bookmarkList = 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;
                    }
                    BookmarkObj[] results = webService.GetMyBookmarks(bookID);

                    if (results != null && results.Length > 0)
                    {
                        bookmarkList = new List <Bookmark>();
                        foreach (BookmarkObj bm in results)
                        {
                            Bookmark bookmark = GenerateBookmark(bm);
                            bookmarkList.Add(bookmark);
                        }
                    }
                };
                worker.RunWorkerCompleted += delegate
                {
                    if (GetMyBookmarksEvent != null)
                    {
                        GetMyBookmarksEvent(bookID, bookmarkList, lastItem);
                    }
                };
                worker.RunWorkerAsync();
            }
            catch (Exception ex)
            {
                Logger.WriteLineDebugging("SaveMyStuff - GetMyBookmarks: {0}", ex.ToString());
            }
        }
예제 #2
0
        public static BookmarkObj[] GetMyBookmarksFromCloud(String bookID)
        {
            SaveMyStuff_2 client = GenerateSaveMyStuffClient();

            return(client.GetMyBookmarks(bookID));
        }