Namespace: System.Reflection
Assembly: System.Reflection.dll
Provides a set of methods for dynamically building attributes that can be applied to code elements during reflection-based operations. This interface is instrumental in scenarios where attributes need to be created and attached programmatically, often in conjunction with code generation or metaprogramming tasks.
public interface IReflectionAttributeBuilder
Creates an instance of a specified attribute type using the provided constructor arguments. This method is essential for instantiating attributes dynamically.
attributeType
: The Type
of the attribute to create.constructorArgs
: An array of objects that represent the arguments to pass to the attribute's constructor.An object
representing the newly created attribute instance.
Sets the value of a public property on a given attribute instance. This allows for the configuration of an attribute's properties after its instantiation.
attribute
: The attribute instance whose property is to be set.propertyName
: The name of the public property to set.propertyValue
: The value to assign to the property.Sets the value of a public field on a given attribute instance. This is used for configuring attributes that expose public fields.
attribute
: The attribute instance whose field is to be set.fieldName
: The name of the public field to set.fieldValue
: The value to assign to the field.