I need to use the clipboard for my own purposes. But I want to restore the previous clipboard state after using it.
I tried to do something like this:
var tmp = Clipboard.GetDataObject();
// My work with clipboard
Clipboard.SetDataObject(tmp);
But the clipboard is empty after this. What did I miss?