Exemple #1
0
 internal static void FillAuthor(IEnumerable <BookViewModel> loadedSource)
 {
     using (var dou = new DataOperationUnit())
     {
         var loading = loadedSource.Where(b => b.Author == null);
         foreach (var book in loading)
         {
             BookLoading.LoadAuthor(book, dou);
         }
     }
 }
Exemple #2
0
        internal static void FillFirstPage(IEnumerable <BookViewModel> loadedSource)
        {
            var notAvailable = loadedSource.Where(x => x.FirstPage == null);

            using (var dou = new DataOperationUnit())
            {
                foreach (var book in notAvailable)
                {
                    BookLoading.Load(book, dou);
                }
            }
        }
Exemple #3
0
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            var book = value as BookViewModel;

            if (!book.ContentsRegistered)
            {
                Thread.Sleep(0);
            }
            if (!book.IsLoaded)
            {
                var task = Task.Run(() =>
                {
                    BookLoading.Load(book);
                });
                return(new TaskCompletionSource <object>(task));
            }
            return(null);
        }
 private void PrepareBookContents()
 {
     BookLoading.Load(Book);
     ContentsLoadTask.FillContentsWithImage(LibraryManager, Book);
 }