Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
ExpressionExtension.cs
Go to the documentation of this file.
7
9
10internal static class ExpressionExtension
11{
16
45
61
79
99
101 {
104 if (!delegateType.IsSubclassOf(typeof(MulticastDelegate)))
105 {
107 }
109 ParameterInfo[] parametersCached = validMethodForDynamic.GetParametersCached();
120 }
121
123 {
124 MethodInfo invokeMethod = delegateType.GetInvokeMethod();
125 ParameterInfo[] parametersCached = invokeMethod.GetParametersCached();
126 if (parametersCached.Length == 0 || parametersCached[0].ParameterType != typeof(CallSite))
127 {
129 }
130 return invokeMethod;
131 }
132
137
146
156
167
179
188
208
209 private static void ValidateDynamicArgument(Expression arg, string paramName)
210 {
212 }
213
214 private static void ValidateDynamicArgument(Expression arg, string paramName, int index)
215 {
217 Type type = arg.Type;
219 TypeUtils.ValidateType(type, "type", allowByRef: true, allowPointer: true);
220 if (type == typeof(void))
221 {
223 }
224 }
225}
static void RequiresNotNull(object value, string paramName)
static void ValidateArgumentCount(MethodBase method, ExpressionType nodeKind, int count, ParameterInfo[] pis)
static void RequiresCanRead(Expression expression, string paramName)
static void ValidateArgumentTypes(MethodBase method, ExpressionType nodeKind, ref ReadOnlyCollection< Expression > arguments, string methodParamName)
static Expression ValidateOneArgument(MethodBase method, ExpressionType nodeKind, Expression arguments, ParameterInfo pi, string methodParamName, string argumentParamName, int index=-1)
static void ValidateType(Type type, string paramName)
Definition TypeUtils.cs:695
static TypeInfo NextTypeInfo(Type initialArg)
static Type MakeCallSiteDelegate(ReadOnlyCollection< Expression > types, Type returnType)
static TypeInfo GetNextTypeInfo(Type initialArg, TypeInfo curTypeInfo)
static DynamicExpression Make(Type returnType, Type delegateType, CallSiteBinder binder, ReadOnlyCollection< Expression > arguments)
static Exception ArgumentTypeCannotBeVoid()
Definition Error.cs:328
static Exception FirstArgumentMustBeCallSite()
Definition Error.cs:103
static Exception TypeMustBeDerivedFromSystemDelegate()
Definition Error.cs:123
static DynamicExpression Dynamic(CallSiteBinder binder, Type returnType, Expression arg0)
static DynamicExpression Dynamic(CallSiteBinder binder, Type returnType, Expression arg0, Expression arg1)
static DynamicExpression Dynamic(CallSiteBinder binder, Type returnType, params Expression[] arguments)
static DynamicExpression MakeDynamic(Type delegateType, CallSiteBinder binder, Expression arg0, Expression arg1, Expression arg2, Expression arg3)
static DynamicExpression MakeDynamic(Type delegateType, CallSiteBinder binder, Expression arg0)
static DynamicExpression MakeDynamic(Type delegateType, CallSiteBinder binder, params Expression[] arguments)
static void ValidateDynamicArgument(Expression arg, string paramName)
static DynamicExpression Dynamic(CallSiteBinder binder, Type returnType, Expression arg0, Expression arg1, Expression arg2)
static DynamicExpression Dynamic(CallSiteBinder binder, Type returnType, Expression arg0, Expression arg1, Expression arg2, Expression arg3)
static DynamicExpression Dynamic(CallSiteBinder binder, Type returnType, IEnumerable< Expression > arguments)
static DynamicExpression MakeDynamic(Type delegateType, CallSiteBinder binder, Expression arg0, Expression arg1)
static DynamicExpression MakeDynamic(Type delegateType, CallSiteBinder binder, IEnumerable< Expression > arguments)
static MethodInfo GetValidMethodForDynamic(Type delegateType)
static void ValidateDynamicArgument(Expression arg, string paramName, int index)
static DynamicExpression MakeDynamic(CallSiteBinder binder, Type returnType, ReadOnlyCollection< Expression > arguments)
static DynamicExpression MakeDynamic(Type delegateType, CallSiteBinder binder, Expression arg0, Expression arg1, Expression arg2)