C#/.NET Little Wonders: The EventHandler and EventHandler<TEventArgs> (blackrabbitcoder.net)

submitted by BlackRabbitCoderBlackRabbitCoder(661) 6 months, 6 days ago

Once again, in this series of posts I look at the parts of the .NET Framework that may seem trivial, but can help improve your code by making it easier to write and maintain. In the last two weeks, we examined the Action family of delegates (and delegates in general), and the Func family of delegates and how they can be used to support generic, reusable algorithms and classes. So this week, we are going to look at a handy pair of delegates that can be used to eliminate the need for defining custom delegates when creating events: the EventHandler and EventHandler<TEventArgs> delegates.

2 comments |category: |Views: 25

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 BlackRabbitCoderBlackRabbitCoder(661) 6 months, 6 days ago 0

New post!

Reply

posted by dpetersondpeterson(4397) replied to BlackRabbitCoderBlackRabbitCoder(661), 6 months, 6 days ago 0

Thanks again for keeping these going. I like your simple approach to thread safety with checking for null delegates.

Reply

information Login or create an account to comment on this story