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

◆ WriteStartElement() [1/2]

void System.Xml.XmlCanonicalWriter.WriteStartElement ( byte[] prefixBuffer,
int prefixOffset,
int prefixLength,
byte[] localNameBuffer,
int localNameOffset,
int localNameLength )
inline

Definition at line 328 of file XmlCanonicalWriter.cs.

329 {
330 if (prefixBuffer == null)
331 {
332 throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentNullException("prefixBuffer"));
333 }
334 if (prefixOffset < 0)
335 {
336 throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("prefixOffset", System.SR.ValueMustBeNonNegative));
337 }
338 if (prefixOffset > prefixBuffer.Length)
339 {
340 throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("prefixOffset", System.SR.Format(System.SR.OffsetExceedsBufferSize, prefixBuffer.Length)));
341 }
342 if (prefixLength < 0)
343 {
344 throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("prefixLength", System.SR.ValueMustBeNonNegative));
345 }
346 if (prefixLength > prefixBuffer.Length - prefixOffset)
347 {
348 throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("prefixLength", System.SR.Format(System.SR.SizeExceedsRemainingBufferSpace, prefixBuffer.Length - prefixOffset)));
349 }
350 if (localNameBuffer == null)
351 {
352 throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentNullException("localNameBuffer"));
353 }
354 if (localNameOffset < 0)
355 {
356 throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("localNameOffset", System.SR.ValueMustBeNonNegative));
357 }
358 if (localNameOffset > localNameBuffer.Length)
359 {
360 throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("localNameOffset", System.SR.Format(System.SR.OffsetExceedsBufferSize, localNameBuffer.Length)));
361 }
362 if (localNameLength < 0)
363 {
364 throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("localNameLength", System.SR.ValueMustBeNonNegative));
365 }
366 if (localNameLength > localNameBuffer.Length - localNameOffset)
367 {
368 throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("localNameLength", System.SR.Format(System.SR.SizeExceedsRemainingBufferSpace, localNameBuffer.Length - localNameOffset)));
369 }
371 bool flag = _depth == 0;
372 StartElement();
374 _element.prefixLength = prefixLength;
375 _element.localNameOffset = _element.prefixOffset + prefixLength + ((prefixLength != 0) ? 1 : 0);
376 _element.localNameLength = localNameLength;
377 _elementWriter.WriteStartElement(prefixBuffer, prefixOffset, prefixLength, localNameBuffer, localNameOffset, localNameLength);
378 if (!flag || _inclusivePrefixes == null)
379 {
380 return;
381 }
382 for (int i = 0; i < _scopes[0].xmlnsAttributeCount; i++)
383 {
385 {
388 }
389 }
390 }
static string Format(string resourceFormat, object p1)
Definition SR.cs:118
static string ValueMustBeNonNegative
Definition SR.cs:296
static string SizeExceedsRemainingBufferSpace
Definition SR.cs:324
static string OffsetExceedsBufferSize
Definition SR.cs:322
Definition SR.cs:7
void AddXmlnsAttribute(ref XmlnsAttribute xmlnsAttribute)
bool IsInclusivePrefix(ref XmlnsAttribute xmlnsAttribute)
override void WriteStartElement(string prefix, string localName)

References System.Xml.XmlCanonicalWriter._depth, System.Xml.XmlCanonicalWriter._elementWriter, System.Xml.XmlCanonicalWriter._inclusivePrefixes, System.Xml.XmlCanonicalWriter._scopes, System.Xml.XmlCanonicalWriter._xmlnsAttributes, System.Xml.XmlCanonicalWriter.AddXmlnsAttribute(), System.Xml.Dictionary, System.SR.Format(), System.Xml.XmlCanonicalWriter.IsInclusivePrefix(), System.SR.OffsetExceedsBufferSize, System.SR.SizeExceedsRemainingBufferSpace, System.Xml.XmlCanonicalWriter.StartElement(), System.Runtime.Serialization.DiagnosticUtility.ExceptionUtility.ThrowHelperError(), System.Xml.XmlCanonicalWriter.ThrowIfClosed(), System.SR.ValueMustBeNonNegative, System.Xml.XmlUTF8NodeWriter.WriteStartElement(), and System.Xml.XmlCanonicalWriter.Scope.xmlnsAttributeCount.