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

◆ GetCustomAttributes() [16/16]

static Attribute[] System.Attribute.GetCustomAttributes ( ParameterInfo element,
Type attributeType,
bool inherit )
inlinestaticinherited

Definition at line 440 of file Attribute.cs.

441 {
442 if (element == null)
443 {
444 throw new ArgumentNullException("element");
445 }
446 if (attributeType == null)
447 {
448 throw new ArgumentNullException("attributeType");
449 }
450 if (!attributeType.IsSubclassOf(typeof(Attribute)) && attributeType != typeof(Attribute))
451 {
452 throw new ArgumentException(SR.Argument_MustHaveAttributeBaseClass);
453 }
454 if (element.Member == null)
455 {
456 throw new ArgumentException(SR.Argument_InvalidParameterInfo, "element");
457 }
458 MemberInfo member = element.Member;
459 if (member.MemberType == MemberTypes.Method && inherit)
460 {
461 return InternalParamGetCustomAttributes(element, attributeType, inherit);
462 }
463 return element.GetCustomAttributes(attributeType, inherit) as Attribute[];
464 }
static Attribute[] InternalParamGetCustomAttributes(ParameterInfo param, Type type, bool inherit)
Definition Attribute.cs:175
virtual object[] GetCustomAttributes(bool inherit)

References System.SR.Argument_InvalidParameterInfo, System.SR.Argument_MustHaveAttributeBaseClass, System.Reflection.ParameterInfo.GetCustomAttributes(), System.Attribute.InternalParamGetCustomAttributes(), System.Type.IsSubclassOf(), System.Reflection.ParameterInfo.Member, and System.Reflection.MemberInfo.MemberType.