protected void OnConsoleWrite(EvaluationContext context, string text) { if (ConsoleWrite != null) { ConsoleWriteEventArgs args = new ConsoleWriteEventArgs(text); ConsoleWrite(this, args); } context.Write(text); }
private void EvaluateParsedScript() { var iRoot = GetAstInterface(); if (iRoot == null) { return; } EvaluationContext.ClearLastResult(); var start = Environment.TickCount; iRoot.Evaluate(EvaluationContext, AstMode.Read); EvaluationContext.EvaluationTime = Environment.TickCount - start; if (EvaluationContext.HasLastResult) { EvaluationContext.Write(EvaluationContext.LastResult + Environment.NewLine); } }