I have a C# class that has far too much code in, and I want to refactor
it. What I would like to do is start with all the public methods
, and build a tree
for each one, showing which other methods in the class are called from it, and then which are called from the child one, and so on.
This will enable me to see which private methods
belong solely to one public method
, which are shared and so on.
Note that I DON'T want to do this at run time, I want to be able to look at a class, either directly at the .cs file
, or using reflection on the compiled DLL
.
I know I can use reflection on the compiled DLL to get the methods, but I can't find any way of finding out which methods are called by other methods in the class.
Anyone any ideas? Again, this is NOT a run time issue, it's purely to build a reusable utility to help refactor an oversized class. There are quite a few in the solution I'm working on, so the code woudl be used over and over again.