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

◆ WriteNodeAsync() [2/2]

virtual async Task System.Xml.XmlWriter.WriteNodeAsync ( XPathNavigator navigator,
bool defattr )
inlinevirtualinherited

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

Definition at line 916 of file XmlWriter.cs.

917 {
918 if (navigator == null)
919 {
920 throw new ArgumentNullException("navigator");
921 }
922 int iLevel = 0;
923 navigator = navigator.Clone();
924 while (true)
925 {
926 bool mayHaveChildren = false;
927 switch (navigator.NodeType)
928 {
929 case XPathNodeType.Element:
931 if (navigator.MoveToFirstAttribute())
932 {
933 do
934 {
935 IXmlSchemaInfo schemaInfo = navigator.SchemaInfo;
936 if (defattr || schemaInfo == null || !schemaInfo.IsDefault)
937 {
941 }
942 }
943 while (navigator.MoveToNextAttribute());
944 navigator.MoveToParent();
945 }
946 if (navigator.MoveToFirstNamespace(XPathNamespaceScope.Local))
947 {
949 navigator.MoveToParent();
950 }
951 mayHaveChildren = true;
952 break;
953 case XPathNodeType.Text:
955 break;
956 case XPathNodeType.SignificantWhitespace:
957 case XPathNodeType.Whitespace:
959 break;
960 case XPathNodeType.Root:
961 mayHaveChildren = true;
962 break;
963 case XPathNodeType.Comment:
965 break;
966 case XPathNodeType.ProcessingInstruction:
968 break;
969 }
970 if (mayHaveChildren)
971 {
972 if (navigator.MoveToFirstChild())
973 {
974 iLevel++;
975 continue;
976 }
977 if (navigator.NodeType == XPathNodeType.Element)
978 {
979 if (!navigator.IsEmptyElement)
980 {
982 }
983 else
984 {
986 }
987 }
988 }
989 while (true)
990 {
991 if (iLevel == 0)
992 {
993 return;
994 }
995 if (navigator.MoveToNext())
996 {
997 break;
998 }
999 iLevel--;
1000 navigator.MoveToParent();
1001 if (navigator.NodeType == XPathNodeType.Element)
1002 {
1004 }
1005 }
1006 }
1007 }
new ConfiguredTaskAwaitable< TResult > ConfigureAwait(bool continueOnCapturedContext)
Definition Task.cs:226
virtual Task WriteProcessingInstructionAsync(string name, string? text)
Definition XmlWriter.cs:648
virtual Task WriteWhitespaceAsync(string? ws)
Definition XmlWriter.cs:663
virtual Task WriteStringAsync(string? text)
Definition XmlWriter.cs:668
virtual Task WriteCommentAsync(string? text)
Definition XmlWriter.cs:643
virtual Task WriteFullEndElementAsync()
Definition XmlWriter.cs:606
virtual Task WriteEndElementAsync()
Definition XmlWriter.cs:601
virtual Task WriteStartElementAsync(string? prefix, string localName, string? ns)
Definition XmlWriter.cs:596
virtual Task WriteStartAttributeAsync(string? prefix, string localName, string? ns)
Definition XmlWriter.cs:628
async Task WriteLocalNamespacesAsync(XPathNavigator nsNav)
virtual Task WriteEndAttributeAsync()
Definition XmlWriter.cs:633

References System.Threading.Tasks.Task< TResult >.ConfigureAwait(), System.Xml.Dictionary, System.Xml.Schema.IXmlSchemaInfo.IsDefault, System.Xml.XmlWriter.WriteCommentAsync(), System.Xml.XmlWriter.WriteEndAttributeAsync(), System.Xml.XmlWriter.WriteEndElementAsync(), System.Xml.XmlWriter.WriteFullEndElementAsync(), System.Xml.XmlWriter.WriteLocalNamespacesAsync(), System.Xml.XmlWriter.WriteProcessingInstructionAsync(), System.Xml.XmlWriter.WriteStartAttributeAsync(), System.Xml.XmlWriter.WriteStartElementAsync(), System.Xml.XmlWriter.WriteStringAsync(), and System.Xml.XmlWriter.WriteWhitespaceAsync().