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

◆ WriteNodeAsync()

async Task System.Xml.XmlReader.WriteNodeAsync ( XmlWriter xtw,
bool defattr )
inlineprivateinherited

Definition at line 1672 of file XmlReader.cs.

1673 {
1674 int d = ((NodeType == XmlNodeType.None) ? (-1) : Depth);
1676 {
1677 switch (NodeType)
1678 {
1679 case XmlNodeType.Element:
1680 xtw.WriteStartElement(Prefix, LocalName, NamespaceURI);
1681 ((XmlTextWriter)xtw).QuoteChar = QuoteChar;
1682 xtw.WriteAttributes(this, defattr);
1683 if (IsEmptyElement)
1684 {
1685 xtw.WriteEndElement();
1686 }
1687 break;
1688 case XmlNodeType.Text:
1689 {
1690 XmlWriter xmlWriter = xtw;
1691 xmlWriter.WriteString(await GetValueAsync().ConfigureAwait(continueOnCapturedContext: false));
1692 break;
1693 }
1694 case XmlNodeType.Whitespace:
1695 case XmlNodeType.SignificantWhitespace:
1696 {
1697 XmlWriter xmlWriter = xtw;
1698 xmlWriter.WriteWhitespace(await GetValueAsync().ConfigureAwait(continueOnCapturedContext: false));
1699 break;
1700 }
1701 case XmlNodeType.CDATA:
1702 xtw.WriteCData(Value);
1703 break;
1704 case XmlNodeType.EntityReference:
1705 xtw.WriteEntityRef(Name);
1706 break;
1707 case XmlNodeType.ProcessingInstruction:
1708 case XmlNodeType.XmlDeclaration:
1709 xtw.WriteProcessingInstruction(Name, Value);
1710 break;
1711 case XmlNodeType.DocumentType:
1712 xtw.WriteDocType(Name, GetAttribute("PUBLIC"), GetAttribute("SYSTEM"), Value);
1713 break;
1714 case XmlNodeType.Comment:
1715 xtw.WriteComment(Value);
1716 break;
1717 case XmlNodeType.EndElement:
1718 xtw.WriteFullEndElement();
1719 break;
1720 }
1721 }
1722 if (d == Depth && NodeType == XmlNodeType.EndElement)
1723 {
1725 }
1726 }
new ConfiguredTaskAwaitable< TResult > ConfigureAwait(bool continueOnCapturedContext)
Definition Task.cs:226
string? GetAttribute(string name)
virtual char QuoteChar
Definition XmlReader.cs:94
virtual Task< bool > ReadAsync()
XmlNodeType NodeType
Definition XmlReader.cs:62
virtual Task< string > GetValueAsync()
virtual string Name
Definition XmlReader.cs:65

References System.Threading.Tasks.Task< TResult >.ConfigureAwait(), System.Xml.XmlReader.Depth, System.Xml.Dictionary, System.Xml.XmlReader.GetAttribute(), System.Xml.XmlReader.GetValueAsync(), 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.QuoteChar, System.Xml.XmlReader.ReadAsync(), System.Xml.XmlReader.Value, System.Xml.XmlWriter.WriteString(), and System.Xml.XmlWriter.WriteWhitespace().

Referenced by System.Xml.XmlReader.ReadInnerXmlAsync().