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

◆ WriteXmlnsAttribute() [3/3]

void System.Xml.XmlCanonicalWriter.WriteXmlnsAttribute ( string prefix,
string ns )
inline

Definition at line 488 of file XmlCanonicalWriter.cs.

489 {
490 if (prefix == null)
491 {
493 }
494 if (ns == null)
495 {
497 }
499 if (prefix.Length > int.MaxValue - ns.Length)
500 {
501 throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("ns", System.SR.Format(System.SR.CombinedPrefixNSLength, 715827882)));
502 }
503 int num = prefix.Length + ns.Length;
504 if (num > 715827882)
505 {
506 throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("ns", System.SR.Format(System.SR.CombinedPrefixNSLength, 715827882)));
507 }
508 EnsureXmlnsBuffer(num * 3);
512 _xmlnsOffset += xmlnsAttribute.prefixLength;
514 xmlnsAttribute.nsLength = Encoding.UTF8.GetBytes(ns, 0, ns.Length, _xmlnsBuffer, _xmlnsOffset);
515 _xmlnsOffset += xmlnsAttribute.nsLength;
518 }
static string Format(string resourceFormat, object p1)
Definition SR.cs:118
static string CombinedPrefixNSLength
Definition SR.cs:702
Definition SR.cs:7
static Encoding UTF8
Definition Encoding.cs:526
void EnsureXmlnsBuffer(int byteCount)
void AddXmlnsAttribute(ref XmlnsAttribute xmlnsAttribute)

References System.Xml.XmlCanonicalWriter._xmlnsBuffer, System.Xml.XmlCanonicalWriter._xmlnsOffset, System.Xml.XmlCanonicalWriter.AddXmlnsAttribute(), System.SR.CombinedPrefixNSLength, System.Xml.Dictionary, System.Xml.XmlCanonicalWriter.EnsureXmlnsBuffer(), System.SR.Format(), System.prefix, System.Runtime.Serialization.DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull(), System.Runtime.Serialization.DiagnosticUtility.ExceptionUtility.ThrowHelperError(), System.Xml.XmlCanonicalWriter.ThrowIfClosed(), and System.Text.Encoding.UTF8.

Referenced by System.Xml.XmlCanonicalWriter.SetOutput(), System.Xml.XmlCanonicalWriter.WriteEndStartElement(), System.Xml.XmlSigningNodeWriter.WriteXmlnsAttribute(), System.Xml.XmlSigningNodeWriter.WriteXmlnsAttribute(), and System.Xml.XmlSigningNodeWriter.WriteXmlnsAttribute().