【发布时间】:2010-10-28 02:51:59
【问题描述】:
我正在寻找一种不引用类名的方法,但仍能达到预期的效果。 我不能做 ITypedList.GetType() 因为它是一个接口。
public class DerivedList : ITypedList
...
public PropertyDescriptorCollection GetItemProperties()
{
return TypeDescriptor.GetProperties(typeof(DerivedList));
}
...
我想知道这是否可能。
干杯,
编辑:试图用没有提到它自己的类名的东西来替换它
【问题讨论】:
-
我觉得这个问题有点不清楚,但可能只是我。您是否尝试替换此行'return TypeDescriptor.GetProperties(typeof(DerivedList));'没有提到它自己的类名的东西?
-
是的。抱歉,如果不清楚,我是这里的新手。
标签: c# inheritance interface types