C2017-031 Extend Copy / Paste Replace Functionality for Enhanced Background Steps
This commit is contained in:
@@ -1944,7 +1944,8 @@ namespace Volian.Controls.Library
|
||||
sia.IdentifyChildren(highlight);
|
||||
}
|
||||
}
|
||||
if (MyBeforeEditItems != null)
|
||||
// C2017-031: Support for paste/replace an enhanced step: don't identify/copy before items, i.e. notes/cautions
|
||||
if (MyBeforeEditItems != null && !MyItemInfo.IsEnhancedStep)
|
||||
{
|
||||
foreach (EditItem sib in MyBeforeEditItems)
|
||||
{
|
||||
|
BIN
PROMS/Volian.Controls.Library/RTBItem.designer.cs
generated
BIN
PROMS/Volian.Controls.Library/RTBItem.designer.cs
generated
Binary file not shown.
@@ -1231,7 +1231,7 @@ namespace Volian.Controls.Library
|
||||
}
|
||||
public ItemSelectedChangedEventArgs(EditItem myEditItem)
|
||||
{
|
||||
_MyItemInfo = myEditItem.MyItemInfo;
|
||||
_MyItemInfo = myEditItem?.MyItemInfo;
|
||||
_MyEditItem = myEditItem;
|
||||
}
|
||||
}
|
||||
|
@@ -485,6 +485,8 @@ namespace Volian.Controls.Library
|
||||
public void RefreshDisplay(bool activeMode)
|
||||
{
|
||||
if (IsExperimenting) return;
|
||||
if (IsDisposed) return;
|
||||
|
||||
ActiveMode = activeMode;
|
||||
OnAdjustTableWidth(this, new StepRTBTableWidthEventArgs(true));
|
||||
//Volian.Base.Library.HWndCounter.GetWindowHandlesForCurrentProcess(this.Handle, "RefreshDisplay 2");
|
||||
|
@@ -1750,7 +1750,7 @@ namespace Volian.Controls.Library
|
||||
// note in follow if statements, 'setting' == false when in enhanced document:
|
||||
if (setting && MyItemInfo.IsStep && (eds == null || eds.Count == 0)) // this step is in enhanced, but not linked // B2018-112 and is allowed to edit
|
||||
allowDel = true; // allow delete if not linked
|
||||
btnCpyStp.Enabled = setting;
|
||||
btnCpyStp.Enabled = MyUserInfo.IsAllowedToEdit(Mydvi); // C2017-031: Support for paste/replace an enhanced step
|
||||
//B20170-158 Allow a Unlinked Step to be pasted before or after a linked step.
|
||||
StepTabPanel tmp = Parent as StepTabPanel;
|
||||
//B2020-058: crash on null reference
|
||||
@@ -1801,7 +1801,8 @@ namespace Volian.Controls.Library
|
||||
btnPasteAfter.Enabled = btnCMPasteAfter.Enabled = enable;
|
||||
//B20170-158 Don't allow a step to replace a linked step
|
||||
//B2017-180: The fix for B2017-158 also needed the 'HasEnhancedLinkedStep' to check if the copied step is a source step
|
||||
btnPasteReplace.Enabled = btnCMPasteReplace.Enabled = enable && !MyItemInfo.IsEnhancedStep && !MyItemInfo.HasEnhancedLinkedStep;
|
||||
// C2017-031: Support for paste/replace an enhanced step, enable button
|
||||
btnPasteReplace.Enabled = btnCMPasteReplace.Enabled = enable && ((!MyItemInfo.IsEnhancedStep && !MyItemInfo.HasEnhancedLinkedStep) || (MyItemInfo.IsEnhancedStep));
|
||||
}
|
||||
private void SetPasteButtonEnabled()
|
||||
{
|
||||
@@ -4110,9 +4111,19 @@ namespace Volian.Controls.Library
|
||||
// F2021-009 display a message if pasting step will results in more sub-step levels than are defined in the format
|
||||
ItemInfo.PasteStepIsWithinDefinedSubStepLevels(tmp.MyDisplayTabControl.MyCopyStep.ItemID, MyItemInfo, true);
|
||||
EditItem oldEditItem = MyEditItem;
|
||||
// C2017-031: Support for paste/replace an enhanced step, if pasting an enhanced, remove its EditItem from the 'cache'. A new EditItem gets created during paste.
|
||||
if (MyEditItem != null && MyEditItem.MyItemInfo.IsEnhancedStep) MyEditItem.MyStepPanel._LookupEditItems.Remove(MyEditItem.MyItemInfo.ItemID);
|
||||
MyEditItem = MyEditItem.PasteReplace(tmp.MyDisplayTabControl.MyCopyStep.ItemID);
|
||||
if (MyEditItem == null) oldEditItem.IdentifyMe(false); // B2017-179 if null then we didn't do the replace but did position to the first transition that needs resolved
|
||||
if (MyEditItem != null && MyEditItem.MyItemInfo.ItemID != oldEditItem.MyItemInfo.ItemID) oldEditItem.Dispose();
|
||||
// C2017-031: Support for paste/replace an enhanced step, add Dispose of old EditItem if enhanced
|
||||
if (MyEditItem != null && ((MyEditItem.MyItemInfo.ItemID != oldEditItem.MyItemInfo.ItemID) || MyEditItem.MyItemInfo.IsEnhancedStep))
|
||||
oldEditItem.Dispose();
|
||||
// C2017-031: Support for paste/replace an enhanced step, refresh ItemInfo's in user interface caches.
|
||||
if (MyEditItem.MyItemInfo.IsEnhancedStep)
|
||||
{
|
||||
MyEditItem.MyItemInfo = ItemInfo.Get(MyEditItem.MyItemInfo.ItemID);
|
||||
tmp.MyStepPanel.SelectedItemInfo = ItemInfo.Get(MyEditItem.MyItemInfo.ItemID);
|
||||
}
|
||||
}
|
||||
|
||||
private void btnPdfCreate_Click(object sender, EventArgs e)
|
||||
|
Reference in New Issue
Block a user