256 references to Count
PresentationUI (2)
MS\Internal\Documents\RMPublishingDialog.RightsTable.cs (2)
500if ((e != null) && (e.RowIndex > 0) && (e.RowIndex < Rows.Count) && 624for (int rowIndex = _firstNonOwnerRow; rowIndex < Rows.Count; rowIndex++)
System.Windows.Forms (254)
System\Windows\Forms\Controls\DataGridView\DataGridView.cs (13)
1719Debug.Assert(_ptCurrentCell.Y < Rows.Count); 1787Debug.Assert(_ptCurrentCell.Y >= 0 && _ptCurrentCell.Y < Rows.Count); 1860Debug.Assert(_ptCurrentCell.Y < Rows.Count); 2314&& firstDisplayedCell.RowIndex < Rows.Count 2537ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(value, Rows.Count); 3106int rowCount = Rows.Count; 3182get => Rows.Count; 3192if (value == Rows.Count) 3202else if (value < Rows.Count) 3205while (value < Rows.Count) 3207int currentRowCount = Rows.Count; 3209if (Rows.Count >= currentRowCount) 3226int rowsToAdd = value - Rows.Count;
System\Windows\Forms\Controls\DataGridView\DataGridView.DataConnection.cs (9)
494&& CurrencyManager.List.Count == (_owner.AllowUserToAddRowsInternal ? _owner.Rows.Count - 1 : _owner.Rows.Count)) 596if (_owner.NewRowIndex == -1 || e.NewIndex != _owner.Rows.Count) 663if (_owner.Rows.Count > 0 689if (_owner.Rows.Count == (_owner.AllowUserToAddRowsInternal ? 1 : 0)) 763int result = _owner.Rows.Count; 764if (_owner.AllowUserToAddRowsInternal && _owner.Rows.Count > 0) 1244else if (rowIndex < _owner.Rows.Count) 1269&& rowIndex < _owner.Rows.Count
System\Windows\Forms\Controls\DataGridView\DataGridView.Methods.cs (133)
72if (cellAddress.Y < 0 || cellAddress.Y >= Rows.Count) 119NewRowIndex = Rows.Count - 1; 345Debug.Assert(rowIndex < Rows.Count); 415Debug.Assert(rowIndex >= 0 && rowIndex < Rows.Count); 1425if (Columns.Count == 0 && Rows.Count == 0) 1443allCellsSelected = _individualSelectedCells.Count == Columns.Count * Rows.Count; 1477allCellsSelected = _selectedBandIndexes.Count * Rows.Count + _individualSelectedCells.Count == Columns.Count * Rows.Count; 1513allCellsSelected = _selectedBandIndexes.Count * Columns.Count + _individualSelectedCells.Count == Columns.Count * Rows.Count; 1998ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(rowIndex, Rows.Count); 2173ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(rowIndex, Rows.Count); 2321Debug.Assert(rowIndex >= 0 && rowIndex < Rows.Count); 2624Debug.Assert(_ptCurrentCell.Y >= 0 && _ptCurrentCell.Y < Rows.Count); 3191Debug.Assert((AllowUserToAddRowsInternal && Rows.Count == 1) || (!AllowUserToAddRowsInternal && Rows.Count == 0)); 3193if (Rows.Count > 0) 3541ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(rowIndexException, Rows.Count); 3550ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(rowIndexException, Rows.Count); 4207if (rowIndex >= Rows.Count) 4330int indexTmp = Rows.Count; 4830int nRows = Rows.Count; 5279Debug.Assert(anticipatedRowIndex >= 0 && anticipatedRowIndex <= Rows.Count); 5407int rowsCount = Rows.Count; 5433int rowsCount = Rows.Count; 5508Debug.Assert(Rows.Count > 1); 5519Debug.Assert(NewRowIndex == Rows.Count - 1); 5531NewRowIndex = Rows.Count - 1; 5862if (dgvcme.ColumnIndex < Columns.Count && dgvcme.RowIndex < Rows.Count) 5873if (e.Button == MouseButtons.Left && dgvcme.ColumnIndex < Columns.Count && dgvcme.RowIndex < Rows.Count) 5887if (dgvcme.ColumnIndex < Columns.Count && dgvcme.RowIndex < Rows.Count) 5934if (e.Button == MouseButtons.Left && dgvcme.ColumnIndex < Columns.Count && dgvcme.RowIndex < Rows.Count) 5942if (e.Button == MouseButtons.Left && dgvcme.ColumnIndex < Columns.Count && dgvcme.RowIndex < Rows.Count) 5950if (dgvcme.ColumnIndex < Columns.Count && dgvcme.RowIndex < Rows.Count) 5958if (dgvcme.ColumnIndex < Columns.Count && dgvcme.RowIndex < Rows.Count) 5966if (dgvcme.ColumnIndex < Columns.Count && dgvcme.RowIndex < Rows.Count) 6450Debug.Assert(rowIndex < Rows.Count); 6593&& rowIndexTmp < Rows.Count 6926return cellCount + _selectedBandIndexes.Count * Rows.Count; 6963for (int rowIndex = 0; rowIndex < Rows.Count; rowIndex++) 7001return Rows.Count * Columns.Count; 7010for (int rowIndex = 0; rowIndex < Rows.Count; rowIndex++) 7117ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(rowIndex, Rows.Count); 7162Debug.Assert(rowIndex >= -1 && rowIndex < Rows.Count); 9082ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(rowIndex, Rows.Count); 9089Debug.Assert(rowIndex >= 0 && rowIndex < Rows.Count); 9254Debug.Assert(index >= 0 && index < Rows.Count); 9841ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(rowIndex, Rows.Count); 9908ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(rowIndex, Rows.Count); 9915Debug.Assert(rowIndex >= 0 && rowIndex < Rows.Count); 9944Debug.Assert(lo < Rows.Count); 9945Debug.Assert(hi < Rows.Count); 10100return columnIndex >= Columns.Count || rowIndex >= Rows.Count || columnIndex == -1 || rowIndex == -1; 10105return rowIndex >= Rows.Count || rowIndex == -1; 10447&& (includeNewRow || !AllowUserToAddRowsInternal || firstDisplayedCellAddress.Y != Rows.Count - 1)) 10648Debug.Assert(rowIndex == Rows.Count - 1); 10844if (Rows.Count > 0) 10863for (int rowIndex = 0; rowIndex < Rows.Count; rowIndex++) 10885for (int rowIndex = 0; rowIndex < Rows.Count; rowIndex++) 10925if (Rows.Count > 0 && dataGridViewColumn.CellType is null) 10992if (Rows.Count > 0) 11015for (int rowIndex = 0; rowIndex < Rows.Count; rowIndex++) 11036for (int rowIndex = 0; rowIndex < Rows.Count; rowIndex++) 11063CorrectRowFrozenState(dataGridViewRow, rowState, Rows.Count); 11132CorrectRowFrozenStates(dataGridViewRows, rowIndexInserted: Rows.Count); 11568ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(e.RowIndex, Rows.Count, "e.RowIndex"); 11791Debug.Assert(rowIndex < Rows.Count && columnIndex < Columns.Count); 11879Debug.Assert(rowIndex < Rows.Count && columnIndex < Columns.Count); 12162if (hti._row >= Rows.Count) 13115Debug.Assert(rowIndex < Rows.Count && columnIndex < Columns.Count); 13161Debug.Assert(rowIndex < Rows.Count && columnIndex < Columns.Count); 13336if (Columns.Count != 0 && Rows.Count == 0) 15485if (Rows.Count > 0) 15504for (int rowIndex = 0; rowIndex < Rows.Count; rowIndex++) 15525for (int rowIndex = 0; rowIndex < Rows.Count; rowIndex++) 15962if (dgvcme.ColumnIndex < Columns.Count && dgvcme.RowIndex < Rows.Count) 15983if (dgvcme.ColumnIndex < Columns.Count && dgvcme.RowIndex < Rows.Count) 15994if (dgvcme.ColumnIndex < Columns.Count && dgvcme.RowIndex < Rows.Count) 16051if (dgvcme.ColumnIndex < Columns.Count && dgvcme.RowIndex < Rows.Count) 16101if (dgvcme.ColumnIndex < Columns.Count && dgvcme.RowIndex < Rows.Count) 16113if (rowIndex < Rows.Count) 16225&& _ptMouseEnteredCell.Y >= -1 && _ptMouseEnteredCell.Y < Rows.Count) 16447if (dgvcme.ColumnIndex < Columns.Count && dgvcme.RowIndex < Rows.Count) 17175for (int rowIndex = 0; rowIndex < Rows.Count; rowIndex++) 17302Debug.Assert(rowIndexDeleted >= 0 && rowIndexDeleted < Rows.Count); 17304if (rowIndexDeleted >= 0 && rowIndexDeleted < Rows.Count) 17326Debug.Assert(NewRowIndex == Rows.Count - 1); 17327newY = rowIndexNext > -1 && rowIndexNext < Rows.Count - 1 ? rowIndexNext - 1 : rowIndexPrevious; 17600&& Rows.Count == 0 17679if (!e.Handled && e.Button == MouseButtons.Left && e.RowIndex < Rows.Count) 17724if (rowIndex < Rows.Count && columnIndex < Columns.Count) 17765if (calledAddNewOnTheDataConnection && rowIndex > Rows.Count - 1) 17768rowIndex = Math.Min(rowIndex, Rows.Count - 1); 17790Debug.Assert(rowIndex < Rows.Count && columnIndex < Columns.Count); 18073if (hti._row >= Rows.Count) 18385if (rowIndex < Rows.Count && columnIndex < Columns.Count) 18397Debug.Assert(rowIndex < Rows.Count && columnIndex < Columns.Count); 18797if (dataGridViewCell is not null && rowIndex < Rows.Count && columnIndex < Columns.Count) 18844Debug.Assert(rowIndex < Rows.Count && columnIndex < Columns.Count); 19561if (Columns.Count > 0 || Rows.Count > 0) 20011if (rowIndex == NewRowIndex || rowIndex >= Rows.Count) 20024int dataGridRowsCount = Rows.Count; 20074if (dataGridRowsCount != Rows.Count) 25406Debug.Assert(NewRowIndex == Rows.Count - 1); 26028Debug.Assert(rowIndex < Rows.Count); 26275Debug.Assert(rowIndex >= 0 && rowIndex < Rows.Count); 26276Debug.Assert(DisplayedBandsInfo.FirstDisplayedScrollingRow >= -1 && DisplayedBandsInfo.FirstDisplayedScrollingRow < Rows.Count); 26335Debug.Assert(rowIndex >= 0 && rowIndex < Rows.Count); 26626int rowIndex = 0, maxRowIndex = Rows.Count; 26647int rowIndex = 0, maxRowIndex = Rows.Count; 26731if (index >= Rows.Count) 26733index -= Rows.Count; 26818ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(rowIndex, Rows.Count); 26854Debug.Assert(rowIndex >= 0 && columnIndex < Columns.Count && rowIndex < Rows.Count); 26982if (rowIndex >= Rows.Count) 27021if (oldCurrentCellX < Columns.Count && oldCurrentCellY < Rows.Count) 27026if (oldCurrentCellY != _ptCurrentCell.Y && RowHeadersVisible && oldCurrentCellY < Rows.Count) 27185if (oldCurrentCellX < Columns.Count && oldCurrentCellY < Rows.Count) 27190if (RowHeadersVisible && oldCurrentCellY < Rows.Count) 27541Debug.Assert(columnIndex >= 0 && rowIndex >= 0 && columnIndex < Columns.Count && rowIndex < Rows.Count); 27577for (int row = rowIndex + 1; row < Rows.Count; row++) 27650Debug.Assert(rowIndex >= 0 && rowIndex < Rows.Count); 27691ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(rowIndex, Rows.Count); 27721if (Rows.Count > BulkPaintThreshold) 27740for (int row = rowIndex + 1; row < Rows.Count; row++) 28137ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(rowIndex, Rows.Count); 28933ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(rowIndex, Rows.Count); 28947ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(rowIndex, Rows.Count); 29002ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(rowIndex, Rows.Count); 29013ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(rowIndexStart, Rows.Count); 29016ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(rowIndexEnd, Rows.Count); 29046ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(rowIndex, Rows.Count); 29240&& _ptMouseEnteredCell.Y < Rows.Count) 29267&& _ptMouseEnteredCell.Y < Rows.Count)
System\Windows\Forms\Controls\DataGridView\DataGridView.TopRowAccessibleObject.cs (1)
208return _ownerDataGridView.Rows.Count == 0 ? null : Parent.GetChild(1);
System\Windows\Forms\Controls\DataGridView\DataGridViewButtonCell.cs (1)
483rowIndex < DataGridView.Rows.Count)
System\Windows\Forms\Controls\DataGridView\DataGridViewButtonColumn.cs (3)
83int rowCount = dataGridViewRows.Count; 126int rowCount = dataGridViewRows.Count; 171int rowCount = dataGridViewRows.Count;
System\Windows\Forms\Controls\DataGridView\DataGridViewCell.cs (7)
305if (i < 0 || i >= DataGridView.Rows.Count - 1) 1293ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(rowIndex, DataGridView.Rows.Count); 1729ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(rowIndex, DataGridView.Rows.Count); 1799ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(rowIndex, DataGridView.Rows.Count); 1879ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(rowIndex, DataGridView.Rows.Count); 2417ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(rowIndex, dataGridView.Rows.Count); 3046if (DataGridView is not null && e.ColumnIndex < DataGridView.Columns.Count && e.RowIndex < DataGridView.Rows.Count)
System\Windows\Forms\Controls\DataGridView\DataGridViewCellPaintingEventArgs.cs (3)
80if (RowIndex < -1 || RowIndex >= _dataGridView.Rows.Count) 109if (RowIndex < -1 || RowIndex >= _dataGridView.Rows.Count) 144if (RowIndex < -1 || RowIndex >= _dataGridView.Rows.Count)
System\Windows\Forms\Controls\DataGridView\DataGridViewCheckBoxCell.cs (2)
834rowIndex < DataGridView.Rows.Count) 972rowIndex < 0 || rowIndex >= DataGridView.Rows.Count)
System\Windows\Forms\Controls\DataGridView\DataGridViewCheckBoxColumn.cs (5)
87int rowCount = dataGridViewRows.Count; 130int rowCount = dataGridViewRows.Count; 174int rowCount = dataGridViewRows.Count; 214int rowCount = dataGridViewRows.Count; 268int rowCount = dataGridViewRows.Count;
System\Windows\Forms\Controls\DataGridView\DataGridViewComboBoxColumn.cs (11)
53int rowCount = dataGridViewRows.Count; 116int rowCount = dataGridViewRows.Count; 162int rowCount = dataGridViewRows.Count; 205int rowCount = dataGridViewRows.Count; 249int rowCount = dataGridViewRows.Count; 293int rowCount = dataGridViewRows.Count; 334int rowCount = dataGridViewRows.Count; 397int rowCount = dataGridViewRows.Count; 440int rowCount = dataGridViewRows.Count; 481int rowCount = dataGridViewRows.Count; 523int rowCount = dataGridViewRows.Count;
System\Windows\Forms\Controls\DataGridView\DataGridViewHeaderCell.cs (2)
234(DataGridView is not null && (rowIndex < 0 || rowIndex >= DataGridView.Rows.Count))) 363ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(rowIndex, DataGridView.Rows.Count);
System\Windows\Forms\Controls\DataGridView\DataGridViewImageColumn.cs (3)
94int rowCount = dataGridViewRows.Count; 168int rowCount = dataGridViewRows.Count; 208int rowCount = dataGridViewRows.Count;
System\Windows\Forms\Controls\DataGridView\DataGridViewLinkCell.cs (1)
763rowIndex < DataGridView.Rows.Count)
System\Windows\Forms\Controls\DataGridView\DataGridViewLinkColumn.cs (7)
52int rowCount = dataGridViewRows.Count; 121int rowCount = dataGridViewRows.Count; 163int rowCount = dataGridViewRows.Count; 213int rowCount = dataGridViewRows.Count; 258int rowCount = dataGridViewRows.Count; 301int rowCount = dataGridViewRows.Count; 343int rowCount = dataGridViewRows.Count;
System\Windows\Forms\Controls\DataGridView\DataGridViewRow.cs (4)
1215ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(rowIndex, DataGridView.Rows.Count); 1242ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(rowIndex, DataGridView.Rows.Count); 1291ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(rowIndex, DataGridView.Rows.Count); 1372ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(rowIndex, DataGridView.Rows.Count);
System\Windows\Forms\Controls\DataGridView\DataGridViewRowCollection.cs (32)
70int ICollection.Count => Count; 99int rowCount = Count; 227Debug.Assert(DataGridView.NewRowIndex == Count - 1); 228int insertionIndex = Count - 1; 371Debug.Assert(DataGridView.NewRowIndex == Count - 1); 372int insertionIndex = Count - 1; 409Debug.Assert(DataGridView.NewRowIndex == Count - 1); 410int insertionIndex = Count - 1; 486Debug.Assert(DataGridView.NewRowIndex == Count - 1); 488int insertionIndex = Count - 1; 493if (indexSource < 0 || indexSource >= Count) 551Debug.Assert(DataGridView.NewRowIndex == Count - 1); 552int insertionIndex = Count - 1; 566if (indexSource < 0 || Count <= indexSource) 731Debug.Assert(DataGridView.NewRowIndex == Count - 1); 732InsertRange(Count - 1, dataGridViewRows); 861for (int i = 0; i < Count; i++) 1206for (int i = 0; i < Count; i++) 1397if (rowIndex < 0 || Count < rowIndex) 1422if (DataGridView.NewRowIndex != -1 && rowIndex == Count) 1455if (rowIndex < 0 || Count < rowIndex) 1467if (DataGridView.NewRowIndex != -1 && rowIndex == Count) 1495Debug.Assert(rowIndex >= 0 && rowIndex <= Count); 1499Debug.Assert(DataGridView.NewRowIndex == -1 || rowIndex != Count); 1584if (indexSource < 0 || Count <= indexSource) 1589if (indexDestination < 0 || Count < indexDestination) 1599if (DataGridView.NewRowIndex != -1 && indexDestination == Count) 1759if (rowIndex < 0 || rowIndex > Count) 1769if (DataGridView.NewRowIndex != -1 && rowIndex == Count) 2163if (index < 0 || index >= Count) 2211Debug.Assert(index >= 0 && index < Count); 2260Debug.Assert(index < Count);
System\Windows\Forms\Controls\DataGridView\DataGridViewRowCollection.UnsharingRowEnumerator.cs (3)
29if (_current < _owner.Count - 1) 36_current = _owner.Count; 61if (_current == _owner.Count)
System\Windows\Forms\Controls\DataGridView\DataGridViewRowHeaderCell.cs (3)
100ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(rowIndex, DataGridView.Rows.Count); 297ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(rowIndex, DataGridView.Rows.Count); 567ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(rowIndex, DataGridView.Rows.Count);
System\Windows\Forms\Controls\DataGridView\DataGridViewRowPostPaintEventArgs.cs (5)
64if (RowIndex < 0 || RowIndex >= _dataGridView.Rows.Count) 81if (RowIndex < 0 || RowIndex >= _dataGridView.Rows.Count) 99if (RowIndex < 0 || RowIndex >= _dataGridView.Rows.Count) 123if (RowIndex < 0 || RowIndex >= _dataGridView.Rows.Count) 152if (RowIndex < 0 || RowIndex >= _dataGridView.Rows.Count)
System\Windows\Forms\Controls\DataGridView\DataGridViewRowPrePaintEventArgs.cs (5)
81if (RowIndex < 0 || RowIndex >= _dataGridView.Rows.Count) 98if (RowIndex < 0 || RowIndex >= _dataGridView.Rows.Count) 116if (RowIndex < 0 || RowIndex >= _dataGridView.Rows.Count) 140if (RowIndex < 0 || RowIndex >= _dataGridView.Rows.Count) 169if (RowIndex < 0 || RowIndex >= _dataGridView.Rows.Count)
System\Windows\Forms\Controls\DataGridView\DataGridViewTextBoxColumn.cs (1)
64int rowCount = dataGridViewRows.Count;