public sealed record DesktopClipboardContent : IEquatable<DesktopClipboardContent> What one IDesktopClipboard.WriteAsync puts on the clipboard: every format set here, offered together.
Remarks
Set at least one format. Other applications pick the format they understand best, so set the formats that describe the same thing, such as a table as DesktopClipboardContent.Html and as tab-separated DesktopClipboardContent.Text. The write replaces everything on the clipboard.
DesktopClipboardContent.Text, DesktopClipboardContent.Html and DesktopClipboardContent.Rtf must not contain NUL characters, DesktopClipboardContent.Image must be a PNG file, and every entry of DesktopClipboardContent.Files must exist when the write runs; otherwise the write reports PlatformFailureCode.InvalidData or, for a missing file, PlatformFailureCode.NotFound, and the clipboard is unchanged.
Constructors
DesktopClipboardContent
public DesktopClipboardContent() No documentation.
Properties
Files
public ImmutableArray<string> Files { get; init; } Fully qualified paths of local files or directories, at most 4096; empty for none.
Remarks
File managers paste them as a copy. The paths are offered, not the files' contents: an application that pastes them reads the files itself.
Html
public string? Html { get; init; } HTML, a fragment such as <b>bold</b> or a whole document; null for none.
Remarks
Windows offers it as CF_HTML, with the fragment, or the document's body, marked as what is pasted; macOS and Linux offer the string as it is.
Image
public ReadOnlyMemory<byte> Image { get; init; } A PNG file's bytes; empty for none.
Remarks
Windows also offers the image as a device-independent bitmap for applications that read only those.
Rtf
public string? Rtf { get; init; } Rich Text Format source, starting with {\rtf1; null for none.
Remarks
RTF is a byte format: each character is written as one byte (Latin-1), and RTF's escapes, such as 荤?, carry other characters. A character above U+00FF reports PlatformFailureCode.InvalidData.
Text
public string? Text { get; init; } Unicode text; null for none.