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

◆ ReadContentAsFloat()

override float System.Xml.XmlSqlBinaryReader.ReadContentAsFloat ( )
inlinevirtual

Reimplemented from System.Xml.XmlReader.

Definition at line 1263 of file XmlSqlBinaryReader.cs.

1264 {
1265 int num = _pos;
1266 try
1267 {
1268 float result;
1269 if (SetupContentAsXXX("ReadContentAsFloat"))
1270 {
1271 try
1272 {
1273 switch (_token)
1274 {
1275 case BinXmlToken.SQL_REAL:
1276 case BinXmlToken.SQL_FLOAT:
1277 result = (float)ValueAsDouble();
1278 goto IL_0133;
1279 case BinXmlToken.SQL_SMALLINT:
1280 case BinXmlToken.SQL_INT:
1281 case BinXmlToken.SQL_MONEY:
1282 case BinXmlToken.SQL_BIT:
1283 case BinXmlToken.SQL_TINYINT:
1284 case BinXmlToken.SQL_BIGINT:
1285 case BinXmlToken.SQL_UUID:
1286 case BinXmlToken.SQL_DECIMAL:
1287 case BinXmlToken.SQL_NUMERIC:
1288 case BinXmlToken.SQL_BINARY:
1289 case BinXmlToken.SQL_VARBINARY:
1290 case BinXmlToken.SQL_DATETIME:
1291 case BinXmlToken.SQL_SMALLDATETIME:
1292 case BinXmlToken.SQL_SMALLMONEY:
1293 case BinXmlToken.SQL_IMAGE:
1294 case BinXmlToken.SQL_UDT:
1295 case BinXmlToken.XSD_KATMAI_TIMEOFFSET:
1296 case BinXmlToken.XSD_KATMAI_DATETIMEOFFSET:
1297 case BinXmlToken.XSD_KATMAI_DATEOFFSET:
1298 case BinXmlToken.XSD_KATMAI_TIME:
1299 case BinXmlToken.XSD_KATMAI_DATETIME:
1300 case BinXmlToken.XSD_KATMAI_DATE:
1301 case BinXmlToken.XSD_TIME:
1302 case BinXmlToken.XSD_DATETIME:
1303 case BinXmlToken.XSD_DATE:
1304 case BinXmlToken.XSD_BINHEX:
1305 case BinXmlToken.XSD_BASE64:
1306 case BinXmlToken.XSD_BOOLEAN:
1307 case BinXmlToken.XSD_DECIMAL:
1308 case BinXmlToken.XSD_BYTE:
1309 case BinXmlToken.XSD_UNSIGNEDSHORT:
1310 case BinXmlToken.XSD_UNSIGNEDINT:
1311 case BinXmlToken.XSD_UNSIGNEDLONG:
1312 case BinXmlToken.XSD_QNAME:
1313 throw new InvalidCastException(System.SR.Format(System.SR.XmlBinary_CastNotSupported, _token, "Float"));
1314 case BinXmlToken.EndElem:
1315 case BinXmlToken.Element:
1316 return XmlConvert.ToSingle(string.Empty);
1317 }
1318 }
1319 catch (InvalidCastException innerException)
1320 {
1322 }
1323 catch (FormatException innerException2)
1324 {
1326 }
1327 catch (OverflowException innerException3)
1328 {
1330 }
1331 }
1332 goto end_IL_0007;
1333 IL_0133:
1334 num = FinishContentAsXXX(num);
1335 return result;
1336 end_IL_0007:;
1337 }
1338 finally
1339 {
1340 _pos = num;
1341 }
1342 return base.ReadContentAsFloat();
1343 }
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.ToSingle(), System.Xml.XmlSqlBinaryReader.ValueAsDouble(), System.SR.Xml_ReadContentAsFormatException, System.SR.XmlBinary_CastNotSupported, and System.Xml.XmlException.