From 9ccdaef3540274e1a53d970438d59e0c89caab8b Mon Sep 17 00:00:00 2001 From: mschill Date: Tue, 10 Mar 2026 07:02:50 -0400 Subject: [PATCH] B2026-029 Update the Clipboard Copying in PROMS StepTabRibbon to retry --- PROMS/Volian.Controls.Library/StepTabRibbon.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/PROMS/Volian.Controls.Library/StepTabRibbon.cs b/PROMS/Volian.Controls.Library/StepTabRibbon.cs index 482e4c1a..06f8474e 100644 --- a/PROMS/Volian.Controls.Library/StepTabRibbon.cs +++ b/PROMS/Volian.Controls.Library/StepTabRibbon.cs @@ -1672,9 +1672,11 @@ namespace Volian.Controls.Library //if can't, log it and use old method of scoping clipboard to PROMS life try { - Clipboard.SetDataObject(myDO, true); // this saves the cleaned up information to the Windows clipboard + // noticed that sometimes the clipboard will get stuck - so set it to retry twice + // and if it fails, scope the clipboard to within PROMS + Clipboard.SetDataObject(myDO, true, 2, 100); // this saves the cleaned up information to the Windows clipboard } - catch (Exception ex) + catch (System.Runtime.InteropServices.ExternalException ex) { _MyLog.Warn($"Error Setting Clipboard Object to Persist beyond PROMS. Clipboard will be scoped to PROMS. Error:{ex.Message}"); Clipboard.SetDataObject(myDO); // this saves the cleaned up information to the Windows clipboard