Share via


UniqueId.TryGetGuid Method (array<Byte[], Int32)

Microsoft Silverlight will reach end of support after October 2021. Learn more.

Tries to get the value of the UniqueId as a Guid and store it in the given byte array at the specified offset.

Namespace:  System.Xml
Assembly:  System.Runtime.Serialization (in System.Runtime.Serialization.dll)

Syntax

'Declaration
<SecuritySafeCriticalAttribute> _
Public Function TryGetGuid ( _
    buffer As Byte(), _
    offset As Integer _
) As Boolean
[SecuritySafeCriticalAttribute]
public bool TryGetGuid(
    byte[] buffer,
    int offset
)

Parameters

  • offset
    Type: System.Int32
    Position in the byte array to start inserting the Guid value.

Return Value

Type: System.Boolean
true if the value stored in this instance of UniqueId is a Guid; otherwise, false.

Exceptions

Exception Condition
ArgumentNullException

buffer is nulla null reference (Nothing in Visual Basic).

ArgumentOutOfRangeException

offset less than zero or greater than the length of the array.

ArgumentException

buffer and offset provide less than 16 valid bytes.

Remarks

This method is unsafe.

Version Information

Silverlight

Supported in: 5, 4, 3

Silverlight for Windows Phone

Supported in: Windows Phone OS 7.1, Windows Phone OS 7.0

XNA Framework

Supported in: Windows Phone OS 7.0

Platforms

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.