Table of Contents

Class ParameterCollection

Namespace
AsmResolver.DotNet.Collections
Assembly
AsmResolver.DotNet.dll

Represents an ordered collection of parameters that a method defines and/or uses. This includes the hidden "this" parameter, as well as the virtual return parameter.

public class ParameterCollection : IReadOnlyList<Parameter>, IReadOnlyCollection<Parameter>, IEnumerable<Parameter>, IEnumerable
Inheritance
ParameterCollection
Implements
Inherited Members

Properties

Count

Gets the number of elements in the collection.

public int Count { get; }

Property Value

int

The number of elements in the collection.

this[int]

Gets the element at the specified index in the read-only list.

public Parameter this[int index] { get; }

Parameters

index int

The zero-based index of the element to get.

Property Value

Parameter

The element at the specified index in the read-only list.

MethodSignatureIndexBase

Gets the displacement of the parameters in the method signature, depending on the value of HasThis.

public int MethodSignatureIndexBase { get; }

Property Value

int

ReturnParameter

Gets the virtual parameter representing the return value of the method.

public Parameter ReturnParameter { get; }

Property Value

Parameter

ThisParameter

Gets the virtual parameter containing the current instance of the class that the method is defined in.

public Parameter? ThisParameter { get; }

Property Value

Parameter

Methods

ContainsSignatureIndex(int)

Determines whether a parameter with the provided signature index exists within this parameter collection.

public bool ContainsSignatureIndex(int index)

Parameters

index int

The method signature index of the parameter.

Returns

bool

true if the parameter exists, false otherwise.

GetBySignatureIndex(int)

Gets a parameter by its method signature index.

public Parameter GetBySignatureIndex(int index)

Parameters

index int

The index.

Returns

Parameter

The parameter.

Remarks

This method can be used to resolve parameter indices in a method body to parameter objects.

GetEnumerator()

Returns an enumerator that iterates through the collection.

public IEnumerator<Parameter> GetEnumerator()

Returns

IEnumerator<Parameter>

An enumerator that can be used to iterate through the collection.

PullUpdatesFromMethodSignature()

Updates the list of parameters according to the parameters specified in the method's signature.

public void PullUpdatesFromMethodSignature()

Remarks

This method should be called once the signature of the owner method is updated.