//0 = Not sure, trying initial download //1 = First download completed, HTML detecting, retrying public void CancelAsync() { if (_webClient != null) { _webClient.CancelAsync(); } }
private void buttonCancel_Click(object sender, System.EventArgs e) { ListView.SelectedIndexCollection selectedIndices = listViewUrls.SelectedIndices; foreach (int index in selectedIndices) { WebClientEx client = webClients[index]; if (client == null) { continue; } if (!(client.IsBusy)) { continue; } client.CancelAsync(); } }
//0 = Not sure, trying initial download //1 = First download completed, HTML detecting, retrying public void CancelAsync() { _webClient.CancelAsync(); }