Exemple #1
0
        public static ValueResolver Create(SimpleReference reference)
        {
            var objectReference = reference as ObjectReference;

            if (!ReferenceEquals(null, objectReference))
            {
                return(new ObjectValueResolver(objectReference));
            }
            var functionReference = reference as FunctionReference;

            if (!ReferenceEquals(null, functionReference))
            {
                if (FunctionHandlers.Exists(functionReference.Name))
                {
                    return(new AggregateValueResolver(functionReference));
                }
                return(new FunctionValueResolver(functionReference));
            }

            throw new InvalidOperationException("Unresolvable Reference type.");
        }
Exemple #2
0
 public AggregateValueResolver(FunctionReference reference)
 {
     _reference        = reference;
     _argumentResolver = Create(reference.Argument);
     _handler          = FunctionHandlers.Get(reference.Name);
 }
Exemple #3
0
        private static bool ReferenceIsNotAggregateFunction(SimpleReference reference)
        {
            var functionReference = reference as FunctionReference;

            return(ReferenceEquals(functionReference, null) || !FunctionHandlers.Exists(functionReference.Name));
        }