With WPF, I can get data in a given format from the clipboard:
object test = Clipboard.GetGata (format);
How can I enumerate the list of formats present in the clipboard?
With WPF, I can get data in a given format from the clipboard:
object test = Clipboard.GetGata (format);
How can I enumerate the list of formats present in the clipboard?
Have a look at the IDataObject
class.
IDataObject content = Clipboard.GetDataObject();
string [] formats = clipContent.GetFormats();
List<String> dataFormats = typeof(DataFormats).GetFields(BindingFlags.Public | BindingFlags.Static)
.Select(f => f.Name)
.ToList();
this should give you all the Fields from DataFormats
List<String> dataFormatsInClipboard =
dataFormats.Where( df => Clipboard.ContainsData(df) )
.ToList();
will give you just the ones that match the clipboard.