1297    {
 1298        if (typeof(TOther) == typeof(byte))
 1299        {
 1300            result = (char)(
byte)(object)
value;
 
 1301            return true;
 1302        }
 1303        if (typeof(TOther) == typeof(char))
 1304        {
 1305            result = (char)(
object)
value;
 
 1306            return true;
 1307        }
 1308        if (typeof(TOther) == typeof(decimal))
 1309        {
 1310            decimal num = (decimal)(
object)
value;
 
 1311            if (num < 0m || num > 65535m)
 1312            {
 1313                result = '\0';
 1314                return false;
 1315            }
 1316            result = (char)num;
 1317            return true;
 1318        }
 1319        if (typeof(TOther) == typeof(double))
 1320        {
 1321            double num2 = (double)(
object)
value;
 
 1322            if (num2 < 0.0 || num2 > 65535.0)
 1323            {
 1324                result = '\0';
 1325                return false;
 1326            }
 1327            result = (char)num2;
 1328            return true;
 1329        }
 1330        if (typeof(TOther) == typeof(short))
 1331        {
 1333            if (num3 < 0)
 1334            {
 1335                result = '\0';
 1336                return false;
 1337            }
 1338            result = (char)num3;
 1339            return true;
 1340        }
 1341        if (typeof(TOther) == typeof(int))
 1342        {
 1343            int num4 = (int)(
object)
value;
 
 1344            if (num4 < 0 || num4 > 65535)
 1345            {
 1346                result = '\0';
 1347                return false;
 1348            }
 1349            result = (char)num4;
 1350            return true;
 1351        }
 1352        if (typeof(TOther) == typeof(long))
 1353        {
 1354            long num5 = (long)(
object)
value;
 
 1355            if (num5 < 0 || num5 > 65535)
 1356            {
 1357                result = '\0';
 1358                return false;
 1359            }
 1360            result = (char)num5;
 1361            return true;
 1362        }
 1363        if (typeof(TOther) == typeof(IntPtr))
 1364        {
 1366            if ((nint)intPtr < 0 || (nint)intPtr > 65535)
 1367            {
 1368                result = '\0';
 1369                return false;
 1370            }
 1371            result = (char)(nint)intPtr;
 1372            return true;
 1373        }
 1374        if (typeof(TOther) == typeof(sbyte))
 1375        {
 1376            sbyte b = (sbyte)(
object)
value;
 
 1377            if (b < 0)
 1378            {
 1379                result = '\0';
 1380                return false;
 1381            }
 1382            result = (char)b;
 1383            return true;
 1384        }
 1385        if (typeof(TOther) == typeof(float))
 1386        {
 1387            float num6 = (float)(
object)
value;
 
 1388            if (num6 < 0f || num6 > 65535f)
 1389            {
 1390                result = '\0';
 1391                return false;
 1392            }
 1393            result = (char)num6;
 1394            return true;
 1395        }
 1396        if (typeof(TOther) == typeof(ushort))
 1397        {
 1398            ushort num7 = (ushort)(
object)
value;
 
 1399            if (num7 > ushort.MaxValue)
 1400            {
 1401                result = '\0';
 1402                return false;
 1403            }
 1404            result = (char)num7;
 1405            return true;
 1406        }
 1407        if (typeof(TOther) == typeof(uint))
 1408        {
 1409            uint num8 = (uint)(
object)
value;
 
 1410            if (num8 > 65535)
 1411            {
 1412                result = '\0';
 1413                return false;
 1414            }
 1415            result = (char)num8;
 1416            return true;
 1417        }
 1418        if (typeof(TOther) == typeof(ulong))
 1419        {
 1420            ulong num9 = (ulong)(
object)
value;
 
 1421            if (num9 > 65535)
 1422            {
 1423                result = '\0';
 1424                return false;
 1425            }
 1426            result = (char)num9;
 1427            return true;
 1428        }
 1429        if (typeof(TOther) == typeof(UIntPtr))
 1430        {
 1432            if ((nuint)uIntPtr > 65535)
 1433            {
 1434                result = '\0';
 1435                return false;
 1436            }
 1437            result = (char)(nuint)uIntPtr;
 1438            return true;
 1439        }
 1440        ThrowHelper.ThrowNotSupportedException();
 1441        result = '\0';
 1442        return false;
 1443    }