Implemented interface member:
83 references to Count
System.Windows.Forms (59)
System\Windows\Forms\Controls\ListView\ListView.CheckedIndexCollection.cs (2)
55
for (int i = 0; i < _owner.Items.
Count
&& index < indices.Length; ++i)
77
int cnt = _owner.Items.
Count
;
System\Windows\Forms\Controls\ListView\ListView.CheckedListViewItemCollection.cs (1)
50
for (int i = 0; i < _owner.Items.
Count
&& index < items.Length; ++i)
System\Windows\Forms\Controls\ListView\ListView.cs (33)
1719
return Items.
Count
> 0 ? Items[0] : null;
1723
return _topIndex >= 0 && _topIndex < Items.
Count
? Items[_topIndex] : null;
1755
if ((topItem is null) && (_topIndex == Items.
Count
))
1911
if (value && Items.
Count
> 0)
2475
&& Items.
Count
> 0)
2501
Items.
Count
> 0)
2518
for (int i = 0; i < Items.
Count
; i++)
3181
ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(index, Items.
Count
);
3189
public ListViewItem? FindItemWithText(string text) => Items.
Count
== 0
3199
ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(startIndex, Items.
Count
);
3265
if (Items.
Count
== 0)
3318
for (int i = startIndex; i < Items.
Count
; i++)
3571
ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(index, Items.
Count
);
3600
if (index < 0 || index >= Items.
Count
)
3636
ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(itemIndex, Items.
Count
);
3941
for (int i = 0; i < Items.
Count
; i++)
3955
for (int i = 0; i < Items.
Count
; i++)
3993
if (IsHandleCreated && Items.
Count
== 0 && View == View.SmallIcon && Application.ComCtlSupportsVisualStyles)
4362
if (Items.
Count
> 0)
4646
for (int i = 0; i < Items.
Count
; i++)
4662
int count = Items.
Count
;
4684
var items = new ListViewItem[tempItems.
Count
];
4704
if (ShowItemToolTips && Items.
Count
> 0 && (FocusedItem ?? Items[0]) is ListViewItem focusedItem)
4978
int maxSize = VirtualMode ? VirtualListSize : Items.
Count
;
5012
if (endIndex < Items.
Count
- 1)
5044
for (int i = 0; i < Items.
Count
; i++)
5497
if (itemIndex < 0 || itemIndex >= Items.
Count
)
5568
s += $", Items.Count: {Items.
Count
}";
5569
if (Items.
Count
> 0 && !VirtualMode)
6570
if (indexItem >= 0 && indexItem < Items.
Count
)
6612
if (Items.
Count
> 0)
6622
if (Items.
Count
== 0 || Items[^1] is not null)
7052
if (FocusedItem is null && Items.
Count
> 0)
System\Windows\Forms\Controls\ListView\ListView.ListViewAccessibleObject.cs (5)
68
=> this.TryGetOwnerAs(out ListView? owningListView) ? owningListView.Items.
Count
: base.RowCount;
103
return index < owningListView.Items.
Count
? owningListView.Items[index].AccessibilityObject : null;
113
int count = owningListView.GroupsDisplayed ? GetVisibleGroups().Count : owningListView.Items.
Count
;
128
return index < owningListView.Items.
Count
? index : InvalidIndex;
219
return owningListView.Items.
Count
== 0 ? null : owningListView.Items[^1].AccessibilityObject;
System\Windows\Forms\Controls\ListView\ListView.ListViewItemCollection.cs (7)
227
var itemArray = new ListViewItem[items.
Count
];
281
for (int i = 0; i < listViewItems.
Count
; i++)
318
for (int index = 0; index <
Count
; ++index)
353
for (int i = 0; i <
Count
; i++)
372
return index >= 0 && index <
Count
;
378
ArgumentOutOfRangeException.ThrowIfGreaterThan(index,
Count
);
439
ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(index,
Count
);
System\Windows\Forms\Controls\ListView\ListView.ListViewNativeItemCollection.cs (2)
225
int count = _owner.Items.
Count
;
281
int count = _owner.Items.
Count
;
System\Windows\Forms\Controls\ListView\ListView.SelectedIndexCollection.cs (3)
170
if (selectedIndex < 0 || selectedIndex >= _owner.Items.
Count
)
274
ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(itemIndex, _owner.Items.
Count
);
329
ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(itemIndex, _owner.Items.
Count
);
System\Windows\Forms\Controls\ListView\ListViewGroup.cs (3)
466
if (_items is not null && _items.
Count
> 0)
468
info.AddValue("ItemsCount", Items.
Count
);
469
for (int i = 0; i < Items.
Count
; i++)
System\Windows\Forms\Controls\ListView\ListViewGroup.ListViewGroupAccessibleObject.cs (1)
26
?? (owningGroup.Items.
Count
> 0 && _owningGroup.Items[0].ListView is ListView listView
System\Windows\Forms\Controls\ListView\ListViewGroupCollection.cs (1)
175
for (int i = 0; i < group.Items.
Count
; i++)
System\Windows\Forms\Controls\ListView\ListViewItem.IKeyboardToolTip.cs (1)
53
if (Index < _listView.Items.
Count
- 1)
System.Windows.Forms.Design (2)
System\Windows\Forms\Design\MaskDesignerDialog.cs (2)
463
if (maskDexIndex < 0 || _listViewCannedMasks.Items.
Count
<= maskDexIndex)
601
if (_listViewCannedMasks.FocusedItem is not null || _listViewCannedMasks.Items.
Count
<= 0)
System.Windows.Forms.Tests (22)
System\Windows\Forms\ListViewTests.cs (22)
4597
Assert.True(control.Items.
Count
> 0);
5533
Assert.Equal(3, listView.Items.
Count
);
5540
Assert.Equal(2, listView.Items.
Count
);
5562
for (int count = listView.Items.
Count
; count > 1; count -= 1)
5568
Assert.Equal(count, listView.Items.
Count
);
5577
Assert.Equal(count, listView.Items.
Count
);
5595
Assert.Equal(3, listView.Items.
Count
);
5602
Assert.Equal(2, listView.Items.
Count
);
5622
for (int count = listView.Items.
Count
; count > 1; count -= 1)
5628
Assert.Equal(count, listView.Items.
Count
);
5637
Assert.Equal(count, listView.Items.
Count
);
5658
Assert.Equal(3, listView.Items.
Count
);
5666
Assert.Equal(3, listView.Items.
Count
);
5675
Assert.Equal(3, listView.Items.
Count
);
5701
Assert.Equal(3, listView.Items.
Count
);
5711
Assert.Equal(3, listView.Items.
Count
);
5733
Assert.Equal(3, listView.Items.
Count
);
5734
Assert.Equal(3, listView.Items.
Count
);
5741
Assert.Equal(3, listView.Items.
Count
);
5749
Assert.Equal(3, listView.Items.
Count
);
5774
Assert.Equal(3, listView.Items.
Count
);
5784
Assert.Equal(3, listView.Items.
Count
);