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

◆ FindMethod()

static MethodInfo System.Linq.Expressions.Expression< TDelegate >.FindMethod ( [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicMethods | DynamicallyAccessedMemberTypes.NonPublicMethods)] Type type,
string methodName,
Type[] typeArgs,
Expression< TDelegate >[] args,
BindingFlags flags )
inlinestaticprivateinherited

Definition at line 4270 of file Expression.cs.

4271 {
4272 int num = 0;
4273 MethodInfo methodInfo = null;
4274 MethodInfo[] methods = type.GetMethods(flags);
4275 foreach (MethodInfo methodInfo2 in methods)
4276 {
4277 if (!methodInfo2.Name.Equals(methodName, StringComparison.OrdinalIgnoreCase))
4278 {
4279 continue;
4280 }
4282 if (methodInfo3 != null && IsCompatible(methodInfo3, args))
4283 {
4284 if (methodInfo == null || (!methodInfo.IsPublic && methodInfo3.IsPublic))
4285 {
4287 num = 1;
4288 }
4289 else if (methodInfo.IsPublic == methodInfo3.IsPublic)
4290 {
4291 num++;
4292 }
4293 }
4294 }
4295 if (num == 0)
4296 {
4297 if (typeArgs != null && typeArgs.Length != 0)
4298 {
4299 throw Error.GenericMethodWithArgsDoesNotExistOnType(methodName, type);
4300 }
4301 throw Error.MethodWithArgsDoesNotExistOnType(methodName, type);
4302 }
4303 if (num > 1)
4304 {
4305 throw Error.MethodWithMoreThanOneMatch(methodName, type);
4306 }
4307 return methodInfo;
4308 }
static bool IsCompatible(PropertyInfo pi, Expression[] args)
static MethodInfo ApplyTypeArgs(MethodInfo m, Type[] typeArgs)

References System.Linq.Expressions.Expression< TDelegate >.ApplyTypeArgs(), System.Linq.Expressions.Error.GenericMethodWithArgsDoesNotExistOnType(), System.Linq.Expressions.Expression< TDelegate >.IsCompatible(), System.Linq.Expressions.Error.MethodWithArgsDoesNotExistOnType(), System.Linq.Expressions.Error.MethodWithMoreThanOneMatch(), and System.type.

Referenced by System.Linq.Expressions.Expression< TDelegate >.Call(), System.Linq.Expressions.Expression< TDelegate >.Call(), and System.Linq.Expressions.Expression< TDelegate >.ListInit().