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

◆ ReadContentAsString() [2/4]

string System.Xml.XmlDictionaryReader.ReadContentAsString ( int maxStringContentLength)
inlineprotectedinherited

Definition at line 758 of file XmlDictionaryReader.cs.

759 {
761 string text = string.Empty;
762 bool flag = false;
763 while (true)
764 {
765 switch (NodeType)
766 {
767 case XmlNodeType.Attribute:
768 text = Value;
769 break;
770 case XmlNodeType.Text:
771 case XmlNodeType.CDATA:
772 case XmlNodeType.Whitespace:
773 case XmlNodeType.SignificantWhitespace:
774 {
775 string value = Value;
776 if (text.Length == 0)
777 {
778 text = value;
779 break;
780 }
781 if (stringBuilder == null)
782 {
784 }
785 if (stringBuilder.Length > maxStringContentLength - value.Length)
786 {
787 XmlExceptionHelper.ThrowMaxStringContentLengthExceeded(this, maxStringContentLength);
788 }
789 stringBuilder.Append(value);
790 break;
791 }
792 case XmlNodeType.EntityReference:
794 {
796 break;
797 }
798 goto default;
799 default:
800 flag = true;
801 break;
802 case XmlNodeType.ProcessingInstruction:
803 case XmlNodeType.Comment:
804 case XmlNodeType.EndEntity:
805 break;
806 }
807 if (flag)
808 {
809 break;
810 }
811 if (AttributeCount != 0)
812 {
814 }
815 else
816 {
817 Read();
818 }
819 }
820 if (stringBuilder != null)
821 {
822 text = stringBuilder.ToString();
823 }
824 if (text.Length > maxStringContentLength)
825 {
826 XmlExceptionHelper.ThrowMaxStringContentLengthExceeded(this, maxStringContentLength);
827 }
828 return text;
829 }
virtual bool CanResolveEntity
Definition XmlReader.cs:118
XmlNodeType NodeType
Definition XmlReader.cs:62

References System.Xml.XmlReader.AttributeCount, System.Xml.XmlReader.CanResolveEntity, System.Xml.Dictionary, System.Xml.XmlReader.NodeType, System.Xml.XmlReader.Read(), System.Xml.XmlReader.ReadAttributeValue(), System.Xml.XmlReader.ResolveEntity(), System.text, System.Xml.XmlExceptionHelper.ThrowMaxStringContentLengthExceeded(), System.value, and System.Xml.XmlReader.Value.