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).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top