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

◆ WriteEndElement()

override void System.Runtime.Serialization.Json.XmlJsonWriter.WriteEndElement ( )
inline

Definition at line 560 of file XmlJsonWriter.cs.

561 {
562 if (IsClosed)
563 {
564 ThrowClosed();
565 }
566 if (_depth == 0)
567 {
569 }
571 {
573 }
574 _endElementBuffer = false;
575 JsonNodeType jsonNodeType = ExitScope();
576 if (jsonNodeType == JsonNodeType.Collection)
577 {
578 _indentLevel--;
579 if (_indent)
580 {
581 if (_nodeType == JsonNodeType.Element)
582 {
584 }
585 else
586 {
587 WriteNewLine();
588 WriteIndent();
589 }
590 }
593 }
594 else if (_nodeType == JsonNodeType.QuotedText)
595 {
597 }
598 else if (_nodeType == JsonNodeType.Element)
599 {
600 if (_dataType == JsonDataType.None && _serverTypeValue != null)
601 {
602 throw new XmlException(System.SR.Format(System.SR.JsonMustSpecifyDataType, "type", "object", "__type"));
603 }
605 {
606 throw new XmlException(System.SR.Format(System.SR.JsonMustSpecifyDataType, "item", string.Empty, "item"));
607 }
608 if (_dataType == JsonDataType.None || _dataType == JsonDataType.String)
609 {
612 }
613 }
614 if (_depth != 0)
615 {
616 switch (jsonNodeType)
617 {
618 case JsonNodeType.Element:
619 _endElementBuffer = true;
620 break;
621 case JsonNodeType.Object:
622 _indentLevel--;
623 if (_indent)
624 {
625 if (_nodeType == JsonNodeType.Element)
626 {
628 }
629 else
630 {
631 WriteNewLine();
632 WriteIndent();
633 }
634 }
636 if (_depth > 0 && _scopes[_depth] == JsonNodeType.Element)
637 {
638 ExitScope();
639 _endElementBuffer = true;
640 }
641 break;
642 }
643 }
644 _dataType = JsonDataType.None;
645 _nodeType = JsonNodeType.EndElement;
646 _nameState = NameState.None;
648 }
static string Format(string resourceFormat, object p1)
Definition SR.cs:118
static string JsonMustSpecifyDataType
Definition SR.cs:564
static string JsonEndElementNoOpenNodes
Definition SR.cs:560
static string JsonOpenAttributeMustBeClosedFirst
Definition SR.cs:562
Definition SR.cs:7

References System.Runtime.Serialization.Json.XmlJsonWriter._dataType, System.Runtime.Serialization.Json.XmlJsonWriter._depth, System.Runtime.Serialization.Json.XmlJsonWriter._endElementBuffer, System.Runtime.Serialization.Json.XmlJsonWriter._indent, System.Runtime.Serialization.Json.XmlJsonWriter._indentLevel, System.Runtime.Serialization.Json.XmlJsonWriter._nameState, System.Runtime.Serialization.Json.XmlJsonWriter._nodeType, System.Runtime.Serialization.Json.XmlJsonWriter._nodeWriter, System.Runtime.Serialization.Json.XmlJsonWriter._scopes, System.Runtime.Serialization.Json.XmlJsonWriter._serverTypeValue, System.Runtime.Serialization.Json.XmlJsonWriter._wroteServerTypeAttribute, System.Runtime.Serialization.Dictionary, System.Runtime.Serialization.Json.XmlJsonWriter.ExitScope(), System.SR.Format(), System.Runtime.Serialization.Json.XmlJsonWriter.HasOpenAttribute, System.Runtime.Serialization.Json.XmlJsonWriter.IsClosed, System.Runtime.Serialization.Json.XmlJsonWriter.IsWritingNameWithMapping, System.SR.JsonEndElementNoOpenNodes, System.SR.JsonMustSpecifyDataType, System.SR.JsonOpenAttributeMustBeClosedFirst, System.Runtime.Serialization.Json.XmlJsonWriter.ThrowClosed(), System.Runtime.Serialization.Json.XmlJsonWriter.WriteIndent(), System.Runtime.Serialization.Json.XmlJsonWriter.WriteJsonQuote(), System.Runtime.Serialization.Json.XmlJsonWriter.WriteNewLine(), System.Xml.XmlUTF8NodeWriter.WriteText(), System.Runtime.Serialization.Json.XmlJsonWriter.WrittenNameWithMapping, and System.Xml.XmlException.

Referenced by System.Runtime.Serialization.Json.XmlJsonWriter.WriteEndDocument(), System.Runtime.Serialization.Json.XmlJsonWriter.WriteFullEndElement(), and System.Runtime.Serialization.Json.XmlJsonWriter.WriteServerTypeAttribute().