AttributesNReflect

Attributes are reflected by NReflect. This pages shows how.

Overview

The following figure shows every type related to attribute reflection of NReflect.

Attributes
Figure 1: Class diagram showing all types belonging to the reflection of attributes.

Since nearly everything in IL can have attributes, NReflect provides an interface NReflect.IAttributable which is implemented by the following NReflect types:

Notice the type NReflect.NRMembers.NRReturnValueOperation which does not implement the interface but also has a list of attributes. These attributes are placed at the return value of an operation.

Each of the mentioned types has a list of NReflect.NRAttributes.NRAttribute instances, one per placed attribute. Since attributes may be placed using parameters, we have to reflect the parameter values, too. These are hold within the NRAttribute.Values and NRAttribute.NamedValues properties. The first one holds the values used for the constructor of the attribute. The latter one takes the values of the properties of the attribute which are also set.

The values itself are stored as a NReflect.NRAttributes.NRAttributeValue instance which holds the type of the value and the value itself.

See Also

Reference

Other Resources