Exemple #1
0
		public void Add(Expression expression)
		{
			if (expression == null)
				throw new ArgumentNullException("expression");
			_expressions.Add(expression);
			expression.Parent = this;
		}
		public ReferenceExpression(ReferenceAttribute referrerProperty, Expression expression)
		{
			if (expression == null)
				throw new ArgumentNullException("expression");
			_referrerProperty = new PropertyLiteral((NodeAttribute)referrerProperty);
			_expression = expression;
			//_existenceOnly = false;
		}
Exemple #3
0
		public ExpressionList(ChainOperator operatorType, Expression exp0, Expression exp1) : this(operatorType)
		{
			if (exp0 == null)
				throw new ArgumentNullException("exp0");
			if (exp1 == null)
				throw new ArgumentNullException("exp1");
			Add(exp0);
			Add(exp1);
		}
		public ReferenceExpression(PropertyType referrerProperty, Expression expression)
		{
			if (referrerProperty == null)
				throw new ArgumentNullException("referrerProperty");
			if (referrerProperty.DataType != DataType.Reference)
				throw new ArgumentOutOfRangeException("referrerProperty", "The DataType of ''referrerProperty'' must be Reference");
			if (expression == null)
				throw new ArgumentNullException("expression");
			_referrerProperty = new PropertyLiteral(referrerProperty);
			_expression = expression;
			//_existenceOnly = false;
		}
Exemple #5
0
        private Query CompileExpressionNode(Expression expression)
        {
            ExpressionList expList;
            NotExpression notExp;
            ReferenceExpression refExp;
            SearchExpression textExp;
            TypeExpression typeExp;
            IBinaryExpressionWrapper binExp;

            if ((expList = expression as ExpressionList) != null)
                return CompileExpressionListNode(expList);
            else if ((notExp = expression as NotExpression) != null)
                return CompileNotExpressionNode(notExp);
            else if ((refExp = expression as ReferenceExpression) != null)
                return CompileReferenceExpressionNode(refExp);
            else if ((textExp = expression as SearchExpression) != null)
                return CompileSearchExpressionNode(textExp);
            else if ((typeExp = expression as TypeExpression) != null)
                return CompileTypeExpressionNode(typeExp);
            else if ((binExp = expression as IBinaryExpressionWrapper) != null)
                return CompileBinaryExpressionNode(binExp);
            throw new NotImplementedException("Unknown expression type: " + expression.GetType().FullName);
        }
Exemple #6
0
        //====================================================================================== 

        private Query TreeWalker(Expression exp)
        {
            return CompileExpressionNode(exp);
        }
Exemple #7
0
		public ExpressionList(ChainOperator operatorType, Expression expression) : this(operatorType)
		{
			if (expression == null)
				throw new ArgumentNullException("expression");
			Add(expression);
		}
Exemple #8
0
		public NotExpression(Expression expression)
		{
			if (expression == null)
				throw new ArgumentNullException("expression");
			_expression = expression;
		}
Exemple #9
0
        public void AddClause(Expression expression, ChainOperator chainOp)
        {
            if (expression == null)
                throw new ArgumentNullException("expression");

            ExpressionList finalExpList;
            var origExpList = expression as ExpressionList;
            
            if (origExpList != null)
            {
                finalExpList = origExpList;
            }
            else
            {
                finalExpList = new ExpressionList(chainOp);
                finalExpList.Add(expression);
            }

            this.Text = AddFilterToNodeQuery(Text, finalExpList.ToXml());
        }
Exemple #10
0
 public void AddClause(Expression expression)
 {
     AddClause(expression, ChainOperator.And);
 }