I created a .net extension method that converts an string to an integer and throws an InvalidCastException if the passed string isn\'t an integer:
public static i