Predicates/SimpleParser/AbstractTree/NodeItem.cs
/// <summary>
/// Remove all the empty nodes from the children list
/// </summary>
Remove all the empty nodes from the children list
Remove all the empty nodes from the children list
public void RemoveEmptyChildren()
        {
            var todelete = new List<NodeItem>();
            foreach (var item in NodeItems)
            {
                item.RemoveEmptyChildren();
                if (string.IsNullOrEmpty(item.Name) && item.NodeItems.Count == 0)
                {
                    todelete.Add(item);
                }
            }
            foreach (var del in todelete)
            {
                NodeItems.Remove(del);
            }
        }
public void RemoveEmptyChildren ( ) { var todelete = new List < NodeItem > ( ) ; foreach ( var item in NodeItems ) { item . RemoveEmptyChildren ( ) ; if ( string . IsNullOrEmpty ( item . Name ) && item . NodeItems . Count == 0 ) { todelete . Add ( item ) ; } } foreach ( var del in todelete ) { NodeItems . Remove ( del ) ; } }
Remove all the empty nodes from the children list
Remove all the empty nodes from the children list