Skip to main content
Version: 0.9.0 (next)

GuiPanelId struct

A GUI panel's 16-byte UUID, derived from the panel's common name by GuiPanelControl.GetOrCreate. Compared by content; default(GuiPanelId) equals GuiPanelId.Default.

Namespace: Quaternar.Qaros · Assembly: Quaternar.Qaros.dll

public readonly struct GuiPanelId : IEquatable<GuiPanelId>

Implements: IEquatable<GuiPanelId>

Properties​

Default​

The all-zero id, meaning "none".

public static GuiPanelId Default { get; }

Value: GuiPanelId

Methods​

MemberDescription
Unique()
Parse(string)Parses the UUID text GuiPanelId.ToString produces.
TryParse(string, out GuiPanelId)Parses the UUID text GuiPanelId.ToString produces; false, with a default id, when it is not one.
ToByteArray()A copy of the 16 bytes.
AsSpan()
TryCopyTo(Span<byte>)Copies the 16 bytes; false, copying nothing, when destination is shorter.
ToString()The 36-character UUID text, which GuiPanelId.Parse accepts back.
Equals(GuiPanelId)Indicates whether the current object is equal to another object of the same type.
Equals(object?)Indicates whether this instance and a specified object are equal.
GetHashCode()Returns the hash code for this instance.

Unique​

public static GuiPanelId Unique()

Returns: GuiPanelId

Parse​

Parses the UUID text GuiPanelId.ToString produces.

public static GuiPanelId Parse(string text)

Parameters

NameTypeDescription
textstring

Returns: GuiPanelId

Exceptions

ExceptionCondition
FormatExceptiontext is not a UUID string.

TryParse​

Parses the UUID text GuiPanelId.ToString produces; false, with a default id, when it is not one.

public static bool TryParse(string text, out GuiPanelId id)

Parameters

NameTypeDescription
textstring
idGuiPanelId

Returns: bool

ToByteArray​

A copy of the 16 bytes.

public byte[] ToByteArray()

Returns: byte[]

AsSpan​

public ReadOnlySpan<byte> AsSpan()

Returns: ReadOnlySpan<byte>

TryCopyTo​

Copies the 16 bytes; false, copying nothing, when destination is shorter.

public bool TryCopyTo(Span<byte> destination)

Parameters

NameTypeDescription
destinationSpan<byte>

Returns: bool

ToString​

The 36-character UUID text, which GuiPanelId.Parse accepts back.

public override string ToString()

Returns: string

Equals(GuiPanelId)​

Indicates whether the current object is equal to another object of the same type.

public bool Equals(GuiPanelId other)

Parameters

NameTypeDescription
otherGuiPanelIdAn object to compare with this object.

Returns: bool — true if the current object is equal to the other parameter; otherwise, false.

Equals(object?)​

Indicates whether this instance and a specified object are equal.

public override bool Equals(object? obj)

Parameters

NameTypeDescription
objobjectThe object to compare with the current instance.

Returns: bool — true if obj and this instance are the same type and represent the same value; otherwise, false.

GetHashCode​

Returns the hash code for this instance.

public override int GetHashCode()

Returns: int — A 32-bit signed integer that is the hash code for this instance.

Operators​

operator ==​

public static bool operator ==(GuiPanelId left, GuiPanelId right)

Parameters

NameTypeDescription
leftGuiPanelId
rightGuiPanelId

Returns: bool

operator !=​

public static bool operator !=(GuiPanelId left, GuiPanelId right)

Parameters

NameTypeDescription
leftGuiPanelId
rightGuiPanelId

Returns: bool