コード例 #1
0
ファイル: EvaluatorTests.cs プロジェクト: RasterImage/Orchard
 protected override EvaluationResult EvaluateSimpleExpression(string expression, Func<string, IList<object>, object> methodInvocationCallback) {
     var evaluator = new RubyScriptExpressionEvaluator(_scriptingManager, new StubCacheManager());
     try {
         var value = evaluator.Evaluate(expression, new[] { new GlobalMethodProvider(methodInvocationCallback) });
         return new EvaluationResult(value);
     }
     catch (Exception e) {
         Trace.WriteLine(string.Format("Error during evaluation of '{0}': {1}", expression, e.Message));
         return new EvaluationResult(new Error { Message = e.Message, Exception = e });
     }
 }
コード例 #2
0
 public CallbackApi(RubyScriptExpressionEvaluator ruleManager, IEnumerable<IGlobalMethodProvider> providers) {
     _ruleManager = ruleManager;
     _providers = providers;
 }
コード例 #3
0
 public CallbackApi(RubyScriptExpressionEvaluator ruleManager, IEnumerable <IGlobalMethodProvider> providers)
 {
     _ruleManager = ruleManager;
     _providers   = providers;
 }