132 Views
This post shows a quick and easy pattern to use across any application or library to make consuming events completely optional. You can tell your classes "if no one is listening, don't invoke".
2 comments
dpeterson
8/25/2011 4:04:05 PM
Very nice, I'm going to use this. Thanks :-)
vijayst
8/25/2011 9:14:24 PM
I always like articles that explain clearly why I should be doing something (in the code). This post does a wonderful job of explaining the need of a TryInvoke() method for calling event handlers.