9 [__DynamicallyInvokable]
12 private const int DEFAULT_PACKING_SIZE = 8;
17 [__DynamicallyInvokable]
21 [__DynamicallyInvokable]
25 [__DynamicallyInvokable]
30 [__DynamicallyInvokable]
33 [__DynamicallyInvokable]
41 internal static Attribute GetCustomAttribute(RuntimeType type)
75 type.GetRuntimeModule().MetadataImport.GetClassLayout(type.MetadataToken, out packSize, out classSize);
80 return new StructLayoutAttribute(layoutKind, packSize, classSize, charSet);
83 internal static bool IsDefined(RuntimeType type)
85 if (type.IsInterface || type.HasElementType || type.IsGenericParameter)
92 internal StructLayoutAttribute(
LayoutKind layoutKind,
int pack,
int size,
CharSet charSet)
102 [__DynamicallyInvokable]
int Size
Indicates the absolute size of the class or structure.
Represents the base class for custom attributes.
LayoutKind
Controls the layout of an object when exported to unmanaged code.
StructLayoutAttribute(short layoutKind)
Initalizes a new instance of the T:System.Runtime.InteropServices.StructLayoutAttribute class with th...
Lets you control the physical layout of the data fields of a class or structure in memory.
LayoutKind Value
Gets the T:System.Runtime.InteropServices.LayoutKind value that specifies how the class or structure ...
int Pack
Controls the alignment of data fields of a class or structure in memory.
CharSet
Dictates which character set marshaled strings should use.
TypeAttributes
Specifies type attributes.
AttributeTargets
Specifies the application elements on which it is valid to apply an attribute.
CharSet CharSet
Indicates whether string data fields within the class should be marshaled as LPWSTR or LPSTR by defau...
StructLayoutAttribute(LayoutKind layoutKind)
Initalizes a new instance of the T:System.Runtime.InteropServices.StructLayoutAttribute class with th...