mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-05 17:40:39 +00:00
Add exception handling on Clipboard.SetText, fall back to SetDataObject
This commit is contained in:
@@ -275,8 +275,23 @@ namespace renderdocui.Windows
|
||||
text += string.Format("{0,-5} {1}" + Environment.NewLine, n[0].ToString(), n[1].ToString());
|
||||
}
|
||||
|
||||
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!
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -292,8 +307,23 @@ namespace renderdocui.Windows
|
||||
text += n.ToString() + 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!
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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!
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1694,8 +1694,23 @@ namespace renderdocui.Windows.PipelineState
|
||||
}
|
||||
}
|
||||
|
||||
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!
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1712,8 +1712,23 @@ namespace renderdocui.Windows.PipelineState
|
||||
}
|
||||
}
|
||||
|
||||
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!
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2293,7 +2293,21 @@ namespace renderdocui.Windows
|
||||
|
||||
if (e.KeyCode == Keys.C && e.Control)
|
||||
{
|
||||
Clipboard.SetText(texStatusDim.Text + " | " + statusLabel.Text);
|
||||
try
|
||||
{
|
||||
Clipboard.SetText(texStatusDim.Text + " | " + statusLabel.Text);
|
||||
}
|
||||
catch (System.Exception)
|
||||
{
|
||||
try
|
||||
{
|
||||
Clipboard.SetDataObject(texStatusDim.Text + " | " + statusLabel.Text);
|
||||
}
|
||||
catch (System.Exception)
|
||||
{
|
||||
// give up!
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!m_Core.LogLoaded) return;
|
||||
|
||||
Reference in New Issue
Block a user