MetalamaAPI documentationAspect APIMetalama.​Framework.​Code.​Declaration­BuildersAttribute­Construction
Open sandboxFocus

AttributeConstruction Class

Encapsulates the information necessary to create a custom attribute.

Inheritance
System.Object
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 System.Type of the attribute. The method will attempt to find a suitable constructor.