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

◆ TryResolveStateMachineMethod()

static bool System.Diagnostics.StackTrace.TryResolveStateMachineMethod ( ref MethodBase method,
out Type declaringType )
inlinestaticprivate

Definition at line 371 of file StackTrace.cs.

372 {
373 declaringType = method.DeclaringType;
374 Type declaringType2 = declaringType.DeclaringType;
375 if (declaringType2 == null)
376 {
377 return false;
378 }
379 MethodInfo[] array = GetDeclaredMethods(declaringType2);
380 if (array == null)
381 {
382 return false;
383 }
385 foreach (MethodInfo methodInfo in array2)
386 {
388 if (customAttributes == null)
389 {
390 continue;
391 }
392 bool flag = false;
393 bool flag2 = false;
395 {
396 if (item.StateMachineType == declaringType)
397 {
398 flag = true;
400 }
401 }
402 if (flag)
403 {
405 declaringType = methodInfo.DeclaringType;
406 return flag2;
407 }
408 }
409 return false;
410 [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2070:UnrecognizedReflectionPattern", Justification = "Using Reflection to find the state machine's corresponding method is safe because the corresponding method is the only caller of the state machine. If the state machine is present, the corresponding method will be, too.")]
411 static MethodInfo[] GetDeclaredMethods(Type type)
412 {
413 return type.GetMethods(BindingFlags.DeclaredOnly | BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic);
414 }
415 }

References System.array, System.item, and System.type.

Referenced by System.Diagnostics.StackTrace.ToString().