public static bool IsSupportedType (Type t)
{
TypeCode tc = Type.GetTypeCode (t);
if (tc == TypeCode.Object) {
return true;
}
switch (tc) {
// string
case TypeCode.Char:
case TypeCode.String:
// boolean
case TypeCode.Boolean:
// number
case TypeCode.Byte:
case TypeCode.SByte:
case TypeCode.Int16:
case TypeCode.Int32:
case TypeCode.Int64:
case TypeCode.UInt16:
case TypeCode.UInt32:
case TypeCode.UInt64:
case TypeCode.Single:
case TypeCode.Double:
// case TypeCode.Decimal: // decimal is unsupported(!)
return true;
}
return false;
}