C# Type IsAutoLayout
Description
Type IsAutoLayout
gets a value indicating whether the
fields of the current type are laid out automatically by the common language
runtime.
Syntax
Type.IsAutoLayout
has the following syntax.
public bool IsAutoLayout { get; }
Example
The following example creates an instance of the type and displays the IsAutoLayout property.
//from w w w . j a v a 2s .c o m
using System;
using System.Runtime.InteropServices;
[StructLayoutAttribute(LayoutKind.Auto)]
public class Demo
{
}
public class Example
{
public static void Main()
{
Type myType=typeof(Demo);
Console.WriteLine("\nThe AutoLayout property for the Demo class is {0}.",
myType.IsAutoLayout);
}
}
The code above generates the following result.