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

◆ ReadContentAsDateTime()

override DateTime System.Xml.XmlSqlBinaryReader.ReadContentAsDateTime ( )
inlinevirtual

Reimplemented from System.Xml.XmlReader.

Definition at line 1099 of file XmlSqlBinaryReader.cs.

1100 {
1101 int num = _pos;
1102 try
1103 {
1104 DateTime result;
1105 if (SetupContentAsXXX("ReadContentAsDateTime"))
1106 {
1107 try
1108 {
1109 switch (_token)
1110 {
1111 case BinXmlToken.SQL_DATETIME:
1112 case BinXmlToken.SQL_SMALLDATETIME:
1113 case BinXmlToken.XSD_KATMAI_TIMEOFFSET:
1114 case BinXmlToken.XSD_KATMAI_DATETIMEOFFSET:
1115 case BinXmlToken.XSD_KATMAI_DATEOFFSET:
1116 case BinXmlToken.XSD_KATMAI_TIME:
1117 case BinXmlToken.XSD_KATMAI_DATETIME:
1118 case BinXmlToken.XSD_KATMAI_DATE:
1119 case BinXmlToken.XSD_TIME:
1120 case BinXmlToken.XSD_DATETIME:
1121 case BinXmlToken.XSD_DATE:
1122 result = ValueAsDateTime();
1123 goto IL_016f;
1124 case BinXmlToken.SQL_SMALLINT:
1125 case BinXmlToken.SQL_INT:
1126 case BinXmlToken.SQL_REAL:
1127 case BinXmlToken.SQL_FLOAT:
1128 case BinXmlToken.SQL_MONEY:
1129 case BinXmlToken.SQL_BIT:
1130 case BinXmlToken.SQL_TINYINT:
1131 case BinXmlToken.SQL_BIGINT:
1132 case BinXmlToken.SQL_UUID:
1133 case BinXmlToken.SQL_DECIMAL:
1134 case BinXmlToken.SQL_NUMERIC:
1135 case BinXmlToken.SQL_BINARY:
1136 case BinXmlToken.SQL_VARBINARY:
1137 case BinXmlToken.SQL_SMALLMONEY:
1138 case BinXmlToken.SQL_IMAGE:
1139 case BinXmlToken.SQL_UDT:
1140 case BinXmlToken.XSD_BINHEX:
1141 case BinXmlToken.XSD_BASE64:
1142 case BinXmlToken.XSD_BOOLEAN:
1143 case BinXmlToken.XSD_DECIMAL:
1144 case BinXmlToken.XSD_BYTE:
1145 case BinXmlToken.XSD_UNSIGNEDSHORT:
1146 case BinXmlToken.XSD_UNSIGNEDINT:
1147 case BinXmlToken.XSD_UNSIGNEDLONG:
1148 case BinXmlToken.XSD_QNAME:
1149 throw new InvalidCastException(System.SR.Format(System.SR.XmlBinary_CastNotSupported, _token, "DateTime"));
1150 case BinXmlToken.EndElem:
1151 case BinXmlToken.Element:
1152 return XmlConvert.ToDateTime(string.Empty, XmlDateTimeSerializationMode.RoundtripKind);
1153 }
1154 }
1155 catch (InvalidCastException innerException)
1156 {
1158 }
1159 catch (FormatException innerException2)
1160 {
1162 }
1163 catch (OverflowException innerException3)
1164 {
1166 }
1167 }
1168 goto end_IL_0007;
1169 IL_016f:
1170 num = FinishContentAsXXX(num);
1171 return result;
1172 end_IL_0007:;
1173 }
1174 finally
1175 {
1176 _pos = num;
1177 }
1178 return base.ReadContentAsDateTime();
1179 }
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.ToDateTime(), System.Xml.XmlSqlBinaryReader.ValueAsDateTime(), System.SR.Xml_ReadContentAsFormatException, System.SR.XmlBinary_CastNotSupported, and System.Xml.XmlException.