System.Linq.Expressions.Expression.GetUserDefinedBinaryOperator C# (CSharp) Method

GetUserDefinedBinaryOperator() private static method

private static GetUserDefinedBinaryOperator ( ExpressionType binaryType, Type leftType, Type rightType, string name ) : MethodInfo
binaryType ExpressionType
leftType Type
rightType Type
name string
return System.Reflection.MethodInfo
        private static MethodInfo GetUserDefinedBinaryOperator(ExpressionType binaryType, Type leftType, Type rightType, string name)
        {
            // This algorithm is wrong, we should be checking for uniqueness and erroring if
            // it is defined on both types.
            Type[] types = new Type[] { leftType, rightType };
            Type nnLeftType = leftType.GetNonNullableType();
            Type nnRightType = rightType.GetNonNullableType();
            MethodInfo method = nnLeftType.GetAnyStaticMethodValidated(name, types);
            if (method == null && !TypeUtils.AreEquivalent(leftType, rightType))
            {
                method = nnRightType.GetAnyStaticMethodValidated(name, types);
            }

            if (IsLiftingConditionalLogicalOperator(leftType, rightType, method, binaryType))
            {
                method = GetUserDefinedBinaryOperator(binaryType, nnLeftType, nnRightType, name);
            }
            return method;
        }

Same methods

Expression::GetUserDefinedBinaryOperator ( ExpressionType binaryType, string name, Expression left, Expression right, bool liftToNull ) : BinaryExpression
Expression