public void ExecutionThread() { while (!ReadFlag(ref exitflag)) { if (ReadFlag(ref taskflag)) { try { Tasks.Peek()(Progress); } catch (ThreadAbortException) { } catch (Exception exception) { if (!(exception is ProgressException)) { Exceptions.Warning(exception); exception = new ProgressException(exception.Message, exception); } Progress.ErrorHandler(exception as ProgressException); Progress.Unwind(); } } else { SetFlag(ref waitflag, true); try { Thread.Sleep(Timeout.Infinite); } catch (ThreadInterruptedException) { } SetFlag(ref waitflag, false); } } }
void Progress_OnError_Base(TaskScheduler task, ProgressException exception) { MessageBox.Show(this, (exception.Message.HasValue() ? exception.Message : "An unspecified error occurred.") + "\nFor more information about this error, see the rawksd.log file (in the same folder as RawkSD is)." + "\nIf the problem persists or you need help with RawkSD, please send this log file along with any related files and an explanation of what you were doing to [email protected]" , "RawkSD Error!", MessageBoxButtons.OK, MessageBoxIcon.Error); }
void Progress_OnError(ProgressIndicator progress, ProgressException exception) { if (OnError != null) { OnError(this, exception); } }
void Progress_OnError(TaskScheduler task, ProgressException exception) { Invoke((Action <TaskScheduler, ProgressException>)Progress_OnError_Base, task, exception); }