My intention is to investigate the “Methods” of a Type using reflection in order to verify the following :
-
The Methods should be instance methods and public.
-
Takes the parameter “params” and void in nature.
-
The Method does not makes recursive call.
I started as :
static void ProcessMethodInfo(Type t)
{
MethodInfo[] info = t.GetMethods();
foreach (MethodInfo mi in info)
{
// How to check the conditions here ?
}
}
But I don’t know how to proceed further. Help is needed.
Well, if by 3 you mean the method under inspection should be non-recursive; then that is a pain – you’d need to parse the IL. But for the others;