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
this[int]
public Parameter this[int index] { get; }
Parameters
indexint
Property Value
MethodSignatureIndexBase
Gets the displacement of the parameters in the method signature, depending on the value of HasThis.
public int MethodSignatureIndexBase { get; }
Property Value
ReturnParameter
Gets the virtual parameter representing the return value of the method.
public Parameter ReturnParameter { get; }
Property Value
ThisParameter
Gets the virtual parameter containing the current instance of the class that the method is defined in.
public Parameter? ThisParameter { get; }
Property Value
Methods
ContainsSignatureIndex(int)
Determines whether a parameter with the provided signature index exists within this parameter collection.
public bool ContainsSignatureIndex(int index)
Parameters
indexintThe method signature index of the parameter.
Returns
- bool
trueif the parameter exists,falseotherwise.
GetBySignatureIndex(int)
Gets a parameter by its method signature index.
public Parameter GetBySignatureIndex(int index)
Parameters
indexintThe 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
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.