Metalama 1.0 / / Metalama Documentation / Aspect API / Metalama.​Framework.​Code.​Declaration­Builders / Attribute­Construction

Class AttributeConstruction

Encapsulates the information necessary to create a custom attribute.

Inheritance
AttributeConstruction
Implements
IAttributeData
Namespace: Metalama.Framework.Code.DeclarationBuilders
Assembly: Metalama.Framework.dll
Syntax
public sealed class AttributeConstruction : Object, IAttributeData

Properties

Name Description
Constructor

Gets the attribute constructor.

ConstructorArguments

Gets the constructor arguments.

NamedArguments

Gets the named arguments, i.e. the assigned fields and properties. Note that the order may be important in case of non-trivial property setters.

Type

Gets the attribute type.

Methods

Name Description
Create(IConstructor, IReadOnlyList<TypedConstant>, IReadOnlyList<KeyValuePair<String, TypedConstant>>)

Creates a new AttributeConstruction by explicitly specifying the constructor and strongly-typed arguments.

Create(INamedType, IReadOnlyList<Object>, IReadOnlyList<KeyValuePair<String, Object>>)

Creates a new AttributeConstruction by specifying the INamedType of the attribute. The method will attempt to find a suitable constructor.

Create(Type, IReadOnlyList<Object>, IReadOnlyList<KeyValuePair<String, Object>>)

Creates a new AttributeConstruction by specifying the reflection Type of the attribute. The method will attempt to find a suitable constructor.