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 IDataObject:
IDataObject content = Clipboard.GetDataObject();
string[] formats = content.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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With