using System;
using System.Collections.Generic;
public static class ClipboardFusionHelper
{
public static string ProcessText(string text)
{
// get the number of items in the history
int count = BFS.ClipboardFusion.GetHistoryItemCount();
if (count <= 0)
{
// show an error and return if there are no items
BFS.Dialog.ShowMessageError("Sorry, there are no items currently in your History.");
return "";
}
// build the history selection dialog by getting each item in the history
List<string> items = new List<string>();
for (int a=0; a<count; a++)
items.Add(BFS.ClipboardFusion.GetHistoryText(a));
// show the history selection dialog
text = BFS.Dialog.GetUserInputList("Select a History Item", items.ToArray());
// if the user cancels, return without doing anything
if (text.Length == 0)
return "";
// generate the return text using the value the user selected (in this case it's an HTML link)
text = "<a href=\"" + text + "\" target=\"_blank\"><b>XXXX</b></a>";
// paste the generated text into the currently active window
BFS.Clipboard.PasteText(text);
return text;
}
}