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

◆ InternalGetAttributeUsage()

static AttributeUsageAttribute System.Attribute.InternalGetAttributeUsage ( Type type)
inlinestaticprivateinherited

Definition at line 319 of file Attribute.cs.

320 {
321 object[] customAttributes = type.GetCustomAttributes(typeof(AttributeUsageAttribute), inherit: false);
322 if (customAttributes.Length == 1)
323 {
324 return (AttributeUsageAttribute)customAttributes[0];
325 }
326 if (customAttributes.Length == 0)
327 {
328 return AttributeUsageAttribute.Default;
329 }
330 throw new FormatException(SR.Format(SR.Format_AttributeUsage, type));
331 }

References System.AttributeUsageAttribute.Default, System.SR.Format(), System.SR.Format_AttributeUsage, and System.type.

Referenced by System.Attribute.AddAttributesToList(), System.Attribute.CopyToAttributeList(), System.Attribute.InternalIsDefined(), System.Attribute.InternalIsDefined(), System.Attribute.InternalParamGetCustomAttributes(), and System.Attribute.InternalParamIsDefined().