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