public PageListData() { MangaChapterItem chpter = new MangaChapterItem(); for (int i = 1; i <= 20; i++) { _pageListData.Add(new MangaPageItem("page-" + i, "http://localhost:8800/image/Hub/Hub-Product.jpg", string.Empty, chpter,i,20)); } }
public MangaPageItem(string uniqueId, string imagePath, string pageUrl, MangaChapterItem chapter,int pageNum,int totalNum) : base(uniqueId, string.Empty, string.Empty, imagePath, string.Empty) { _pageUrl = pageUrl; _imagePath = imagePath; _chapter = chapter; _pageNum = pageNum; _totalNum = totalNum; }
public Task<ObservableCollection<MangaPageItem>> GetPageList(MangaChapterItem chapter) { return Task.Run<ObservableCollection<MangaPageItem>>(() => { MangaPattern mPattern = WebSiteAccess.GetMangaPatternInstance(WebType); List<string> pageUrlList = mPattern.GetPageList(chapter.Url); ObservableCollection<MangaPageItem> mangaPageList = new ObservableCollection<MangaPageItem>(); for (int i = 1; i <= pageUrlList.Count; i++) { //string imagePath = mPattern.GetImageUrl(pageUrlList[i-1]); MangaPageItem item = new MangaPageItem("page-" + i, string.Empty, pageUrlList[i - 1], chapter, i, pageUrlList.Count); item.WebImageUrl = mPattern.GetImageUrl(item.PageUrl, item.PageNum); mangaPageList.Add(item); } return mangaPageList; }); }