开发者

Reflection Type vs TypeDescriptor

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜