private void btnAbort_Click(object sender, RoutedEventArgs e) { if (!ProcessManagement.StopProcess()) { System.Windows.MessageBox.Show("Couldn't abort the process!", "Error", MessageBoxButton.OK, MessageBoxImage.Error); } else { btnAbort.IsEnabled = false; } }
private void btnCancelSecure_Click(object sender, RoutedEventArgs e) { { try { wcSecure.CancelAsync(); wcSecure.Dispose(); if (progressDownloadSecure.Value == 100) { ProcessManagement.StopProcess(); } } catch { } txtURLSecure.IsEnabled = true; progressDownloadSecure.Value = 0; progressDownloadSecure.IsEnabled = false; txtProgressSecure.Text = "Cancelled"; btnCancelSecure.IsEnabled = false; } }