public ComputedExpressionParser(TextReader reader, PropertyInfo propertyInfo, ParameterExpression target, Type[] referencedTypes = null, Type coersionType = null)
		{
			this.propertyInfo = propertyInfo;
			this.coersionType = coersionType;
			this.referencedTypesByName = (referencedTypes ?? new Type[0]).ToDictionary(c => c.Name, c => c);
			this.referencedAssemblies = new HashSet<Assembly>(referencedTypes?.Select(c => c.Assembly) ?? new Assembly[0]).ToList();
			this.tokenizer = new ComputedExpressionTokenizer(reader);
			this.targetObject = target;
		}
Пример #2
0
		public ComputedExpressionParser(TextReader reader, PropertyInfo propertyInfo)
		{
			if (propertyInfo.DeclaringType == null)
			{
				throw new ArgumentException(nameof(propertyInfo));
			}

			this.propertyInfo = propertyInfo;
			this.tokenizer = new ComputedExpressionTokenizer(reader);
			this.targetObject = Expression.Parameter(propertyInfo.DeclaringType, "object");
		}
Пример #3
0
        public ComputedExpressionParser(TextReader reader, PropertyInfo propertyInfo)
        {
            if (propertyInfo.DeclaringType == null)
            {
                throw new ArgumentException(nameof(propertyInfo));
            }

            this.propertyInfo = propertyInfo;
            this.tokenizer    = new ComputedExpressionTokenizer(reader);
            this.targetObject = Expression.Parameter(propertyInfo.DeclaringType, "object");
        }
Пример #4
0
        public ComputedExpressionParser(TextReader reader, PropertyInfo propertyInfo, Type[] referencedTypes = null)
        {
            if (propertyInfo.DeclaringType == null)
            {
                throw new ArgumentException(nameof(propertyInfo));
            }

            this.propertyInfo          = propertyInfo;
            this.referencedTypesByName = (referencedTypes ?? new Type[0]).ToDictionary(c => c.Name, c => c);
            this.referencedAssemblies  = new HashSet <Assembly>(referencedTypes?.Select(c => c.Assembly) ?? new Assembly[0]).ToList();
            this.tokenizer             = new ComputedExpressionTokenizer(reader);
            this.targetObject          = Expression.Parameter(propertyInfo.DeclaringType, "object");
        }
Пример #5
0
		public ComputedExpressionParser(TextReader reader, PropertyInfo propertyInfo, Type[] referencedTypes = null)
		{
			if (propertyInfo.DeclaringType == null)
			{
				throw new ArgumentException(nameof(propertyInfo));
			}

			this.propertyInfo = propertyInfo;
			this.referencedTypesByName = (referencedTypes ?? new Type[0]).ToDictionary(c => c.Name, c => c);
			this.referencedAssemblies = new HashSet<Assembly>(referencedTypes?.Select(c => c.Assembly) ?? new Assembly[0]).ToList();
			this.tokenizer = new ComputedExpressionTokenizer(reader);
			this.targetObject = Expression.Parameter(propertyInfo.DeclaringType, "object");
		}