Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ Negate() [2/2]

static UnaryExpression System.Linq.Expressions.Expression< TDelegate >.Negate ( Expression< TDelegate > expression,
MethodInfo? method )
inlinestaticinherited

Definition at line 5119 of file Expression.cs.

5120 {
5122 if (method == null)
5123 {
5124 if (expression.Type.IsArithmetic() && !expression.Type.IsUnsignedInt())
5125 {
5126 return new UnaryExpression(ExpressionType.Negate, expression, expression.Type, null);
5127 }
5128 return GetUserDefinedUnaryOperatorOrThrow(ExpressionType.Negate, "op_UnaryNegation", expression);
5129 }
5131 }
static void RequiresCanRead(Expression expression, string paramName)
static UnaryExpression GetUserDefinedUnaryOperatorOrThrow(ExpressionType unaryType, string name, Expression operand)
static UnaryExpression GetMethodBasedUnaryOperator(ExpressionType unaryType, Expression operand, MethodInfo method)

References System.Linq.Expressions.Expression< TDelegate >.GetMethodBasedUnaryOperator(), System.Linq.Expressions.Expression< TDelegate >.GetUserDefinedUnaryOperatorOrThrow(), and System.Dynamic.Utils.ExpressionUtils.RequiresCanRead().