Implemented interface member:
222 references to Count
PresentationUI (2)
MS\Internal\Documents\SignatureSummaryDialog.cs (2)
319if (_showRequestDialog && _listBoxSummary.Items.Count > 0) 587if (e.Index > -1 && e.Index < _listBoxSummary.Items.Count)
System.Windows.Forms (47)
System\Windows\Forms\Controls\ListBoxes\CheckedListBox.CheckedIndexCollection.cs (1)
161if (index >= 0 && index < _owner.Items.Count)
System\Windows\Forms\Controls\ListBoxes\CheckedListBox.cs (12)
230if ((items is not null) && (items.Count > 0)) 373ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(index, Items.Count); 415if (index < 0 || index >= Items.Count) 485if (e.Index < Items.Count) 507if (e.Index < Items.Count) 714if (Items.Count == 0 && 835CheckState[] savedCheckedItems = new CheckState[Items.Count]; 836for (int i = 0; i < Items.Count; i++) 845for (int j = 0; j < Items.Count; j++) 858ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(index, Items.Count); 945if (item < 0 || item >= Items.Count) 958if (item < 0 || item >= Items.Count || (state != LB_CHECKED && state != LB_UNCHECKED))
System\Windows\Forms\Controls\ListBoxes\ListBox.AccessibleObject.cs (3)
80int childCount = this.TryGetOwnerAs(out ListBox? owner) ? owner.Items.Count : 0; 193if (index < 0 || index >= owner.Items.Count || owner.Items.InnerArray.Count == 0) 216return this.TryGetOwnerAs(out ListBox? owner) ? owner.Items.Count : 0;
System\Windows\Forms\Controls\ListBoxes\ListBox.cs (22)
635if (Items.Count == _itemsCount) 640_itemsCount = Items.Count; 726int count = _itemsCollection.Count; 740int count = _itemsCollection.Count; 852ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(value, _itemsCollection?.Count ?? 0); 1043if (_sorted && _itemsCollection is not null && _itemsCollection.Count >= 1) 1086int cnt = Items.Count; 1272ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(index, Items.Count); 1300string?[] strings = new string[Items.Count]; 1302for (int i = 0; i < Items.Count; i++) 1326int itemCount = (_itemsCollection is null) ? 0 : _itemsCollection.Count; 1411int itemCount = (_itemsCollection is null) ? 0 : _itemsCollection.Count; 1657int cnt = Items.Count; 1778int count = _itemsCollection.Count; 1883AccessibilityObject?.GetChild(Items.Count - 1)?.RaiseAutomationEvent(UIA_EVENT_ID.UIA_AutomationFocusChangedEventId); 1952int cnt = Items.Count; 1996newItems = new object[savedItems.Count]; 2018int cnt = savedItems.Count; 2144int itemCount = (_itemsCollection is null) ? 0 : _itemsCollection.Count; 2192int count = _itemsCollection.Count; 2213s += $", Items.Count: {Items.Count}"; 2214if (Items.Count > 0)
System\Windows\Forms\Controls\ListBoxes\ListBox.ItemAccessibleObject.cs (2)
132int lastItemIndex = _owningListBox.Items.Count - 1; 220int itemsCount = _owningListBox.Items.Count;
System\Windows\Forms\Controls\ListBoxes\ListBox.ObjectCollection.cs (4)
105if (Count > 0) 120Debug.Assert(index >= 0 && index <= Count, "Wrong index for insert"); 140index = Count - 1; 244int cnt = _owner.Items.Count;
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\PropertyGridView.cs (2)
2260if (DropDownListBox.Items.Count == 0) 3728bool resizable = DropDownListBox.Items.Count > (DropDownListBox.Height / DropDownListBox.ItemHeight);
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\PropertyGridView.DropDownHolder.cs (1)
589if (listBox.Items.Count == 0)
System.Windows.Forms.Design (44)
System\ComponentModel\Design\CollectionEditor.CollectionEditorCollectionForm.cs (16)
164_listBox.SelectedIndex = _listBox.Items.Count - 1; 166object[] items = new object[_listBox.Items.Count]; 176if (_listBox.Items.Count > 0 && _listBox.SelectedIndex != _listBox.Items.Count - 1) 179_listBox.SelectedIndex = _listBox.Items.Count - 1; 211int c = Math.Max(2, _listBox.Items.Count); 321if (index == _listBox.Items.Count - 1) 329if (ti < _listBox.Items.Count - 1) 561int c = _listBox.Items.Count; 677object[] items = new object[_listBox.Items.Count]; 761if (_listBox.Items.Count > 0) 821if (index < _listBox.Items.Count) 825else if (_listBox.Items.Count > 0) 827_listBox.SelectedIndex = _listBox.Items.Count - 1; 1033_upButton.Enabled = editEnabled && _listBox.Items.Count > 1; 1034_downButton.Enabled = editEnabled && _listBox.Items.Count > 1;
System\ComponentModel\Design\DesignerActionPanel.EditorPropertyLine.cs (1)
87if (listBox.Items.Count > 0)
System\Drawing\Design\CursorEditor.CursorUI.cs (1)
96for (int i = 0; i < Items.Count; i++)
System\Windows\Forms\Design\DataGridViewAddColumnDialog.cs (3)
179bool dataGridViewIsDataBound = _dataColumns.Items.Count > 0; 743_dataColumns.SelectedIndex = selectedIndex != -1 && selectedIndex < _dataColumns.Items.Count 745: _dataColumns.Items.Count > 0 ? 0 : -1;
System\Windows\Forms\Design\DataGridViewColumnCollectionDialog.cs (19)
663Debug.Assert(selectedIndex > -1 && selectedIndex < _selectedColumns.Items.Count - 1); 703_moveDown.Enabled = _selectedColumns.SelectedIndex < _selectedColumns.Items.Count - 1; 747_moveDown.Enabled = _selectedColumns.SelectedIndex < _selectedColumns.Items.Count - 1; 761for (int i = 0; i < _selectedColumns.Items.Count; i++) 805_selectedColumns.SelectedIndex = Math.Min(0, _selectedColumns.Items.Count - 1); 808_moveDown.Enabled = _selectedColumns.SelectedIndex < _selectedColumns.Items.Count - 1; 809_deleteButton.Enabled = _selectedColumns.Items.Count > 0 && _selectedColumns.SelectedIndex != -1; 834_selectedColumns.SelectedIndex = Math.Min(_selectedColumns.Items.Count - 1, selectedIndex); 837_moveDown.Enabled = _selectedColumns.SelectedIndex < _selectedColumns.Items.Count - 1; 838_deleteButton.Enabled = _selectedColumns.Items.Count > 0 && _selectedColumns.SelectedIndex != -1; 844int insertIndex = _selectedColumns.SelectedIndex == -1 ? _selectedColumns.Items.Count : _selectedColumns.SelectedIndex + 1; 863for (int i = 0; i < _selectedColumns.Items.Count; i++) 881_selectedColumns.SelectedIndex = Math.Min(selectedIndex, _selectedColumns.Items.Count - 1); 885if (_selectedColumns.Items.Count == 0) 1066_moveDown.Enabled = _selectedColumns.Items.Count > 0 && _selectedColumns.SelectedIndex != _selectedColumns.Items.Count - 1; 1067_moveUp.Enabled = _selectedColumns.Items.Count > 0 && _selectedColumns.SelectedIndex > 0; 1068_deleteButton.Enabled = _selectedColumns.Items.Count > 0 && _selectedColumns.SelectedIndex != -1; 1158for (int i = 0; i < _selectedColumns.Items.Count; i++)
System\Windows\Forms\Design\DataGridViewColumnTypeEditor.Picker.cs (2)
47for (int i = 0; i < _typesListBox.Items.Count; i++) 127for (int i = 0; i < _typesListBox.Items.Count; i++)
System\Windows\Forms\Design\FormatControl.cs (1)
48for (int i = 0; i < formatTypeListBox.Items.Count; i++)
System\Windows\Forms\Design\ListBoxDesigner.cs (1)
184if (listBox.IsHandleCreated && listBox.Items.Count == 0)
System.Windows.Forms.Tests (127)
CheckedListBoxTests.cs (8)
508Assert.Equal(3, checkedListBox.Items.Count); 516Assert.Equal(2, checkedListBox.Items.Count); 546for (int count = checkedListBox.Items.Count; count > 1; count -= 1) 558Assert.Equal(count, checkedListBox.Items.Count); 582for (int count = checkedListBox.Items.Count; count > 1; count -= 1) 591Assert.Equal(count, checkedListBox.Items.Count); 611for (int count = checkedListBox.Items.Count; count > 1; count -= 1) 622Assert.Equal(count, checkedListBox.Items.Count);
System\Windows\Forms\AccessibleObjects\CheckedListBoxAccessibleObjectTests.cs (1)
30for (int i = 0; i < checkedListBox.Items.Count; i++)
System\Windows\Forms\ListBox.ObjectCollectionTests.cs (106)
26Assert.Equal(3, collection.Count); 39Assert.Equal(3, collection.Count); 1314Assert.Equal(2, collection.Count); 1322Assert.Equal(3, collection.Count); 1330Assert.Equal(4, collection.Count); 1355Assert.Equal(2, collection.Count); 1363Assert.Equal(3, collection.Count); 1371Assert.Equal(4, collection.Count); 1399Assert.Equal(2, collection.Count); 1407Assert.Equal(3, collection.Count); 1415Assert.Equal(4, collection.Count); 1443Assert.Equal(2, collection.Count); 1451Assert.Equal(3, collection.Count); 1459Assert.Equal(4, collection.Count); 1495Assert.Equal(2, collection.Count); 1510Assert.Equal(3, collection.Count); 1527Assert.Equal(4, collection.Count); 1574Assert.Equal(2, collection.Count); 1589Assert.Equal(3, collection.Count); 1606Assert.Equal(4, collection.Count); 1656Assert.Equal(2, collection.Count); 1671Assert.Equal(3, collection.Count); 1688Assert.Equal(4, collection.Count); 1738Assert.Equal(2, collection.Count); 1753Assert.Equal(3, collection.Count); 1770Assert.Equal(4, collection.Count); 2224Assert.Equal(4, collection.Count); 2232Assert.Equal(4, collection.Count); 2248Assert.Equal(4, collection.Count); 2256Assert.Equal(4, collection.Count); 2275Assert.Equal(4, collection.Count); 2283Assert.Equal(4, collection.Count); 2302Assert.Equal(4, collection.Count); 2310Assert.Equal(4, collection.Count); 2332Assert.Equal(4, collection.Count); 2351Assert.Equal(4, collection.Count); 2384Assert.Equal(4, collection.Count); 2403Assert.Equal(4, collection.Count); 2439Assert.Equal(4, collection.Count); 2458Assert.Equal(4, collection.Count); 2494Assert.Equal(4, collection.Count); 2513Assert.Equal(4, collection.Count); 2881Assert.Equal(4, collection.Count); 2891Assert.Equal(4, collection.Count); 2910Assert.Equal(4, collection.Count); 2920Assert.Equal(4, collection.Count); 2942Assert.Equal(4, collection.Count); 2952Assert.Equal(4, collection.Count); 2974Assert.Equal(4, collection.Count); 2984Assert.Equal(4, collection.Count); 3009Assert.Equal(4, collection.Count); 3030Assert.Equal(4, collection.Count); 3066Assert.Equal(4, collection.Count); 3087Assert.Equal(4, collection.Count); 3126Assert.Equal(4, collection.Count); 3147Assert.Equal(4, collection.Count); 3186Assert.Equal(4, collection.Count); 3207Assert.Equal(4, collection.Count); 4137Assert.Equal(2, collection.Count); 4145Assert.Equal(3, collection.Count); 4153Assert.Equal(4, collection.Count); 4178Assert.Equal(2, collection.Count); 4186Assert.Equal(3, collection.Count); 4194Assert.Equal(4, collection.Count); 4222Assert.Equal(2, collection.Count); 4230Assert.Equal(3, collection.Count); 4238Assert.Equal(4, collection.Count); 4266Assert.Equal(2, collection.Count); 4274Assert.Equal(3, collection.Count); 4282Assert.Equal(4, collection.Count); 4318Assert.Equal(2, collection.Count); 4333Assert.Equal(3, collection.Count); 4350Assert.Equal(4, collection.Count); 4397Assert.Equal(2, collection.Count); 4412Assert.Equal(3, collection.Count); 4429Assert.Equal(4, collection.Count); 4479Assert.Equal(2, collection.Count); 4494Assert.Equal(3, collection.Count); 4511Assert.Equal(4, collection.Count); 4561Assert.Equal(2, collection.Count); 4576Assert.Equal(3, collection.Count); 4593Assert.Equal(4, collection.Count); 5068Assert.Equal(2, collection.Count); 5076Assert.Equal(2, collection.Count); 5112Assert.Equal(2, collection.Count); 5119Assert.Equal(2, collection.Count); 5158Assert.Equal(2, collection.Count); 5166Assert.Equal(2, collection.Count); 5205Assert.Equal(2, collection.Count); 5212Assert.Equal(2, collection.Count); 5252Assert.Equal(2, collection.Count); 5267Assert.Equal(2, collection.Count); 5326Assert.Equal(2, collection.Count); 5342Assert.Equal(2, collection.Count); 5404Assert.Equal(2, collection.Count); 5419Assert.Equal(2, collection.Count); 5481Assert.Equal(2, collection.Count); 5497Assert.Equal(2, collection.Count); 6015Assert.Equal(2, collection.Count); 6051Assert.Equal(2, collection.Count); 6090Assert.Equal(2, collection.Count); 6129Assert.Equal(2, collection.Count); 6169Assert.Equal(2, collection.Count); 6228Assert.Equal(2, collection.Count); 6290Assert.Equal(2, collection.Count); 6352Assert.Equal(2, collection.Count);
System\Windows\Forms\ListBoxTests.cs (12)
6124Assert.Equal(3, listBox.Items.Count); 6132Assert.Equal(2, listBox.Items.Count); 6166Assert.Equal(4, listBox.Items.Count); 6174Assert.Equal(3, listBox.Items.Count); 6182Assert.Equal(2, listBox.Items.Count); 6204for (int count = listBox.Items.Count; count > 1; count -= 1) 6216Assert.Equal(count, listBox.Items.Count); 6240for (int count = listBox.Items.Count; count > 1; count -= 1) 6253Assert.Equal(count, listBox.Items.Count); 6316int itemCount = listBox.Items.Count; 6364for (int i = 0; i < listBox.Items.Count; i++) 6388for (int i = 0; i < listBox.Items.Count; i++)
System.Windows.Forms.UI.IntegrationTests (2)
DragDropTests.cs (2)
417Assert.Equal(2, form.ListDragTarget.Items.Count); 781else if (ListDragSource.Items.Count > 0)