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

◆ WriteElementAsync()

async Task System.Xml.Linq.ElementWriter.WriteElementAsync ( XElement e,
CancellationToken cancellationToken )
inline

Definition at line 60 of file ElementWriter.cs.

61 {
63 XNode i = e;
64 while (true)
65 {
66 if (i is XElement current)
67 {
69 if (current.content == null)
70 {
72 }
73 else
74 {
75 if (!(current.content is string text))
76 {
77 i = ((XNode)current.content).next;
78 continue;
79 }
80 cancellationToken.ThrowIfCancellationRequested();
83 }
84 }
85 else
86 {
87 await i.WriteToAsync(_writer, cancellationToken).ConfigureAwait(continueOnCapturedContext: false);
88 }
89 while (i != e && i == i.parent.content)
90 {
91 i = i.parent;
93 }
94 if (i != e)
95 {
96 i = i.next;
97 continue;
98 }
99 break;
100 }
101 }
new ConfiguredTaskAwaitable< TResult > ConfigureAwait(bool continueOnCapturedContext)
Definition Task.cs:226
virtual Task WriteStringAsync(string? text)
Definition XmlWriter.cs:668
async Task WriteFullEndElementAsync(CancellationToken cancellationToken)
readonly XmlWriter _writer
async Task WriteStartElementAsync(XElement e, CancellationToken cancellationToken)
async Task WriteEndElementAsync(CancellationToken cancellationToken)

References System.Xml.Linq.ElementWriter._writer, System.cancellationToken, System.Threading.Tasks.Task< TResult >.ConfigureAwait(), System.Xml.Dictionary, System.Xml.Linq.ElementWriter.PushAncestors(), System.text, System.Xml.Linq.ElementWriter.WriteEndElementAsync(), System.Xml.Linq.ElementWriter.WriteFullEndElementAsync(), System.Xml.Linq.ElementWriter.WriteStartElementAsync(), and System.Xml.XmlWriter.WriteStringAsync().

Referenced by System.Xml.Linq.XElement.WriteToAsync().