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

◆ WriteAttributesAsync()

virtual async Task System.Xml.XmlWriter.WriteAttributesAsync ( XmlReader reader,
bool defattr )
inlinevirtualinherited

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

Definition at line 737 of file XmlWriter.cs.

738 {
739 if (reader == null)
740 {
741 throw new ArgumentNullException("reader");
742 }
743 if (reader.NodeType == XmlNodeType.Element || reader.NodeType == XmlNodeType.XmlDeclaration)
744 {
745 if (reader.MoveToFirstAttribute())
746 {
748 reader.MoveToElement();
749 }
750 return;
751 }
752 if (reader.NodeType != XmlNodeType.Attribute)
753 {
754 throw new XmlException(System.SR.Xml_InvalidPosition, string.Empty);
755 }
756 do
757 {
758 if (!defattr && reader.IsDefaultInternal)
759 {
760 continue;
761 }
762 await WriteStartAttributeAsync(reader.Prefix, reader.LocalName, reader.NamespaceURI).ConfigureAwait(continueOnCapturedContext: false);
763 while (reader.ReadAttributeValue())
764 {
765 if (reader.NodeType == XmlNodeType.EntityReference)
766 {
768 }
769 else
770 {
772 }
773 }
775 }
776 while (reader.MoveToNextAttribute());
777 }
static string Xml_InvalidPosition
Definition SR.cs:318
Definition SR.cs:7
new ConfiguredTaskAwaitable< TResult > ConfigureAwait(bool continueOnCapturedContext)
Definition Task.cs:226
virtual async Task WriteAttributesAsync(XmlReader reader, bool defattr)
Definition XmlWriter.cs:737
virtual Task WriteEntityRefAsync(string name)
Definition XmlWriter.cs:653
virtual Task WriteStringAsync(string? text)
Definition XmlWriter.cs:668
virtual Task WriteStartAttributeAsync(string? prefix, string localName, string? ns)
Definition XmlWriter.cs:628
virtual Task WriteEndAttributeAsync()
Definition XmlWriter.cs:633

References System.Threading.Tasks.Task< TResult >.ConfigureAwait(), System.Xml.Dictionary, System.Xml.XmlReader.IsDefaultInternal, System.Xml.XmlReader.LocalName, System.Xml.XmlReader.MoveToElement(), System.Xml.XmlReader.MoveToFirstAttribute(), System.Xml.XmlReader.MoveToNextAttribute(), System.Xml.XmlReader.Name, System.Xml.XmlReader.NamespaceURI, System.Xml.XmlReader.NodeType, System.Xml.XmlReader.Prefix, System.Xml.XmlReader.ReadAttributeValue(), System.Xml.XmlReader.Value, System.Xml.XmlWriter.WriteAttributesAsync(), System.Xml.XmlWriter.WriteEndAttributeAsync(), System.Xml.XmlWriter.WriteEntityRefAsync(), System.Xml.XmlWriter.WriteStartAttributeAsync(), System.Xml.XmlWriter.WriteStringAsync(), System.SR.Xml_InvalidPosition, and System.Xml.XmlException.

Referenced by System.Xml.XmlDictionaryAsyncCheckWriter.WriteAttributesAsync(), System.Xml.XmlAsyncCheckWriter.WriteAttributesAsync(), System.Xml.XmlWriter.WriteAttributesAsync(), System.Xml.XmlWriter.WriteNodeAsync_CallAsyncReader(), and System.Xml.XmlWriter.WriteNodeAsync_CallSyncReader().