Table of Contents

Class FieldSignature

Namespace
AsmResolver.DotNet.Signatures
Assembly
AsmResolver.DotNet.dll

Represents a signature of a field defined in a .NET executable file.

public class FieldSignature : MemberSignature, IImportable
Inheritance
FieldSignature
Implements
Inherited Members

Constructors

FieldSignature(CallingConventionAttributes, TypeSignature)

Creates a new field signature with the provided field type.

public FieldSignature(CallingConventionAttributes attributes, TypeSignature fieldType)

Parameters

attributes CallingConventionAttributes

The attributes of the field.

fieldType TypeSignature

The field type.

Remarks

This constructor automatically sets the Field bit.

FieldSignature(TypeSignature)

Creates a new field signature with the provided field type.

public FieldSignature(TypeSignature fieldType)

Parameters

fieldType TypeSignature

The field type.

Properties

FieldType

Gets the type of the value that the field contains.

public TypeSignature FieldType { get; set; }

Property Value

TypeSignature

Methods

CreateInstance(TypeSignature)

Creates a new field signature for a static field.

[Obsolete("The HasThis bit in field signatures is ignored by the CLR. Use the constructor instead, or when this call is used in an argument of a FieldDefinition constructor, use the overload taking TypeSignature instead.")]
public static FieldSignature CreateInstance(TypeSignature fieldType)

Parameters

fieldType TypeSignature

The value type of the field.

Returns

FieldSignature

The signature.

CreateStatic(TypeSignature)

Creates a new field signature for a static field.

[Obsolete("The HasThis bit in field signatures is ignored by the CLR. Use the constructor instead, or when this call is used in an argument of a FieldDefinition constructor, use the overload taking TypeSignature instead.")]
public static FieldSignature CreateStatic(TypeSignature fieldType)

Parameters

fieldType TypeSignature

The value type of the field.

Returns

FieldSignature

The signature.

FromReader(ref BlobReaderContext, ref BinaryStreamReader)

Reads a single field signature from an input stream.

public static FieldSignature FromReader(ref BlobReaderContext context, ref BinaryStreamReader reader)

Parameters

context BlobReaderContext

The blob reader context.

reader BinaryStreamReader

The blob input stream.

Returns

FieldSignature

The field signature.

ImportWith(ReferenceImporter)

Imports the field signature using the provided reference importer object.

public FieldSignature ImportWith(ReferenceImporter importer)

Parameters

importer ReferenceImporter

The reference importer to us.

Returns

FieldSignature

The imported field signature.

ImportWithInternal(ReferenceImporter)

Imports the signature using the provided reference importer object.

protected override CallingConventionSignature ImportWithInternal(ReferenceImporter importer)

Parameters

importer ReferenceImporter

The reference importer to us.

Returns

CallingConventionSignature

The imported signature.

InstantiateGenericTypes(GenericContext)

Substitutes any generic type parameter in the field signature with the parameters provided by the generic context.

public FieldSignature InstantiateGenericTypes(GenericContext context)

Parameters

context GenericContext

The generic context.

Returns

FieldSignature

The instantiated field signature.

Remarks

When the type signature does not contain any generic parameter, this method might return the current instance of the field signature.

ToString()

Returns a string that represents the current object.

public override string ToString()

Returns

string

A string that represents the current object.

WriteContents(in BlobSerializationContext)

Serializes the blob (without extra data) to an output stream.

protected override void WriteContents(in BlobSerializationContext context)

Parameters

context BlobSerializationContext