I am working on a small Project in which I need to find all the references to other types in a C# class. For example :
class C1 : C2
{
C3 var1;
C4 var2;
public C5 SomeMethod(C6 p1, C7 p2)
{
C8 varC8 = new C8(p1,p2);
varC8.DoSomething();
}
}
As in the above example I have a class which has references to other classes C2, C3,C4,C5,C6,C7,C8. I want to know what are all the types that are being used by this Class C1 and any method/property calls that are used in this class.
I have tried using Mono.Cecil library and I can get till the point of finding out the types of local variables, properties, fields, return types of methods and parameters of the methods. I can not get to the point of going through each line of code and finding out how to find out any declarations or method calls are part of that line.
Can some one help me with this analysis?
Thanks, Satish