private static bool ShouldConvertTypeToInteger(Type type) { switch (Type.GetTypeCode(type)) { case TypeCode.SByte: case TypeCode.Int16: case TypeCode.Byte: case TypeCode.UInt16: { return true; } } return false; }