Table of Contents

Class CustomAttribute

Namespace
AsmResolver.DotNet
Assembly
AsmResolver.DotNet.dll

Represents a custom attribute that is associated to a member in a .NET module.

public class CustomAttribute : MetadataMember, IMetadataMember, IOwnedCollectionElement<IHasCustomAttribute>
Inheritance
CustomAttribute
Implements
Derived
Inherited Members

Constructors

CustomAttribute(ICustomAttributeType?)

Creates a new custom attribute.

public CustomAttribute(ICustomAttributeType? constructor)

Parameters

constructor ICustomAttributeType

The constructor of the attribute to call.

CustomAttribute(ICustomAttributeType?, CustomAttributeSignature?)

Creates a new custom attribute.

public CustomAttribute(ICustomAttributeType? constructor, CustomAttributeSignature? signature)

Parameters

constructor ICustomAttributeType

The constructor of the attribute to call.

signature CustomAttributeSignature

The signature containing the arguments to the constructor.

CustomAttribute(MetadataToken)

Initializes an empty custom attribute.

protected CustomAttribute(MetadataToken token)

Parameters

token MetadataToken

The token of the custom attribute.

Properties

Constructor

Gets or sets the constructor that is invoked upon initializing the attribute.

public ICustomAttributeType? Constructor { get; set; }

Property Value

ICustomAttributeType

Parent

Gets the member that this custom attribute is assigned to.

public IHasCustomAttribute? Parent { get; }

Property Value

IHasCustomAttribute

Signature

Gets or sets the signature containing the arguments passed onto the attribute's constructor.

public CustomAttributeSignature? Signature { get; set; }

Property Value

CustomAttributeSignature

Methods

GetConstructor()

Obtains the constructor of the attribute.

protected virtual ICustomAttributeType? GetConstructor()

Returns

ICustomAttributeType

The constructor

Remarks

This method is called upon initialization of the Constructor property.

GetParent()

Obtains the parent member of the attribute.

protected virtual IHasCustomAttribute? GetParent()

Returns

IHasCustomAttribute

The member

Remarks

This method is called upon initialization of the Parent property.

GetSignature()

Obtains the signature of the attribute.

protected virtual CustomAttributeSignature? GetSignature()

Returns

CustomAttributeSignature

The signature

Remarks

This method is called upon initialization of the Signature property.

ToString()

Returns a string that represents the current object.

public override string ToString()

Returns

string

A string that represents the current object.