Compare commits
No commits in common. "4b35f73bbfd3103654d2d1113248b7f35cb2e71c" and "f4706eb1268283f8869dd4ac47f9744088507fe1" have entirely different histories.
4b35f73bbf
...
f4706eb126
@ -1309,8 +1309,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
else if (addType == EAddpingPart.Replace) // what about user interface for enhanced pasted steps?
|
else if (addType == EAddpingPart.Replace) // what about user interface for enhanced pasted steps?
|
||||||
{
|
{
|
||||||
ItemInfo enhReplaceItem = ItemInfo.Get(edSource.ItemID);
|
ItemInfo enhReplaceItem = ItemInfo.Get(edSource.ItemID);
|
||||||
TreeNode trn = null;
|
newEnhancedItemInfo = Item.PasteReplace(enhReplaceItem, tmpCopyEnhancedID, chgid);
|
||||||
newEnhancedItemInfo = Item.PasteReplace(enhReplaceItem, tmpCopyEnhancedID, chgid, trn);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// update the config data for the new enhanced item (procedure, section or step) to point back to the correct source
|
// update the config data for the new enhanced item (procedure, section or step) to point back to the correct source
|
||||||
@ -2498,16 +2497,13 @@ namespace VEPROMS.CSLA.Library
|
|||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
#region PasteReplace
|
#region PasteReplace
|
||||||
|
public static ItemInfo PasteReplace(ItemInfo itemInfo, int copyStartID, string chgid)
|
||||||
|
|
||||||
|
|
||||||
public static ItemInfo PasteReplace(ItemInfo itemInfo, int copyStartID, string chgid, TreeNode treeNodeReplace)
|
|
||||||
{
|
{
|
||||||
bool tmp= false;
|
bool tmp= false;
|
||||||
return PasteReplace(itemInfo, copyStartID, chgid, treeNodeReplace, ref tmp);
|
return PasteReplace(itemInfo, copyStartID, chgid, ref tmp);
|
||||||
}
|
}
|
||||||
// B2017-179 return a bool (firstTrans) if we could not replace the step but the user wants to position to the first transition that needs resolved
|
// B2017-179 return a bool (firstTrans) if we could not replace the step but the user wants to position to the first transition that needs resolved
|
||||||
public static ItemInfo PasteReplace(ItemInfo itemInfo, int copyStartID, string chgid, TreeNode treeNodeReplace, ref bool firstTrans)
|
public static ItemInfo PasteReplace(ItemInfo itemInfo, int copyStartID, string chgid, ref bool firstTrans)
|
||||||
{
|
{
|
||||||
firstTrans = false;
|
firstTrans = false;
|
||||||
if (!CanDeleteObject())
|
if (!CanDeleteObject())
|
||||||
@ -2564,14 +2560,7 @@ namespace VEPROMS.CSLA.Library
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
//Create tree node for copied procedure when no other procedures exist in the folder
|
newItemInfo.MyParent.OnNewChild(new ItemInfoInsertEventArgs(newItemInfo, ItemInfo.EAddpingPart.Child));
|
||||||
VETreeNode vtn = treeNodeReplace as VETreeNode;
|
|
||||||
DocVersionInfo dvi = vtn.VEObject as DocVersionInfo;
|
|
||||||
|
|
||||||
ItemInfo newProc = dvi.PasteChild(copyStartID);
|
|
||||||
VETreeNode tn1 = new VETreeNode(newProc);
|
|
||||||
treeNodeReplace.Nodes.Add(tn1); // add tree node to end of list.
|
|
||||||
treeNodeReplace = tn1;
|
|
||||||
}
|
}
|
||||||
return newItemInfo;
|
return newItemInfo;
|
||||||
}
|
}
|
||||||
|
@ -688,14 +688,8 @@ namespace Volian.Controls.Library
|
|||||||
edtitm.PasteSiblingAfter(copyStartID);
|
edtitm.PasteSiblingAfter(copyStartID);
|
||||||
break;
|
break;
|
||||||
case ItemInfo.EAddpingPart.Replace:
|
case ItemInfo.EAddpingPart.Replace:
|
||||||
|
|
||||||
EditItem ei = edtitm.PasteReplace(copyStartID);
|
EditItem ei = edtitm.PasteReplace(copyStartID);
|
||||||
if (ei == null)
|
if (ei == null) return false; //B2017-179 PasteReplace will return null if was aborted
|
||||||
{
|
|
||||||
CloseTabItem(_MyDisplayTabItems["Item - " + myItemInfo.ItemID.ToString()]); //Grab itemID and set to close open tab.
|
|
||||||
return false; //B2017-179 PasteReplace will return null if was aborted
|
|
||||||
}
|
|
||||||
|
|
||||||
if (ei.MyItemInfo.ItemID != edtitm.MyItemInfo.ItemID)
|
if (ei.MyItemInfo.ItemID != edtitm.MyItemInfo.ItemID)
|
||||||
{
|
{
|
||||||
edtitm.Dispose();
|
edtitm.Dispose();
|
||||||
|
@ -1825,7 +1825,6 @@ namespace Volian.Controls.Library
|
|||||||
EditItem newFocus = null;
|
EditItem newFocus = null;
|
||||||
EditItem nextEditItem = MyNextEditItem;
|
EditItem nextEditItem = MyNextEditItem;
|
||||||
EditItem prevEditItem = MyPreviousEditItem;
|
EditItem prevEditItem = MyPreviousEditItem;
|
||||||
if (MyStepPanel?.SelectedEditItem?.ActiveParent == null) return null; //Was causing an error when active parent was null and the replaced proc was opened in the editor.
|
|
||||||
EditItem parentEditItem = ActiveParent;
|
EditItem parentEditItem = ActiveParent;
|
||||||
|
|
||||||
StepConfig savOrigPasteConfig = MyItemInfo.MyConfig as StepConfig;
|
StepConfig savOrigPasteConfig = MyItemInfo.MyConfig as StepConfig;
|
||||||
@ -1836,8 +1835,7 @@ namespace Volian.Controls.Library
|
|||||||
bool gotoFirstTrans = false;
|
bool gotoFirstTrans = false;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
TreeNode treeNodeReplace = null;
|
newItemInfo = Item.PasteReplace(MyItemInfo, copyStartID, GetChangeId(MyItemInfo), ref gotoFirstTrans);
|
||||||
newItemInfo = Item.PasteReplace(MyItemInfo, copyStartID, GetChangeId(MyItemInfo), treeNodeReplace, ref gotoFirstTrans);
|
|
||||||
if (gotoFirstTrans) //B2017-179 could not replace step, we are positioning onto the first transition that needs resolved
|
if (gotoFirstTrans) //B2017-179 could not replace step, we are positioning onto the first transition that needs resolved
|
||||||
{
|
{
|
||||||
MyStepPanel.MyStepTabPanel.MyDisplayTabControl.OpenItem(newItemInfo);
|
MyStepPanel.MyStepTabPanel.MyDisplayTabControl.OpenItem(newItemInfo);
|
||||||
|
@ -2018,6 +2018,7 @@ namespace Volian.Controls.Library
|
|||||||
// lots of paste options:
|
// lots of paste options:
|
||||||
case "Paste Procedure":
|
case "Paste Procedure":
|
||||||
case "Paste Procedure Before":
|
case "Paste Procedure Before":
|
||||||
|
case "Replace Existing Procedure":
|
||||||
case "Paste Procedure After":
|
case "Paste Procedure After":
|
||||||
case "Paste Section":
|
case "Paste Section":
|
||||||
case "Paste Section Before":
|
case "Paste Section Before":
|
||||||
@ -2030,18 +2031,6 @@ namespace Volian.Controls.Library
|
|||||||
case "Paste Subsection":
|
case "Paste Subsection":
|
||||||
tv_NodePaste(mi.Text);
|
tv_NodePaste(mi.Text);
|
||||||
break;
|
break;
|
||||||
case "Replace Existing Procedure":
|
|
||||||
DialogResult ovewriteEx = FlexibleMessageBox.Show("This will overwrite the selected procedure with then one you copied, would you like to overwrite it?\r\n\r\nSelecting 'Cancel' will cancel the paste action.", "Overwrite the procedure?", MessageBoxButtons.OKCancel, MessageBoxIcon.Question);// == DialogResult.Yes;
|
|
||||||
|
|
||||||
if (ovewriteEx == DialogResult.Cancel) break;
|
|
||||||
else
|
|
||||||
{
|
|
||||||
TreeNode treenodeDirectory = SelectedNode.Parent;
|
|
||||||
tv_NodePaste(mi.Text);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
case "Delete":
|
case "Delete":
|
||||||
if (tv_NodeDelete())
|
if (tv_NodeDelete())
|
||||||
{
|
{
|
||||||
@ -2408,7 +2397,6 @@ namespace Volian.Controls.Library
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
VETreeNode tn = SelectedNode as VETreeNode;
|
VETreeNode tn = SelectedNode as VETreeNode;
|
||||||
TreeNode treeNodeReplace = SelectedNode.Parent; //Get Tree Node of Parent we are proc we are placing into.
|
|
||||||
DocVersionInfo dvi = tn.VEObject as DocVersionInfo;
|
DocVersionInfo dvi = tn.VEObject as DocVersionInfo;
|
||||||
// Check for paste into a docversion - queries/code is different than paste related to an item (into a proc or section)
|
// Check for paste into a docversion - queries/code is different than paste related to an item (into a proc or section)
|
||||||
if (dvi != null)
|
if (dvi != null)
|
||||||
@ -2444,17 +2432,13 @@ namespace Volian.Controls.Library
|
|||||||
else if (p.IndexOf("After") > -1)
|
else if (p.IndexOf("After") > -1)
|
||||||
PasteBeforeOrAfter(MenuSelections.StepAfter, tn, iiClipboard.ItemID);
|
PasteBeforeOrAfter(MenuSelections.StepAfter, tn, iiClipboard.ItemID);
|
||||||
else if (p.IndexOf("Replace") > -1)
|
else if (p.IndexOf("Replace") > -1)
|
||||||
{
|
PasteReplace(tn, iiClipboard.ItemID);
|
||||||
PasteReplace(tn, iiClipboard.ItemID, treeNodeReplace);
|
|
||||||
}
|
|
||||||
else // paste as child
|
else // paste as child
|
||||||
PasteAsChild(tn, iiClipboard.ItemID);
|
PasteAsChild(tn, iiClipboard.ItemID);
|
||||||
|
|
||||||
//if (p.IndexOf("Replace") <= -1)
|
|
||||||
this.Cursor = Cursors.Default;
|
this.Cursor = Cursors.Default;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void PasteAsDocVersionChild(VETreeNode tn, int copyStartID)
|
private void PasteAsDocVersionChild(VETreeNode tn, int copyStartID)
|
||||||
{
|
{
|
||||||
// Only need to handle paste in tree since this will create a new procedure.
|
// Only need to handle paste in tree since this will create a new procedure.
|
||||||
DocVersionInfo dvi = tn.VEObject as DocVersionInfo;
|
DocVersionInfo dvi = tn.VEObject as DocVersionInfo;
|
||||||
@ -2541,7 +2525,7 @@ namespace Volian.Controls.Library
|
|||||||
}
|
}
|
||||||
SelectedNode = (VETreeNode)((newtype == MenuSelections.StepAfter) ? tn.NextNode : tn.PrevNode);
|
SelectedNode = (VETreeNode)((newtype == MenuSelections.StepAfter) ? tn.NextNode : tn.PrevNode);
|
||||||
}
|
}
|
||||||
private void PasteReplace(VETreeNode tn, int copyStartID, TreeNode treeNodeReplace)
|
private void PasteReplace(VETreeNode tn, int copyStartID)
|
||||||
{
|
{
|
||||||
VETreeNode prevtn = (VETreeNode) tn.PrevNode;
|
VETreeNode prevtn = (VETreeNode) tn.PrevNode;
|
||||||
VETreeNode partn = (VETreeNode) tn.Parent;
|
VETreeNode partn = (VETreeNode) tn.Parent;
|
||||||
@ -2552,35 +2536,16 @@ namespace Volian.Controls.Library
|
|||||||
{
|
{
|
||||||
// first, check if a changeid is required.
|
// first, check if a changeid is required.
|
||||||
string chgId = OnGetChangeId(this, new vlnTreeItemInfoEventArgs(ii));
|
string chgId = OnGetChangeId(this, new vlnTreeItemInfoEventArgs(ii));
|
||||||
ItemInfo replItemInfo = Item.PasteReplace(ii, copyStartID, chgId, treeNodeReplace);
|
ItemInfo replItemInfo = Item.PasteReplace(ii, copyStartID, chgId);
|
||||||
|
|
||||||
StepConfig replItemConfig = ii.MyConfig as StepConfig;
|
StepConfig replItemConfig = ii.MyConfig as StepConfig;
|
||||||
if (replItemInfo != null)
|
if (replItemInfo != null)
|
||||||
{
|
{
|
||||||
|
OnOpenItem(this, new vlnTreeItemInfoEventArgs(replItemInfo));
|
||||||
ItemInfo newEnhStep = replItemInfo.PasteEnhancedItems(copyStartID, ii, ItemInfo.EAddpingPart.Replace, chgId);
|
ItemInfo newEnhStep = replItemInfo.PasteEnhancedItems(copyStartID, ii, ItemInfo.EAddpingPart.Replace, chgId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// B2018-047: was crashing on the following line (before change it was casting the result to a VETreeNote when the partn.FirstNode was just a TreeNode)
|
// B2018-047: was crashing on the following line (before change it was casting the result to a VETreeNote when the partn.FirstNode was just a TreeNode)
|
||||||
SelectedNode = prevtn != null ? prevtn.NextNode : partn.FirstNode;
|
SelectedNode = prevtn != null ? prevtn.NextNode : partn.FirstNode;
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
public void PasteRepalceEmpty(VETreeNode tn, int copyStartID)
|
|
||||||
{
|
|
||||||
// Only need to handle paste in tree since this will create a new procedure.
|
|
||||||
DocVersionInfo dvi = tn.VEObject as DocVersionInfo;
|
|
||||||
if (dvi.DocVersionAssociationCount == 0)
|
|
||||||
{
|
|
||||||
// Set docversionassociation to the copied docversion association
|
|
||||||
// so that the rofst for ro's can be found. (if there is no association set)
|
|
||||||
ROFstInfo rfi = GetAssociationRofstId(copyStartID);
|
|
||||||
Association myAs = Association.MakeAssociation(dvi.Get(), rfi.GetJustROFst(), "");
|
|
||||||
dvi.RefreshDocVersionAssociations();
|
|
||||||
}
|
|
||||||
ItemInfo newProc = dvi.PasteChild(copyStartID);
|
|
||||||
VETreeNode tn1 = new VETreeNode(newProc);
|
|
||||||
SelectedNode.Nodes.Add(tn1); // add tree node to end of list.
|
|
||||||
SelectedNode = tn1;
|
|
||||||
}
|
}
|
||||||
private void tv_NodeCopy()
|
private void tv_NodeCopy()
|
||||||
{
|
{
|
||||||
@ -2588,7 +2553,6 @@ namespace Volian.Controls.Library
|
|||||||
VETreeNode tn = SelectedNode as VETreeNode;
|
VETreeNode tn = SelectedNode as VETreeNode;
|
||||||
OnNodeCopy(this, new vlnTreeEventArgs(tn));
|
OnNodeCopy(this, new vlnTreeEventArgs(tn));
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
#region PropertyPagesInterface
|
#region PropertyPagesInterface
|
||||||
private void SetupNodeProperties()
|
private void SetupNodeProperties()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user