public void StopDownload() { if (_Downloader != null) { _Downloader.Cancel(); } }
void OnGUI() { fileToDownload = GUILayout.TextField(fileToDownload); if (GUILayout.Button("Download") && !downloader.IsInQueue(fileToDownload)) { // start downloading string pathToSave = System.IO.Path.Combine(Application.persistentDataPath, System.IO.Path.GetFileName(fileToDownload)); downloader.Download(fileToDownload, pathToSave); fileToDownload = FILE_URL_FLV; } if (GUILayout.Button("Download in queue") && !downloader.IsInQueue(fileToDownload)) { string pathToSave = System.IO.Path.Combine(Application.persistentDataPath, System.IO.Path.GetFileName(fileToDownload)); downloader.DownloadInQueue(fileToDownload, pathToSave); } if (GUILayout.Button("Cancel")) { downloader.Cancel(); } // status GUILayout.Label("Total Bytes : " + evt.totalBytes); GUILayout.Label("Downloaded Bytes : " + evt.downloadedBytes); GUILayout.Label("Downloading Progress (%): " + evt.progress); GUILayout.Label("\nStatus : " + evt.status); GUILayout.Label("\nError : " + ((!string.IsNullOrEmpty(evt.error)) ? evt.error : "")); }
private void cancelDownload_Click(object sender, Windows.UI.Xaml.Input.TappedRoutedEventArgs e) { fileDownloader.Cancel(); downloadCanceled = true; progressPanel.Visibility = Visibility.Collapsed; downloadPanel.Visibility = Visibility.Visible; }
void View_OnCancel(object sender, EventArgs e) { lock (_lock) { if (_currentDownloader != null) { _currentDownloader.Cancel(); } } }
private void btnCancel_Click(object sender, EventArgs e) { this.Hide(); log.Info("Download cancelled."); // Cancel the ongoing download if any. // Todo: remove the partially downloaded file? if (downloadStarted && downloader != null) { downloadStarted = false; downloader.Cancel(); } this.Close(); }
private void btnCancel_Click(object sender, EventArgs e) { //----------------------------------------------- // Cancellation. // Si un téléchargement est lancé, on l'arrète. // Sinon, on quitte la boîte. //----------------------------------------------- if (m_bDownloadStarted && m_Downloader != null) { m_bDownloadStarted = false; m_Downloader.Cancel(); HideProgressBar(); } else { Close(); } }
private void DownloadFtp_ProgressChanged(object sender, DownloadEventArgs e) { downloadFtpTestDownloader.Cancel(); }
private void Cancel_ProgressChanged(object sender, DownloadEventArgs e) { cancelTestDownloader.Cancel(); }