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

◆ WriteNodeAsync_CallSyncReader()

async Task System.Xml.XmlWriter.WriteNodeAsync_CallSyncReader ( XmlReader reader,
bool defattr )
inlinepackageinherited

Definition at line 792 of file XmlWriter.cs.

793 {
794 bool canReadChunk = reader.CanReadValueChunk;
795 int d = ((reader.NodeType == XmlNodeType.None) ? (-1) : reader.Depth);
796 do
797 {
798 switch (reader.NodeType)
799 {
800 case XmlNodeType.Element:
801 await WriteStartElementAsync(reader.Prefix, reader.LocalName, reader.NamespaceURI).ConfigureAwait(continueOnCapturedContext: false);
803 if (reader.IsEmptyElement)
804 {
806 }
807 break;
808 case XmlNodeType.Text:
809 if (canReadChunk)
810 {
811 if (_writeNodeBuffer == null)
812 {
813 _writeNodeBuffer = new char[1024];
814 }
815 int count;
816 while ((count = reader.ReadValueChunk(_writeNodeBuffer, 0, 1024)) > 0)
817 {
819 }
820 }
821 else
822 {
824 }
825 break;
826 case XmlNodeType.Whitespace:
827 case XmlNodeType.SignificantWhitespace:
829 break;
830 case XmlNodeType.CDATA:
832 break;
833 case XmlNodeType.EntityReference:
835 break;
836 case XmlNodeType.ProcessingInstruction:
837 case XmlNodeType.XmlDeclaration:
839 break;
840 case XmlNodeType.DocumentType:
841 await WriteDocTypeAsync(reader.Name, reader.GetAttribute("PUBLIC"), reader.GetAttribute("SYSTEM"), reader.Value).ConfigureAwait(continueOnCapturedContext: false);
842 break;
843 case XmlNodeType.Comment:
845 break;
846 case XmlNodeType.EndElement:
848 break;
849 }
850 }
851 while (reader.Read() && (d < reader.Depth || (d == reader.Depth && reader.NodeType == XmlNodeType.EndElement)));
852 }
new ConfiguredTaskAwaitable< TResult > ConfigureAwait(bool continueOnCapturedContext)
Definition Task.cs:226
virtual Task WriteProcessingInstructionAsync(string name, string? text)
Definition XmlWriter.cs:648
virtual async Task WriteAttributesAsync(XmlReader reader, bool defattr)
Definition XmlWriter.cs:737
virtual Task WriteWhitespaceAsync(string? ws)
Definition XmlWriter.cs:663
virtual Task WriteEntityRefAsync(string name)
Definition XmlWriter.cs:653
virtual Task WriteStringAsync(string? text)
Definition XmlWriter.cs:668
virtual Task WriteCommentAsync(string? text)
Definition XmlWriter.cs:643
virtual Task WriteFullEndElementAsync()
Definition XmlWriter.cs:606
virtual Task WriteCDataAsync(string? text)
Definition XmlWriter.cs:638
virtual Task WriteCharsAsync(char[] buffer, int index, int count)
Definition XmlWriter.cs:678
virtual Task WriteEndElementAsync()
Definition XmlWriter.cs:601
virtual Task WriteStartElementAsync(string? prefix, string localName, string? ns)
Definition XmlWriter.cs:596
virtual Task WriteDocTypeAsync(string name, string? pubid, string? sysid, string? subset)
Definition XmlWriter.cs:591

References System.Xml.XmlWriter._writeNodeBuffer, System.Xml.XmlReader.CanReadValueChunk, System.Threading.Tasks.Task< TResult >.ConfigureAwait(), System.count, System.Xml.XmlReader.Depth, System.Xml.Dictionary, System.Xml.XmlReader.GetAttribute(), System.Xml.XmlReader.IsEmptyElement, System.Xml.XmlReader.LocalName, System.Xml.XmlReader.Name, System.Xml.XmlReader.NamespaceURI, System.Xml.XmlReader.NodeType, System.Xml.XmlReader.Prefix, System.Xml.XmlReader.Read(), System.Xml.XmlReader.ReadValueChunk(), System.Xml.XmlReader.Value, System.Xml.XmlWriter.WriteAttributesAsync(), System.Xml.XmlWriter.WriteCDataAsync(), System.Xml.XmlWriter.WriteCharsAsync(), System.Xml.XmlWriter.WriteCommentAsync(), System.Xml.XmlWriter.WriteDocTypeAsync(), System.Xml.XmlWriter.WriteEndElementAsync(), System.Xml.XmlWriter.WriteEntityRefAsync(), System.Xml.XmlWriter.WriteFullEndElementAsync(), System.Xml.XmlWriter.WriteProcessingInstructionAsync(), System.Xml.XmlWriter.WriteStartElementAsync(), System.Xml.XmlWriter.WriteStringAsync(), and System.Xml.XmlWriter.WriteWhitespaceAsync().

Referenced by System.Xml.XmlWriter.WriteNodeAsync().