/// <summary> /// Fires the AsyncExecutionFinished event and dereferences /// the background worker. /// </summary> /// <param name="result">The result of the execution.</param> private void OnAsyncExecutionFinished(JITExecutionResult result) { // Dispose and dereference background worker this.asyncExecutionWorker.Dispose(); this.asyncExecutionWorker = null; // Fire finished event if (this.AsyncExecutionFinished != null) { this.AsyncExecutionFinished(result); } }
/// <summary> /// Handles the AsyncExecutionFinished event of the Brainfuck Interpreter object. /// </summary> /// <param name="executionResult">Result of the execution.</param> private void BFI_AsyncExecutionFinished(JITExecutionResult executionResult) { MessageBox.Show("Execution finished: " + executionResult, "Finished"); // GUI this.Dispatcher.Invoke((Action)delegate { this.RunWithoutDebug.IsEnabled = true; this.StopRunning.IsEnabled = false; this.ShowCommonElements_StopRun(); }); }