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

◆ ReadAsync()

override async Task< bool > System.Xml.XmlCharCheckingReader.ReadAsync ( )
inlinevirtual

Reimplemented from System.Xml.XmlReader.

Definition at line 520 of file XmlCharCheckingReader.cs.

521 {
522 switch (_state)
523 {
524 case State.Initial:
525 _state = State.Interactive;
526 if (reader.ReadState != 0)
527 {
528 break;
529 }
530 goto case State.Interactive;
531 case State.Error:
532 return false;
533 case State.InReadBinary:
535 _state = State.Interactive;
536 goto case State.Interactive;
537 case State.Interactive:
539 {
540 return false;
541 }
542 break;
543 default:
544 return false;
545 }
546 XmlNodeType nodeType = reader.NodeType;
547 if (!_checkCharacters)
548 {
549 switch (nodeType)
550 {
551 case XmlNodeType.Comment:
552 if (_ignoreComments)
553 {
555 }
556 break;
557 case XmlNodeType.Whitespace:
559 {
561 }
562 break;
563 case XmlNodeType.ProcessingInstruction:
564 if (_ignorePis)
565 {
567 }
568 break;
569 case XmlNodeType.DocumentType:
570 if (_dtdProcessing == DtdProcessing.Prohibit)
571 {
572 Throw(System.SR.Xml_DtdIsProhibitedEx, string.Empty);
573 }
574 else if (_dtdProcessing == DtdProcessing.Ignore)
575 {
577 }
578 break;
579 }
580 return true;
581 }
582 switch (nodeType)
583 {
584 case XmlNodeType.Element:
585 if (!_checkCharacters)
586 {
587 break;
588 }
591 {
592 do
593 {
596 }
597 while (reader.MoveToNextAttribute());
599 }
600 break;
601 case XmlNodeType.Text:
602 case XmlNodeType.CDATA:
604 {
606 }
607 break;
608 case XmlNodeType.EntityReference:
610 {
612 }
613 break;
614 case XmlNodeType.ProcessingInstruction:
615 if (_ignorePis)
616 {
618 }
620 {
623 }
624 break;
625 case XmlNodeType.Comment:
626 if (_ignoreComments)
627 {
629 }
631 {
633 }
634 break;
635 case XmlNodeType.DocumentType:
636 if (_dtdProcessing == DtdProcessing.Prohibit)
637 {
638 Throw(System.SR.Xml_DtdIsProhibitedEx, string.Empty);
639 }
640 else if (_dtdProcessing == DtdProcessing.Ignore)
641 {
643 }
645 {
648 string attribute = reader.GetAttribute("SYSTEM");
649 if (attribute != null)
650 {
652 }
653 attribute = reader.GetAttribute("PUBLIC");
654 int invCharIndex;
655 if (attribute != null && (invCharIndex = XmlCharType.IsPublicId(attribute)) >= 0)
656 {
658 }
659 }
660 break;
661 case XmlNodeType.Whitespace:
663 {
665 }
667 {
669 }
670 break;
671 case XmlNodeType.SignificantWhitespace:
673 {
675 }
676 break;
677 case XmlNodeType.EndElement:
679 {
681 }
682 break;
683 }
684 _lastNodeType = nodeType;
685 return true;
686 }
static string Xml_InvalidCharacter
Definition SR.cs:110
static string Xml_DtdIsProhibitedEx
Definition SR.cs:160
Definition SR.cs:7
new ConfiguredTaskAwaitable< TResult > ConfigureAwait(bool continueOnCapturedContext)
Definition Task.cs:226
override async Task< bool > ReadAsync()
void Throw(string res, string arg)
string? GetAttribute(string name)
virtual Task< bool > ReadAsync()
XmlNodeType NodeType
Definition XmlReader.cs:62
virtual Task< string > GetValueAsync()
virtual string Name
Definition XmlReader.cs:65

References System.Xml.XmlCharCheckingReader._checkCharacters, System.Xml.XmlCharCheckingReader._dtdProcessing, System.Xml.XmlCharCheckingReader._ignoreComments, System.Xml.XmlCharCheckingReader._ignorePis, System.Xml.XmlCharCheckingReader._ignoreWhitespace, System.Xml.XmlCharCheckingReader._lastNodeType, System.Xml.XmlCharCheckingReader._state, System.Xml.XmlException.BuildCharExceptionArgs(), System.Xml.XmlCharCheckingReader.CheckCharacters(), System.Xml.XmlCharCheckingReader.CheckWhitespace(), System.Threading.Tasks.Task< TResult >.ConfigureAwait(), System.Xml.Dictionary, System.Xml.XmlCharCheckingReader.FinishReadBinaryAsync(), System.Xml.XmlReader.GetAttribute(), System.Xml.XmlReader.GetValueAsync(), System.Xml.XmlCharType.IsPublicId(), System.Xml.XmlReader.LocalName, System.Xml.XmlReader.MoveToElement(), System.Xml.XmlReader.MoveToFirstAttribute(), System.Xml.XmlReader.MoveToNextAttribute(), System.Xml.XmlReader.Name, System.Xml.XmlReader.NodeType, System.Xml.XmlReader.Prefix, System.Xml.XmlCharCheckingReader.ReadAsync(), System.Xml.XmlReader.ReadAsync(), System.Xml.XmlWrappingReader.reader, System.Xml.XmlReader.ReadState, System.Xml.XmlCharCheckingReader.Throw(), System.Xml.XmlCharCheckingReader.ValidateQName(), System.Xml.XmlReader.Value, System.SR.Xml_DtdIsProhibitedEx, and System.SR.Xml_InvalidCharacter.

Referenced by System.Xml.XmlCharCheckingReader.ReadAsync().