public bool ShowBackgroundCancelDialog(int millisecondsDelay, System.Threading.Thread thread, IExternalDrivenBackgroundMonitor monitor) { for (int i = 0; i < millisecondsDelay && thread.IsAlive; i += 10) { System.Threading.Thread.Sleep(10); } if (thread.IsAlive) { Altaxo.Gui.Common.BackgroundCancelDialog dlg = new Altaxo.Gui.Common.BackgroundCancelDialog(thread, monitor); if (thread.IsAlive) { System.Windows.Forms.DialogResult r = dlg.ShowDialog(Current.MainWindow); return(r == System.Windows.Forms.DialogResult.OK ? false : true); } } return(false); }
public override bool ShowBackgroundCancelDialog(int millisecondsDelay, IExternalDrivenBackgroundMonitor monitor, System.Threading.Thread thread) { for (int i = 0; i < millisecondsDelay && thread.IsAlive; i += 10) System.Threading.Thread.Sleep(10); if (thread.IsAlive) { BackgroundCancelDialog dlg = new BackgroundCancelDialog(thread, monitor); if (thread.IsAlive) { System.Windows.Forms.DialogResult r = dlg.ShowDialog(MainWindow); return r == System.Windows.Forms.DialogResult.OK ? false : true; } } return false; }