Beispiel #1
0
 internal void FireLeaveNode(ExecutionLeaveEventArgs args)
 {
     if (IsAborting)
     {
         throw new ExecutionAbortException(Properties.Language.ExecutionAborted);
     }
     LeaveNode?.Invoke(this, args);
     if (_parent != null)
     {
         _parent.FireLeaveNode(args);
     }
 }
Beispiel #2
0
 private void Engine_LeaveNode(object engine, ExecutionLeaveEventArgs arg)
 {
     if (IsStackMonitored && stackTrace.Count > 0)
     {
         stackTrace.Pop();
     }
     if (IsHighlightStep)
     {
         if (arg.Location != null && arg.Location is ScratchNet.Expression)
         {
             Control editor = null;
             double  cycle  = 100;
             Dispatcher.Invoke(() =>
             {
                 try
                 {
                     cycle  = 100 - SliderSpeeder.Value;
                     editor = Editor.FindEditorFor(arg.Location);
                     if (editor != null)
                     {
                         Editor.Highlight(editor, arg.Value == null ? null : arg.Value.ReturnValue);
                     }
                 }
                 catch (Exception e)
                 {
                     Console.WriteLine(e.Message);
                     Console.WriteLine(e.StackTrace);
                 }
             });
             if (editor != null)
             {
                 Thread.Sleep((int)(5000 * cycle / 100));
                 Dispatcher.Invoke(() =>
                 {
                     Editor.ClearHighlight();
                 });
             }
         }
     }
 }