Geeks With Blogs

@michelgrootjans
  • michelgrootjans @hackerrank Thanks for the support, but I'm working on an alternate algorithm that should work. If this doesn't work, I'll mail you. about 4 days ago
  • michelgrootjans https://t.co/b8ECP6841I is working, but I can't get it to run the 'heavy' examples under 16 seconds. about 4 days ago
  • michelgrootjans Really good: just discovered https://t.co/nDagnJG72Z about 4 days ago
  • michelgrootjans If you want to introduce your team to some agile practices like TDD, DDD, continuous deployment, continuous improvement... => I'm available. about 19 days ago

News
Shelfari: Book reviews on your book blog

.net alternatives by Michel Grootjans January 2009 Entries
Elegant way to raise an event
I got fed up with this kind of code for a long time: private void personList_DoubleClick(object sender, EventArgs e) { if (ShowSelectedPerson != null) ShowSelectedPerson(this, EventArgs.Empty); } Today, a colleague of mine triggered this simple idea: private void personList_DoubleClick(object sender, EventArgs e) { ShowSelectedPerson.Raise(this, EventArgs.Empty); } This is implemented with a simple extension method public static class EventHandlerExtensions { public static void Raise(this EventHandler ......

Posted On Monday, January 19, 2009 1:24 PM

Copyright © Michel Grootjans | Powered by: GeeksWithBlogs.net | Join free