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

◆ ScanAttributes()

void System.Xml.XmlSqlBinaryReader.ScanAttributes ( )
inlineprivate

Definition at line 2429 of file XmlSqlBinaryReader.cs.

2430 {
2431 int num = -1;
2432 int num2 = -1;
2433 _mark = _pos;
2434 string text = null;
2435 bool flag = false;
2436 BinXmlToken binXmlToken;
2437 while (BinXmlToken.EndAttrs != (binXmlToken = NextToken()))
2438 {
2439 if (BinXmlToken.Attr == binXmlToken)
2440 {
2441 if (text != null)
2442 {
2443 PushNamespace(text, string.Empty, implied: false);
2444 text = null;
2445 }
2446 if (_attrCount == _attributes.Length)
2447 {
2449 }
2452 if (n.prefix == "xml")
2453 {
2454 if (n.localname == "lang")
2455 {
2456 num2 = _attrCount;
2457 }
2458 else if (n.localname == "space")
2459 {
2460 num = _attrCount;
2461 }
2462 }
2463 else if (Ref.Equal(n.namespaceUri, _nsxmlns))
2464 {
2465 text = n.localname;
2466 if (text == "xmlns")
2467 {
2468 text = string.Empty;
2469 }
2470 }
2471 else if (n.prefix.Length != 0)
2472 {
2473 if (n.namespaceUri.Length == 0)
2474 {
2475 throw new XmlException(System.SR.Xml_PrefixForEmptyNs, string.Empty);
2476 }
2477 PushNamespace(n.prefix, n.namespaceUri, implied: true);
2478 }
2479 else if (n.namespaceUri.Length != 0)
2480 {
2481 throw ThrowXmlException(System.SR.XmlBinary_AttrWithNsNoPrefix, n.localname, n.namespaceUri);
2482 }
2483 _attrCount++;
2484 flag = false;
2485 }
2486 else
2487 {
2489 if (flag)
2490 {
2492 }
2493 string stringValue = _stringValue;
2494 if (stringValue != null)
2495 {
2497 _stringValue = null;
2498 }
2499 if (text != null)
2500 {
2501 string ns = _xnt.Add(ValueAsString(binXmlToken));
2502 PushNamespace(text, ns, implied: false);
2503 text = null;
2504 }
2505 flag = true;
2506 }
2507 }
2508 if (num != -1)
2509 {
2510 string attributeText = GetAttributeText(num);
2511 XmlSpace xmlSpace = XmlSpace.None;
2512 if (attributeText == "preserve")
2513 {
2514 xmlSpace = XmlSpace.Preserve;
2515 }
2516 else if (attributeText == "default")
2517 {
2518 xmlSpace = XmlSpace.Default;
2519 }
2520 _elementStack[_elemDepth].xmlSpace = xmlSpace;
2522 }
2523 if (num2 != -1)
2524 {
2526 }
2527 if (_attrCount < 200)
2528 {
2530 }
2531 else
2532 {
2534 }
2535 }
static string Xml_PrefixForEmptyNs
Definition SR.cs:286
static string XmlBinary_ListsOfValuesNotSupported
Definition SR.cs:1380
static string XmlBinary_AttrWithNsNoPrefix
Definition SR.cs:1386
Definition SR.cs:7
string Add(char[] array, int offset, int length)
XmlNodeType ScanOverValue(BinXmlToken token, bool attr, bool checkChars)
Exception ThrowXmlException(string res)
string ValueAsString(BinXmlToken token)
Exception ThrowNotSupported(string res)
void PushNamespace(string prefix, string ns, bool implied)

References System.Xml.XmlSqlBinaryReader._attrCount, System.Xml.XmlSqlBinaryReader._attributes, System.Xml.XmlSqlBinaryReader._elemDepth, System.Xml.XmlSqlBinaryReader._elementStack, System.Xml.XmlSqlBinaryReader._mark, System.Xml.XmlSqlBinaryReader._nsxmlns, System.Xml.XmlSqlBinaryReader._pos, System.Xml.XmlSqlBinaryReader._stringValue, System.Xml.XmlSqlBinaryReader._symbolTables, System.Xml.XmlSqlBinaryReader._xmlspacePreserve, System.Xml.XmlSqlBinaryReader._xnt, System.Xml.XmlNameTable.Add(), System.Xml.Dictionary, System.Xml.Ref.Equal(), System.Xml.XmlSqlBinaryReader.GetAttributeText(), System.Xml.XmlSqlBinaryReader.GrowAttributes(), System.Xml.XmlSqlBinaryReader.HashCheckForDuplicateAttributes(), System.Xml.XmlSqlBinaryReader.NextToken(), System.Xml.XmlSqlBinaryReader.PushNamespace(), System.Xml.XmlSqlBinaryReader.SymbolTables.qnametable, System.Xml.XmlSqlBinaryReader.ReadQNameRef(), System.Xml.XmlSqlBinaryReader.ScanOverValue(), System.Xml.XmlSqlBinaryReader.AttrInfo.Set(), System.Xml.XmlSqlBinaryReader.SimpleCheckForDuplicateAttributes(), System.text, System.Xml.XmlSqlBinaryReader.ThrowNotSupported(), System.Xml.XmlSqlBinaryReader.ThrowXmlException(), System.Xml.XmlSqlBinaryReader.AttrInfo.val, System.Xml.XmlSqlBinaryReader.ValueAsString(), System.SR.Xml_PrefixForEmptyNs, System.SR.XmlBinary_AttrWithNsNoPrefix, System.SR.XmlBinary_ListsOfValuesNotSupported, System.Xml.XmlException, System.Xml.XmlSqlBinaryReader.ElemInfo.xmlLang, and System.Xml.XmlSqlBinaryReader.ElemInfo.xmlSpace.

Referenced by System.Xml.XmlSqlBinaryReader.ImplReadElement().