예제 #1
0
            public void Process(GlobalMethodContext context) {
                var ruleContext = new RuleContext {
                    FunctionName = context.FunctionName,
                    Arguments = context.Arguments.ToArray(),
                    Result = context.Result
                };

                _ruleManager._ruleProviders.Process(ruleContext);

                context.Result = ruleContext.Result;
            }
예제 #2
0
            public void Process(GlobalMethodContext context) {
                var ruleContext = new ConditionEvaluationContext {
                    FunctionName = context.FunctionName,
                    Arguments = context.Arguments.ToArray(),
                    Result = context.Result
                };

                _conditionManager._conditions.Evaluate(ruleContext);

                context.Result = ruleContext.Result;
            }
예제 #3
0
        private object Evaluate(IEnumerable<IGlobalMethodProvider> globalMethodProviders, string name, IEnumerable<object> args) {
            var globalMethodContext = new GlobalMethodContext {
                FunctionName = name, 
                Arguments = args.ToArray(),
                Result = null
            };

            foreach (var globalMethodProvider in globalMethodProviders) {
                globalMethodProvider.Process(globalMethodContext);
            }

            return globalMethodContext.Result;
        }
        private object Evaluate(IEnumerable <IGlobalMethodProvider> globalMethodProviders, string name, IEnumerable <object> args)
        {
            var globalMethodContext = new GlobalMethodContext {
                FunctionName = name,
                Arguments    = args.ToArray(),
                Result       = null
            };

            foreach (var globalMethodProvider in globalMethodProviders)
            {
                globalMethodProvider.Process(globalMethodContext);
            }

            return(globalMethodContext.Result);
        }
예제 #5
0
 public void Process(GlobalMethodContext context) {
     context.Result = _methodInvocationCallback(context.FunctionName, context.Arguments);
 }