MarshalAsAttribute.MarshalTypeRef 필드

정의

MarshalType을 형식으로 구현합니다.

public: Type ^ MarshalTypeRef;
public Type MarshalTypeRef;
public Type? MarshalTypeRef;
[System.Runtime.InteropServices.ComVisible(true)]
public Type MarshalTypeRef;
val mutable MarshalTypeRef : Type
[<System.Runtime.InteropServices.ComVisible(true)>]
val mutable MarshalTypeRef : Type
Public MarshalTypeRef As Type 

필드 값

특성

설명

또는 MarshalType 필드를 사용하여 MarshalTypeRef 특성 매개 변수, 필드 또는 반환 형식에 대한 사용자 지정 마샬러 형식을 지정할 수 있습니다. 필드를 MarshalTypeRef 사용하면 구문을 줄여 를 더 쉽게 사용할 MarshalType 수 있습니다. 다음 예제에서 첫 번째 줄은 를 사용하는 MarshalType 구문을 나타내고 두 번째 줄은 를 사용하는 MarshalTypeRef구문을 나타냅니다.

[MarshalAs(UnmanagedType.CustomMarshaler, MarshalType = "Assembly, NameSpace.TypeName")]   
[MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(NameSpace.TypeName))]  

C#, GetType Visual Basic 또는 typeid C++에서 를 사용하여 typeof 개체를 설정할 Type 수 있습니다. 사용자 지정 마샬러를 만들고 사용하는 방법에 대한 자세한 내용은 사용자 지정 마샬링을 참조하세요.

적용 대상

추가 정보