In .NET, using reflection how can I get class variables that are used in a method?
Ex:
class A
{
UltraClass B = new(..);
SupaClass C = new(..);
void M1()
{
B.xyz(); // it can be a method call
int a = C.a; // a variable access
}
}
Note:
GetClassVariablesInMethod(M1 MethodInfo) returns B and C variables.
By variables I mean Value and/or Type and Constructor Parameters of that specific variable.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…