Get the real method name of a Delegate

  • Thread starter Thread starter Deckarep
  • Start date Start date
D

Deckarep

Hey all,

I pass my methods to be called into my function by Delegate.

Once inside my function which invokes them I'd like to get the orignal
name of the delegate if possible. I just want the name for reporting
purposes so I know which Delegate is being used for that particular
call.

Thanks in advance,

-Ralph
 
Deckarep said:
Hey all,

I pass my methods to be called into my function by Delegate.

Once inside my function which invokes them I'd like to get the orignal
name of the delegate if possible. I just want the name for reporting
purposes so I know which Delegate is being used for that particular
call.

It's all inside the Method property of every delegate. For a multicast
delegate, break it apart first using GetInvocationList.
 
Deckarep said:
I pass my methods to be called into my function by Delegate.

Once inside my function which invokes them I'd like to get the orignal
name of the delegate if possible. I just want the name for reporting
purposes so I know which Delegate is being used for that particular
call.

Yes - use Delegate.GetInvocationList. Note that a single delegate
instance can contain many actions due to them being combined together.
 
Yes - use Delegate.GetInvocationList. Note that a single delegate
instance can contain many actions due to them being combined together.

Thanks guys, that worked....wasn't sure where to look and this time
around Google was not my friend...bad Google.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top