void saveNewCastsToDb(Feed feed, RssHelper rssFeed) { int newCasts = 0; foreach (var rss in rssFeed.RssDnldInfos) { //Application.Current.Dispatcher.BeginInvoke(new Action(() => { // new Func<bool>(() => //tu: new Action(() => DnLd dl; if (SaveToDnldRow_IsDnldRequired(feed, rss, out dl)) { Application.Current.Dispatcher.BeginInvoke(new Action(() => { if (!CurrentDnLds.Contains(dl)) { CurrentDnLds.Add(dl); } })); newCasts++; //? better wait for all feeds check to finish and then move on to dnlding: if (IsAutoNextStep) Dh.StartDownload(db, dl, dgD); //Dh.LaunchIfDownloadRequiredMvvm(dl, ((DataGrid)dgD)); } //})); } feed.CastQntNew = newCasts; feed.CastQntTtl = rssFeed.RssDnldInfos.Count; feed.StatusInfo = $"{newCasts} / {rssFeed.RssDnldInfos.Count}"; //update feed with counts of new casts feed.LastCheckedAt = _now; }
void onDnldOne(object dgD) { Bpr.BeepOk(); SelectedDnLd.ReDownload = true; //Application.Current.Dispatcher.BeginInvoke(new Action(() => { if (!CurrentDnLds.Contains(SelectedDnLd)) { CurrentDnLds.Add(SelectedDnLd); } //})); onStartDnlds(dgD); // StartDownload(SelectedDnLd, ((DataGrid)dgD)); }
void onDeleteOne(object dgH) { Bpr.BeepOk(); //Application.Current.Dispatcher.BeginInvoke(new Action(() => { if (CurrentDnLds.Contains(SelectedDnLd)) { CurrentDnLds.Remove(SelectedDnLd); } var td = db.DnLds.FirstOrDefault(r => r.Id == SelectedDnLd.Id); if (td != null) { db.DnLds.Remove(td); } SelectedDnLd = null; //})); }