B2020-142: Cannot get Properties for a restored procedure

This commit is contained in:
Kathy Ruffing 2021-04-23 13:58:54 +00:00
parent 700321f4e5
commit 2a59f6b69e

View File

@ -497,13 +497,33 @@ namespace VEPROMS.CSLA.Library
}
void myItemInfo_NewSiblingBefore(object sender, ItemInfoInsertEventArgs args)
{
if(this.Parent != null) // Only do this if the node has a parent - RHM 20100106
this.Parent.Nodes.Insert(Index,(new VETreeNode(args.ItemInserted)));
if (this.Parent != null) // Only do this if the node has a parent - RHM 20100106
{
ItemInfo ii = args.ItemInserted as ItemInfo;
if (ii == null)
this.Parent.Nodes.Insert(Index, (new VETreeNode(args.ItemInserted)));
else // B2020-142: Can't get properties of restored item (no treeview context menu would be correct after restore)
{
if (ii.IsProcedure) this.Parent.Nodes.Insert(Index, (new VETreeNode(ProcedureInfo.Get(ii.ItemID))));
if (ii.IsSection) this.Parent.Nodes.Insert(Index, (new VETreeNode(SectionInfo.Get(ii.ItemID))));
if (ii.IsStep) this.Parent.Nodes.Insert(Index, (new VETreeNode(StepInfo.Get(ii.ItemID))));
}
}
}
void myItemInfo_NewSiblingAfter(object sender, ItemInfoInsertEventArgs args)
{
if (this.Parent != null) // Only do this if the node has a parent - RHM 20100106
{
ItemInfo ii = args.ItemInserted as ItemInfo;
if (ii == null)
this.Parent.Nodes.Insert(Index + 1, (new VETreeNode(args.ItemInserted)));
else // B2020-142: Can't get properties of restored item (no treeview context menu would be correct after restore)
{
if (ii.IsProcedure) this.Parent.Nodes.Insert(Index + 1, (new VETreeNode(ProcedureInfo.Get(ii.ItemID))));
if (ii.IsSection) this.Parent.Nodes.Insert(Index + 1, (new VETreeNode(SectionInfo.Get(ii.ItemID))));
if (ii.IsStep) this.Parent.Nodes.Insert(Index + 1, (new VETreeNode(StepInfo.Get(ii.ItemID))));
}
}
}
public VETreeNode(string s)
: base(s)