PDA

View Full Version : Is there support for events


mohangupta
08-21-2005, 02:00 AM
Hi!

I was wondering whether it's possible to intercept events.


Thanks
Mohan

Aleks Seovic
08-22-2005, 08:27 PM
Hi,

It is possible to intercept event *registrations*, if that's what you mean. Actual events can simply be listened to so there is really no good reason to intercept them.

Regards,

Aleks

Mark Pollack
08-24-2005, 12:55 AM
Hi,

Well just to be contrary :), as a generic infrastructure feature it could be useful - we just haven't thought it through yet. We should look into what is possible here. I don't think such a feature would be "as bad" as intercepting fields - though people disagree on that as well.

Cheers,
Mark

Thibaut
08-24-2005, 09:42 AM
Hi guys

I'd give +1 to event interceptions, apart from event registrations.

One case I think of for instance (but i'm pretty sure there are many more) is detecting a guilty event handler which does something abnormal (such as throwing exceptions - this prevents the next registered handler to not receive the event if you use the default .net event call; or such as never returning, deadlocking etc).

Sure there are other practices (write better code, use windbg to understand the deadlocks, use good logging code in each module etc), but the cross-cutting magic would be really neat here.

my 0.02€

Thibaut
--
[blog] http://www.dotnetguru2.org/tbarrere