private Boolean CanResumeReadingAsync(ChapterCacheObject ChapterCacheObject)
 {
     if (Equals(MangaCacheObject, null))
     {
         return(false);
     }
     if (Equals(MangaCacheObject.MangaObject, null))
     {
         return(false);
     }
     if (Equals(ChapterCacheObject, null))
     {
         return(false);
     }
     if (Equals(ChapterCacheObject.MangaObject, null))
     {
         return(false);
     }
     if (Equals(ChapterCacheObject.ChapterObject, null))
     {
         return(false);
     }
     if (Equals(ChapterCacheObject.IsResumeChapter, null))
     {
         return(false);
     }
     return(true);
 }
 private async void ResumeReadingAsync(ChapterCacheObject ChapterCacheObject)
 {
     if (!ChapterCacheObject.IsLocal)
     {
         await App.ContentDownloadManager.DownloadAsync(ChapterCacheObject.MangaObject, ChapterCacheObject.ChapterObject, ChapterCacheObject.DownloadProgressReporter);
     }
     Messenger.Instance.Send(new ReadChapterRequestObject(ChapterCacheObject.MangaObject, ChapterCacheObject.ChapterObject), "ReadChapterRequest");
     Messenger.Instance.Send(ChapterCacheObject, "ResumeChapterCacheObject");
 }
        private async void ReadSelectedChapterAsync(IList SelectedChapterObjects)
        {
            ChapterCacheObject ChapterCacheObject = SelectedChapterObjects[0] as ChapterCacheObject;

            if (!ChapterCacheObject.IsLocal)
            {
                await App.ContentDownloadManager.DownloadAsync(ChapterCacheObject.MangaObject, ChapterCacheObject.ChapterObject, ChapterCacheObject.DownloadProgressReporter);
            }
            Messenger.Instance.Send(new ReadChapterRequestObject(ChapterCacheObject.MangaObject, ChapterCacheObject.ChapterObject), "ReadChapterRequest");
            Messenger.Instance.Send(ChapterCacheObject, "ReadChapterCacheObject");
        }
        private void PreloadChapterObject(MangaObject MangaObject, ChapterObject ChapterObject)
        {
            if (!App.ContentDownloadManager.IsCacheKeyActive(App.ContentDownloadManager.CacheKey(MangaObject, ChapterObject)))
            {
                // Lookup MangaCacheObject and ChapterCacheObject
                MangaCacheObject MangaCacheObject = App.MangaCacheObjects.FirstOrDefault(mco => Equals(
                                                                                             mco.MangaObject.Name,
                                                                                             MangaObject.Name));
                ChapterCacheObject ChapterCacheObject = Equals(MangaCacheObject, null) ? null : MangaCacheObject.ChapterCacheObjects.FirstOrDefault(cco => Equals(
                                                                                                                                                        cco.ArchiveFileName,
                                                                                                                                                        ChapterObject.ChapterArchiveName(App.CORE.CHAPTER_ARCHIVE_EXTENSION)));

                // Start Download
                App.ContentDownloadManager.Download(
                    MangaObject,
                    ChapterObject,
                    Equals(ChapterCacheObject, null) ? null : ChapterCacheObject.DownloadProgressReporter);
            }
        }
 private Boolean CanDownloadChapterAsync(ChapterCacheObject ChapterCacheObject)
 {
     if (Equals(MangaCacheObject, null))
     {
         return(false);
     }
     if (Equals(MangaCacheObject.MangaObject, null))
     {
         return(false);
     }
     if (Equals(ChapterCacheObject, null))
     {
         return(false);
     }
     if (Equals(ChapterCacheObject.ChapterObject, null))
     {
         return(false);
     }
     return(true);
 }
 private async Task OpenForReading(ChapterCacheObject ChapterCacheObject, Boolean ResumeChapter)
 {
     await OpenForReading(ChapterCacheObject.MangaObject, ChapterCacheObject.ChapterObject, false, ResumeChapter);
 }
 private async Task OpenForReading(ChapterCacheObject ChapterCacheObject)
 {
     await OpenForReading(ChapterCacheObject.MangaObject, ChapterCacheObject.ChapterObject, false, false);
 }
 private void DownloadChapterAsync(ChapterCacheObject ChapterCacheObject)
 {
     App.ContentDownloadManager.Download(ChapterCacheObject.MangaObject, ChapterCacheObject.ChapterObject, ChapterCacheObject.DownloadProgressReporter);
 }