Пример #1
0
        private void RunScript(string script)
        {
            try
            {
                ExecutionStart?.Invoke(this, EventArgs.Empty);
                lock (_script)
                {
                    _script.DoString(script, codeFriendlyName: "script");
                }

                ExecutionComplete?.Invoke(this, ExitCondition.ProgramEnd);
            }
            catch (InterpreterException e)
            {
                LuaError?.Invoke(this, e);
                ExecutionComplete?.Invoke(this, ExitCondition.ScriptError);
            }
            catch (ThreadAbortException)
            {
                // Ignore
            }
            catch (Exception e)
            {
                CsError?.Invoke(this, e);
                ExecutionComplete?.Invoke(this, ExitCondition.CsError);
            }
        }
Пример #2
0
 /// <summary>
 /// Fires the execution start event.
 /// </summary>
 private void FireExecutionStartEvent()
 {
     ExecutionStart?.Invoke(this, new ExecutionStartEventArgs());
 }