private void btnClose_Click(object sender, RoutedEventArgs e) { if (_done) { DialogResult = true; } else { this.IsEnabled = false; _canceled = true; _wrapper?.Cancel(); if (!_processThread.Join(TimeSpan.FromSeconds(5))) { _processThread.Abort(); } DialogResult = false; } Close(); }
public override void Cancel() { _canceled = true; _wrapper.Cancel(); }