Exemple #1
0
        private static void StartPush()
        {
            // Push books to the server
            PushMyBooksWork();

            // Push my stuffs to the srever
            List <Book> bookList = BooksOnDeviceAccessor.GetAllBooks();

            if (bookList != null && bookList.Count > 0)
            {
                foreach (var book in bookList)
                {
                    PushMyStuffsWork(book);
                }
            }
        }
Exemple #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());
            }
        }
Exemple #3
0
        private static void PushStart()
        {
            if (Reachability.IsDefaultNetworkAvailable())
            {
                // SEND
                List <Book> bookList = BooksOnDeviceAccessor.GetAllBooks();
                if (bookList != null && bookList.Count > 0)
                {
                    SendMyBooks(bookList);

                    SendMyBookmarks(bookList);

                    SendMyNotes(bookList);

                    SendMyAnnotations(bookList);
                }
                else
                {
                    sentBooks = sentBookmarks = sentNotes = sentAnnotations = true;

                    CheckSentDone();
                }
            }
        }