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

◆ IsDefined() [9/9]

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

Definition at line 13 of file CustomAttribute.cs.

14 {
15 if ((object)type.GetElementType() != null)
16 {
17 return false;
18 }
19 if (PseudoCustomAttribute.IsDefined(type, caType))
20 {
21 return true;
22 }
23 if (IsCustomAttributeDefined(type.GetRuntimeModule(), type.MetadataToken, caType))
24 {
25 return true;
26 }
27 if (!inherit)
28 {
29 return false;
30 }
31 type = type.BaseType as RuntimeType;
32 while ((object)type != null)
33 {
34 if (IsCustomAttributeDefined(type.GetRuntimeModule(), type.MetadataToken, caType, 0, inherit))
35 {
36 return true;
37 }
38 type = type.BaseType as RuntimeType;
39 }
40 return false;
41 }
static bool IsCustomAttributeDefined(RuntimeModule decoratedModule, int decoratedMetadataToken, RuntimeType attributeFilterType)

References System.Reflection.CustomAttribute.IsCustomAttributeDefined(), System.Reflection.PseudoCustomAttribute.IsDefined(), and System.type.

Referenced by System.Reflection.Emit.TypeBuilder.IsDefined(), System.Reflection.RuntimeAssembly.IsDefined(), System.Reflection.RuntimeConstructorInfo.IsDefined(), System.Reflection.RuntimeEventInfo.IsDefined(), System.Reflection.RuntimeFieldInfo.IsDefined(), System.Reflection.RuntimeMethodInfo.IsDefined(), System.Reflection.RuntimeModule.IsDefined(), System.Reflection.RuntimeParameterInfo.IsDefined(), System.Reflection.RuntimePropertyInfo.IsDefined(), and System.RuntimeType.IsDefined().