Table of Contents

Class ClipboardItem

Namespace
BootstrapBlazor.Components
Assembly
BootstrapBlazor.dll

Represents an item on the clipboard with associated data and metadata.

public class ClipboardItem
Inheritance
ClipboardItem
Inherited Members
Extension Methods

Constructors

ClipboardItem()

public ClipboardItem()

Properties

Data

Gets or sets the raw data of the clipboard item.

public byte[]? Data { get; set; }

Property Value

byte[]

Remarks

The data is stored as a byte array, allowing for any binary or text content to be represented. The interpretation of the data depends on the MIME type.

MimeType

Gets or sets the Internet Media Type (MIME type) of the content stored in the clipboard item.

public string? MimeType { get; set; }

Property Value

string

Remarks

The MIME type is used to specify the nature and format of the data stored in the clipboard. It can be used to determine how the data should be handled or presented.

Text

Retrieves a text representation of the clipboard item if the MIME type indicates text content.

public string Text { get; }

Property Value

string

A string containing the text representation of the data if the MIME type starts with "text/", otherwise an empty string.

Remarks

This property checks the MIME type of the clipboard item and, if it's a text type, converts the byte array to a UTF-8 encoded string. If the data is not text or the MIME type is not specified, it returns an empty string.