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); 3684group.TitleImageIndex = group.ImageIndexer.ActualIndex < _imageListGroup.Images.Count 3686: _imageListGroup.Images.Count - 1; 4312int imageIndex = item.ImageIndexer.ActualIndex < _imageListLarge.Images.Count 4314: _imageListLarge.Images.Count - 1; 5901if (_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; 2213tv.ImageList is { } imageList && ImageIndexer.ActualIndex >= imageList.Images.Count 2214? 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)
2264BindingImageIndex = 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)
119for (int i = 0; i < _owner.ImageList.Images.Count; i++)
System.Windows.Forms.Tests (52)
System\Windows\Forms\BinaryFormat\WinFormsBinaryFormattedObjectTests.cs (2)
191newList.Images.Count.Should().Be(1); 214newList.Images.Count.Should().Be(1);
System\Windows\Forms\ImageList.ImageCollectionTests.cs (41)
448collection.Count.Should().Be(1); 455Assert.Equal(2, collection.Count); 462Assert.Equal(3, collection.Count); 468Assert.Equal(4, collection.Count); 475Assert.Equal(5, collection.Count); 500Assert.Equal(2, collection.Count); 507Assert.Equal(3, collection.Count); 513Assert.Equal(4, collection.Count); 520Assert.Equal(5, collection.Count); 537collection.Count.Should().Be(1); 544Assert.Equal(2, collection.Count); 569Assert.Equal(2, collection.Count); 606collection.Count.Should().Be(1); 613Assert.Equal(2, collection.Count); 638Assert.Equal(2, collection.Count); 663collection.Count.Should().Be(1); 670Assert.Equal(2, collection.Count); 677Assert.Equal(3, collection.Count); 683Assert.Equal(4, collection.Count); 690Assert.Equal(5, collection.Count); 715Assert.Equal(2, collection.Count); 722Assert.Equal(3, collection.Count); 728Assert.Equal(4, collection.Count); 735Assert.Equal(5, collection.Count); 752collection.Count.Should().Be(1); 759Assert.Equal(2, collection.Count); 784Assert.Equal(2, collection.Count); 825Assert.Equal(2, collection.Count); 832Assert.Equal(2, collection.Count); 850Assert.Equal(2, collection.Count); 857Assert.Equal(2, collection.Count); 914Assert.Equal(expectedCount, collection.Count); 932Assert.Equal(expectedCount, collection.Count); 1320Assert.Equal(2, collection.Count); 1358Assert.Equal(2, collection.Count); 1418Assert.Equal(2, collection.Count); 1424Assert.Equal(2, collection.Count); 1462Assert.Equal(2, collection.Count); 1470Assert.Equal(2, collection.Count); 1513Assert.Equal(3, collection.Count); 1522Assert.Equal(3, collection.Count);
System\Windows\Forms\ImageListStreamerTests.cs (4)
40Assert.Equal(imageListBf.Images.Count, imageListMs.Images.Count); 67Assert.Equal(imageListBf.Images.Count, imageListMs.Images.Count);
System\Windows\Forms\ImageListTests.cs (3)
841list.Images.Count.Should().Be(0); 861Assert.Equal(2, list.Images.Count); 866Assert.Equal(2, list.Images.Count);
System\Windows\Forms\Ole\BinaryFormatUtilitiesTests.cs (1)
50newList.Images.Count.Should().Be(1);
System\Windows\Forms\TreeViewImageIndexConverterTests.cs (1)
93result.Count.Should().Be(imageList.Images.Count + 2);