Implemented interface member:
125 references to Count
System.Windows.Forms (68)
System\Windows\Forms\Controls\Buttons\ButtonBase.cs (4)
384if (actualIndex >= _imageList.Images.Count) 386actualIndex = _imageList.Images.Count - 1; 457get => _imageIndex.Index != ImageList.Indexer.DefaultIndex && _imageList is not null && _imageIndex.Index >= _imageList.Images.Count 458? _imageList.Images.Count - 1
System\Windows\Forms\Controls\ImageList\ImageList.cs (5)
96private bool ShouldSerializeColorDepth() => Images.Count == 0; 175private bool ShouldSerializeImageSize() => Images.Count == 0; 526ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(index, Images.Count); 603ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(index, Images.Count); 757: $"{base.ToString()} Images.Count: {Images.Count}, ImageSize: {ImageSize}";
System\Windows\Forms\Controls\ImageList\ImageList.ImageCollection.cs (12)
65for (int i = 0; i < Count; i++) 121public bool Empty => Count == 0; 130ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(index, Count); 137ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(index, Count); 229Debug.Assert((Count == _imageInfoCollection.Count), "The count of these two collections should be equal."); 247Debug.Assert((Count == _imageInfoCollection.Count), "The count of these two collections should be equal."); 268return Count - 1; 484for (i = 0; i < Count; i++) 504private bool IsValidIndex(int index) => index >= 0 && index < Count; 509for (int i = 0; i < Count; ++i) 520Image[] images = new Image[Count]; 545ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(index, Count);
System\Windows\Forms\Controls\Labels\Label.cs (2)
423if (ImageList is not null && (index >= ImageList.Images.Count)) 425return ImageList.Images.Count - 1;
System\Windows\Forms\Controls\Labels\Label.LabelImageIndexer.cs (2)
62return (Index < ImageList.Images.Count) ? Index : ImageList.Images.Count - 1;
System\Windows\Forms\Controls\ListView\ColumnHeader.cs (3)
92if (ImageList is null || ImageList.Images is null || imgIndex >= ImageList.Images.Count) 197if (_imageIndexer.Index != ImageList.Indexer.DefaultIndex && ImageList is not null && _imageIndexer.Index >= ImageList.Images.Count) 199return ImageList.Images.Count - 1;
System\Windows\Forms\Controls\ListView\ListView.cs (6)
1600(_imageListState is null || _imageListState.Images.Count == 0) ? 0 : _imageListState.Handle); 3680group.TitleImageIndex = group.ImageIndexer.ActualIndex < _imageListGroup.Images.Count 3682: _imageListGroup.Images.Count - 1; 4308int imageIndex = item.ImageIndexer.ActualIndex < _imageListLarge.Images.Count 4310: _imageListLarge.Images.Count - 1; 5897if (_imageListState is not null && _imageListState.Images.Count < 2)
System\Windows\Forms\Controls\ListView\ListViewGroup.cs (2)
268return imageList is null || ImageIndexer.Index < imageList.Images.Count 270: imageList.Images.Count - 1;
System\Windows\Forms\Controls\ListView\ListViewItem.cs (2)
477return ImageList is null || ImageIndexer.Index < ImageList.Images.Count 479: ImageList.Images.Count - 1;
System\Windows\Forms\Controls\ListView\ListViewItem.ListViewItemBaseAccessibleObject.cs (1)
55internal bool HasImage => _owningItem.ImageList is not null && _owningItem.ImageList.Images.Count > 0
System\Windows\Forms\Controls\ListView\ListViewItemStateImageIndexConverter.cs (1)
74int nImages = imageList.Images.Count;
System\Windows\Forms\Controls\PropertyGrid\PropertyGrid.cs (1)
2093for (int i = 0; i < images.Count; i++)
System\Windows\Forms\Controls\ToolStrips\ToolStripItem.cs (3)
1029if (!disposing && ImageIndexer.ActualIndex < Owner.ImageList.Images.Count) 1118&& Owner.ImageList is not null && ImageIndexer.Index >= Owner.ImageList.Images.Count) 1120return Owner.ImageList.Images.Count - 1;
System\Windows\Forms\Controls\TreeView\TreeNode.cs (8)
513&& ImageIndexer.Index >= tv.ImageList.Images.Count) 515return tv.ImageList.Images.Count - 1; 896&& SelectedImageIndexer.Index >= tv.ImageList.Images.Count) 898return tv.ImageList.Images.Count - 1; 1022StateImageIndexer.Index >= tv.StateImageList.Images.Count) 1024return tv.StateImageList.Images.Count - 1; 2215tv.ImageList is { } imageList && ImageIndexer.ActualIndex >= imageList.Images.Count 2216? imageList.Images.Count - 1
System\Windows\Forms\Controls\TreeView\TreeView.cs (12)
543if (ImageIndexer.Index >= _imageList.Images.Count) 545return Math.Max(0, _imageList.Images.Count - 1); 631if (StateImageList is not null && StateImageList.Images.Count > 0 && _internalStateImageList is not null) 710if ((_stateImageList is null || _stateImageList.Images.Count == 0) && CheckBoxes) 1014if (SelectedImageIndexer.Index >= _imageList.Images.Count) 1016return Math.Max(0, _imageList.Images.Count - 1); 1765if (_stateImageList is null || _stateImageList.Images.Count <= 0) 1771Image[] images = new Image[_stateImageList.Images.Count + 1]; 1773for (int i = 1; i <= _stateImageList.Images.Count; i++) 1972if (_stateImageList is null || _stateImageList.Images.Count <= 0) 1983Image[] images = new Image[_stateImageList.Images.Count + 1]; 1985for (int i = 1; i <= _stateImageList.Images.Count; i++)
System\Windows\Forms\Controls\TreeView\TreeViewImageIndexConverter.cs (1)
120int nImages = imageList.Images.Count + 2;
System\Windows\Forms\ImageIndexConverter.cs (1)
144int nImages = imageList.Images.Count;
System\Windows\Forms\ImageKeyConverter.cs (1)
150int nImages = imageList.Images.Count;
System\Windows\Forms\VisualStyles\VisualStyleRenderer.cs (1)
320ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(imageIndex, imageList.Images.Count);
System.Windows.Forms.Design (5)
System\Windows\Forms\Design\DesignBindingPicker.cs (1)
2262BindingImageIndex = images.Count - 1;
System\Windows\Forms\Design\ImageCollectionEditor.cs (2)
95var imageListImages = new ImageListImage[source.Count]; 96for (int i = 0; i < source.Count; i++)
System\Windows\Forms\Design\ImageIndexEditor.cs (1)
94if (index < _currentImageList.Images.Count)
System\Windows\Forms\Design\ImageListDesigner.OriginalImageCollection.cs (1)
121for (int i = 0; i < _owner.ImageList.Images.Count; i++)
System.Windows.Forms.Tests (52)
System\Windows\Forms\BinaryFormat\WinFormsBinaryFormattedObjectTests.cs (2)
88newList.Images.Count.Should().Be(1); 110newList.Images.Count.Should().Be(1);
System\Windows\Forms\BinaryFormatUtilitiesTests.cs (2)
256newList.Images.Count.Should().Be(1); 271newList.Images.Count.Should().Be(1);
System\Windows\Forms\ImageList.ImageCollectionTests.cs (41)
446collection.Count.Should().Be(1); 453Assert.Equal(2, collection.Count); 460Assert.Equal(3, collection.Count); 466Assert.Equal(4, collection.Count); 473Assert.Equal(5, collection.Count); 498Assert.Equal(2, collection.Count); 505Assert.Equal(3, collection.Count); 511Assert.Equal(4, collection.Count); 518Assert.Equal(5, collection.Count); 535collection.Count.Should().Be(1); 542Assert.Equal(2, collection.Count); 567Assert.Equal(2, collection.Count); 604collection.Count.Should().Be(1); 611Assert.Equal(2, collection.Count); 636Assert.Equal(2, collection.Count); 661collection.Count.Should().Be(1); 668Assert.Equal(2, collection.Count); 675Assert.Equal(3, collection.Count); 681Assert.Equal(4, collection.Count); 688Assert.Equal(5, collection.Count); 713Assert.Equal(2, collection.Count); 720Assert.Equal(3, collection.Count); 726Assert.Equal(4, collection.Count); 733Assert.Equal(5, collection.Count); 750collection.Count.Should().Be(1); 757Assert.Equal(2, collection.Count); 782Assert.Equal(2, collection.Count); 823Assert.Equal(2, collection.Count); 830Assert.Equal(2, collection.Count); 848Assert.Equal(2, collection.Count); 855Assert.Equal(2, collection.Count); 912Assert.Equal(expectedCount, collection.Count); 930Assert.Equal(expectedCount, collection.Count); 1318Assert.Equal(2, collection.Count); 1356Assert.Equal(2, collection.Count); 1416Assert.Equal(2, collection.Count); 1422Assert.Equal(2, collection.Count); 1460Assert.Equal(2, collection.Count); 1468Assert.Equal(2, collection.Count); 1511Assert.Equal(3, collection.Count); 1520Assert.Equal(3, collection.Count);
System\Windows\Forms\ImageListStreamerTests.cs (4)
38Assert.Equal(imageListBf.Images.Count, imageListMs.Images.Count); 65Assert.Equal(imageListBf.Images.Count, imageListMs.Images.Count);
System\Windows\Forms\ImageListTests.cs (3)
839list.Images.Count.Should().Be(0); 859Assert.Equal(2, list.Images.Count); 864Assert.Equal(2, list.Images.Count);