public void StopDownload()
 {
     if (_Downloader != null)
     {
         _Downloader.Cancel();
     }
 }
Exemplo n.º 2
0
    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 : ""));
    }
Exemplo n.º 3
0
        private void cancelDownload_Click(object sender, Windows.UI.Xaml.Input.TappedRoutedEventArgs e)
        {
            fileDownloader.Cancel();
            downloadCanceled = true;

            progressPanel.Visibility = Visibility.Collapsed;
            downloadPanel.Visibility = Visibility.Visible;
        }
Exemplo n.º 4
0
 void View_OnCancel(object sender, EventArgs e)
 {
     lock (_lock)
     {
         if (_currentDownloader != null)
         {
             _currentDownloader.Cancel();
         }
     }
 }
Exemplo n.º 5
0
        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();
        }
Exemplo n.º 6
0
 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();
     }
 }
Exemplo n.º 7
0
 private void DownloadFtp_ProgressChanged(object sender, DownloadEventArgs e)
 {
     downloadFtpTestDownloader.Cancel();
 }
Exemplo n.º 8
0
 private void Cancel_ProgressChanged(object sender, DownloadEventArgs e)
 {
     cancelTestDownloader.Cancel();
 }