Tree node fixes when deleting nodes
This commit is contained in:
@@ -1078,7 +1078,7 @@ namespace VEPROMS.CSLA.Library
|
||||
string number = (MyContent.Type >= 20000 ? Ordinal.ToString() + "." : ((MyContent.Number ?? "") == "" ? MyContent.Text : MyContent.Number));
|
||||
ItemInfo parent = this;
|
||||
while (parent.MyPrevious != null) parent = parent.MyPrevious;
|
||||
if (parent.ItemPartCount == 0)
|
||||
if (parent.ItemPartCount <= 0 || parent.ItemParts.Count == 0)
|
||||
return null;
|
||||
else
|
||||
{
|
||||
|
@@ -183,6 +183,20 @@ namespace VEPROMS.CSLA.Library
|
||||
internal void OnDeleted(object sender)
|
||||
{
|
||||
if (Deleted != null) Deleted(sender);
|
||||
if (MyParent != null) MyParent.OnChildrenDeleted(sender);
|
||||
}
|
||||
public event ItemInfoEvent ChildrenDeleted;
|
||||
internal void OnChildrenDeleted(object sender)
|
||||
{
|
||||
if (_CacheByPrimaryKey.ContainsKey(ItemID.ToString()))
|
||||
{
|
||||
List<ItemInfo> itmlst = _CacheByPrimaryKey[ItemID.ToString()];
|
||||
foreach (ItemInfo itm in itmlst)
|
||||
if (itm.ChildrenDeleted != null)
|
||||
{
|
||||
itm.ChildrenDeleted(itm);
|
||||
}
|
||||
}
|
||||
}
|
||||
public event ItemInfoInsertEvent NewSiblingAfter;
|
||||
internal void OnNewSiblingAfter(object sender, ItemInfoInsertEventArgs args)
|
||||
|
Reference in New Issue
Block a user