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

◆ WriteXmlnsAttribute() [1/3]

void System.Xml.XmlCanonicalWriter.WriteXmlnsAttribute ( byte[] prefixBuffer,
int prefixOffset,
int prefixLength,
byte[] nsBuffer,
int nsOffset,
int nsLength )
inline

Definition at line 521 of file XmlCanonicalWriter.cs.

522 {
523 if (prefixBuffer == null)
524 {
525 throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentNullException("prefixBuffer"));
526 }
527 if (prefixOffset < 0)
528 {
529 throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("prefixOffset", System.SR.ValueMustBeNonNegative));
530 }
531 if (prefixOffset > prefixBuffer.Length)
532 {
533 throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("prefixOffset", System.SR.Format(System.SR.OffsetExceedsBufferSize, prefixBuffer.Length)));
534 }
535 if (prefixLength < 0)
536 {
537 throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("prefixLength", System.SR.ValueMustBeNonNegative));
538 }
539 if (prefixLength > prefixBuffer.Length - prefixOffset)
540 {
541 throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("prefixLength", System.SR.Format(System.SR.SizeExceedsRemainingBufferSpace, prefixBuffer.Length - prefixOffset)));
542 }
543 if (nsBuffer == null)
544 {
545 throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentNullException("nsBuffer"));
546 }
547 if (nsOffset < 0)
548 {
549 throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("nsOffset", System.SR.ValueMustBeNonNegative));
550 }
551 if (nsOffset > nsBuffer.Length)
552 {
553 throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("nsOffset", System.SR.Format(System.SR.OffsetExceedsBufferSize, nsBuffer.Length)));
554 }
555 if (nsLength < 0)
556 {
557 throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("nsLength", System.SR.ValueMustBeNonNegative));
558 }
559 if (nsLength > nsBuffer.Length - nsOffset)
560 {
561 throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("nsLength", System.SR.Format(System.SR.SizeExceedsRemainingBufferSpace, nsBuffer.Length - nsOffset)));
562 }
564 if (prefixLength > int.MaxValue - nsLength)
565 {
566 throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("nsLength", System.SR.Format(System.SR.CombinedPrefixNSLength, int.MaxValue)));
567 }
568 EnsureXmlnsBuffer(prefixLength + nsLength);
571 xmlnsAttribute.prefixLength = prefixLength;
572 Buffer.BlockCopy(prefixBuffer, prefixOffset, _xmlnsBuffer, _xmlnsOffset, prefixLength);
573 _xmlnsOffset += prefixLength;
575 xmlnsAttribute.nsLength = nsLength;
576 Buffer.BlockCopy(nsBuffer, nsOffset, _xmlnsBuffer, _xmlnsOffset, nsLength);
577 _xmlnsOffset += nsLength;
580 }
static string Format(string resourceFormat, object p1)
Definition SR.cs:118
static string ValueMustBeNonNegative
Definition SR.cs:296
static string CombinedPrefixNSLength
Definition SR.cs:702
static string SizeExceedsRemainingBufferSpace
Definition SR.cs:324
static string OffsetExceedsBufferSize
Definition SR.cs:322
Definition SR.cs:7
void EnsureXmlnsBuffer(int byteCount)
void AddXmlnsAttribute(ref XmlnsAttribute xmlnsAttribute)

References System.Xml.XmlCanonicalWriter._xmlnsBuffer, System.Xml.XmlCanonicalWriter._xmlnsOffset, System.Xml.XmlCanonicalWriter.AddXmlnsAttribute(), System.Buffer.BlockCopy(), System.SR.CombinedPrefixNSLength, System.Xml.Dictionary, System.Xml.XmlCanonicalWriter.EnsureXmlnsBuffer(), System.SR.Format(), System.SR.OffsetExceedsBufferSize, System.SR.SizeExceedsRemainingBufferSpace, System.Runtime.Serialization.DiagnosticUtility.ExceptionUtility.ThrowHelperError(), System.Xml.XmlCanonicalWriter.ThrowIfClosed(), and System.SR.ValueMustBeNonNegative.