Пример #1
0
 private static void RemoveBooks(String url, String id)
 {
     if (!String.IsNullOrEmpty(URL.ServerURL))
     {
         if (url != URL.ServerURL || id != Settings.UserID)
         {
             List <Book> bookList = BooksOnDeviceAccessor.GetBooks();
             if (bookList != null)
             {
                 BookRemover.RemoveBooks(bookList);
             }
         }
     }
 }
Пример #2
0
        private static void PushMyBooksWork()
        {
            try
            {
                List <Book> bookList = BooksOnDeviceAccessor.GetAllBooks();
                if (bookList != null && bookList.Count > 0)
                {
                    SaveMyStuff.SetMyBooks(bookList);

                    // Remove books that are marked as removed
                    List <Book> removeList = BooksOnDeviceAccessor.GetRemovedBooks();
                    if (removeList != null && removeList.Count > 0)
                    {
                        BookRemover.RemoveBooks(removeList);
                    }
                }
            }
            catch (Exception ex)
            {
                Logger.WriteLineDebugging("CloudSync - PushMyBooksWork: {0}", ex.ToString());
            }
        }
Пример #3
0
        private static void SendMyBooks(List <Book> bookList)
        {
            if (cancelled)
            {
                SetSent(true);

                CheckSentDone();
            }
            else
            {
                if (Reachability.IsDefaultNetworkAvailable())
                {
                    SaveMyStuff.SetMyBooksEvent += HandleSetMyBooksEvent;
                    SaveMyStuff.SetMyBooks(bookList);

                    // Remove books that are marked as removed
                    List <Book> removeList = BooksOnDeviceAccessor.GetRemovedBooks();
                    if (removeList != null && removeList.Count > 0)
                    {
                        BookRemover.RemoveBooks(removeList);
                    }
                }
            }
        }