From 14bb3fcf3b5a85dcaf22593f0fa188ea62ea3020 Mon Sep 17 00:00:00 2001 From: John Date: Wed, 29 Jun 2016 19:32:06 +0000 Subject: [PATCH] =?UTF-8?q?Using=20statement=20added=20so=20the=20ContentI?= =?UTF-8?q?tems[0].MyItem=20do=20not=20say=20in=20cache=20(caused=20issues?= =?UTF-8?q?=20with=20paste/replace=20step)=20B2016-153=20When=20using=20Co?= =?UTF-8?q?pyStep=20Paste,=20don=E2=80=99t=20convert=20a=20transition=20to?= =?UTF-8?q?=20text=20if=20that=20transition=20has=20procedure=20number=20i?= =?UTF-8?q?nformation=20=20B2016-148=20Fixed=20=20issue=20so=20?= =?UTF-8?q?that=20Copy=20Step=20Paste=20options=20menu=20pops=20up=20=20B2?= =?UTF-8?q?016-148=20Made=20SetButtonAndMenuEnabling=20a=20public=20functi?= =?UTF-8?q?on=20to=20fix=20=20issue=20so=20that=20Copy=20Step?= =?UTF-8?q?=20Paste=20options=20menu=20pops=20up=20=20B2016-148?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../VEPROMS.CSLA.Library/Extension/ContentExt.cs | 10 ++++++++-- PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs | 10 ++++++++-- .../Extension/ItemInsertExt.cs | 4 +++- PROMS/Volian.Controls.Library/StepRTB.cs | 16 +++++++++------- PROMS/Volian.Controls.Library/StepTabRibbon.cs | 2 +- 5 files changed, 29 insertions(+), 13 deletions(-) diff --git a/PROMS/VEPROMS.CSLA.Library/Extension/ContentExt.cs b/PROMS/VEPROMS.CSLA.Library/Extension/ContentExt.cs index 041b1e72..467e6176 100644 --- a/PROMS/VEPROMS.CSLA.Library/Extension/ContentExt.cs +++ b/PROMS/VEPROMS.CSLA.Library/Extension/ContentExt.cs @@ -73,7 +73,10 @@ namespace VEPROMS.CSLA.Library { string rv = ConvertTransitionToText(tran, newvalue); //Text = Text.Substring(0, myIndex - 14) + gg + Text.Substring(myIndex + myLength); - Annotation.MakeAnnotation(this.ContentItems[0].MyItem, AnnotationType.GetByName("Verification Required"), "", string.Format("Transition ({0}) converted to text", ItemInfo.ConvertToDisplayText(gg)), null); + using (Item myitem = this.ContentItems[0].MyItem) // so that myitem does not stay in cache B2016-153 + { + Annotation.MakeAnnotation(myitem, AnnotationType.GetByName("Verification Required"), "", string.Format("Transition ({0}) converted to text", ItemInfo.ConvertToDisplayText(gg)), null); + } if(tran != null) Transition.Delete(tran.TransitionID); break; @@ -473,7 +476,10 @@ namespace VEPROMS.CSLA.Library if (value == "?") { retval = this.ConvertROToText(rousg, value, rotype, origROFstInfo); - Annotation.MakeAnnotation(this.ContentItems[0].MyItem, AnnotationType.GetByName("Verification Required"), "", string.Format("RO value ({0}) converted to text", ItemInfo.ConvertToDisplayText(retval)), null); + using (Item myitem = this.ContentItems[0].MyItem) // so that myitem does not stay in cache B2016-153 + { + Annotation.MakeAnnotation(myitem, AnnotationType.GetByName("Verification Required"), "", string.Format("RO value ({0}) converted to text", ItemInfo.ConvertToDisplayText(retval)), null); + } RoUsage.Delete(rousg.ROUsageID); return retval; } diff --git a/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs b/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs index efcb3748..e5002603 100644 --- a/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs +++ b/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs @@ -749,7 +749,10 @@ namespace VEPROMS.CSLA.Library if (roval == "?") { oldText = content.ConvertROToText(rousage, roval, roch.type, rofstinfo); - Annotation.MakeAnnotation(content.ContentItems[0].MyItem, AnnotationType.GetByName("Verification Required"), "", string.Format("RO value ({0}) converted to text", ItemInfo.ConvertToDisplayText(oldText)), null); + using (Item myitem = content.ContentItems[0].MyItem) // so that myitem does not stay in cache B2016-153 + { + Annotation.MakeAnnotation(myitem, AnnotationType.GetByName("Verification Required"), "", string.Format("RO value ({0}) converted to text", ItemInfo.ConvertToDisplayText(oldText)), null); + } } else content.FixContentText(rousage, roval, roch.type, rofstinfo); @@ -787,7 +790,10 @@ namespace VEPROMS.CSLA.Library if (roval == "?") { oldText = content.ConvertROToText(rousage, roval, roch.type, rofstinfo); - Annotation.MakeAnnotation(content.ContentItems[0].MyItem, AnnotationType.GetByName("Verification Required"), "", string.Format("RO value ({0}) converted to text", ItemInfo.ConvertToDisplayText(oldText)), null); + using (Item myitem = content.ContentItems[0].MyItem) // so that myitem does not stay in cache B2016-153 + { + Annotation.MakeAnnotation(myitem, AnnotationType.GetByName("Verification Required"), "", string.Format("RO value ({0}) converted to text", ItemInfo.ConvertToDisplayText(oldText)), null); + } } else content.FixContentText(rousage, roval, roch.type, rofstinfo); diff --git a/PROMS/VEPROMS.CSLA.Library/Extension/ItemInsertExt.cs b/PROMS/VEPROMS.CSLA.Library/Extension/ItemInsertExt.cs index 92585357..8f40b3ce 100644 --- a/PROMS/VEPROMS.CSLA.Library/Extension/ItemInsertExt.cs +++ b/PROMS/VEPROMS.CSLA.Library/Extension/ItemInsertExt.cs @@ -803,7 +803,9 @@ namespace VEPROMS.CSLA.Library } if (!forceConvertToText) { - if (tran.MyContent.ContentItems[0].MyDocVersion.VersionID != tran.MyItemToID.MyDocVersion.VersionID) + // bug fix B2016-148 added check if transition had procedure information in which case we do not want to convert it to text + if (tran.MyContent.ContentItems[0].MyDocVersion.VersionID != tran.MyItemToID.MyDocVersion.VersionID && + !tran.MyContent.ContentItems[0].ActiveFormat.PlantFormat.FormatData.TransData.TransTypeList[tran.TranType].TransMenu.Contains("Proc")) forceConvertToText = true; } content.FixTransitionText(tran, forceConvertToText); diff --git a/PROMS/Volian.Controls.Library/StepRTB.cs b/PROMS/Volian.Controls.Library/StepRTB.cs index 30b3be6b..5596670f 100644 --- a/PROMS/Volian.Controls.Library/StepRTB.cs +++ b/PROMS/Volian.Controls.Library/StepRTB.cs @@ -2272,13 +2272,15 @@ namespace Volian.Controls.Library ItemInfo myCopyStep = (this.Parent.Parent.Parent as StepTabPanel).MyDisplayTabControl.MyCopyStep; if (myCopyStep != null) { - if (this.MyItemInfo.IsSection && myCopyStep.IsSection) - OnSetMenu(this, new StepRTBMenuEventArgs("StepPaste")); - if (this.MyItemInfo.IsStep && myCopyStep.IsStep) - { - if ((this.MyItemInfo.IsHigh && myCopyStep.IsHigh) || (!this.MyItemInfo.IsHigh && !myCopyStep.IsHigh)) - OnSetMenu(this, new StepRTBMenuEventArgs("StepPaste")); - } + // commented out as part of bug fix B2016-148 to fix the not popping up the paste options + //if (this.MyItemInfo.IsSection && myCopyStep.IsSection) + // OnSetMenu(this, new StepRTBMenuEventArgs("StepPaste")); + //if (this.MyItemInfo.IsStep && myCopyStep.IsStep) + //{ + // if ((this.MyItemInfo.IsHigh && myCopyStep.IsHigh) || (!this.MyItemInfo.IsHigh && !myCopyStep.IsHigh)) + // OnSetMenu(this, new StepRTBMenuEventArgs("StepPaste")); + //} + OnSetMenu(this, new StepRTBMenuEventArgs("StepPaste")); } //if (!OnCheckClipboard(this, new EventArgs())) return; // check if 'clipboard' contains a step. //OnSetMenu(this, new StepRTBMenuEventArgs("StepPaste")); diff --git a/PROMS/Volian.Controls.Library/StepTabRibbon.cs b/PROMS/Volian.Controls.Library/StepTabRibbon.cs index 8c9f9d7d..cddca296 100644 --- a/PROMS/Volian.Controls.Library/StepTabRibbon.cs +++ b/PROMS/Volian.Controls.Library/StepTabRibbon.cs @@ -1140,7 +1140,7 @@ namespace Volian.Controls.Library if (MyItemInfo.ActiveFormat.PlantFormat.FormatData.PrintData.SpecialCaseCalvertAlarm) btnInsCaut.Enabled = btnInsNote.Enabled = btnCMInsCaution.Enabled = btnCMInsNote.Enabled = setting && !MyItemInfo.IsInCalvertConditionResponse; } - private void SetButtonAndMenuEnabling(bool docontextmenus) + public void SetButtonAndMenuEnabling(bool docontextmenus) { if (_MyStepRTB == null) return; if (_MyStepRTB.FieldToEdit != E_FieldToEdit.StepText)