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.





















Home »
  C# Tutorial »
    System »




Array
BitConverter
Boolean
Byte
Char
Console
ConsoleKeyInfo
Convert
DateTime
DateTimeOffset
Decimal
Double
Enum
Environment
Exception
Guid
Int16
Int32
Int64
Math
OperatingSystem
Random
SByte
Single
String
StringComparer
TimeSpan
TimeZone
TimeZoneInfo
Tuple
Tuple
Tuple
Type
UInt16
UInt32
UInt64
Uri
Version