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