Can I determine the delegate instance that was fired?

  • Thread starter Thread starter Peter Rilling
  • Start date Start date
P

Peter Rilling

This may sound like a weird desire, but is there any way to get a reference
to the actual MulticastDelegate that was used to invoke a handler, from
within the handler? Maybe through the call stack or something?
 
Peter Rilling said:
This may sound like a weird desire, but is there any way to get a reference
to the actual MulticastDelegate that was used to invoke a handler, from
within the handler? Maybe through the call stack or something?

Not as far as I'm aware. Can I ask why you'd want to?
 
Well, I am trying to think outside-the-box to try to implement an event
bubbling architecture that is a companion to my event broadcasting design
(http://www.codeproject.com/useritems/event_broadcast.asp).

I was first researching ways of getting the delegates from the actual event
but soon realized that the storage of the event can be anywhere and so I
cannot develop a consistent way of evaluating it. So I thought it would be
cool to grab the delegate after it had invoked some method thereby allowing
me to get the delegate no matter where it is stored.

Now the interesting thing is that to implement event bubbling, I only need
to know the number of delegates registered for an event, not necessarily the
actual delegates.
 

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