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