Reflection of Member Interaction

  • Thread starter Thread starter carl.manaster
  • Start date Start date
C

carl.manaster

Hi,

I'm exploring the reflection capabilities; I'd like to be able to find
which methods read and write to which fields and properties, and which
methods call which other methods. The idea would be to be able to make
recommendations about extracting classes - if some subset of fields is
referenced only by some subset of methods, maybe it's a new, smaller
class waiting to be born.

But all I see in the docs is PropertyInfo.GetAccessors. That's fine as
far as it goes (although I'd really like to know specifics of read- and
write- access), but I don't see a counterpart for FieldInfo or
MethodInfo. Am I missing something, or is this capability simply not
offered by the reflection classes?

Thanks,
--Carl
 
I'm exploring the reflection capabilities; I'd like to be able to find
which methods read and write to which fields and properties, and which
methods call which other methods.

That would require parsing the IL code. Reflection currently doesn't
support that, but there are other libraries that do.

But all I see in the docs is PropertyInfo.GetAccessors.

That doesn't return information about code that access the property,
it returns MethodInfo objects representing the property get and/or set
methods.




Mattias
 
Hi, Mattias,
That would require parsing the IL code. Reflection currently doesn't
support that, but there are other libraries that do.

Thanks for the info. Can you tell me more about where to find the
IL-parsing libraries?

Peace,
--Carl
 
Back
Top