Exemplo n.º 1
0
 // internal virtual for testing only
 protected virtual void SendBookDoWork(Book.Book book, Color backColor)
 {
     PublishToAndroidApi.SendBook(book, _bookServer,
                                  null, (publishedFileName, path) =>
     {
         _lastPublishedBloomdSize = GetSizeOfBloomdFile(path);
         _androidDeviceUsbConnection.SendBook(path);
     },
                                  _progress,
                                  (publishedFileName, bookTitle) =>
                                  _androidDeviceUsbConnection.BookExists(publishedFileName) ?
                                  _progress.GetTitleMessage("ReplacingBook", "Replacing existing \"{0}\"...", bookTitle) :
                                  _progress.GetTitleMessage("SendingBook", "Sending \"{0}\" to your Android device...", bookTitle),
                                  publishedFileName => _androidDeviceUsbConnection.BookExists(publishedFileName),
                                  backColor);
     PublishToAndroidApi.ReportAnalytics("usb", book);
 }