public static Type GetMatchingIntType (Type type)
{
ArgumentUtility.CheckNotNull ("type", type);
if (type == typeof (bool))
return typeof (int);
else if (type == typeof (bool?))
return typeof (int?);
else
throw new ArgumentException ("Type must be Boolean or Nullable<Boolean>.", "type");
}