public bool ExecuteCodeAndGenerateDocument(CodeEvaluationEventArgs args) { string theCode = String.Concat(CodeStart, args.Code, CodeBeforeClasses, args.CodeClasses, CodeEnd); string[] linesOfCode = new string[] { theCode }; return(CompileAndRun(linesOfCode, args.EvaluationParameter)); }
public void ForceCompile(CodeEvaluationEventArgs args) { compileComplete = false; if (!String.IsNullOrEmpty(args.Code)) { CompileExampleAndShowPrintPreview(args); } compileComplete = true; }
protected internal virtual CodeEvaluationEventArgs RaiseQueryEvaluate() { if (QueryEvaluate != null) { CodeEvaluationEventArgs args = new CodeEvaluationEventArgs(); QueryEvaluate(this, args); return(args); } return(null); }
void CompileExampleAndShowPrintPreview(CodeEvaluationEventArgs args) { bool evaluationSucceed = false; try { RaiseOnBeforeCompile(); evaluationSucceed = Evaluate(args); } finally { RaiseOnAfterCompile(evaluationSucceed); } }
public void CompileExample(object sender, EventArgs e) { if (!compileComplete) { return; } CodeEvaluationEventArgs args = RaiseQueryEvaluate(); if (!args.Result) { return; } ForceCompile(args); }
public bool Evaluate(CodeEvaluationEventArgs args) { ExampleCodeEvaluator snapExampleCodeEvaluator = GetExampleCodeEvaluator(args.Language); return(snapExampleCodeEvaluator.ExecuteCodeAndGenerateDocument(args)); }