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

◆ TryGetGuid() [1/2]

unsafe bool System.Xml.UniqueId.TryGetGuid ( byte[] buffer,
int offset )
inline

Definition at line 319 of file UniqueId.cs.

320 {
321 if (!IsGuid)
322 {
323 return false;
324 }
325 if (buffer == null)
326 {
327 throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentNullException("buffer"));
328 }
329 if (offset < 0)
330 {
331 throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("offset", System.SR.ValueMustBeNonNegative));
332 }
333 if (offset > buffer.Length)
334 {
335 throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("offset", System.SR.Format(System.SR.OffsetExceedsBufferSize, buffer.Length)));
336 }
337 if (16 > buffer.Length - offset)
338 {
339 throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("buffer", System.SR.Format(System.SR.XmlArrayTooSmallOutput, 16)));
340 }
341 fixed (byte* ptr = &buffer[offset])
342 {
345 }
346 return true;
347 }
static string Format(string resourceFormat, object p1)
Definition SR.cs:118
static string ValueMustBeNonNegative
Definition SR.cs:296
static string XmlArrayTooSmallOutput
Definition SR.cs:328
static string OffsetExceedsBufferSize
Definition SR.cs:322
Definition SR.cs:7
unsafe void UnsafeSetInt64(long value, byte *pb)
Definition UniqueId.cs:416

References System.Xml.UniqueId._idHigh, System.Xml.UniqueId._idLow, System.buffer, System.Xml.Dictionary, System.SR.Format(), System.Xml.UniqueId.IsGuid, System.offset, System.SR.OffsetExceedsBufferSize, System.Runtime.Serialization.DiagnosticUtility.ExceptionUtility.ThrowHelperError(), System.Xml.UniqueId.UnsafeSetInt64(), System.SR.ValueMustBeNonNegative, and System.SR.XmlArrayTooSmallOutput.