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

◆ MoveToDeclaration()

XmlDeclarationNode System.Xml.XmlBaseReader.MoveToDeclaration ( )
inlineprotectedinherited

Definition at line 1328 of file XmlBaseReader.cs.

1329 {
1330 if (_attributeCount < 1)
1331 {
1332 XmlExceptionHelper.ThrowXmlException(this, new XmlException(System.SR.XmlDeclMissingVersion));
1333 }
1334 if (_attributeCount > 3)
1335 {
1336 XmlExceptionHelper.ThrowXmlException(this, new XmlException(System.SR.XmlMalformedDecl));
1337 }
1338 if (!CheckDeclAttribute(0, "version", "1.0", checkLower: false, System.SR.XmlInvalidVersion))
1339 {
1340 XmlExceptionHelper.ThrowXmlException(this, new XmlException(System.SR.XmlDeclMissingVersion));
1341 }
1342 if (_attributeCount > 1)
1343 {
1344 if (CheckDeclAttribute(1, "encoding", null, checkLower: true, System.SR.XmlInvalidEncoding_UTF8))
1345 {
1346 if (_attributeCount == 3 && !CheckStandalone(2))
1347 {
1348 XmlExceptionHelper.ThrowXmlException(this, new XmlException(System.SR.XmlMalformedDecl));
1349 }
1350 }
1351 else if (!CheckStandalone(1) || _attributeCount > 2)
1352 {
1353 XmlExceptionHelper.ThrowXmlException(this, new XmlException(System.SR.XmlMalformedDecl));
1354 }
1355 }
1356 if (_declarationNode == null)
1357 {
1358 _declarationNode = new XmlDeclarationNode(_bufferReader);
1359 }
1361 return _declarationNode;
1362 }
static string XmlMalformedDecl
Definition SR.cs:458
static string XmlDeclMissingVersion
Definition SR.cs:364
Definition SR.cs:7
readonly XmlBufferReader _bufferReader
void MoveToNode(XmlNode node)
XmlDeclarationNode _declarationNode
bool CheckStandalone(int attr)
bool CheckDeclAttribute(int index, string localName, string value, bool checkLower, string valueSR)

References System.Xml.XmlBaseReader.NamespaceManager._attributeCount, System.Xml.XmlBaseReader.NamespaceManager._bufferReader, System.Xml.XmlBaseReader._declarationNode, System.Xml.XmlBaseReader.CheckDeclAttribute(), System.Xml.XmlBaseReader.CheckStandalone(), System.Xml.Dictionary, System.Xml.XmlBaseReader.MoveToNode(), System.Xml.XmlExceptionHelper.ThrowXmlException(), System.SR.XmlDeclMissingVersion, System.Xml.XmlException, System.SR.XmlInvalidEncoding_UTF8, System.SR.XmlInvalidVersion, and System.SR.XmlMalformedDecl.

Referenced by System.Xml.XmlBaseReader.MoveToElement(), and System.Xml.XmlUTF8TextReader.ReadDeclaration().