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

◆ ReadContentAsDecimal()

override decimal System.Xml.XmlSqlBinaryReader.ReadContentAsDecimal ( )
inlinevirtual

Reimplemented from System.Xml.XmlReader.

Definition at line 1345 of file XmlSqlBinaryReader.cs.

1346 {
1347 int num = _pos;
1348 try
1349 {
1350 decimal result;
1351 if (SetupContentAsXXX("ReadContentAsDecimal"))
1352 {
1353 try
1354 {
1355 switch (_token)
1356 {
1357 case BinXmlToken.SQL_SMALLINT:
1358 case BinXmlToken.SQL_INT:
1359 case BinXmlToken.SQL_MONEY:
1360 case BinXmlToken.SQL_BIT:
1361 case BinXmlToken.SQL_TINYINT:
1362 case BinXmlToken.SQL_BIGINT:
1363 case BinXmlToken.SQL_DECIMAL:
1364 case BinXmlToken.SQL_NUMERIC:
1365 case BinXmlToken.SQL_SMALLMONEY:
1366 case BinXmlToken.XSD_DECIMAL:
1367 case BinXmlToken.XSD_BYTE:
1368 case BinXmlToken.XSD_UNSIGNEDSHORT:
1369 case BinXmlToken.XSD_UNSIGNEDINT:
1370 case BinXmlToken.XSD_UNSIGNEDLONG:
1371 result = ValueAsDecimal();
1372 goto IL_016e;
1373 case BinXmlToken.SQL_REAL:
1374 case BinXmlToken.SQL_FLOAT:
1375 case BinXmlToken.SQL_UUID:
1376 case BinXmlToken.SQL_BINARY:
1377 case BinXmlToken.SQL_VARBINARY:
1378 case BinXmlToken.SQL_DATETIME:
1379 case BinXmlToken.SQL_SMALLDATETIME:
1380 case BinXmlToken.SQL_IMAGE:
1381 case BinXmlToken.SQL_UDT:
1382 case BinXmlToken.XSD_KATMAI_TIMEOFFSET:
1383 case BinXmlToken.XSD_KATMAI_DATETIMEOFFSET:
1384 case BinXmlToken.XSD_KATMAI_DATEOFFSET:
1385 case BinXmlToken.XSD_KATMAI_TIME:
1386 case BinXmlToken.XSD_KATMAI_DATETIME:
1387 case BinXmlToken.XSD_KATMAI_DATE:
1388 case BinXmlToken.XSD_TIME:
1389 case BinXmlToken.XSD_DATETIME:
1390 case BinXmlToken.XSD_DATE:
1391 case BinXmlToken.XSD_BINHEX:
1392 case BinXmlToken.XSD_BASE64:
1393 case BinXmlToken.XSD_BOOLEAN:
1394 case BinXmlToken.XSD_QNAME:
1395 throw new InvalidCastException(System.SR.Format(System.SR.XmlBinary_CastNotSupported, _token, "Decimal"));
1396 case BinXmlToken.EndElem:
1397 case BinXmlToken.Element:
1398 return XmlConvert.ToDecimal(string.Empty);
1399 }
1400 }
1401 catch (InvalidCastException innerException)
1402 {
1404 }
1405 catch (FormatException innerException2)
1406 {
1408 }
1409 catch (OverflowException innerException3)
1410 {
1412 }
1413 }
1414 goto end_IL_0007;
1415 IL_016e:
1416 num = FinishContentAsXXX(num);
1417 return result;
1418 end_IL_0007:;
1419 }
1420 finally
1421 {
1422 _pos = num;
1423 }
1424 return base.ReadContentAsDecimal();
1425 }
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.ToDecimal(), System.Xml.XmlSqlBinaryReader.ValueAsDecimal(), System.SR.Xml_ReadContentAsFormatException, System.SR.XmlBinary_CastNotSupported, and System.Xml.XmlException.