Class MethodSignatureBase
- Namespace
- AsmResolver.DotNet.Signatures
- Assembly
- AsmResolver.DotNet.dll
Provides a base for method and property signatures.
public abstract class MethodSignatureBase : MemberSignature, IImportable
- Inheritance
-
MethodSignatureBase
- Implements
- Derived
- Inherited Members
Constructors
MethodSignatureBase(CallingConventionAttributes, TypeSignature, IEnumerable<TypeSignature>)
Initializes the base of a method signature.
protected MethodSignatureBase(CallingConventionAttributes attributes, TypeSignature memberReturnType, IEnumerable<TypeSignature> parameterTypes)
Parameters
attributes
CallingConventionAttributesThe attributes associated to the signature.
memberReturnType
TypeSignatureThe return type of the member.
parameterTypes
IEnumerable<TypeSignature>The types of all (non-sentinel) parameters.
Properties
IncludeSentinel
Gets or sets a value indicating whether sentinel parameters should be included in the signature.
public bool IncludeSentinel { get; set; }
Property Value
ParameterTypes
Gets an ordered list of types indicating the types of the parameters that this member defines.
public IList<TypeSignature> ParameterTypes { get; }
Property Value
ReturnType
Gets or sets the type of the value that this member returns.
public TypeSignature ReturnType { get; set; }
Property Value
ReturnsValue
Gets value indicating if method returns value or not.
public bool ReturnsValue { get; }
Property Value
SentinelParameterTypes
Gets an ordered list of types indicating the types of the sentinel parameters that this member defines.
public IList<TypeSignature> SentinelParameterTypes { get; }
Property Value
Remarks
For any of the sentinel parameter types to be emitted to the output module, the IncludeSentinel
must be set to true
.
Methods
GetTotalParameterCount()
Determines the total number of parameters that this method requires to be invoked.
public int GetTotalParameterCount()
Returns
- int
The number of parameters
Remarks
This number includes the this parameter, as well as any potential sentinel parameters.
IsImportedInModule(ModuleDefinition)
Determines whether the descriptor of the member is fully imported in the provided module.
public override bool IsImportedInModule(ModuleDefinition module)
Parameters
module
ModuleDefinitionThe module that is supposed to import the member.
Returns
- bool
true
if the descriptor of the member is fully imported by the module,false
otherwise.
Remarks
This method verifies all references in the descriptor of the member only. It does not verify any additional data or contents (such as a method body) associated to the member.
ReadParametersAndReturnType(ref BlobReaderContext, ref BinaryStreamReader)
Initializes the ParameterTypes and ReturnType properties by reading the parameter count, return type and parameter fields of the signature from the provided input stream.
protected void ReadParametersAndReturnType(ref BlobReaderContext context, ref BinaryStreamReader reader)
Parameters
context
BlobReaderContextThe blob reader context.
reader
BinaryStreamReaderThe input stream.
WriteParametersAndReturnType(BlobSerializationContext)
Writes the parameter and return types in the signature to the provided output stream.
protected void WriteParametersAndReturnType(BlobSerializationContext context)
Parameters
context
BlobSerializationContext