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

◆ AttributeUsageCheck()

static bool System.Reflection.CustomAttribute.AttributeUsageCheck ( RuntimeType attributeType,
bool mustBeInheritable,
ref RuntimeType::ListBuilder< object > derivedAttributes )
inlinestaticprivate

Definition at line 447 of file CustomAttribute.cs.

448 {
449 AttributeUsageAttribute attributeUsageAttribute = null;
450 if (mustBeInheritable)
451 {
452 attributeUsageAttribute = GetAttributeUsage(attributeType);
453 if (!attributeUsageAttribute.Inherited)
454 {
455 return false;
456 }
457 }
458 if (derivedAttributes.Count == 0)
459 {
460 return true;
461 }
462 for (int i = 0; i < derivedAttributes.Count; i++)
463 {
464 if (derivedAttributes[i].GetType() == attributeType)
465 {
466 if (attributeUsageAttribute == null)
467 {
468 attributeUsageAttribute = GetAttributeUsage(attributeType);
469 }
470 return attributeUsageAttribute.AllowMultiple;
471 }
472 }
473 return true;
474 }
static AttributeUsageAttribute GetAttributeUsage(RuntimeType decoratedAttribute)

References System.AttributeUsageAttribute.AllowMultiple, and System.AttributeUsageAttribute.Inherited.