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

◆ BuildCallMethodWithResult< TBinder >()

DynamicMetaObject System.Dynamic.DynamicObject.MetaDynamic.BuildCallMethodWithResult< TBinder > ( MethodInfo method,
TBinder binder,
Expression[] args,
DynamicMetaObject fallbackResult,
Fallback< TBinder > fallbackInvoke )
inlineprivate
Type Constraints
TBinder :DynamicMetaObjectBinder 

Definition at line 237 of file DynamicObject.cs.

237 : DynamicMetaObjectBinder
238 {
239 if (!IsOverridden(method))
240 {
241 return fallbackResult;
242 }
247 if (binder.ReturnType != typeof(object))
248 {
250 string value = Strings.DynamicObjectResultNotAssignable("{0}", Value.GetType(), binder.GetType(), binder.ReturnType);
251 Expression test = ((!binder.ReturnType.IsValueType || !(Nullable.GetUnderlyingType(binder.ReturnType) == null)) ? ((Expression)System.Linq.Expressions.Expression.OrElse(System.Linq.Expressions.Expression.Equal(dynamicMetaObject.Expression, System.Linq.Expressions.Utils.Null), System.Linq.Expressions.Expression.TypeIs(dynamicMetaObject.Expression, binder.ReturnType))) : ((Expression)System.Linq.Expressions.Expression.TypeIs(dynamicMetaObject.Expression, binder.ReturnType)));
254 }
255 if (fallbackInvoke != null)
256 {
258 }
260 }
DynamicMetaObject(Expression expression, BindingRestrictions restrictions)
static Expression ReferenceArgAssign(Expression callArgs, Expression[] args)
static ReadOnlyCollection< Expression > GetConvertedArgs(params Expression[] args)
static ConstantExpression Constant(object? value)
static BlockExpression Block(Expression arg0, Expression arg1)
static MethodCallExpression Call(MethodInfo method)
static BinaryExpression Assign(Expression left, Expression right)
static BinaryExpression OrElse(Expression left, Expression right)
static ParameterExpression Parameter(Type type)
static ConditionalExpression Condition(Expression test, Expression ifTrue, Expression ifFalse)
static TypeBinaryExpression TypeIs(Expression expression, Type type)
static NewExpression New(ConstructorInfo constructor)
static UnaryExpression Convert(Expression expression, Type type)
static NewArrayExpression NewArrayInit(Type type, params Expression[] initializers)
static BinaryExpression Equal(Expression left, Expression right)
static UnaryExpression Throw(Expression? value)
static string DynamicObjectResultNotAssignable(object p0, object p1, object p2, object p3)
Definition Strings.cs:198
static readonly ConstantExpression Null
Definition Utils.cs:62

References System.Dynamic.DynamicMetaObject.DynamicMetaObject(), System.Linq.Expressions.Expression< TDelegate >.Assign(), System.Linq.Expressions.Expression< TDelegate >.Block(), System.Linq.Expressions.Expression< TDelegate >.Call(), System.Linq.Expressions.Expression< TDelegate >.Condition(), System.Linq.Expressions.Expression< TDelegate >.Constant(), System.Linq.Expressions.Expression< TDelegate >.Convert(), System.Linq.Expressions.CachedReflectionInfo.DynamicObject_TryBinaryOperation, System.Linq.Expressions.Strings.DynamicObjectResultNotAssignable(), System.Dynamic.BindingRestrictions.Empty, System.Linq.Expressions.Utils.Empty, System.Linq.Expressions.Expression< TDelegate >.Equal(), System.Dynamic.DynamicMetaObject.Expression, System.Dynamic.DynamicObject.MetaDynamic.GetConvertedArgs(), System.Dynamic.DynamicObject.MetaDynamic.GetLimitedSelf(), System.Dynamic.DynamicObject.MetaDynamic.GetRestrictions(), System.Nullable< T >.GetUnderlyingType(), System.Linq.Expressions.CachedReflectionInfo.InvalidCastException_Ctor_String, System.Dynamic.DynamicObject.MetaDynamic.IsOverridden(), System.Dynamic.BindingRestrictions.Merge(), System.Linq.Expressions.Expression< TDelegate >.New(), System.Linq.Expressions.Expression< TDelegate >.NewArrayInit(), System.Linq.Expressions.Utils.Null, System.Linq.Expressions.CachedReflectionInfo.Object_GetType, System.Linq.Expressions.Expression< TDelegate >.OrElse(), System.Linq.Expressions.Expression< TDelegate >.Parameter(), System.Dynamic.DynamicObject.MetaDynamic.ReferenceArgAssign(), System.Linq.Expressions.CachedReflectionInfo.String_Format_String_ObjectArray, System.Linq.Expressions.Expression< TDelegate >.Throw(), System.Linq.Expressions.Expression< TDelegate >.TypeIs(), System.Dynamic.DynamicObject.MetaDynamic.Value, and System.value.