public static void StopDownload() { __ContinueDownload = false; if (CurrentTask != null && CurrentTask.Status != ProgressStatus.Disposed) { CurrentTask.Cancel(); } }
private void cancelTaskToolStripMenuItem_Click(object sender, EventArgs e) { if (downloadQueue1.SelectedObject == null) { return; } Internet.DownloadTask task = (Internet.DownloadTask)downloadQueue1.SelectedObject; task.Cancel(); }