How to find the base type or interface declaring a specific property?

  • Thread starter Thread starter Joe Jax
  • Start date Start date
J

Joe Jax

I have an object which has a base object hierarchy as well as a number of
implemented interfaces. Given any one property on that object, how do I find
out which base class or interface defines that property?
 
Joe Jax said:
I have an object which has a base object hierarchy as well as a number of
implemented interfaces. Given any one property on that object, how do I find
out which base class or interface defines that property?

Well, multiple interfaces could each define it, but you'd basically
have to find all the interfaces and base types (Type.GetInterfaces,
Type.BaseType), and ask each in turn whether it declared that property
(Type.GetProperty).
 
Back
Top