February 14, 2014
Gets a value indicating whether the class layout attribute ExplicitLayout is selected for the Type.
Assembly: mscorlib (in mscorlib.dll)
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.
Classes marked with the ExplicitLayout attribute cause the loader to ignore field sequence and to use the explicit layout rules provided, in the form of field offsets, overall class size and alignment, or all of these.
Use the ExplicitLayout attribute to specify the offsets at which each field starts, or to specify the overall size and, optionally, the packing size of the objects of the class. The packing size is the empty memory space between fields and must be 1, 2, 4, 8 or 16 bytes.
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 type and displays the value of its IsExplicitLayout property. It uses the MySystemTime class, which is also in the code example for StructLayoutAttribute.