public DataGridViewCellPaintingEventArgs(DataGridView dataGridView,
                                                 Graphics graphics,
                                                 Rectangle clipBounds,
                                                 Rectangle cellBounds,
                                                 int rowIndex,
                                                 int columnIndex,
                                                 DataGridViewElementStates cellState,
                                                 object value,
                                                 object formattedValue,
                                                 string errorText,
                                                 DataGridViewCellStyle cellStyle,
                                                 DataGridViewAdvancedBorderStyle advancedBorderStyle,
                                                 DataGridViewPaintParts paintParts)
        {
            if ((paintParts & ~DataGridViewPaintParts.All) != 0)
            {
                throw new ArgumentException(string.Format(SR.DataGridView_InvalidDataGridViewPaintPartsCombination, nameof(paintParts)), nameof(paintParts));
            }

            _dataGridView       = dataGridView.OrThrowIfNull();
            Graphics            = graphics.OrThrowIfNull();
            ClipBounds          = clipBounds;
            CellBounds          = cellBounds;
            RowIndex            = rowIndex;
            ColumnIndex         = columnIndex;
            State               = cellState;
            Value               = value;
            FormattedValue      = formattedValue;
            ErrorText           = errorText;
            CellStyle           = cellStyle.OrThrowIfNull();
            AdvancedBorderStyle = advancedBorderStyle;
            PaintParts          = paintParts;
        }
예제 #2
0
 public DataGridViewRowPostPaintEventArgs(
     DataGridView dataGridView,
     Graphics graphics,
     Rectangle clipBounds,
     Rectangle rowBounds,
     int rowIndex,
     DataGridViewElementStates rowState,
     string?errorText,
     DataGridViewCellStyle inheritedRowStyle,
     bool isFirstDisplayedRow,
     bool isLastVisibleRow)
 {
     _dataGridView       = dataGridView.OrThrowIfNull();
     Graphics            = graphics.OrThrowIfNull();
     ClipBounds          = clipBounds;
     RowBounds           = rowBounds;
     RowIndex            = rowIndex;
     State               = rowState;
     ErrorText           = errorText;
     InheritedRowStyle   = inheritedRowStyle.OrThrowIfNull();
     IsFirstDisplayedRow = isFirstDisplayedRow;
     IsLastVisibleRow    = isLastVisibleRow;
 }