F2021-009 PROMS Express – Added checks and warning messages when Pasting a CopyStep from the procedure tree when the paste will result in a step with sub-step levels that exceed the defined sub-step levels in the format.

This commit is contained in:
John Jenko 2021-03-24 19:53:06 +00:00
parent 627d12e5cf
commit 877a7dfa7b

View File

@ -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.