public void WriteLine()
 {
     if (dispatcher.CheckAccess())
     {
         nonThreadSafeScriptingConsole.WriteLine();
     }
     else
     {
         Action action = WriteLine;
         dispatcher.Invoke(action);
     }
 }
 void ThreadSafeTextEditorWrite(string text)
 {
     if (dispatcher.CheckAccess())
     {
         textEditor.Append(text);
     }
     else
     {
         Action <string> action = ThreadSafeTextEditorWrite;
         dispatcher.Invoke(action, text);
     }
 }