Exceptions During EventHandler Invocation and Allowing No Subscribers(www.jnadal.com)

submitted by jnadaljnadal(20) 9 months ago

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 |category: |Views: 14

tags: another

new Add a live kick counter to your blog >> liveImage

You can even customize the image by choosing your own colors, and then clicking the button below to update the preview and the html code:

  • "Kick It" text
  • "Kick It" background
  • kick count text
  • kick count background
  • border

Simply copy and paste this HTML into your blog post.


Users who kicked this story:
Comments:

posted by dpetersondpeterson(4397) 9 months ago +1

Very nice, I'm going to use this. Thanks :-)

Reply

posted by vijaystvijayst(1311) 9 months ago +1

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.

Reply

information Login or create an account to comment on this story