Struct MethodDefinitionRow
- Namespace
- AsmResolver.PE.DotNet.Metadata.Tables
- Assembly
- AsmResolver.PE.dll
Represents a single row in the method definition metadata table.
public struct MethodDefinitionRow : IMetadataRow, IReadOnlyList<uint>, IReadOnlyCollection<uint>, IEnumerable<uint>, IEnumerable, IEquatable<MethodDefinitionRow>
- Implements
- Inherited Members
Constructors
MethodDefinitionRow(ISegmentReference, MethodImplAttributes, MethodAttributes, uint, uint, uint)
Creates a new row for the method definition metadata table.
public MethodDefinitionRow(ISegmentReference body, MethodImplAttributes implAttributes, MethodAttributes attributes, uint name, uint signature, uint parameterList)
Parameters
bodyISegmentReferenceThe reference to the beginning of the method body.
implAttributesMethodImplAttributesThe characteristics of the implementation of the method body.
attributesMethodAttributesThe attributes associated to the method.
nameuintThe index into the #Strings heap containing the name of the type reference.
signatureuintThe index into the #Blob heap containing the signature of the method.
parameterListuintThe index into the Param (or ParamPtr) table, representing the first parameter that this method defines.
Properties
Attributes
Gets or sets the attributes associated to the method.
public MethodAttributes Attributes { readonly get; set; }
Property Value
Body
Gets a reference to the beginning of the method body.
public ISegmentReference Body { readonly get; set; }
Property Value
Remarks
This field deviates from the original specification as described in ECMA-335. It replaces the RVA column of the method definition row. Only the RVA of this reference is only considered when comparing two method definition rows for equality.
If this value is null, the method does not define any method body.
Count
public int Count { get; }
Property Value
ImplAttributes
Gets or sets the characteristics of the implementation of the method body.
public MethodImplAttributes ImplAttributes { readonly get; set; }
Property Value
Remarks
These attributes dictate the format of Body.
this[int]
public uint this[int index] { get; }
Parameters
indexint
Property Value
Name
Gets or sets an index into the #Strings heap containing the name of the type reference.
public uint Name { readonly get; set; }
Property Value
Remarks
This value should always index a non-empty string.
ParameterList
Gets or sets an index into the Param (or ParamPtr) table, representing the first parameter that this method defines.
public uint ParameterList { readonly get; set; }
Property Value
Signature
Gets or sets an index into the #Blob heap containing the signature of the method. This includes the return type, as well as parameter types.
public uint Signature { readonly get; set; }
Property Value
Remarks
This value should always index a valid method signature.
TableIndex
Gets or sets the index of the table that this row is stored in.
public TableIndex TableIndex { get; }
Property Value
Methods
Equals(MethodDefinitionRow)
Determines whether this row is considered equal to the provided method definition row.
public bool Equals(MethodDefinitionRow other)
Parameters
otherMethodDefinitionRowThe other row.
Returns
- bool
trueif the rows are equal,falseotherwise.
Remarks
When comparing both method bodies, only the RVA is considered in this equality test. The exact type is ignored.
Equals(object?)
public override bool Equals(object? obj)
Parameters
objobject
Returns
FromReader(MetadataReaderContext, ref BinaryStreamReader, TableLayout)
Reads a single method definition row from an input stream.
public static MethodDefinitionRow FromReader(MetadataReaderContext context, ref BinaryStreamReader reader, TableLayout layout)
Parameters
contextMetadataReaderContextThe reader context.
readerBinaryStreamReaderThe input stream.
layoutTableLayoutThe layout of the method definition table.
Returns
- MethodDefinitionRow
The row.
GetEnumerator()
public IEnumerator<uint> GetEnumerator()
Returns
GetHashCode()
public override int GetHashCode()
Returns
ToString()
public override string ToString()
Returns
Write(BinaryStreamWriter, TableLayout)
Writes the row to an output stream.
public void Write(BinaryStreamWriter writer, TableLayout layout)
Parameters
writerBinaryStreamWriterThe output stream writer.
layoutTableLayoutThe new layout of the table.
Operators
operator ==(MethodDefinitionRow, MethodDefinitionRow)
Determines whether two rows are considered equal.
public static bool operator ==(MethodDefinitionRow left, MethodDefinitionRow right)
Parameters
leftMethodDefinitionRowrightMethodDefinitionRow
Returns
operator !=(MethodDefinitionRow, MethodDefinitionRow)
Determines whether two rows are not considered equal.
public static bool operator !=(MethodDefinitionRow left, MethodDefinitionRow right)
Parameters
leftMethodDefinitionRowrightMethodDefinitionRow