using System;
using System.Collections.Generic;
// The 'text' parameter will contain the text from the:
// - Current Clipboard when run by HotKey
// - History Item when run from the History Menu
// The returned string will be:
// - Placed directly on the Clipboard
// - Ignored by ClipboardFusion if it is 'null'
public static class ClipboardFusionHelper
{
public static string ProcessText(string text)
{
// Copy the selected text from the focused window
text = BFS.Clipboard.CopyText();
// Split it into separate lines
string[] stringSeparators = new string[]{"\r\n"};
string[] lines = text.Split(stringSeparators, StringSplitOptions.None);
// Clear the local pinned items
while (BFS.ClipboardFusion.GetLocalPinnedItemCount() > 0)
{
BFS.ClipboardFusion.RemoveLocalPinnedItem(0);
}
// Add the copied lines to the local pinned items
foreach (string line in lines)
{
BFS.ClipboardFusion.AddLocalPinnedText(line);
}
// Exit and leave the clipboard alone
return null;
}
}