CustomAttributeAdapter Class

Namespace
Kampute.DocToolkit.Metadata.Adapters
Assembly
  • Kampute.DocToolkit.dll

Definition

An adapter that wraps a CustomAttributeData and provides metadata access.
public class CustomAttributeAdapter : ICustomAttribute
Inheritance
Implements

Remarks

This class serves as a bridge between the reflection-based CustomAttributeData and the metadata representation defined by the ICustomAttribute interface. It provides access to attribute-level information regardless of whether the assembly containing the attribute was loaded via Common Language Runtime (CLR) or Metadata Load Context (MLC).

Thread Safety

All public members of the type are guaranteed to be thread-safe.

Constructors

CustomAttributeAdapter(CustomAttributeData, AttributeTarget)Initializes a new instance of the CustomAttributeAdapter class.

Fields

SystemAttributePatternsThe collection of patterns that identify attributes applied by the system/compiler.

Properties

ConstructorArgumentsGets the constructor arguments used to create the attribute.
IsImplicitlyAppliedGets a value indicating whether the attribute is applied by the compiler.
NamedArgumentsGets the named arguments (properties and fields) set on the attribute.
NativeGets the underlying CustomAttributeData instance.
TargetGets the target of the attribute.
TypeGets the type of the attribute.

Methods

CreateTypedValue(CustomAttributeTypedArgument)Converts a custom attribute typed argument into a TypedValue, handling array arguments by wrapping element values in an array of TypedValue instances.
Represents(CustomAttributeData)Determines whether this metadata adapter represents the specified reflection element.