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;
		}
		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");
		}
        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");
        }
		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");
		}