【发布时间】:2011-05-19 02:17:09
【问题描述】:
我有以下内容:
Assembly asm = Assembly.GetAssembly(this.GetType());
foreach (Type type in asm.GetTypes())
{
MyAttribute attr = Attribute.GetCustomAttribute(type, typeof(MyAttribute)) as MyAttribute;
if(attr != null && [type is inherited from Iinterface])
{
...
}
}
如何检查类型是从 MyInterface 继承的?是否 keywork 会以这种方式工作?
谢谢。
【问题讨论】:
标签: c# reflection inheritance interface