From 877a7dfa7b3bb691461aa5bdd54b8ca5692db2d9 Mon Sep 17 00:00:00 2001 From: John Date: Wed, 24 Mar 2021 19:53:06 +0000 Subject: [PATCH] =?UTF-8?q?F2021-009=20PROMS=20Express=20=E2=80=93=20Added?= =?UTF-8?q?=20checks=20and=20warning=20messages=20when=20Pasting=20a=20Cop?= =?UTF-8?q?yStep=20from=20the=20procedure=20tree=20when=20the=20paste=20wi?= =?UTF-8?q?ll=20result=20in=20a=20step=20with=20sub-step=20levels=20that?= =?UTF-8?q?=20exceed=20the=20defined=20sub-step=20levels=20in=20the=20form?= =?UTF-8?q?at.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- PROMS/Volian.Controls.Library/vlnTreeView.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/PROMS/Volian.Controls.Library/vlnTreeView.cs b/PROMS/Volian.Controls.Library/vlnTreeView.cs index 13afe44d..1bcf981d 100644 --- a/PROMS/Volian.Controls.Library/vlnTreeView.cs +++ b/PROMS/Volian.Controls.Library/vlnTreeView.cs @@ -2154,9 +2154,7 @@ namespace Volian.Controls.Library else if (p.IndexOf("After") > -1) PasteBeforeOrAfter(MenuSelections.StepAfter, tn, iiClipboard.ItemID); else if (p.IndexOf("Replace") > -1) - { PasteReplace(tn, iiClipboard.ItemID); - } else // paste as child PasteAsChild(tn, iiClipboard.ItemID); this.Cursor = Cursors.Default; @@ -2227,6 +2225,9 @@ namespace Volian.Controls.Library // If parent step is open in step editor, the 'OnPasteItemInfo' event will cause // the item to be pasted in the step editor and the tree. ItemInfo newItemInfo = null; + // F2021-009 display a message if pasting step will results in more sub-step levels than are defined in the format + if (!ii.IsProcedure) + ItemInfo.PasteStepIsWithinDefinedSubStepLevels(copyStartID, ii, false); if (ii.IsProcedure || !OnPasteItemInfo(this, new vlnTreeItemInfoPasteEventArgs(ii, copyStartID, pasteOpt, ii.MyContent.Type))) { // The parent step was not open in the step editor, just paste step (in data) and add treenode. @@ -2251,6 +2252,8 @@ namespace Volian.Controls.Library VETreeNode prevtn = (VETreeNode) tn.PrevNode; VETreeNode partn = (VETreeNode) tn.Parent; ItemInfo ii = tn.VEObject as ItemInfo; + // F2021-009 display a message if pasting step will results in more sub-step levels than are defined in the format + ItemInfo.PasteStepIsWithinDefinedSubStepLevels(copyStartID, ii, true); if (!OnPasteItemInfo(this, new vlnTreeItemInfoPasteEventArgs(ii, copyStartID, ItemInfo.EAddpingPart.Replace, ii.MyContent.Type))) { // first, check if a changeid is required.