StringOrBlob Struct

The data of a representation of a ClipboardItem: a string or a StringOrBlob.Blob (the result of a ClipboardItemData promise).

public readonly struct StringOrBlob : IEquatable<StringOrBlob>
Implements

Properties

NameDescription
BlobGets the value when it is a blob, or null.
StringValueGets the value when it is a string, or null.
ValueGets the value: a String or a Blob.

Gets the value when it is a blob, or null.

public Blob? Blob { get; }

Property value

Blob?

StringValue

ClipboardItem.cs

Gets the value when it is a string, or null.

public string? StringValue { get; }

Property value

string?

Gets the value: a String or a Blob.

public object Value { get; }

Property value

object

Methods

NameDescription
Equals(StringOrBlob)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.
FromBlob(Blob)Creates the union from a blob.
FromString(string)Creates the union from a string.
GetHashCode()Returns the hash code for this instance.
ToString()Returns the fully qualified type name of this instance.

Equals overloads

Equals(StringOrBlob)

ClipboardItem.cs

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

public bool Equals(StringOrBlob other)
Parameters
other StringOrBlob
An object to compare with this object.
Returns

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

Equals(object?)

ClipboardItem.cs

Indicates whether this instance and a specified object are equal.

public override bool Equals(object? obj)
Parameters
obj object?
The 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.

FromBlob(Blob)

ClipboardItem.cs

Creates the union from a blob.

public static StringOrBlob FromBlob(Blob value)

Parameters

value Blob

Returns

StringOrBlob

FromString(string)

ClipboardItem.cs

Creates the union from a string.

public static StringOrBlob FromString(string value)

Parameters

value string

Returns

StringOrBlob

GetHashCode()

ClipboardItem.cs

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.

Returns the fully qualified type name of this instance.

public override string? ToString()

Returns

string? The fully qualified type name.

Operators

NameDescription
operator ==(StringOrBlob, StringOrBlob)Returns whether the two unions hold the same value.
implicit operator StringOrBlob(Blob)Converts a blob to the union.
implicit operator StringOrBlob(string)Converts a string to the union.
operator !=(StringOrBlob, StringOrBlob)Returns whether the two unions hold different values.

operator ==(StringOrBlob, StringOrBlob)

ClipboardItem.cs

Returns whether the two unions hold the same value.

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

Parameters

left StringOrBlob
right StringOrBlob

Returns

bool

op_Implicit overloads

implicit operator StringOrBlob(Blob)

ClipboardItem.cs

Converts a blob to the union.

public static implicit operator StringOrBlob(Blob value)
Parameters
value Blob
Returns

StringOrBlob

implicit operator StringOrBlob(string)

ClipboardItem.cs

Converts a string to the union.

public static implicit operator StringOrBlob(string value)
Parameters
value string
Returns

StringOrBlob

operator !=(StringOrBlob, StringOrBlob)

ClipboardItem.cs

Returns whether the two unions hold different values.

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

Parameters

left StringOrBlob
right StringOrBlob

Returns

bool