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

◆ ValidateContentChars()

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

Definition at line 1362 of file XmlUtf8RawTextWriter.cs.

1363 {
1365 {
1366 if (!XmlCharType.IsOnlyWhitespace(chars))
1367 {
1369 }
1370 return;
1371 }
1372 string text = null;
1373 int num = 0;
1374 object[] args;
1375 while (true)
1376 {
1377 if (num >= chars.Length)
1378 {
1379 return;
1380 }
1381 if (!XmlCharType.IsTextChar(chars[num]))
1382 {
1383 switch (chars[num])
1384 {
1385 case '&':
1386 case '<':
1387 case ']':
1388 {
1390 args = XmlException.BuildCharExceptionArgs(chars, num);
1392 break;
1393 }
1394 default:
1395 if (XmlCharType.IsHighSurrogate(chars[num]))
1396 {
1397 if (num + 1 < chars.Length && XmlCharType.IsLowSurrogate(chars[num + 1]))
1398 {
1399 num++;
1400 goto IL_00f6;
1401 }
1403 }
1404 else
1405 {
1406 if (!XmlCharType.IsLowSurrogate(chars[num]))
1407 {
1408 goto IL_00f6;
1409 }
1411 }
1412 break;
1413 case '\t':
1414 case '\n':
1415 case '\r':
1416 goto IL_00f6;
1417 }
1418 break;
1419 }
1420 goto IL_00f6;
1421 IL_00f6:
1422 num++;
1423 }
1425 args = new string[2] { propertyName, text };
1427 }
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.XmlUtf8RawTextWriter.XmlUtf8RawTextWriter(), and System.Xml.XmlUtf8RawTextWriterIndent.Init().