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

◆ ReadFromAsyncInternal()

static async Task< XNode > System.Xml.Linq.XNode.ReadFromAsyncInternal ( XmlReader reader,
CancellationToken cancellationToken )
inlinestaticprivateinherited

Definition at line 332 of file XNode.cs.

333 {
334 if (reader.ReadState != ReadState.Interactive)
335 {
337 }
338 XNode ret;
339 switch (reader.NodeType)
340 {
341 case XmlNodeType.Text:
342 case XmlNodeType.Whitespace:
343 case XmlNodeType.SignificantWhitespace:
344 ret = new XText(reader.Value);
345 break;
346 case XmlNodeType.CDATA:
347 ret = new XCData(reader.Value);
348 break;
349 case XmlNodeType.Comment:
350 ret = new XComment(reader.Value);
351 break;
352 case XmlNodeType.DocumentType:
353 {
354 string name2 = reader.Name;
355 string attribute = reader.GetAttribute("PUBLIC");
356 string attribute2 = reader.GetAttribute("SYSTEM");
357 string value2 = reader.Value;
358 ret = new XDocumentType(name2, attribute, attribute2, value2);
359 break;
360 }
361 case XmlNodeType.Element:
362 return await XElement.CreateAsync(reader, cancellationToken).ConfigureAwait(continueOnCapturedContext: false);
363 case XmlNodeType.ProcessingInstruction:
364 {
365 string name = reader.Name;
366 string value = reader.Value;
367 ret = new XProcessingInstruction(name, value);
368 break;
369 }
370 default:
372 }
373 cancellationToken.ThrowIfCancellationRequested();
374 await reader.ReadAsync().ConfigureAwait(continueOnCapturedContext: false);
375 return ret;
376 }
static string Format(string resourceFormat, object p1)
Definition SR.cs:118
static string InvalidOperation_ExpectedInteractive
Definition SR.cs:46
static string InvalidOperation_UnexpectedNodeType
Definition SR.cs:58
Definition SR.cs:7

References System.cancellationToken, System.Xml.Linq.XElement.CreateAsync(), System.Xml.Dictionary, System.SR.Format(), System.Xml.XmlReader.GetAttribute(), System.SR.InvalidOperation_ExpectedInteractive, System.SR.InvalidOperation_UnexpectedNodeType, System.Xml.XmlReader.Name, System.Xml.XmlReader.NodeType, System.Xml.XmlReader.ReadAsync(), System.Xml.XmlReader.ReadState, System.value, and System.Xml.XmlReader.Value.

Referenced by System.Xml.Linq.XNode.ReadFromAsync().