Terraria v1.4.4.9
Terraria source code documentation
All Classes Namespaces Files Functions Variables Enumerations Enumerator Properties Events Macros

◆ WriteNode() [1/3]

virtual void System.Xml.XmlDictionaryWriter.WriteNode ( XmlDictionaryReader reader,
bool defattr )
inlinevirtualinherited

Reimplemented in System.Xml.XmlDictionaryAsyncCheckWriter.

Definition at line 681 of file XmlDictionaryWriter.cs.

682 {
683 if (reader == null)
684 {
685 throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentNullException("reader"));
686 }
687 int num = ((reader.NodeType == XmlNodeType.None) ? (-1) : reader.Depth);
688 do
689 {
690 XmlNodeType nodeType = reader.NodeType;
691 if (nodeType == XmlNodeType.Text || nodeType == XmlNodeType.Whitespace || nodeType == XmlNodeType.SignificantWhitespace)
692 {
694 continue;
695 }
696 if (reader.Depth > num && reader.IsStartArray(out Type type))
697 {
698 WriteArrayNode(reader, type);
699 continue;
700 }
701 switch (nodeType)
702 {
703 case XmlNodeType.Element:
704 WriteElementNode(reader, defattr);
705 break;
706 case XmlNodeType.CDATA:
707 WriteCData(reader.Value);
708 break;
709 case XmlNodeType.EntityReference:
710 WriteEntityRef(reader.Name);
711 break;
712 case XmlNodeType.ProcessingInstruction:
713 case XmlNodeType.XmlDeclaration:
714 WriteProcessingInstruction(reader.Name, reader.Value);
715 break;
716 case XmlNodeType.DocumentType:
717 WriteDocType(reader.Name, reader.GetAttribute("PUBLIC"), reader.GetAttribute("SYSTEM"), reader.Value);
718 break;
719 case XmlNodeType.Comment:
720 WriteComment(reader.Value);
721 break;
722 case XmlNodeType.EndElement:
724 break;
725 }
726 if (!reader.Read())
727 {
728 break;
729 }
730 }
731 while (num < reader.Depth || (num == reader.Depth && reader.NodeType == XmlNodeType.EndElement));
732 }
virtual void WriteTextNode(XmlDictionaryReader reader, bool isAttribute)
void WriteArrayNode(XmlDictionaryReader reader, string prefix, string localName, string namespaceUri, Type type)
void WriteElementNode(XmlDictionaryReader reader, bool defattr)
void WriteCData(string? text)
void WriteComment(string? text)
void WriteProcessingInstruction(string name, string? text)
void WriteEntityRef(string name)
void WriteDocType(string name, string? pubid, string? sysid, string? subset)

References System.Xml.XmlReader.Depth, System.Xml.Dictionary, System.Xml.XmlDictionaryReader.GetAttribute(), System.Xml.XmlDictionaryReader.IsStartArray(), System.Xml.XmlReader.Name, System.Xml.XmlReader.NodeType, System.Xml.XmlReader.Read(), System.Runtime.Serialization.DiagnosticUtility.ExceptionUtility.ThrowHelperError(), System.type, System.Xml.XmlReader.Value, System.Xml.XmlDictionaryWriter.WriteArrayNode(), System.Xml.XmlWriter.WriteCData(), System.Xml.XmlWriter.WriteComment(), System.Xml.XmlWriter.WriteDocType(), System.Xml.XmlDictionaryWriter.WriteElementNode(), System.Xml.XmlWriter.WriteEntityRef(), System.Xml.XmlWriter.WriteFullEndElement(), System.Xml.XmlWriter.WriteProcessingInstruction(), and System.Xml.XmlDictionaryWriter.WriteTextNode().