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

◆ WriteAttributes()

virtual void System.Xml.XmlWriter.WriteAttributes ( XmlReader reader,
bool defattr )
inlinevirtualinherited

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

Definition at line 211 of file XmlWriter.cs.

212 {
213 if (reader == null)
214 {
215 throw new ArgumentNullException("reader");
216 }
217 if (reader.NodeType == XmlNodeType.Element || reader.NodeType == XmlNodeType.XmlDeclaration)
218 {
219 if (reader.MoveToFirstAttribute())
220 {
221 WriteAttributes(reader, defattr);
222 reader.MoveToElement();
223 }
224 return;
225 }
226 if (reader.NodeType != XmlNodeType.Attribute)
227 {
228 throw new XmlException(System.SR.Xml_InvalidPosition, string.Empty);
229 }
230 do
231 {
232 if (!defattr && reader.IsDefaultInternal)
233 {
234 continue;
235 }
236 WriteStartAttribute(reader.Prefix, reader.LocalName, reader.NamespaceURI);
237 while (reader.ReadAttributeValue())
238 {
239 if (reader.NodeType == XmlNodeType.EntityReference)
240 {
241 WriteEntityRef(reader.Name);
242 }
243 else
244 {
245 WriteString(reader.Value);
246 }
247 }
249 }
250 while (reader.MoveToNextAttribute());
251 }
static string Xml_InvalidPosition
Definition SR.cs:318
Definition SR.cs:7
void WriteEntityRef(string name)
void WriteString(string? text)
virtual void WriteAttributes(XmlReader reader, bool defattr)
Definition XmlWriter.cs:211
void WriteStartAttribute(string localName, string? ns)
Definition XmlWriter.cs:67

References 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.WriteAttributes(), System.Xml.XmlWriter.WriteEndAttribute(), System.Xml.XmlWriter.WriteEntityRef(), System.Xml.XmlWriter.WriteStartAttribute(), System.Xml.XmlWriter.WriteString(), System.SR.Xml_InvalidPosition, and System.Xml.XmlException.

Referenced by System.Xml.XmlDictionaryAsyncCheckWriter.WriteAttributes(), System.Xml.XmlDictionaryWriter.XmlWrappedWriter.WriteAttributes(), System.Xml.XmlAsyncCheckWriter.WriteAttributes(), System.Xml.XmlWriter.WriteAttributes(), and System.Xml.XmlWriter.WriteNode().