开发者

Reflection Type vs TypeDescriptor

开发者 https://www.devze.com 2023-02-16 05:57 出处:网络
Lately I have been using reflection to work in my project, and I have the current 开发者_开发百科question.

Lately I have been using reflection to work in my project, and I have the current 开发者_开发百科question.

While in Type.GetProperties(Flags), we can filter the properties we get using 'Flags'; in TypeDescriptor.GetProperties(), we don't.

In type.GetProperties I can filter to get only properties not inherited. Is it possible to do the same with TypeDescriptor.GetProperties() (only properties not inherited)?

Thank you


No, you can't.

The TypeDescriptor.GetProperties() is used to get PropertyDescriptor instances with possibility to filter using specific Attributes.

The Type.GetProperties() is used to get PropertyInfo instances with possibility to filter using specific BindingFlags.

0

精彩评论

暂无评论...
验证码 换一张
取 消