public override bool Equals(object obj)
        {
            if (obj == null)
            {
                return(false);
            }
            if (Object.ReferenceEquals(this, obj))
            {
                return(true);
            }
            if (this.GetType() != obj.GetType())
            {
                return(false);
            }


            var other = (VLFilterDetail)obj;

            //reference types
            if (!Object.Equals(m_userInput1, other.m_userInput1))
            {
                return(false);
            }
            if (!Object.Equals(m_userInput2, other.m_userInput2))
            {
                return(false);
            }
            //value types
            if (!m_viewId.Equals(other.m_viewId))
            {
                return(false);
            }
            if (!m_filterId.Equals(other.m_filterId))
            {
                return(false);
            }
            if (!m_detailId.Equals(other.m_detailId))
            {
                return(false);
            }
            if (!m_operator.Equals(other.m_operator))
            {
                return(false);
            }
            if (!m_selectedOption.Equals(other.m_selectedOption))
            {
                return(false);
            }
            if (!m_selectedColumn.Equals(other.m_selectedColumn))
            {
                return(false);
            }

            return(true);
        }
Beispiel #2
0
 public override bool Equals(object other)
 {
     if (this == other)
     {
         return(true);
     }
     if (other == null || GetType() != other.GetType())
     {
         return(false);
     }
     Db4objects.Db4o.NativeQueries.Expr.ComparisonExpression casted = (Db4objects.Db4o.NativeQueries.Expr.ComparisonExpression
                                                                       )other;
     return(_left.Equals(casted._left) && _right.Equals(casted._right) && _op.Equals(casted
                                                                                     ._op));
 }
Beispiel #3
0
        public override bool Equals(object other)
        {
            if (this == other)
            {
                return(true);
            }
            if (other == null || GetType() != other.GetType())
            {
                return(false);
            }
            var casted = (ComparisonExpression
                          )other;

            return(_left.Equals(casted._left) && _right.Equals(casted._right) && _op.Equals(casted
                                                                                            ._op));
        }
Beispiel #4
0
            public virtual void Visit(ComparisonExpression expression)
            {
                IQuery subQuery = Descend(expression.Left());
                ComparisonQueryGeneratingVisitor visitor = new ComparisonQueryGeneratingVisitor(_predicate
                                                                                                , _classSource, _referenceResolver);

                expression.Right().Accept(visitor);
                _constraint = subQuery.Constrain(visitor.Value());
                ComparisonOperator op = expression.Op();

                if (op.Equals(ComparisonOperator.ValueEquality))
                {
                    return;
                }
                if (op.Equals(ComparisonOperator.ReferenceEquality))
                {
                    _constraint.Identity();
                    return;
                }
                if (op.Equals(ComparisonOperator.Greater))
                {
                    _constraint.Greater();
                    return;
                }
                if (op.Equals(ComparisonOperator.Smaller))
                {
                    _constraint.Smaller();
                    return;
                }
                if (op.Equals(ComparisonOperator.Contains))
                {
                    _constraint.Contains();
                    return;
                }
                if (op.Equals(ComparisonOperator.StartsWith))
                {
                    _constraint.StartsWith(true);
                    return;
                }
                if (op.Equals(ComparisonOperator.EndsWith))
                {
                    _constraint.EndsWith(true);
                    return;
                }
                throw new Exception("Can't handle constraint: " + op);
            }
Beispiel #5
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);
 }