Is it possible to retrieve from inside a given method any information about the method that called it?
public void MethodOne()
{
for (int nCount = 0; nCount < 10; nCount++) MethodTwo();
}
public void MethodTwo()
{
// Can I retrieve here information about the call to MethodOne which originated this call?
}
For example, in this situation I would like to be able to know at runtime that a given set of ten calls to MethodTwo were originated from a call to MethodOne in a given thread… Is this possible?
This is horrible:
(this also doesn’t come free; any such abuse has a performance price)