Table of Contents

Class ClipboardHelper

Namespace
SunamoClipboard
Assembly
SunamoClipboard.dll

Provides helper methods for working with the system clipboard.

public static class ClipboardHelper
Inheritance
ClipboardHelper
Inherited Members

Methods

AppendText(string)

Appends text to the existing clipboard content with two newlines as separator.

public static void AppendText(string textToAppend)

Parameters

textToAppend string

The text to append to the clipboard.

GetLines()

Gets lines from the clipboard by splitting on newline characters.

public static List<string> GetLines()

Returns

List<string>

A list of lines from the clipboard text.

GetLinesAllWhitespaces()

Gets lines from the clipboard by splitting on all whitespace characters.

public static List<string> GetLinesAllWhitespaces()

Returns

List<string>

A list of strings split by whitespace characters.

GetText()

Gets text from the clipboard.

public static string GetText()

Returns

string

The text from the clipboard, or an empty string if the clipboard is empty or null.

SetDictionary<T1, T2>(Dictionary<T1, T2>, string)

Sets a dictionary to the clipboard, with each key-value pair on a separate line.

public static void SetDictionary<T1, T2>(Dictionary<T1, T2> dictionary, string delimiter) where T1 : notnull where T2 : notnull

Parameters

dictionary Dictionary<T1, T2>

The dictionary to set to the clipboard.

delimiter string

The delimiter to use between keys and values.

Type Parameters

T1

The type of the dictionary keys.

T2

The type of the dictionary values.

SetLines(List<string>)

Sets multiple lines to the clipboard, joined by newline characters.

public static void SetLines(List<string> list)

Parameters

list List<string>

The list of lines to set to the clipboard.

SetText(string)

Sets text to the clipboard. Cannot be empty or only whitespace - if the text is empty, the clipboard content will remain unchanged.

public static void SetText(string text)

Parameters

text string

The text to set to the clipboard.

SetText(StringBuilder)

Sets text from a StringBuilder to the clipboard.

public static void SetText(StringBuilder stringBuilder)

Parameters

stringBuilder StringBuilder

The StringBuilder containing the text to set to the clipboard.