G
Guest
I have a function called RegisterXX. Its called from a bunch of places. I
need to know the method name that is calling my RegisterXX
for example given the following code:
public void MyFunctionA
{
//... do something
RegisterXX();
}
public void MyFunctionB
{
//... do something
RegisterXX();
}
I'm trying to hook up some instrumentation code in RegisterXX and want to be
able to pull the caller's name out of the air so I don't have to rely on
developers hooking things up correctly.
public void RegisterXX( EventTypeEnum eventType )
{
string s_MethodName = GetCallingMethodName();
WriteOutInstrumentation( s_MethodName, eventType );
)
so when MyFunctionA calls the RegisterXX method some instrumentation data is
written with the name "MyFunctionA".
I'm trying to be extremely clear here. I just need to know how to find the
calling method.
need to know the method name that is calling my RegisterXX
for example given the following code:
public void MyFunctionA
{
//... do something
RegisterXX();
}
public void MyFunctionB
{
//... do something
RegisterXX();
}
I'm trying to hook up some instrumentation code in RegisterXX and want to be
able to pull the caller's name out of the air so I don't have to rely on
developers hooking things up correctly.
public void RegisterXX( EventTypeEnum eventType )
{
string s_MethodName = GetCallingMethodName();
WriteOutInstrumentation( s_MethodName, eventType );
)
so when MyFunctionA calls the RegisterXX method some instrumentation data is
written with the name "MyFunctionA".
I'm trying to be extremely clear here. I just need to know how to find the
calling method.