Back to API Reference
Struct

ClipboardItem

sealed

A single (format, payload) pair on the clipboard. Multi-format writes pass a list of items in one atomic SetItems call; the OS stores them as a single clipboard write whose richest available format is selected by the consumer on paste.

Remarks

Data holds the format's bytes. For text formats the bytes are UTF-8 (so a consumer can Encoding.UTF8.GetString(item.Data)); for binary formats (P2 image, RTFD) it is the format's native byte representation.
public ClipboardFormat Format{ get }

Format identifier for Data.

public byte[] Data{ get }

Payload bytes. Never; may be empty.

public string Text{ get }

Payload decoded as UTF-8 text. Empty string for an empty payload.

[ctor]public ClipboardItem()
[ctor]public ClipboardItem()

Convenience constructor that UTF-8-encodes a string into the payload. Use for any text-style format (PlainText, Html, Url).