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 getPropertyDescriptorinstances with possibility to filter using specificAttributes.The
Type.GetProperties()is used to getPropertyInfoinstances with possibility to filter using specificBindingFlags.