src/Misc/EFTools/DesignXmlCore/VirtualTreeGrid/UI/ColumnHeader.cs
/// <summary>
///     Test if the new ordering is allowed by the current column header settings
/// </summary>
/// <param name="oldOrder">The old order. Acts as a base order to determine new order</param>
/// <param name="newOrder">The new order. Compare columns to old order to deduce current display order.</param>
/// <returns>true to allow the change, false to block it</returns>
Test if the new ordering is allowed by the current column header settings
Test if the new ordering is allowed by the current column header settings
protected virtual bool AllowColumnOrderChange(int[] oldOrder, int[] newOrder)
        {
            var itemCount = oldOrder.Length;
            var headers = myHeaderBounds.Headers;
            for (var i = 0; i < itemCount; ++i)
            {
                if (0 != (headers[i].Style & VirtualTreeColumnHeaderStyles.ColumnPositionLocked))
                {
                    if (oldOrder[i] != newOrder[i])
                    {
                        return false;
                    }
                }
            }
            return true;
        }
protected virtual bool AllowColumnOrderChange ( int [ ] oldOrder , int [ ] newOrder ) { var itemCount = oldOrder . Length ; var headers = myHeaderBounds . Headers ; for ( var i = 0 ; i < itemCount ; ++ i ) { if ( 0 != ( headers [ i ] . Style & VirtualTreeColumnHeaderStyles . ColumnPositionLocked ) ) { if ( oldOrder [ i ] != newOrder [ i ] ) { return false ; } } } return true ; }
Test if the new ordering is allowed by the current column header settings
Test if the new ordering is allowed by the current column header settings
// See if any of the items we're moving should not be moving
true to allow the change, false to block it
true to allow the change false to block it
oldOrder
int[]
The old order. Acts as a base order to determine new order
The old order . Acts as a base order to determine new order
newOrder
int[]
The new order. Compare columns to old order to deduce current display order.
The new order . Compare columns to old order to deduce current display order .