I have a Type object, and a method name:
Type type;
string methodName;
And i need a MethodBase object for the method "methodName", somewhere in the stack.
This works:
MethodBase nemo;
StackTrace st = new StackTrace(); // Behaves poorly...
for(int i =0; i< st.FrameCount; i++ )
{
StackFrame sf = st.GetFrame(i);
if (sf.GetMethod().Name == methodName)
{
nemo = sf.GetMethod();
}
}
But i need a faster approach...