Add exception handling on Clipboard.SetText, fall back to SetDataObject

This commit is contained in:
baldurk
2015-07-06 18:15:49 +02:00
parent 069e2047ae
commit 6afbe8c92b
5 changed files with 100 additions and 11 deletions
+17 -2
View File
@@ -670,8 +670,23 @@ namespace renderdocui.Windows
}
text += Environment.NewLine;
if (text.Length > 0)
Clipboard.SetText(text);
try
{
if (text.Length > 0)
Clipboard.SetText(text);
}
catch (System.Exception)
{
try
{
if (text.Length > 0)
Clipboard.SetDataObject(text);
}
catch (System.Exception)
{
// give up!
}
}
}
}
}