Table of Contents

Class ClassLayout

Namespace
AsmResolver.DotNet
Assembly
AsmResolver.DotNet.dll

Describes the explicit layout of a type, including its total and packing size.

public class ClassLayout : MetadataMember, IMetadataMember
Inheritance
ClassLayout
Implements
Derived
Inherited Members

Constructors

ClassLayout(MetadataToken)

Initializes the class layout with a metadata token.

protected ClassLayout(MetadataToken token)

Parameters

token MetadataToken

ClassLayout(ushort, uint)

Creates a new explicit layout for a type.

public ClassLayout(ushort packingSize, uint classSize)

Parameters

packingSize ushort

The alignment in bytes of each field in the type. This value should be a power of two between 0 and 128.

classSize uint

The size in bytes of the type.

Properties

ClassSize

Gets the size in bytes of the type.

public uint ClassSize { get; set; }

Property Value

uint

PackingSize

Gets the alignment in bytes of each field in the type.

public ushort PackingSize { get; set; }

Property Value

ushort

Remarks

This value should be a power of two between 0 and 128.

Parent

Gets the type that this layout is assigned to.

public TypeDefinition? Parent { get; }

Property Value

TypeDefinition

Methods

GetParent()

Obtains the type this layout is assigned to.

protected virtual TypeDefinition? GetParent()

Returns

TypeDefinition

The parent type.

Remarks

This method is called upon initialization of the Parent property.

ToString()

Returns a string that represents the current object.

public override string ToString()

Returns

string

A string that represents the current object.