LayoutKind Enumeration

LayoutKind Enumeration

This API supports the .NET Framework infrastructure and is not intended to be used directly from your code.

[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]

Controls the layout of an object when exported to unmanaged code.

Namespace:  System.Runtime.InteropServices
Assembly:  mscorlib (in mscorlib.dll)

public enum LayoutKind

Member nameDescription
AutoThe runtime automatically chooses an appropriate layout for the members of an object in unmanaged memory. Objects defined with this enumeration member cannot be exposed outside of managed code. Attempting to do so generates an exception.
ExplicitThe precise position of each member of an object in unmanaged memory is explicitly controlled. Each member must use the FieldOffsetAttribute to indicate the position of that field within the type.
SequentialThe members of the object are laid out sequentially, in the order in which they appear when exported to unmanaged memory. The members are laid out according to the packing specified in StructLayoutAttribute.Pack, and can be noncontiguous.

Windows Phone OS

Supported in: 8.1, 8.0, 7.1, 7.0

Windows Phone

Show:
© 2017 Microsoft