From d6cd49cab2a1ea13e40631cb36bf9c413609d000 Mon Sep 17 00:00:00 2001 From: John Date: Wed, 20 Sep 2017 17:06:10 +0000 Subject: [PATCH] B2017-212 If the user uses the X button in Word to close the word attachment, PROMS thinks that the user wants to close out of PROMS as well. Trap for this and close only the Word tab in PROMS. Made StackToString() public for use in fixing B2017-212 --- PROMS/VEPROMS User Interface/frmVEPROMS.cs | 12 ++++++++++++ PROMS/Volian.Base.Library/vlnStackTrace.cs | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/PROMS/VEPROMS User Interface/frmVEPROMS.cs b/PROMS/VEPROMS User Interface/frmVEPROMS.cs index 2465f827..0895f3d3 100644 --- a/PROMS/VEPROMS User Interface/frmVEPROMS.cs +++ b/PROMS/VEPROMS User Interface/frmVEPROMS.cs @@ -1072,6 +1072,18 @@ namespace VEPROMS } private void frmVEPROMS_FormClosing(object sender, FormClosingEventArgs e) { + // B2017-212 If the user uses the X button in Word to close the word attachment, PROMS thinks that the user wants to close out of PROMS as well + // trap for this and close only the Word tab in PROMS + if (tc.SelectedDisplayTabItem.MyDSOTabPanel != null) + { + string stk = Volian.Base.Library.vlnStackTrace.StackToString(); + if (!stk.Contains("MouseUp") && !stk.Contains("ButtonDown") && !stk.Contains("Exception")) + { + e.Cancel = true; + tc.CloseTabItem(tc.SelectedDisplayTabItem); + return; + } + } tc.ShuttingDown = true; // This keeps PROMS from Hanging under certain circumstances foreach (DisplayTabItem dti in tc.MyBar.Items) { diff --git a/PROMS/Volian.Base.Library/vlnStackTrace.cs b/PROMS/Volian.Base.Library/vlnStackTrace.cs index d945daf9..84ce7a99 100644 --- a/PROMS/Volian.Base.Library/vlnStackTrace.cs +++ b/PROMS/Volian.Base.Library/vlnStackTrace.cs @@ -29,7 +29,7 @@ namespace Volian.Base.Library { Console.WriteLine(StackToString()); } - private static string StackToString() + public static string StackToString() { return StackToString(true); }