MethodA(Delegate obj)
{
MethodB(obj):
}
MethodB(Delegate obj)
{
MethodC(obj):
}
MethodC(Delegate obj)
{
//By using obj need to Track all The Travellled Methods info
// Like MethodA.MethodB.MethodC
}
Loading
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Manish Kumar ChoudharyRank #339 · 7.4K reputationPosted Nov 26, 2014, 1:04 AM EST
Read these links it may help you
http://msdn.microsoft.com/en-us/library/bb985537.aspx
http://etutorials.org/Programming/visual-c-sharp/Part+II+Advanced+C/Chapter+6+Delegates+and+Attributes/Using+Delegates/
VulpesRank #55 · 29.2K reputationPosted Nov 26, 2014, 2:36 AM EST
To track the methods which have been called up to the current point, you need a stack trace:
The output is :
Notice that the only method in the invocation list is MyGreeting.
However, the stack trace reveals the methods that have been called culminating in MethodC.
Notice also that I've had to add extra code to MethodA and MethodB to avoid them being 'optimized away' by the JIT compiler.