Interface IClipboard
Provides a platform agnostic way to interact with the clipboard of the operating system the app is running on.
Namespace: DevToys.Api
Assembly: DevToys.Api.dll
Syntax
public interface IClipboard
Methods
GetClipboardDataAsync()
Retrieves data from the system clipboard.
Declaration
Task<object?> GetClipboardDataAsync()
Returns
Type | Description |
---|---|
Task<object> | The data currently stored in the system clipboard. |
Remarks
This method may try to access to the UI thread.
GetClipboardFilesAsync()
Retrieves files from the system clipboard.
Declaration
Task<FileInfo[]?> GetClipboardFilesAsync()
Returns
Type | Description |
---|---|
Task<FileInfo[]> | The files currently stored in the system clipboard, or null if nothing is present. |
Remarks
This method may try to access to the UI thread.
GetClipboardImageAsync()
Retrieves the image from the system clipboard.
Declaration
Task<Image<Rgba32>?> GetClipboardImageAsync()
Returns
Type | Description |
---|---|
Task<Image<Rgba32>> | The image currently stored in the system clipboard, or null if nothing is present. |
Remarks
This method may try to access to the UI thread.
GetClipboardTextAsync()
Retrieves text from the system clipboard.
Declaration
Task<string?> GetClipboardTextAsync()
Returns
Type | Description |
---|---|
Task<string> | The text currently stored in the system clipboard, or null if nothing is present. |
Remarks
This method may try to access to the UI thread.
SetClipboardFilesAsync(FileInfo[]?)
Sets files to the system clipboard.
Declaration
Task SetClipboardFilesAsync(FileInfo[]? filePaths)
Parameters
Type | Name | Description |
---|---|---|
FileInfo[] | filePaths | The list of files to be stored in the system clipboard. |
Returns
Type | Description |
---|---|
Task |
Remarks
This method may try to access to the UI thread.
SetClipboardImageAsync(Image?)
Sets image to the system clipboard.
Declaration
Task SetClipboardImageAsync(Image? image)
Parameters
Type | Name | Description |
---|---|---|
Image | image | The image to be stored in the system clipboard. |
Returns
Type | Description |
---|---|
Task |
Remarks
This method may try to access to the UI thread.
SetClipboardTextAsync(string?)
Sets text to the system clipboard.
Declaration
Task SetClipboardTextAsync(string? data)
Parameters
Type | Name | Description |
---|---|---|
string | data | The data to be stored in the system clipboard. |
Returns
Type | Description |
---|---|
Task |
Remarks
This method may try to access to the UI thread.