object CallVariable(String expression) { String varName = expression.Substring(1); IExternalFunction func = Values["controller"] as IExternalFunction; return(func.CallVariable(varName)); }
private static Evaluator CreateEvaluator(Dictionary <string, object> values = null, IExternalFunction controller = null, Dictionary <string, string> translations = null) { var valueStack = Substitute.For <IValueStack>(); if (values != null) { valueStack.Values.Returns(values); } var translator = Substitute.For <ITranslator>(); if (translations != null) { translator.TranslateByKey(Arg.Any <string>()).Returns(info => translations[info.Arg <string>()]); } var evaluator = new Evaluator(valueStack, translator); evaluator.SetController(controller ?? Substitute.For <IExternalFunction>()); return(evaluator); }
private static Evaluator CreateEvaluator(Dictionary<string, object> values = null, IExternalFunction controller = null, Dictionary<string, string> translations = null) { var valueStack = Substitute.For<IValueStack>(); if (values != null) valueStack.Values.Returns(values); var translator = Substitute.For<ITranslator>(); if (translations != null) translator.TranslateByKey(Arg.Any<string>()).Returns(info => translations[info.Arg<string>()]); var evaluator = new Evaluator(valueStack, translator); evaluator.SetController(controller ?? Substitute.For<IExternalFunction>()); return evaluator; }
public object CallScript(String functionName, object[] parameters) { IExternalFunction func = Values["controller"] as IExternalFunction; return(func.CallFunction(functionName, parameters)); }
public CollocatedExternalFunction(IExternalFunction/*!*/externalFunction, IExternals extManager) { Debug.Assert(externalFunction != null); this.externalFunction = externalFunction; this.extManager = extManager; }
public void SetController(IExternalFunction controller) { _executor.SetController(controller); }
public void SetController(IExternalFunction controller) { _controller = controller; }