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
TypeSignatureThe type of the argument.
CustomAttributeArgument(TypeSignature, IEnumerable<object?>)
Creates a new custom attribute array argument.
public CustomAttributeArgument(TypeSignature argumentType, IEnumerable<object?> elements)
Parameters
argumentType
TypeSignatureThe 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
TypeSignatureThe type of the argument.
value
objectThe value of the argument.
CustomAttributeArgument(TypeSignature, params object?[])
Creates a new custom attribute array argument.
public CustomAttributeArgument(TypeSignature argumentType, params object?[] elements)
Parameters
argumentType
TypeSignatureThe 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
Element
When ArgumentType is not a SzArrayTypeSignature, gets the first element of the
public object? Element { get; }
Property Value
Elements
Gets a collection of all elements that the argument is built with.
public IList<object?> Elements { get; }
Property Value
IsNullArray
Gets or sets a value indicating whether the argument represents the null array value.
public bool IsNullArray { get; set; }
Property Value
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
BlobReaderContextThe blob reader context.
argumentType
TypeSignatureThe type of the argument to read.
reader
BinaryStreamReaderThe 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