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

◆ Close() [2/2]

override void System.Xml.DocumentXmlWriter.Close ( WriteState currentState)
inlinepackagevirtual

Reimplemented from System.Xml.XmlRawWriter.

Definition at line 407 of file DocumentXmlWriter.cs.

408 {
409 if (currentState == WriteState.Error)
410 {
411 return;
412 }
413 try
414 {
415 switch (_type)
416 {
417 case DocumentXmlWriterType.InsertSiblingAfter:
418 {
419 XmlNode parentNode = _start.ParentNode;
420 if (parentNode == null)
421 {
423 }
424 for (int num2 = _fragment.Count - 1; num2 >= 0; num2--)
425 {
426 parentNode.InsertAfter(_fragment[num2], _start);
427 }
428 break;
429 }
430 case DocumentXmlWriterType.InsertSiblingBefore:
431 {
432 XmlNode parentNode = _start.ParentNode;
433 if (parentNode == null)
434 {
436 }
437 for (int j = 0; j < _fragment.Count; j++)
438 {
439 parentNode.InsertBefore(_fragment[j], _start);
440 }
441 break;
442 }
443 case DocumentXmlWriterType.PrependChild:
444 {
445 for (int num = _fragment.Count - 1; num >= 0; num--)
446 {
448 }
449 break;
450 }
451 case DocumentXmlWriterType.AppendChild:
452 {
453 for (int i = 0; i < _fragment.Count; i++)
454 {
456 }
457 break;
458 }
459 case DocumentXmlWriterType.AppendAttribute:
461 break;
462 case DocumentXmlWriterType.ReplaceToFollowingSibling:
463 if (_fragment.Count == 0)
464 {
466 }
468 break;
469 }
470 }
471 finally
472 {
474 }
475 }
static string Xpn_NoContent
Definition SR.cs:1320
static string Xpn_MissingParent
Definition SR.cs:1318
Definition SR.cs:7
readonly DocumentXmlWriterType _type
readonly List< XmlNode > _fragment
virtual ? XmlNode AppendChild(XmlNode newChild)
Definition XmlNode.cs:739
virtual ? XmlNode PrependChild(XmlNode newChild)
Definition XmlNode.cs:734
virtual ? XmlNode ParentNode
Definition XmlNode.cs:76

References System.Xml.DocumentXmlWriter._fragment, System.Xml.DocumentXmlWriter._start, System.Xml.DocumentXmlWriter._type, System.Xml.XmlNode.AppendChild(), System.Collections.Generic.Dictionary< TKey, TValue >.Clear(), System.Xml.DocumentXmlWriter.CloseWithAppendAttribute(), System.Xml.DocumentXmlWriter.CloseWithReplaceToFollowingSibling(), System.Collections.Generic.Dictionary< TKey, TValue >.Count, System.Xml.XmlNode.InsertAfter(), System.Xml.XmlNode.InsertBefore(), System.Xml.XmlNode.ParentNode, System.Xml.XmlNode.PrependChild(), System.SR.Xpn_MissingParent, and System.SR.Xpn_NoContent.