using System;
using System.Collections.Generic;
using System.Windows.Forms;
using System.IO;
// 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 select item
BFS.Clipboard.Copy();
//if the clipboard contains a file, return its filename
if((Clipboard.ContainsFileDropList()) && (Clipboard.GetFileDropList().Count > 0))
{
//Check if multiple files are selected i.e. more than one)
if(Clipboard.GetFileDropList().Count > 1)
{
string FileNames = null;
//Copy all the file names in the selection to FileNames
for(int fileCount = 0; fileCount < Clipboard.GetFileDropList().Count; fileCount++)
{
FileNames += Path.GetFileName(Clipboard.GetFileDropList()[fileCount]) + Environment.NewLine ;
}
return FileNames;
}
return Path.GetFileName(Clipboard.GetFileDropList()[0]);
}
return text;
}
}