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

◆ ReadContentAsBoolean()

override bool System.Xml.XmlSqlBinaryReader.ReadContentAsBoolean ( )
inlinevirtual

Reimplemented from System.Xml.XmlReader.

Definition at line 1021 of file XmlSqlBinaryReader.cs.

1022 {
1023 int num = _pos;
1024 bool flag = false;
1025 try
1026 {
1027 if (SetupContentAsXXX("ReadContentAsBoolean"))
1028 {
1029 try
1030 {
1031 switch (_token)
1032 {
1033 case BinXmlToken.XSD_BOOLEAN:
1034 flag = _data[_tokDataPos] != 0;
1035 goto IL_0165;
1036 case BinXmlToken.SQL_SMALLINT:
1037 case BinXmlToken.SQL_INT:
1038 case BinXmlToken.SQL_REAL:
1039 case BinXmlToken.SQL_FLOAT:
1040 case BinXmlToken.SQL_MONEY:
1041 case BinXmlToken.SQL_BIT:
1042 case BinXmlToken.SQL_TINYINT:
1043 case BinXmlToken.SQL_BIGINT:
1044 case BinXmlToken.SQL_UUID:
1045 case BinXmlToken.SQL_DECIMAL:
1046 case BinXmlToken.SQL_NUMERIC:
1047 case BinXmlToken.SQL_BINARY:
1048 case BinXmlToken.SQL_VARBINARY:
1049 case BinXmlToken.SQL_DATETIME:
1050 case BinXmlToken.SQL_SMALLDATETIME:
1051 case BinXmlToken.SQL_SMALLMONEY:
1052 case BinXmlToken.SQL_IMAGE:
1053 case BinXmlToken.SQL_UDT:
1054 case BinXmlToken.XSD_KATMAI_TIMEOFFSET:
1055 case BinXmlToken.XSD_KATMAI_DATETIMEOFFSET:
1056 case BinXmlToken.XSD_KATMAI_DATEOFFSET:
1057 case BinXmlToken.XSD_KATMAI_TIME:
1058 case BinXmlToken.XSD_KATMAI_DATETIME:
1059 case BinXmlToken.XSD_KATMAI_DATE:
1060 case BinXmlToken.XSD_TIME:
1061 case BinXmlToken.XSD_DATETIME:
1062 case BinXmlToken.XSD_DATE:
1063 case BinXmlToken.XSD_BINHEX:
1064 case BinXmlToken.XSD_BASE64:
1065 case BinXmlToken.XSD_DECIMAL:
1066 case BinXmlToken.XSD_BYTE:
1067 case BinXmlToken.XSD_UNSIGNEDSHORT:
1068 case BinXmlToken.XSD_UNSIGNEDINT:
1069 case BinXmlToken.XSD_UNSIGNEDLONG:
1070 case BinXmlToken.XSD_QNAME:
1071 throw new InvalidCastException(System.SR.Format(System.SR.XmlBinary_CastNotSupported, _token, "Boolean"));
1072 case BinXmlToken.EndElem:
1073 case BinXmlToken.Element:
1074 return XmlConvert.ToBoolean(string.Empty);
1075 }
1076 }
1077 catch (InvalidCastException innerException)
1078 {
1080 }
1081 catch (FormatException innerException2)
1082 {
1084 }
1085 }
1086 goto end_IL_0009;
1087 IL_0165:
1088 num = FinishContentAsXXX(num);
1089 return flag;
1090 end_IL_0009:;
1091 }
1092 finally
1093 {
1094 _pos = num;
1095 }
1096 return base.ReadContentAsBoolean();
1097 }
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._data, System.Xml.XmlSqlBinaryReader._pos, System.Xml.XmlSqlBinaryReader._tokDataPos, System.Xml.XmlSqlBinaryReader._token, System.Xml.Dictionary, System.Xml.XmlSqlBinaryReader.FinishContentAsXXX(), System.SR.Format(), System.Xml.XmlSqlBinaryReader.SetupContentAsXXX(), System.Xml.XmlConvert.ToBoolean(), System.SR.Xml_ReadContentAsFormatException, System.SR.XmlBinary_CastNotSupported, and System.Xml.XmlException.