src/Misc/EFTools/DesignXmlCore/VirtualTreeGrid/UI/VirtualTreeControl.cs
/// <summary>
///     Recursively expand the branch at the given location.
/// </summary>
/// <param name="row">The row coordinate.</param>
/// <param name="column">The native column coordinate.</param>
Recursively expand the branch at the given location.
Recursively expand the branch at the given location .
public void ExpandRecurse(int row, int column)
        {
            myTree.ItemCountChanged -= OnItemCountChanged;
            try
            {
                if (myTree.IsExpandable(row, column))
                {
                    bool allowRecursion;
                    int change;
                    if (myTree.IsExpanded(row, column))
                    {
                        allowRecursion = myTree.GetDescendantItemCount(row, column, false, false) > 0;
                        change = 0;
                    }
                    else
                    {
                        var toggle = myTree.ToggleExpansion(row, column);
                        change = toggle.Change;
                        allowRecursion = toggle.AllowRecursion;
                        if (change > 0)
                        {
                            if (!allowRecursion)
                            {
                                OnToggleExpansion(myTree, row, column, change, 0, null, true);
                            }
                        }
                        else if (change == 0)
                        {
                            if (GetStyleFlag(VTCStyleFlags.HasButtons))
                            {
                                InvalidateItem(row, column, NativeMethods.RedrawWindowFlags.Invalidate);
                            }
                            allowRecursion = false;
                        }
                    }
                    if (allowRecursion)
                    {
                        var stateTracker = new ListBoxStateTracker(this);
                        if (change != 0)
                        {
                            . We need to pass real data here.
                            stateTracker.ApplyChange(row, column, change, 0, myTree.VisibleItemCount, true);
                        }
                        DoExpandRecurse(row, column, stateTracker);
                        BeginUpdate();
                        ItemCount = myTree.VisibleItemCount;
                        stateTracker.Restore(this);
                        var iTop = TopIndex;
                        if (iTop > 0
                            && row < iTop)
                        {
                            TopIndex = row;
                        }
                        ScrollBarsAfterSetWidth(VirtualTreeConstant.NullIndex);
                        EndUpdate();
                    }
                }
            }
            finally
            {
                myTree.ItemCountChanged += OnItemCountChanged;
            }
        }
public void ExpandRecurse ( int row , int column ) { myTree . ItemCountChanged -= OnItemCountChanged ; try { if ( myTree . IsExpandable ( row , column ) ) { bool allowRecursion ; int change ; if ( myTree . IsExpanded ( row , column ) ) { allowRecursion = myTree . GetDescendantItemCount ( row , column , false , false ) > 0 ; change = 0 ; } else { var toggle = myTree . ToggleExpansion ( row , column ) ; change = toggle . Change ; allowRecursion = toggle . AllowRecursion ; if ( change > 0 ) { if ( ! allowRecursion ) { OnToggleExpansion ( myTree , row , column , change , 0 , null , true ) ; } } else if ( change == 0 ) { if ( GetStyleFlag ( VTCStyleFlags . HasButtons ) ) { InvalidateItem ( row , column , NativeMethods . RedrawWindowFlags . Invalidate ) ; } allowRecursion = false ; } } if ( allowRecursion ) { var stateTracker = new ListBoxStateTracker ( this ) ; if ( change != 0 ) { stateTracker . ApplyChange ( row , column , change , 0 , myTree . VisibleItemCount , true ) ; } DoExpandRecurse ( row , column , stateTracker ) ; BeginUpdate ( ) ; ItemCount = myTree . VisibleItemCount ; stateTracker . Restore ( this ) ; var iTop = TopIndex ; if ( iTop > 0 && row < iTop ) { TopIndex = row ; } ScrollBarsAfterSetWidth ( VirtualTreeConstant . NullIndex ) ; EndUpdate ( ) ; } } } finally { myTree . ItemCountChanged += OnItemCountChanged ; } }
Recursively expand the branch at the given location.
Recursively expand the branch at the given location .
// Turn off the event temporarily. We'll do all of the tracking in this routine instead of // firing multiple events. // Fire the event manually // UNDONE_NOW: The blank expansion is wrong // Make sure the plus/minus changes // UNDONE_NOW: The blank expansion is wrong. We need to pass real data here.
row
int
The row coordinate.
The row coordinate .
column
int
The native column coordinate.
The native column coordinate .