ClipboardItem Class
The data of a clipboard item (https://w3c.github.io/clipboard-apis/#clipboarditem): representations of the same data in different MIME types. An item created by navigator.clipboard.read() reads its data from the system clipboard when ClipboardItem.GetType is called, and fails when the clipboard changed since.
public sealed class ClipboardItemConstructors
| Name | Description |
|---|---|
| ClipboardItem(IEnumerable<KeyValuePair<string, StringOrBlob>>, ClipboardItemOptions?) | Creates a clipboard item from data available synchronously. |
| ClipboardItem(IEnumerable<KeyValuePair<string, Task<StringOrBlob>>>, ClipboardItemOptions?) | https://w3c.github.io/clipboard-apis/#dom-clipboarditem-clipboarditem |
ClipboardItem overloads
ClipboardItem(IEnumerable<KeyValuePair<string, StringOrBlob>>, ClipboardItemOptions?)
ClipboardItem.csCreates a clipboard item from data available synchronously.
public ClipboardItem(IEnumerable<KeyValuePair<string, StringOrBlob>> items, ClipboardItemOptions? options = null)Parameters
ClipboardItem(IEnumerable<KeyValuePair<string, Task<StringOrBlob>>>, ClipboardItemOptions?)
ClipboardItem.cshttps://w3c.github.io/clipboard-apis/#dom-clipboarditem-clipboarditem
public ClipboardItem(IEnumerable<KeyValuePair<string, Task<StringOrBlob>>> items, ClipboardItemOptions? options = null)Parameters
Exceptions
TypeErrorExceptionitemsis empty, a type is not a valid MIME type, or two types are the same MIME type.
See also
Properties
| Name | Description |
|---|---|
| PresentationStyle | https://w3c.github.io/clipboard-apis/#dom-clipboarditem-presentationstyle |
| Types | Gets the MIME types of the representations (https://w3c.github.io/clipboard-apis/#dom-clipboarditem-types); the web custom formats have the web prefix. |
PresentationStyle
ClipboardItem.cshttps://w3c.github.io/clipboard-apis/#dom-clipboarditem-presentationstyle
public PresentationStyle PresentationStyle { get; }Types
ClipboardItem.csGets the MIME types of the representations (https://w3c.github.io/clipboard-apis/#dom-clipboarditem-types); the web custom formats have the web prefix.
public IReadOnlyList<string> Types { get; }Property value
See also
Methods
| Name | Description |
|---|---|
| GetType(string) | Returns the data of the representation of a type as a blob (https://w3c.github.io/clipboard-apis/#dom-clipboarditem-gettype). The task fails with a NotFoundError DomException when there is no such representation, or an InvalidStateError when the item was read from the system clipboard and the clipboard changed since. |
| Supports(string) | Whether the type is a mandatory or an optional data type (https://w3c.github.io/clipboard-apis/#dom-clipboarditem-supports). |
GetType(string)
ClipboardItem.csReturns the data of the representation of a type as a blob (https://w3c.github.io/clipboard-apis/#dom-clipboarditem-gettype). The task fails with a NotFoundError DomException when there is no such representation, or an InvalidStateError when the item was read from the system clipboard and the clipboard changed since.
Supports(string)
ClipboardItem.csWhether the type is a mandatory or an optional data type (https://w3c.github.io/clipboard-apis/#dom-clipboarditem-supports).