Exemplo n.º 1
0
        public static ExprDotEnumerationSource GetEnumerationSource(ExprNode inputExpression, StreamTypeService streamTypeService, EventAdapterService eventAdapterService, int statementId, bool hasEnumerationMethod, bool disablePropertyExpressionEventCollCache)
        {
            var rootNodeEvaluator = inputExpression.ExprEvaluator;
            ExprEvaluatorEnumeration rootLambdaEvaluator = null;
            EPType info = null;

            if (rootNodeEvaluator is ExprEvaluatorEnumeration)
            {
                rootLambdaEvaluator = (ExprEvaluatorEnumeration)rootNodeEvaluator;

                if (rootLambdaEvaluator.GetEventTypeCollection(eventAdapterService, statementId) != null)
                {
                    info = EPTypeHelper.CollectionOfEvents(rootLambdaEvaluator.GetEventTypeCollection(eventAdapterService, statementId));
                }
                else if (rootLambdaEvaluator.GetEventTypeSingle(eventAdapterService, statementId) != null)
                {
                    info = EPTypeHelper.SingleEvent(rootLambdaEvaluator.GetEventTypeSingle(eventAdapterService, statementId));
                }
                else if (rootLambdaEvaluator.ComponentTypeCollection != null)
                {
                    info = EPTypeHelper.CollectionOfSingleValue(rootLambdaEvaluator.ComponentTypeCollection);
                }
                else
                {
                    rootLambdaEvaluator = null; // not a lambda evaluator
                }
            }
            else if (inputExpression is ExprIdentNode)
            {
                var identNode  = (ExprIdentNode)inputExpression;
                var streamId   = identNode.StreamId;
                var streamType = streamTypeService.EventTypes[streamId];
                return(GetPropertyEnumerationSource(identNode.ResolvedPropertyName, streamId, streamType, hasEnumerationMethod, disablePropertyExpressionEventCollCache));
            }
            return(new ExprDotEnumerationSource(info, null, rootLambdaEvaluator));
        }
Exemplo n.º 2
0
 public EventType GetEventTypeCollection(EventAdapterService eventAdapterService, int statementId)
 {
     return(_innerEvaluatorLambda != null?_innerEvaluatorLambda.GetEventTypeCollection(eventAdapterService, statementId) : null);
 }