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

◆ CalculateCustomAttributeValueTreatment()

CustomAttributeValueTreatment System.Reflection.Metadata.MetadataReader.CalculateCustomAttributeValueTreatment ( CustomAttributeHandle handle)
inlinepackage

Definition at line 1731 of file MetadataReader.cs.

1732 {
1733 EntityHandle parent = CustomAttributeTable.GetParent(handle);
1735 {
1737 }
1738 TypeDefinitionHandle typeDefinitionHandle = (TypeDefinitionHandle)parent;
1739 if (StringHeap.EqualsRaw(TypeDefTable.GetNamespace(typeDefinitionHandle), "Windows.Foundation.Metadata"))
1740 {
1742 {
1743 return CustomAttributeValueTreatment.AttributeUsageVersionAttribute;
1744 }
1745 if (StringHeap.EqualsRaw(TypeDefTable.GetName(typeDefinitionHandle), "DeprecatedAttribute"))
1746 {
1747 return CustomAttributeValueTreatment.AttributeUsageDeprecatedAttribute;
1748 }
1749 }
1750 if (!HasAttribute(typeDefinitionHandle, "Windows.Foundation.Metadata", "AllowMultipleAttribute"))
1751 {
1752 return CustomAttributeValueTreatment.AttributeUsageAllowSingle;
1753 }
1754 return CustomAttributeValueTreatment.AttributeUsageAllowMultiple;
1755 }
CustomAttributeTableReader CustomAttributeTable
bool IsWindowsAttributeUsageAttribute(EntityHandle targetType, CustomAttributeHandle attributeHandle)
bool HasAttribute(EntityHandle token, string asciiNamespaceName, string asciiTypeName)
bool EqualsRaw(StringHandle rawHandle, string asciiString)
StringHandle GetNamespace(TypeDefinitionHandle handle)
StringHandle GetName(TypeDefinitionHandle handle)

References System.Reflection.Metadata.MetadataReader.CustomAttributeTable, System.Reflection.Metadata.Ecma335.StringHeap.EqualsRaw(), System.Reflection.Metadata.Ecma335.TypeDefTableReader.GetName(), System.Reflection.Metadata.Ecma335.TypeDefTableReader.GetNamespace(), System.Reflection.Metadata.Ecma335.CustomAttributeTableReader.GetParent(), System.handle, System.Reflection.Metadata.MetadataReader.HasAttribute(), System.Reflection.Metadata.MetadataReader.IsWindowsAttributeUsageAttribute(), and System.Reflection.Metadata.MetadataReader.TypeDefTable.

Referenced by System.Reflection.Metadata.CustomAttribute.GetProjectedValue().