Click here to Skip to main content
15,891,423 members

Articles by Ian Good (Tip/Tricks: 3)

Tip/Tricks: 3

RSS Feed

Average article rating:

No articles have been posted.

Average blogs rating:

No blogs have been submitted.

Average tips rating: 5.00

Programming Languages
C#
7 Dec 2010   Updated: 19 Dec 2010   Rating: 5.00/5    Votes: 1   Popularity: 0.00
Licence: CPOL    Views: 4,551     Bookmarked: 1   Downloaded: 0
Please Sign up or sign in to vote.
Looks good!I would suggest using Func instead of GetDelegate, simply because it's the same thing.Also, the compiler will deduce the type for you, so there's no need to write:Level3 level3 = NullHelper.Get(() => level1.Level2.Level3);when:var level3 = NullHelper.Get(()...
2 Jun 2011   Updated: 2 Jun 2011   Rating: 5.00/5    Votes: 1   Popularity: 0.00
Licence: CPOL    Views: 6,611     Bookmarked: 0   Downloaded: 0
Please Sign up or sign in to vote.
I'm a fan of these guys... (Though I feel like I might catch some flack for the first one.)public static bool IsNullOrEmpty(this ICollection collection){ return collection == null || collection.Count == 0;}public static float Clamp(this float value, float low, float hi){...
C# 4.0
19 May 2011   Updated: 30 May 2011   Rating: 5.00/5    Votes: 7   Popularity: 4.23
Licence: CPOL    Views: 16,341     Bookmarked: 5   Downloaded: 0
Please Sign up or sign in to vote.
A possibly simpler version of this is to create an extension method for strings:public static class MyExtensions{ public static TEnum ParseEnum(this string value, bool ignoreCase = false) where TEnum : struct { TEnum tenumResult; ...

Average reference rating:

No reference articles have been posted.

Average project rating:

No projects have been posted.
Software Developer (Senior) Undead Labs
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.