RClipboard class
public static class RClipboardCopy and paste of text, tables, files and images.
Methods
static Task SetText(Control owner, string text)Puts a text in the clipboard.
static Task<string> GetText(Control owner)The text in the clipboard (null if there is none).
static Task SetTable(Control owner, IEnumerable<string[]> rows)Puts rows of cells in the clipboard as a spreadsheet copies them: tabs between the cells, a line for each row.
static Task<List<string[]>> GetTable(Control owner)The rows of cells in the clipboard (empty if there is no text).
static string Tsv(IEnumerable<string[]> rows)Rows of cells as text with tabs and line breaks. Tabs and breaks inside a cell become spaces: a cell never splits.
static List<string[]> Cells(string text)The rows of a text copied from a spreadsheet: lines split at the tabs. The empty last line that sheets add is dropped; null gives no rows.
static Task<List<string>> GetFiles(Control owner)The files in the clipboard, as paths (empty if none, or none on the disk).
static Task SetFiles(Control owner, IEnumerable<string> paths)Puts files in the clipboard, to paste in a folder of the system; the paths that do not exist are skipped.
static Task SetImage(Control owner, Bitmap image)Puts an image in the clipboard (a chart: RImage.Render).
static Task<Bitmap> GetImage(Control owner)The image in the clipboard (null if there is none).
static Task Clear(Control owner)Empties the clipboard.