Type.IsLayoutSequential Property

May 11, 2014

Gets a value indicating whether the class layout attribute SequentialLayout is selected for the Type.

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

public bool IsLayoutSequential { get; }

Property Value

Type: System.Boolean
true if the class layout attribute SequentialLayout is selected for the Type; otherwise, false.

The LayoutMask is used to select the class layout attributes. The class layout attributes (AutoLayout, SequentialLayout and ExplicitLayout) define how the fields of the class instance are laid out in memory.

For more information, see section 9.1.2 of the specification for the Common Language Infrastructure (CLI) documentation, "Partition II: Metadata Definition and Semantics". The documentation is available online; see ECMA C# and Common Language Infrastructure Standards on MSDN and Standard ECMA-335 - Common Language Infrastructure (CLI) on the Ecma International Web site.

If the current Type represents a constructed generic type, this property applies to the generic type definition from which the type was constructed. For example, if the current Type represents MyGenericType<int> (MyGenericType(Of Integer) in Visual Basic), the value of this property is determined by MyGenericType<T>.

If the current Type represents a type parameter in the definition of a generic type or generic method, this property always returns false.

The following example creates an instance of a class for which the Sequential member of the LayoutKind enum in the StructLayoutAttribute class has been set, checks for the property IsLayoutSequential, and displays the result.

Windows Phone OS

Supported in: 8.1, 8.0

Show:
© 2014 Microsoft