Type::IsExplicitLayout Property
Gets a value indicating whether the class layout attribute ExplicitLayout is selected for the Type.
Assembly: mscorlib (in mscorlib.dll)
Property Value
Type: System::Booleantrue if the class layout attribute ExplicitLayout is selected for the Type; otherwise, false.
Implements
_Type::IsExplicitLayoutThe 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.
Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.