public static void ExpandAll <T>(
     this VirtualizingTreeView treeView,
     T item,
     Func <T, T> getParent,
     Func <T, IEnumerable> getChildren)
 {
     treeView.ExpandTo <T>(getParent(item), getParent);
     treeView.ExpandChildren <T>(item, getChildren);
 }
        public static void ExpandChildren <T>(this VirtualizingTreeView treeView, T item, Func <T, IEnumerable> getChildren)
        {
            IEnumerable children = getChildren(item);

            if (children != null)
            {
                treeView.Expand(item);

                foreach (T child in children)
                {
                    treeView.ExpandChildren(child, getChildren);
                }
            }
        }
        public static void ExpandChildren <T>(
            this VirtualizingTreeView treeView,
            T item,
            Func <T, IEnumerable> getChildren)
        {
            IEnumerable enumerable = getChildren(item);

            if (enumerable == null)
            {
                return;
            }
            treeView.Expand((object)item);
            foreach (T obj in enumerable)
            {
                treeView.ExpandChildren <T>(obj, getChildren);
            }
        }