简体   繁体   English

确定类型实现的接口

[英]Determine what interfaces a type implements

Just a quick one... How do I determine what interfaces a type implements? 请快速浏览...如何确定类型实现的接口?

Cheers Anthony 干杯安东尼

您可以调用GetInterfaces方法。

Type[] interfaceTypes = myType.GetInterfaces();
Type.GetInterfaces()

:)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 确定泛型类是否实现类型 - Determine if Generic Class Implements Type 获取类实现的泛型接口的类型参数 - Getting type arguments of generic interfaces that a class implements 类型实现另一个接口的通用接口 - Generic interfaces which type implements another interface 确定 class 是否实现通用接口,然后调用接口方法 - Determine if a class implements a generic interface and then call a the interfaces method 如何确定类型是否在Powershell中实现接口 - How to determine if a type implements an interface in Powershell 如何在Autofac中注册实现多个接口的类型? - How do I register with Autofac a type that implements multiple interfaces? 是否可以定义实现多个接口的任何类型的列表? - Is it possible to define a list of any type that implements multiple interfaces? 注册使用开放泛型类型将多个接口实现为单例的服务 - Registering service that implements several interfaces as singleton using open generic type 如果一个类实现了两个扩展同一个基接口的接口会发生什么? - What happens if a class implements two interfaces that extend the same base interface? 引用实现多个接口的 class 实例的正确方法是什么? - What is the correct way to reference instance of class that implements multiple interfaces?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM