Skip to content
Taiizor edited this page Mar 1, 2023 · 6 revisions

Board Class - Skylark.Standard.Helper Namespace

The Board class provides functions to manage a clipboard object.

Methods

Copy

Copies the given object to the clipboard.

public static void Copy(object Value)

Parameters:

  • Value: The object to copy to the clipboard.

CopyAsync

Copies the given object to the clipboard asynchronously.

public static Task CopyAsync(object Value)

Parameters:

  • Value: The object to copy to the clipboard.

Paste

Retrieves the object from the clipboard.

public static object Paste(bool Clear = false, object Back = null)

Parameters:

  • Clear (optional): If true, clears the clipboard after retrieving the object. Default is false.
  • Back (optional): The object to return if the clipboard is empty. Default is null.

PasteAsync

Retrieves the object from the clipboard asynchronously.

public static Task<object> PasteAsync(bool Clear = false, object Back = null)

Parameters:

  • Clear (optional): If true, clears the clipboard after retrieving the object. Default is false.
  • Back (optional): The object to return if the clipboard is empty. Default is null.

Example Usage:

// Copy a string to the clipboard
string myString = "Hello, world!";
Board.Copy(myString);
// Retrieve the string from the clipboard
string retrievedString = (string)Board.Paste();
Console.WriteLine(retrievedString);

Note: These functions use an object to store the clipboard content, which can hold any type of object. If you store a value type (such as an int or bool) in the clipboard, be sure to cast it back to the correct type when you retrieve it.

Clone this wiki locally