Extension Methods in C# 3.0

One of the coolest features of C# 3.0 is Extension Methods.  Basically, an extension method is a static method that can extend a given type (even if that type is closed).  The following extension method adds a .ValidateRegularExpression() method to the String object.  public static bool ValidateRegularExpression(this string vali... [More]

Reflection - Find out if a type is subclassed from another type

I've been writing on a dynamic rules module for AlphaStaff and dug into my framework bag to use this gem.  The following function will crawl an object's dependency graph to find out if a class is ultimately a subtype of another class.  This code sample is in VB but could be ported to C# easily.   Public Function IsSubClas... [More]

Design Guidelines for class developers

There's always been some confusion for developers on things like naming conventions, coding style, when/where/how to use namespaces, and the like.  Microsoft published guidelines for this 3 or so years back and updates them as new releases of .Net come out.  You may find them online at:   http://msdn2.microsoft.com/en-us/librar... [More]

*THE* Email address validation regular expression

Most of us use RegEx to validate simple data such as phone numbers of email addresses, but what expression do you choose?    Nothing's quite as good as opening an SMTP outbound connection and starting a session to validate an email address, but this operation is costly for most data entry scenarios, so I've found this RegEx (wh... [More]

About the author

I'm your host, Brandon Kelly.  I'd like to thank you for taking the time to read some of my thoughts on software develoment, the technology industry and the Florida developer community.

Month List

On My Blog

Recent Comments

Comment RSS