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

public int Count { get; }

Property Value

int

this[int]

public Parameter this[int index] { get; }

Parameters

index int

Property Value

Parameter

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()

public IEnumerator<Parameter> GetEnumerator()

Returns

IEnumerator<Parameter>

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.