Handle new error when a deleted step is attempted to be copied.
Added logic to handle an invalid transition (a transition to a disconnected step.
This commit is contained in:
@@ -1246,7 +1246,8 @@ namespace Volian.Controls.Library
|
||||
//catch (System.Data.SqlClient.SqlException ex)
|
||||
catch (Exception ex)
|
||||
{
|
||||
HandleSqlExceptionOnDelete(ex);
|
||||
if(!HandleSqlExceptionOnCopy(ex))
|
||||
HandleSqlExceptionOnDelete(ex);
|
||||
return this;
|
||||
}
|
||||
// Remove the EditItem that was the replaced item.
|
||||
@@ -1299,6 +1300,15 @@ namespace Volian.Controls.Library
|
||||
MyStepPanel.MyStepTabPanel.MyDisplayTabControl.OnItemPaste(this, new vlnTreeItemInfoPasteEventArgs(newItemInfo, copyStartID, ItemInfo.EAddpingPart.Replace, newItemInfo.MyContent.Type));
|
||||
return newEditItem;
|
||||
}
|
||||
private bool HandleSqlExceptionOnCopy(Exception ex)
|
||||
{
|
||||
if (ex.Message.Contains("This step has been deleted"))
|
||||
{
|
||||
MessageBox.Show("The step being pasted has been deleted", "Cannot Paste Step", MessageBoxButtons.OK, MessageBoxIcon.Hand);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
public void IdentifyChildren(bool highlight)
|
||||
{
|
||||
// Highlight children of EditItem:
|
||||
|
Reference in New Issue
Block a user