src/Misc/EFTools/DesignXmlCore/Base/Shell/TreeGridDesignerBranch.cs
/// <summary>
///     Returns structure describing how this branch should be displayed.
/// </summary>
/// <param name="row">Index into this branch</param>
/// <param name="column">Column index</param>
/// <param name="requiredData">The data that must be filled in</param>
/// <returns>
///     Structure to be filled with display information.  By default,
///     No icon is specified, and read-only and creator nodes are grayed out.
/// </returns>
Returns structure describing how this branch should be displayed.
Returns structure describing how this branch should be displayed .
protected virtual VirtualTreeDisplayData GetDisplayData(int row, int column, VirtualTreeDisplayDataMasks requiredData)
        {
            var data = new VirtualTreeDisplayData(-1);
            if (_insertingIndex != -1
                && row > _insertingIndex)
            {
                row--;
            }
            var count = ElementCount;
            if ((requiredData.Mask & VirtualTreeDisplayMasks.StateImage) != 0
                && row < count)
            {
                var columnDescriptor = _columns[column];
                if (columnDescriptor.ColumnIsCheckBox)
                {
                    var checkState = columnDescriptor.GetCheckBoxValue(GetElement(row));
                    if (checkState != CheckBoxState.Unsupported)
                    {
                        data.StateImageIndex = (short)checkState;
                    }
                }
            }
            if (row >= count)
            {
                data.GrayText = true;
            }
            else if (_lastText != null
                     && _lastText.Length > 0)
            {
                var supportedState = GetValueSupported(row, column);
                if ((supportedState & TreeGridDesignerValueSupportedStates.DisplayReadOnly) != 0)
                {
                    data.GrayText = true;
                }
            }
            return data;
        }
protected virtual VirtualTreeDisplayData GetDisplayData ( int row , int column , VirtualTreeDisplayDataMasks requiredData ) { var data = new VirtualTreeDisplayData ( - 1 ) ; if ( _insertingIndex != - 1 && row > _insertingIndex ) { row -- ; } var count = ElementCount ; if ( ( requiredData . Mask & VirtualTreeDisplayMasks . StateImage ) != 0 && row < count ) { var columnDescriptor = _columns [ column ] ; if ( columnDescriptor . ColumnIsCheckBox ) { var checkState = columnDescriptor . GetCheckBoxValue ( GetElement ( row ) ) ; if ( checkState != CheckBoxState . Unsupported ) { data . StateImageIndex = ( short ) checkState ; } } } if ( row >= count ) { data . GrayText = true ; } else if ( _lastText != null && _lastText . Length > 0 ) { var supportedState = GetValueSupported ( row , column ) ; if ( ( supportedState & TreeGridDesignerValueSupportedStates . DisplayReadOnly ) != 0 ) { data . GrayText = true ; } } return data ; }
Returns structure describing how this branch should be displayed.
Returns structure describing how this branch should be displayed .
// account for row insertion index // set state index // display creator nodes in gray // use lastText here as an optimization.  If there's no text, there's no // reason to call derived classes to check the value, as GrayText setting is // irrelevant // display non-editable nodes in gray
Structure to be filled with display information.  By default,
No icon is specified, and read-only and creator nodes are grayed out.
Structure to be filled with display information . By default No icon is specified and read - only and creator nodes are grayed out .
row
int
Index into this branch
Index into this branch
column
int
None
requiredData
VirtualTreeDisplayDataMasks
The data that must be filled in
The data that must be filled in