private void NotifyAll(ContentDownloadState state, ContentDownloadError error = ContentDownloadError.None) { foreach (ContentDownloadItem contentDownloadItem in DownloadQueue.ToArray()) { contentDownloadItem.NotifyDownloadStateChange(state, error); } }
internal void CancelDownload(ContentDownloadItem contentDownloadItem, bool forceReset = false) { if (contentDownloadItem.State != ContentDownloadState.Complete || forceReset) { if (contentDownloadItem.DownloadYieldInstruction != null) { contentDownloadItem.DownloadYieldInstruction.Dispose(); contentDownloadItem.DownloadYieldInstruction = null; } DownloadQueue.Remove(contentDownloadItem); contentDownloadItem.NotifyDownloadStateChange(ContentDownloadState.Unknown); if (this.OnDownloaderDownloadCancel != null) { this.OnDownloaderDownloadCancel(contentDownloadItem); } } }
private void NotifyAndDequeueAll(ContentDownloadState state, ContentDownloadError error = ContentDownloadError.None) { NotifyAll(state, error); DownloadQueue.Clear(); }