TypeToTypeInfoMarshaler 类

定义

将非托管的 ITypeInfo 接口封送处理到托管的 Type 类,并将托管的 Type 类封送处理到非托管的 ITypeInfo 接口。Marshals the unmanaged ITypeInfo interface to the managed Type class, and marshals the managed Type class to the unmanaged ITypeInfo interface.

public ref class TypeToTypeInfoMarshaler : System::Runtime::InteropServices::ICustomMarshaler
public class TypeToTypeInfoMarshaler : System.Runtime.InteropServices.ICustomMarshaler
type TypeToTypeInfoMarshaler = class
    interface ICustomMarshaler
Public Class TypeToTypeInfoMarshaler
Implements ICustomMarshaler
继承
TypeToTypeInfoMarshaler
实现

注解

ITypeInfo为 .net 类型公开的接口基于将出现在导出类型库中的元数据。The ITypeInfo interface exposed for a .NET type is based on the metadata that would appear in an exported type library. 同样, Type 为接口公开的实例 ITypeInfo 基于将出现在导入的程序集中的元数据。Likewise, the Type instance exposed for an ITypeInfo interface is based on the metadata that would appear in an imported assembly.

ITypeInfo MarshalAsAttribute CustomMarshaler 在将使用参数的签名转换 ITypeInfo 为使用参数的签名时 Type ,类型库导入程序(Tlbimp.exe)使用与枚举成员相应的来标记参数。The Type Library Importer (Tlbimp.exe) marks ITypeInfo parameters with the appropriate MarshalAsAttribute with the CustomMarshaler enumeration member when converting signatures that use ITypeInfo parameters to signatures that use Type parameters.

通过调用和,可以在没有自定义封送拆收器的情况下实现相同的转换功能 GetITypeInfoForType GetTypeForITypeInfoThe same conversion functionality can be accomplished without the custom marshaler, by calling GetITypeInfoForType and GetTypeForITypeInfo.

构造函数

TypeToTypeInfoMarshaler()

提供静态类构造函数。Provides the static class constructor.

方法

CleanUpManagedData(Object)

不再需要时执行必要的托管数据的清除。Performs necessary cleanup of the managed data when it is no longer needed.

CleanUpNativeData(IntPtr)

不再需要时执行必要的非托管数据的清除。Performs necessary cleanup of the unmanaged data when it is no longer needed.

Equals(Object)

确定指定对象是否等于当前对象。Determines whether the specified object is equal to the current object.

(继承自 Object)
GetHashCode()

作为默认哈希函数。Serves as the default hash function.

(继承自 Object)
GetInstance(String)

返回自定义封送拆收器的实例。Returns an instance of the custom marshaler.

GetNativeDataSize()

返回要封送处理的非托管数据的大小(以字节为单位)。Returns the size in bytes of the unmanaged data to be marshaled.

GetType()

获取当前实例的 TypeGets the Type of the current instance.

(继承自 Object)
MarshalManagedToNative(Object)

将一个对象从托管代码封送处理到非托管代码。Marshals an object from managed code to unmanaged code.

MarshalNativeToManaged(IntPtr)

将一个对象从非托管代码封送处理到托管代码。Marshals an object from unmanaged code to managed code.

MemberwiseClone()

创建当前 Object 的浅表副本。Creates a shallow copy of the current Object.

(继承自 Object)
ToString()

返回表示当前对象的字符串。Returns a string that represents the current object.

(继承自 Object)

适用于