Re: How to determine if a property is inherited or not using reflection?
- From: digger <Mark_google@xxxxxxxxxx>
- Date: Fri, 20 Jun 2008 12:49:15 -0700 (PDT)
Thanks for the reply,
Checking if .DeclaringType is the same as .ReflectedType should do the trick.
I tried that and it seemed to work in most cases - except for one case
where I had a class ButtonControl that inherited an Infragistics
button control and the declaringtype and relfectedtype were my
buttoncontrol. I assumed it had to do w/ being in different
assemblies?
The inheritance hierarchy is actually an inheritance chain, since C# doesn't
have multiple inheritance. (Interfaces are "implemented" rather than
"inherited".) Simply following Type.BaseType will do.
Excellent. Thank you.
You'll have to enumerate interfaces and mappings with .GetInterfaces() and
.GetInterfaceMap() for a full picture.
Thankfully, I can skip that part :)
.
- Follow-Ups:
- References:
- How to determine if a property is inherited or not using reflection?
- From: Mark_google
- Re: How to determine if a property is inherited or not using reflection?
- From: Jeroen Mostert
- How to determine if a property is inherited or not using reflection?
- Prev by Date: Did you find an answer?
- Next by Date: Re: How to determine if a property is inherited or not using reflection?
- Previous by thread: Re: How to determine if a property is inherited or not using reflection?
- Next by thread: Re: How to determine if a property is inherited or not using reflection?
- Index(es):