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

◆ WriteStartAttribute() [3/3]

override void System.Xml.XmlBinaryNodeWriter.WriteStartAttribute ( string prefix,
XmlDictionaryString localName )
inline

Definition at line 338 of file XmlBinaryNodeWriter.cs.

339 {
340 if (!TryGetKey(localName, out var key))
341 {
342 WriteStartAttribute(prefix, localName.Value);
343 return;
344 }
345 if (prefix.Length == 0)
346 {
347 WriteNode(XmlBinaryNodeType.ShortDictionaryAttribute);
348 WriteDictionaryString(localName, key);
349 }
350 else
351 {
352 char c = prefix[0];
353 if (prefix.Length == 1 && c >= 'a' && c <= 'z')
354 {
355 WritePrefixNode(XmlBinaryNodeType.PrefixDictionaryAttributeA, c - 97);
356 WriteDictionaryString(localName, key);
357 }
358 else
359 {
360 WriteNode(XmlBinaryNodeType.DictionaryAttribute);
362 WriteDictionaryString(localName, key);
363 }
364 }
365 _inAttribute = true;
366 _wroteAttributeValue = false;
367 }
void WritePrefixNode(XmlBinaryNodeType nodeType, int ch)
override void WriteStartAttribute(string prefix, string localName)
bool TryGetKey(XmlDictionaryString s, out int key)
void WriteDictionaryString(XmlDictionaryString s, int key)
void WriteNode(XmlBinaryNodeType nodeType)

References System.Xml.XmlBinaryNodeWriter._inAttribute, System.Xml.XmlBinaryNodeWriter._wroteAttributeValue, System.Xml.Dictionary, System.key, System.prefix, System.Xml.XmlBinaryNodeWriter.TryGetKey(), System.Xml.XmlDictionaryString.Value, System.Xml.XmlBinaryNodeWriter.WriteDictionaryString(), System.Xml.XmlBinaryNodeWriter.WriteName(), System.Xml.XmlBinaryNodeWriter.WriteNode(), System.Xml.XmlBinaryNodeWriter.WritePrefixNode(), and System.Xml.XmlBinaryNodeWriter.WriteStartAttribute().