private void Engine_ExecutionCompleted(object e, object arg) { PrintLnStatement.WriteLine(""); PrintLnStatement.WriteLine(Properties.Resources.ApplicationComplete); PrintLnStatement.Stop(); Dispatcher.InvokeAsync(() => { Editor.IsEnabled = true; ButtonStart.IsEnabled = true; ButtonStop.IsEnabled = false; ButtonSaveAs.IsEnabled = true; ButtonPrint.IsEnabled = true; }); }
private void Engine_ExecutionAborted(object sender, Completion arg) { PrintLnStatement.WriteLine(""); PrintLnStatement.WriteLine(Properties.Resources.ApplicationAbort); PrintLnStatement.WriteLine(arg.ReturnValue); PrintLnStatement.Stop(); if (arg != null) { Dispatcher.InvokeAsync(() => { var ret = MessageBox.Show(Properties.Resources.ExceptionDuringRun + "\n" + arg.ReturnValue + "\n" + Properties.Resources.LocateException, Properties.Resources.Exception, MessageBoxButton.YesNo, MessageBoxImage.Error); if (ret == MessageBoxResult.Yes) { var editor = Editor.FindEditorFor(arg.Location); if (editor == null) { var parent = Editor.FindParent(arg.Location); editor = Editor.FindEditorFor(parent); } if (editor != null) { Console.WriteLine(editor); Editor.Highlight(editor); ButtonClearError.IsEnabled = true; } } //var p = Editor.FindParent(arg.Location); // var pe = Editor.FindEditorFor(p); }); } Dispatcher.InvokeAsync(() => { Editor.IsEnabled = true; ButtonStart.IsEnabled = true; ButtonStop.IsEnabled = false; ButtonSaveAs.IsEnabled = true; ButtonPrint.IsEnabled = true; }); }