Exemplo n.º 1
0
        public object EvaluateEnumMethod(
            EventBean[] eventsLambda,
            ICollection<object> enumcoll,
            bool isNewData,
            ExprEvaluatorContext context)
        {
            var agg =
                new EnumAverageDecimalEventsForgeEval.AggregatorAvgDecimal(_forge.optionalMathContext);
            var resultEvent = new ObjectArrayEventBean(new object[1], _forge.resultEventType);
            eventsLambda[_forge.StreamNumLambda] = resultEvent;
            var props = resultEvent.Properties;

            var values = (ICollection<object>) enumcoll;
            foreach (var next in values) {
                props[0] = next;

                var num = _innerExpression.Evaluate(eventsLambda, isNewData, context);
                if (num == null) {
                    continue;
                }

                agg.Enter(num);
            }

            return agg.Value;
        }
Exemplo n.º 2
0
        public object EvaluateEnumMethod(
            EventBean[] eventsLambda,
            ICollection<object> enumcoll,
            bool isNewData,
            ExprEvaluatorContext context)
        {
            var agg = new EnumAverageDecimalEventsForgeEval.AggregatorAvgDecimal(_optionalMathContext);

            foreach (var next in enumcoll) {
                var num = next;
                if (num == null) {
                    continue;
                }

                agg.Enter(num);
            }

            return agg.Value;
        }