Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ ReadContentAsInt()

override int System.Xml.XmlSqlBinaryReader.ReadContentAsInt ( )
inlinevirtual

Reimplemented from System.Xml.XmlReader.

Definition at line 1427 of file XmlSqlBinaryReader.cs.

1428 {
1429 int num = _pos;
1430 try
1431 {
1432 int result;
1433 if (SetupContentAsXXX("ReadContentAsInt"))
1434 {
1435 try
1436 {
1437 switch (_token)
1438 {
1439 case BinXmlToken.SQL_SMALLINT:
1440 case BinXmlToken.SQL_INT:
1441 case BinXmlToken.SQL_MONEY:
1442 case BinXmlToken.SQL_BIT:
1443 case BinXmlToken.SQL_TINYINT:
1444 case BinXmlToken.SQL_BIGINT:
1445 case BinXmlToken.SQL_DECIMAL:
1446 case BinXmlToken.SQL_NUMERIC:
1447 case BinXmlToken.SQL_SMALLMONEY:
1448 case BinXmlToken.XSD_DECIMAL:
1449 case BinXmlToken.XSD_BYTE:
1450 case BinXmlToken.XSD_UNSIGNEDSHORT:
1451 case BinXmlToken.XSD_UNSIGNEDINT:
1452 case BinXmlToken.XSD_UNSIGNEDLONG:
1453 result = checked((int)ValueAsLong());
1454 goto IL_016f;
1455 case BinXmlToken.SQL_REAL:
1456 case BinXmlToken.SQL_FLOAT:
1457 case BinXmlToken.SQL_UUID:
1458 case BinXmlToken.SQL_BINARY:
1459 case BinXmlToken.SQL_VARBINARY:
1460 case BinXmlToken.SQL_DATETIME:
1461 case BinXmlToken.SQL_SMALLDATETIME:
1462 case BinXmlToken.SQL_IMAGE:
1463 case BinXmlToken.SQL_UDT:
1464 case BinXmlToken.XSD_KATMAI_TIMEOFFSET:
1465 case BinXmlToken.XSD_KATMAI_DATETIMEOFFSET:
1466 case BinXmlToken.XSD_KATMAI_DATEOFFSET:
1467 case BinXmlToken.XSD_KATMAI_TIME:
1468 case BinXmlToken.XSD_KATMAI_DATETIME:
1469 case BinXmlToken.XSD_KATMAI_DATE:
1470 case BinXmlToken.XSD_TIME:
1471 case BinXmlToken.XSD_DATETIME:
1472 case BinXmlToken.XSD_DATE:
1473 case BinXmlToken.XSD_BINHEX:
1474 case BinXmlToken.XSD_BASE64:
1475 case BinXmlToken.XSD_BOOLEAN:
1476 case BinXmlToken.XSD_QNAME:
1477 throw new InvalidCastException(System.SR.Format(System.SR.XmlBinary_CastNotSupported, _token, "Int32"));
1478 case BinXmlToken.EndElem:
1479 case BinXmlToken.Element:
1480 return XmlConvert.ToInt32(string.Empty);
1481 }
1482 }
1483 catch (InvalidCastException innerException)
1484 {
1486 }
1487 catch (FormatException innerException2)
1488 {
1490 }
1491 catch (OverflowException innerException3)
1492 {
1494 }
1495 }
1496 goto end_IL_0007;
1497 IL_016f:
1498 num = FinishContentAsXXX(num);
1499 return result;
1500 end_IL_0007:;
1501 }
1502 finally
1503 {
1504 _pos = num;
1505 }
1506 return base.ReadContentAsInt();
1507 }
static string Format(string resourceFormat, object p1)
Definition SR.cs:118
static string Xml_ReadContentAsFormatException
Definition SR.cs:190
static string XmlBinary_CastNotSupported
Definition SR.cs:1382
Definition SR.cs:7

References System.Xml.XmlSqlBinaryReader._pos, System.Xml.XmlSqlBinaryReader._token, System.Xml.Dictionary, System.Xml.XmlSqlBinaryReader.FinishContentAsXXX(), System.SR.Format(), System.Xml.XmlSqlBinaryReader.SetupContentAsXXX(), System.Xml.XmlConvert.ToInt32(), System.Xml.XmlSqlBinaryReader.ValueAsLong(), System.SR.Xml_ReadContentAsFormatException, System.SR.XmlBinary_CastNotSupported, and System.Xml.XmlException.