internal static void CancelPodcastDownload(ICollection podcasts) { if (podcasts == null) { return; } DownloadInfo tmp = null; ArrayList cancel_list = new ArrayList(); foreach (PodcastInfo pi in podcasts) { if (pi == null || pi.DownloadInfo == null) { continue; } try { if (pi.CanCancel) { tmp = pi.DownloadInfo; if (tmp != null) { cancel_list.Add(tmp); } } } catch { continue; } } if (cancel_list.Count == 1) { DownloadCore.Cancel(cancel_list [0] as DownloadInfo); } else if (cancel_list.Count > 1) { DownloadCore.Cancel(cancel_list); } }
internal static void CancelPodcastDownload(PodcastInfo pi) { if (pi == null || pi.DownloadInfo == null) { return; } DownloadInfo dif = pi.DownloadInfo; if (dif != null) { lock (downloads.SyncRoot) { if (!downloads.Contains(dif)) { return; } DownloadCore.Cancel(dif); } } }