public bool IsRunning() { if (_scriptEngine == null) { return(false); } _scriptEngine.GetScriptThreadState(SCRIPTTHREADID_BASE, out ScriptThreadState state); return(state == ScriptThreadState.Running); }