Exemplo n.º 1
0
 bool setDE(ConstantExpression left, ParameterExpression right)
 {
     if (_x.Equals(right))
     {
         _list[3] = (BigInteger)left.Value;
         return(true);
     }
     if (_y.Equals(right))
     {
         _list[4] = (BigInteger)left.Value;
         return(true);
     }
     return(false);
 }
Exemplo n.º 2
0
 protected override Expression VisitParameter(ParameterExpression node)
 {
     if (node.Equals(_parameter))
     {
         return(this.Visit(_replacement));
     }
     return(base.VisitParameter(node));
 }
Exemplo n.º 3
0
 protected override Expression VisitParameter(ParameterExpression node)
 {
     if (node.Equals(this._paramToApply))
     {
         return(Expression.Constant(_arg1, node.Type));
     }
     return(base.VisitParameter(node));
 }
Exemplo n.º 4
0
            protected override Expression VisitParameter(ParameterExpression parameter)
            {
                if (parameter.Equals(_parameterToReplace))
                {
                    return(_parameterReplacement);
                }

                return(base.VisitParameter(parameter));
            }
Exemplo n.º 5
0
        protected override Expression VisitParameter(ParameterExpression node)
        {
            if (node.Equals(oldParam))
            {
                return(newParam);
            }
            return(node);

            //return base.VisitParameter(node);
        }
Exemplo n.º 6
0
 public bool Equals(RuleParameter <T> other)
 {
     if (ReferenceEquals(null, other))
     {
         return(false);
     }
     if (ReferenceEquals(this, other))
     {
         return(true);
     }
     return(_parameter.Equals(other._parameter));
 }
Exemplo n.º 7
0
        public static bool MatchParameter(ParameterExpression e1,
                                          ParameterExpression e2,
                                          Substitution subst)
        {
            if (e1.Equals(e2))
            {
                return(true);
            }
            ParameterExpression e = subst.Find(e1);

            return(e != null && e.Equals(e2));
        }
Exemplo n.º 8
0
        /// <summary>
        /// Replace all occurences of a ParameterExpression within an expression tree with another ParameterExpression, and return a cloned tree
        /// </summary>
        /// <param name="expression">ParameterExpression to replace parameters in</param>
        /// <param name="oldParameter">Parameter to replace</param>
        /// <param name="newParameter">Parameter to use as replacement</param>
        /// <returns>A cloned expression tree with all occurences of oldParameter replaced with newParameter</returns>
        public static ParameterExpression ReplaceParameter(this ParameterExpression expression, ParameterExpression oldParameter, ParameterExpression newParameter)
        {
            ParameterExpression paramExpression = null;

            if (expression.Equals(oldParameter))
            {
                paramExpression = newParameter;
            }
            else
            {
                paramExpression = expression;
            }
            return(paramExpression);
        }
Exemplo n.º 9
0
        /// <summary>
        /// Visit :: x => `x`.Customer.Name
        /// </summary>
        protected override Expression VisitParameter(ParameterExpression node)
        {
            _builder.Append(_rootParameter.Equals(node) ? "$" : "@");

            return(base.VisitParameter(node));
        }
Exemplo n.º 10
0
 protected override Expression VisitParameter(ParameterExpression node)
 {
     return(node.Equals(fromParameter) ? toParameter : base.VisitParameter(node));
 }
 protected override Expression VisitParameter(ParameterExpression node)
 {
     return(node.Equals(_originalParameter) ? _replacementParameter : base.VisitParameter(node));
 }
 protected override Expression VisitParameter(ParameterExpression node)
 {
     // Replace the source with the target, visit other params as usual.
     return(node.Equals(_source) ? _target : base.VisitParameter(node));
 }
 protected override Expression VisitParameter(ParameterExpression node)
 {
     return(node.Equals(_target) ? _replacement : node);
 }
Exemplo n.º 14
0
 protected override Expression VisitParameter(ParameterExpression node)
 {
     return(node.Equals(Original) ? Replacement : base.VisitParameter(node));
 }