Issue 832: Improve ZedGraph handing of clipboard exceptions

issues
Status:resolved
Assigned To:Brendan MacLean
Type:Defect
Area:Skyline
Priority:3
Milestone:21.2
Opened:2021-08-08 by Brendan MacLean
Changed:2021-10-09 by Nick Shulman
Resolved:2021-10-09 by Nick Shulman
Resolution:Fixed
Closed:
2021-08-08 Brendan MacLean
Title»Improve ZedGraph handing of clipboard exceptions
Assigned To»Nick Shulman
Type»Defect
Area»Skyline
Priority»3
Milestone»21.2
We have seen a number of these exceptions posted to the website:

System.Runtime.InteropServices.ExternalException (0x800401D0): Requested Clipboard operation did not succeed.
   at System.Windows.Forms.Clipboard.ThrowIfFailed(Int32 hr)
   at System.Windows.Forms.Clipboard.SetDataObject(Object data, Boolean copy, Int32 retryTimes, Int32 retryDelay)
   at ZedGraph.ZedGraphControl.Copy(Boolean isShowMessage)
   at System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e)
   at System.Windows.Forms.ToolStripMenuItem.OnClick(EventArgs e)
   at System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e)
   at System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e)
   at System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea)
   at System.Windows.Forms.ToolStripDropDown.OnMouseUp(MouseEventArgs mea)
   at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ToolStrip.WndProc(Message& m)
   at System.Windows.Forms.ToolStripDropDown.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

We should add exception handling to ZedGraph, as I did for Skyline clipboard operations. We should consider having our ZedGraph use ClipboardEx so that we can test it without using the system clipboard. Though, this may be more trouble than it is worth.

2021-10-09 Nick Shulman
resolve as Fixed
Statusopen»resolved
Assigned ToNick Shulman»Brendan MacLean
This was fixed in pull request #1751.
https://github.com/ProteoWizard/pwiz/pull/1751