private void FeedEditionsCallBack(object state) { DownloadReporter.Reset(); _downloadManagerEdition = new DownloadManagerEdition(DownloadManager, DownloadReporter); _downloadManagerEdition.Finished += DownloadManagerEditionFinished; _downloadManagerEdition.Error += DownloadManagerEditionError; foreach (EditionInfoViewModel editionInfoViewModel in Editions.Where(s => s.Active)) { Interlocked.Increment(ref CountDown); string[] cardInfos = DownloadManager.GetCardUrls(editionInfoViewModel.Url); editionInfoViewModel.DownloadReporter.Total = cardInfos.Length; DownloadReporter.Total += cardInfos.Length; EditionInfoViewModel model = editionInfoViewModel; if (model.CardNumber.HasValue) { if (cardInfos.Length != model.CardNumber.Value) { AppendMessage(string.Format("{0}: {1} urls while cardnumber is set to {2}", model.Name, cardInfos.Length, model.CardNumber.Value), false); } } _downloadManagerEdition.AddRange(cardInfos.Select(s => WebAccess.ToAbsoluteUrl(model.Url, s)), model.EditionId, model.DownloadReporter); } _downloadManagerEdition.Start(); }
public async Task <IReadOnlyList <Edition> > GetAll() { return(await Editions.Where(v => v.Id != 1).ToListAsync()); }