Exemplo n.º 1
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());
            }
        }
Exemplo n.º 2
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);
                    }
                }
            }
        }