Home / ASP.NET Weblogs

Browse by Tags

Related Posts

  • Reflecting over an Event

    A coworker (Hey, Evgeny!) came to me with a puzzler today. He has an object that exposes an event, and he wants to know whether he's already subscribed to that event. Two things immediately came to mind - the first was that he really shouldn't be doing that, and the second was to suggest that...
    Posted to Miscellaneous Debris (Weblog) by Avner Kashtan on 03-29-2007, 12:00 AM
    Filed under: .NET, CodeSnippets, Reflection, C#
  • Non-generic default values in C#? Why not?!

    A relatively obscure new keyword in C# 2.0 is the default(T) keyword. It's shorthand for checking if the given generic parameter T is a value type or reference type. If it's a reference type, it returns null. Otherwise it returns 0/false/0.0 or whatever the default value for the type is. For some reason...
    Posted to Miscellaneous Debris (Weblog) by AvnerK on 05-21-2006, 12:00 AM
    Filed under: .NET, CodeSnippets, Reflection, C#
Page 1 of 1 (2 items)