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

◆ IsDefined() [5/9]

static bool System.Reflection.CustomAttribute.IsDefined ( RuntimeMethodInfo method,
RuntimeType caType,
bool inherit )
inlinestaticpackage

Definition at line 43 of file CustomAttribute.cs.

44 {
45 if (PseudoCustomAttribute.IsDefined(method, caType))
46 {
47 return true;
48 }
49 if (IsCustomAttributeDefined(method.GetRuntimeModule(), method.MetadataToken, caType))
50 {
51 return true;
52 }
53 if (!inherit)
54 {
55 return false;
56 }
57 method = method.GetParentDefinition();
58 while ((object)method != null)
59 {
60 if (IsCustomAttributeDefined(method.GetRuntimeModule(), method.MetadataToken, caType, 0, inherit))
61 {
62 return true;
63 }
64 method = method.GetParentDefinition();
65 }
66 return false;
67 }
static bool IsCustomAttributeDefined(RuntimeModule decoratedModule, int decoratedMetadataToken, RuntimeType attributeFilterType)

References System.Reflection.RuntimeMethodInfo.GetParentDefinition(), System.Reflection.RuntimeMethodInfo.GetRuntimeModule(), System.Reflection.CustomAttribute.IsCustomAttributeDefined(), System.Reflection.PseudoCustomAttribute.IsDefined(), and System.Reflection.RuntimeMethodInfo.MetadataToken.