示例#1
0
        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();
        }
示例#2
0
 public override void Cancel()
 {
     _canceled = true;
     _wrapper.Cancel();
 }