public ComparisonExpression(FieldValue left, IComparisonOperand right, ComparisonOperator
     op)
 {
     if (left == null || right == null || op == null)
     {
         throw new ArgumentNullException();
     }
     _left = left;
     _right = right;
     _op = op;
 }
Exemple #2
0
			private void Constrain(ComparisonOperator op)
			{
				this._enclosing.Invoke(this._enclosing.constrainRef);
				if (op.Equals(ComparisonOperator.ValueEquality))
				{
					return;
				}
				if (op.Equals(ComparisonOperator.ReferenceEquality))
				{
					this._enclosing.Invoke(this._enclosing.identityRef);
					return;
				}
				if (op.Equals(ComparisonOperator.Greater))
				{
					this._enclosing.Invoke(this._enclosing.greaterRef);
					return;
				}
				if (op.Equals(ComparisonOperator.Smaller))
				{
					this._enclosing.Invoke(this._enclosing.smallerRef);
					return;
				}
				if (op.Equals(ComparisonOperator.Contains))
				{
					this._enclosing.Invoke(this._enclosing.containsRef);
					return;
				}
				if (op.Equals(ComparisonOperator.StartsWith))
				{
					this._enclosing.Ldc(1);
					this._enclosing.Invoke(this._enclosing.startsWithRef);
					return;
				}
				if (op.Equals(ComparisonOperator.EndsWith))
				{
					this._enclosing.Ldc(1);
					this._enclosing.Invoke(this._enclosing.endsWithRef);
					return;
				}
				throw new Exception("Cannot interpret constraint: " + op);
			}