Beispiel #1
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            Button b = sender as Button;

            if ((string)b.Content == "Pause")
            {
                download.Pause();
                b.Content = "Resume";
            }
            else
            {
                download.Resume();
                b.Content = "Pause";
            }
        }
 internal void StopDownloadAction()
 {
     if (downloadOperation.Progress.Status == BackgroundTransferStatus.Running)
     {
         downloadOperation.Pause();
     }
 }
Beispiel #3
0
        async void PauseOnce(DownloadOperation download)
        {
            download.Pause();
            await Task.Delay(100);

            download.Resume();
        }
Beispiel #4
0
 public void PauseDownload(DownloadOperation downloadOperation)
 {
     if (downloadOperation.Progress.Status == BackgroundTransferStatus.Running)
     {
         downloadOperation.Pause();
     }
 }
Beispiel #5
0
 private void PauseDownload_Click(object sender, RoutedEventArgs e)
 {
     if (download != null)
     {
         download.Pause();
         pauseDownloadButton.IsEnabled  = false;
         resumeDownloadButton.IsEnabled = true;
     }
 }
 public void Pause()
 {
     if (op.Progress.Status == BackgroundTransferStatus.Running)
     {
         op.Pause();
     }
     OnPropertyChanged("CanPause");
     OnPropertyChanged("CanResume");
 }
        /// <summary>
        /// Приостанавливает выполнение запроса
        /// </summary>
        public void Pause()
        {
            if (State != RequestState.Processing)
            {
                return;
            }

            DownloadOperation.Pause();
            State = RequestState.Paused;
        }
 //pauses a download operation
 public void PauseDownload(Download download)
 {
     download.Status = "paused";
     try
     {
         downloadOperation.Pause();
     } catch (InvalidOperationException)
     {
         UsefulMethods.UsefulMethods.ErrorMessage("Couldn't pause the download.");
     }
 }
Beispiel #9
0
 private void Pause_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         if (slowDownload != null)
         {
             slowDownload.Pause();
         }
     }
     catch (InvalidOperationException ex)
     {
         DisplayException(ex);
     }
 }
 private void BtPauseDownload_Click(object sender, RoutedEventArgs e)
 {
     if (DownloadFile.Progress.Status != BackgroundTransferStatus.PausedByApplication)
     {
         DownloadFile.Pause();
         tbSize.Text     = "Resuming";
         btPause.Content = "\uE103";
     }
     else
     {
         DownloadFile.Resume();
         tbSize.Text     = "Downloading Paused";
         btPause.Content = "\uE102";
     }
 }
 public void pause(DownloadOperation download)
 {
     try
     {
         download.Pause();
     }
     catch (Exception ex)
     {
     }
     finally
     {
         PauseEnabled  = false;
         ResumeEnabled = true;
         Status        = download.Progress.Status.ToString();
     }
 }
Beispiel #12
0
 private void btnPauseResume_Click(object sender, RoutedEventArgs e)
 {
     if (btnPauseResume.Content.ToString().ToLower().Equals("pause"))
     {
         try
         {
             downloadOperation.Pause();
         }
         catch (InvalidOperationException)
         {
         }
     }
     else
     {
         try
         {
             downloadOperation.Resume();
         }
         catch (InvalidOperationException)
         { }
     }
 }
Beispiel #13
0
 public void Pause()
 {
     DownloadOperation.Pause();
     DownloadStatus = DownloadStatus.Pause;
 }
Beispiel #14
0
 private void btn_pause_Click(object sender, RoutedEventArgs e)
 {
     downloadOperation.Pause();
 }