[ Team LiB ] Previous Section Next Section

MarshalAsAttributeECMA 1.0

System.Runtime.InteropServices (mscorlib.dll)sealed class

This optional attribute is used to explicitly specify the unmanaged type a parameter, field, or return value should be marshaled to. If you do not specify this attribute, .NET uses the type's default marshaler. The UnmanagedType enumeration contains the unmanaged types you can marshal to with this attribute.

public sealed class MarshalAsAttribute : Attribute {
// Public Constructors
   public MarshalAsAttribute(short unmanagedType);
   public MarshalAsAttribute(UnmanagedType unmanagedType);
// Public Instance Fields
   public UnmanagedType ArraySubType;
   public string MarshalCookie;
   public string MarshalType;
   public Type MarshalTypeRef;
   public VarEnum SafeArraySubType;
   public Type SafeArrayUserDefinedSubType;
   public int SizeConst;
   public short SizeParamIndex;
// Public Instance Properties
   public UnmanagedType Value{get; }
}

Hierarchy

System.Object System.Attribute MarshalAsAttribute

Valid On

Field, Parameter, ReturnValue

    [ Team LiB ] Previous Section Next Section