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

◆ WriteNode() [2/2]

virtual void System.Xml.XmlWriter.WriteNode ( XPathNavigator navigator,
bool defattr )
inlinevirtualinherited

Reimplemented in System.Xml.XmlAsyncCheckWriter, and System.Xml.XmlRawWriter.

Definition at line 319 of file XmlWriter.cs.

320 {
321 if (navigator == null)
322 {
323 throw new ArgumentNullException("navigator");
324 }
325 int num = 0;
326 navigator = navigator.Clone();
327 while (true)
328 {
329 bool flag = false;
330 switch (navigator.NodeType)
331 {
332 case XPathNodeType.Element:
333 WriteStartElement(navigator.Prefix, navigator.LocalName, navigator.NamespaceURI);
334 if (navigator.MoveToFirstAttribute())
335 {
336 do
337 {
338 IXmlSchemaInfo schemaInfo = navigator.SchemaInfo;
339 if (defattr || schemaInfo == null || !schemaInfo.IsDefault)
340 {
341 WriteStartAttribute(navigator.Prefix, navigator.LocalName, navigator.NamespaceURI);
342 WriteString(navigator.Value);
344 }
345 }
346 while (navigator.MoveToNextAttribute());
347 navigator.MoveToParent();
348 }
349 if (navigator.MoveToFirstNamespace(XPathNamespaceScope.Local))
350 {
352 navigator.MoveToParent();
353 }
354 flag = true;
355 break;
356 case XPathNodeType.Text:
357 WriteString(navigator.Value);
358 break;
359 case XPathNodeType.SignificantWhitespace:
360 case XPathNodeType.Whitespace:
362 break;
363 case XPathNodeType.Root:
364 flag = true;
365 break;
366 case XPathNodeType.Comment:
367 WriteComment(navigator.Value);
368 break;
369 case XPathNodeType.ProcessingInstruction:
371 break;
372 }
373 if (flag)
374 {
375 if (navigator.MoveToFirstChild())
376 {
377 num++;
378 continue;
379 }
380 if (navigator.NodeType == XPathNodeType.Element)
381 {
382 if (navigator.IsEmptyElement)
383 {
385 }
386 else
387 {
389 }
390 }
391 }
392 while (true)
393 {
394 if (num == 0)
395 {
396 return;
397 }
398 if (navigator.MoveToNext())
399 {
400 break;
401 }
402 num--;
403 navigator.MoveToParent();
404 if (navigator.NodeType == XPathNodeType.Element)
405 {
407 }
408 }
409 }
410 }
void WriteComment(string? text)
void WriteProcessingInstruction(string name, string? text)
void WriteString(string? text)
void WriteLocalNamespaces(XPathNavigator nsNav)
Definition XmlWriter.cs:450
void WriteStartAttribute(string localName, string? ns)
Definition XmlWriter.cs:67
void WriteWhitespace(string? ws)
void WriteStartElement(string localName, string? ns)
Definition XmlWriter.cs:30

References System.Xml.Dictionary, System.Xml.Schema.IXmlSchemaInfo.IsDefault, System.Xml.XmlWriter.WriteComment(), System.Xml.XmlWriter.WriteEndAttribute(), System.Xml.XmlWriter.WriteEndElement(), System.Xml.XmlWriter.WriteFullEndElement(), System.Xml.XmlWriter.WriteLocalNamespaces(), System.Xml.XmlWriter.WriteProcessingInstruction(), System.Xml.XmlWriter.WriteStartAttribute(), System.Xml.XmlWriter.WriteStartElement(), System.Xml.XmlWriter.WriteString(), and System.Xml.XmlWriter.WriteWhitespace().