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

◆ ValidateContentChars()

void System.Xml.XmlEncodedRawTextWriter.ValidateContentChars ( string chars,
string propertyName,
bool allowOnlyWhitespace )
inlineprotectedinherited

Definition at line 1530 of file XmlEncodedRawTextWriter.cs.

1531 {
1533 {
1534 if (!XmlCharType.IsOnlyWhitespace(chars))
1535 {
1537 }
1538 return;
1539 }
1540 string text = null;
1541 int num = 0;
1542 object[] args;
1543 while (true)
1544 {
1545 if (num >= chars.Length)
1546 {
1547 return;
1548 }
1549 if (!XmlCharType.IsTextChar(chars[num]))
1550 {
1551 switch (chars[num])
1552 {
1553 case '&':
1554 case '<':
1555 case ']':
1556 {
1558 args = XmlException.BuildCharExceptionArgs(chars, num);
1560 break;
1561 }
1562 default:
1563 if (XmlCharType.IsHighSurrogate(chars[num]))
1564 {
1565 if (num + 1 < chars.Length && XmlCharType.IsLowSurrogate(chars[num + 1]))
1566 {
1567 num++;
1568 goto IL_00f6;
1569 }
1571 }
1572 else
1573 {
1574 if (!XmlCharType.IsLowSurrogate(chars[num]))
1575 {
1576 goto IL_00f6;
1577 }
1579 }
1580 break;
1581 case '\t':
1582 case '\n':
1583 case '\r':
1584 goto IL_00f6;
1585 }
1586 break;
1587 }
1588 goto IL_00f6;
1589 IL_00f6:
1590 num++;
1591 }
1593 args = new string[2] { propertyName, text };
1595 }
static CultureInfo InvariantCulture
static string Xml_IndentCharsNotWhitespace
Definition SR.cs:334
static string Format(string resourceFormat, object p1)
Definition SR.cs:118
static string Xml_InvalidCharsInIndent
Definition SR.cs:332
static string Xml_InvalidSurrogateHighChar
Definition SR.cs:322
static string Xml_InvalidSurrogateMissingLowChar
Definition SR.cs:324
static string Xml_InvalidCharacter
Definition SR.cs:110
Definition SR.cs:7

References System.Xml.ArgumentException, System.Xml.XmlException.BuildCharExceptionArgs(), System.chars, System.Xml.Dictionary, System.SR.Format(), System.Globalization.CultureInfo.InvariantCulture, System.Xml.XmlCharType.IsHighSurrogate(), System.Xml.XmlCharType.IsLowSurrogate(), System.Xml.XmlCharType.IsOnlyWhitespace(), System.Xml.XmlCharType.IsTextChar(), System.text, System.SR.Xml_IndentCharsNotWhitespace, System.SR.Xml_InvalidCharacter, System.SR.Xml_InvalidCharsInIndent, System.SR.Xml_InvalidSurrogateHighChar, and System.SR.Xml_InvalidSurrogateMissingLowChar.

Referenced by System.Xml.XmlEncodedRawTextWriter.XmlEncodedRawTextWriter(), and System.Xml.XmlEncodedRawTextWriterIndent.Init().