RuntimeReflectionExtensions.GetRuntimeInterfaceMap(TypeInfo, Type) 方法

定义

返回指定类型和指定接口的接口映射。

C#
public static System.Reflection.InterfaceMapping GetRuntimeInterfaceMap(this System.Reflection.TypeInfo typeInfo, Type interfaceType);

参数

typeInfo
TypeInfo

要检索其映射的类型。

interfaceType
Type

要检索其映射的接口。

返回

表示指定接口和类型的接口映射的对象。

例外

typeInfonull

interfaceTypenull

typeInfo 未实现 interfaceType

- 或 -

interfaceType 不引用接口。

- 或 -

typeInfointerfaceType 为开放式泛型类型。

- 或 -

interfaceType 是一个泛型接口,而 typeInfo 是一个数组类型。

typeInfo 表示泛型类型参数。

typeInfo 是尚未调用其 CreateType() 方法的 TypeBuilder 接口。

- 或 -

基类不支持调用的方法。 派生类必须提供一个实现。

适用于

产品 版本
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Framework 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 1.0, 1.1, 1.2, 1.3, 1.4, 1.6, 2.0, 2.1
UWP 10.0

另请参阅