Beispiel #1
0
 protected virtual void OnDownloadCancelled(DownloadCancelledEventArgs args)
 {
     if (this.DownloadCancelled != null)
     {
         this.DownloadCancelled(args);
     }
 }
Beispiel #2
0
 private void downloadCancelled(DownloadCancelledEventArgs args)
 {
     lock (this.monitor)
     {
         this.CloseFile();
     }
 }
 void OnCancelled(DownloadCancelledEventArgs args)
 {
     Loom.QueueOnMainThread(() =>
     {
         if (onCancelled != null)
         {
             onCancelled(args.Exception);
         }
         Debugger.LogException(args.Exception);
         if (downloader != null)
         {
             downloader.Dispose();
         }
     });
 }
        private void downloadCancelled(DownloadCancelledEventArgs args)
        {
            lock (this.monitor)
            {
                var resumingDownload = (ResumingDownload)args.Download;
                this.downloads.Remove(resumingDownload);
            }

            if (++currentRetryDownloadParts / numberOfParts >= maxRetryDownloadParts)
            {
                this.Stop();
            }
            else
            {
                this.StartDownloadOfNextRange();
            }
        }
Beispiel #5
0
        private void downloadCancelled(DownloadCancelledEventArgs args)
        {
            var download = args.Download;

            lock (this.monitor)
            {
                if (download == this.currentDownload)
                {
                    CountRetryAndCancelIfMaxRetriesReached();

                    if (this.currentDownload != null)
                    {
                        this.currentDownload = null;
                        StartThread(this.SleepThenBuildDownload, Thread.CurrentThread.Name + "-afterCancel");
                    }
                }
            }
        }
 private void downloadCancelled(DownloadCancelledEventArgs args)
 {
     this.StartDownloadOfNextRange();
 }
 static void OnDownloadCancelled(DownloadCancelledEventArgs args)
 {
     args.Download.DetachAllHandlers();
     Console.WriteLine("Download has cancelled!");
     finished = true;
 }