【发布时间】:2017-04-11 19:43:30
【问题描述】:
我正在使用 GetProperties 来获取一个类的属性列表。
Dim properties As List(Of PropertyInfo) = objType.GetProperties(BindingFlags.Instance Or BindingFlags.Public).ToList()
For Each prop As PropertyInfo In properties
'how do I get the parent class type of the prop (level up in hierarchy from property's ReflectedType)?
Next
如何让父类比当前属性的ReflectedType 高一级?请注意,此类可能有多个父级别。我不想要当前属性类的BaseType,而只是属性的ReflectedType 层次结构中的下一层,因为属性可能有好几层深。
【问题讨论】:
标签: vb.net propertyinfo getproperties bindingflags