Table of Contents

Class CustomAttributeArgument

Namespace
AsmResolver.DotNet.Signatures
Assembly
AsmResolver.DotNet.dll

Represents an argument value in a custom attribute construction.

public class CustomAttributeArgument
Inheritance
CustomAttributeArgument
Inherited Members

Constructors

CustomAttributeArgument(TypeSignature)

Creates a new empty custom attribute argument.

public CustomAttributeArgument(TypeSignature argumentType)

Parameters

argumentType TypeSignature

The type of the argument.

CustomAttributeArgument(TypeSignature, IEnumerable<object?>)

Creates a new custom attribute array argument.

public CustomAttributeArgument(TypeSignature argumentType, IEnumerable<object?> elements)

Parameters

argumentType TypeSignature

The type of the argument.

elements IEnumerable<object>

The value making up the elements of the array argument.

CustomAttributeArgument(TypeSignature, object?)

Creates a new custom attribute argument.

public CustomAttributeArgument(TypeSignature argumentType, object? value)

Parameters

argumentType TypeSignature

The type of the argument.

value object

The value of the argument.

CustomAttributeArgument(TypeSignature, params object?[])

Creates a new custom attribute array argument.

public CustomAttributeArgument(TypeSignature argumentType, params object?[] elements)

Parameters

argumentType TypeSignature

The type of the argument.

elements object[]

The value making up the elements of the array argument.

Properties

ArgumentType

Gets or sets the type of the argument value.

public TypeSignature ArgumentType { get; set; }

Property Value

TypeSignature

Element

When ArgumentType is not a SzArrayTypeSignature, gets the first element of the

public object? Element { get; }

Property Value

object

Elements

Gets a collection of all elements that the argument is built with.

public IList<object?> Elements { get; }

Property Value

IList<object>

IsNullArray

Gets or sets a value indicating whether the argument represents the null array value.

public bool IsNullArray { get; set; }

Property Value

bool

Methods

FromReader(in BlobReaderContext, TypeSignature, ref BinaryStreamReader)

Reads a single argument from the provided input stream.

public static CustomAttributeArgument FromReader(in BlobReaderContext context, TypeSignature argumentType, ref BinaryStreamReader reader)

Parameters

context BlobReaderContext

The blob reader context.

argumentType TypeSignature

The type of the argument to read.

reader BinaryStreamReader

The input stream.

Returns

CustomAttributeArgument

The argument.

ToString()

Returns a string that represents the current object.

public override string ToString()

Returns

string

A string that represents the current object.

Write(BlobSerializationContext)

Writes the fixed argument to the provided output stream.

public void Write(BlobSerializationContext context)

Parameters

context BlobSerializationContext