298 instantiations of ListViewGroup
System.Windows.Forms (2)
System\Windows\Forms\Controls\ListView\ListView.cs (1)
737
_defaultGroup ??= new
ListViewGroup
(string.Format(SR.ListViewGroupDefaultGroup, "1"))
System\Windows\Forms\Controls\ListView\ListViewGroupCollection.cs (1)
136
ListViewGroup group =
new
(key, headerText);
System.Windows.Forms.Tests (292)
SerializableTypesTests.cs (1)
126
ListViewGroup listViewGroup =
new
("Header", HorizontalAlignment.Center)
System\Windows\Forms\AccessibleObjects\ListVIew.ListViewAccessibleObjectTests.cs (25)
89
ListViewGroup group =
new
();
119
ListViewGroup group =
new
();
143
ListViewGroup group =
new
();
273
ListViewGroup listViewGroup =
new
("Test Group");
351
ListViewGroup listViewGroup =
new
("Test Group");
397
listView.Groups.Add(new
ListViewGroup
("Test Group"));
454
listView.Groups.Add(new
ListViewGroup
("Test Group"));
520
listView.Groups.Add(new
ListViewGroup
("Test Group"));
591
listView.Groups.Add(new
ListViewGroup
("Test Group"));
646
listView.Groups.Add(new
ListViewGroup
("Test Group 1"));
647
listView.Groups.Add(new
ListViewGroup
("Test Group 2"));
726
listView.Groups.Add(new
ListViewGroup
("Test Group 1"));
727
listView.Groups.Add(new
ListViewGroup
("Test Group 2"));
804
listView.Groups.Add(new
ListViewGroup
("Test Group 1"));
806
listView.Groups.Add(new
ListViewGroup
("Test Group 2"));
860
listView.Groups.Add(new
ListViewGroup
("Test Group 1"));
861
listView.Groups.Add(new
ListViewGroup
("Test Group 2"));
921
ListViewGroup listGroup1 =
new
("Group1");
922
ListViewGroup listGroup2 =
new
("Group2");
923
ListViewGroup listGroup3 =
new
("Group2");
1391
ListViewGroup listViewGroup =
new
("Test");
1722
ListViewGroup listViewGroupWithoutItems =
new
("Group without items");
1723
ListViewGroup listViewGroupWithItems1 =
new
("Group with item 1");
1724
ListViewGroup listViewGroupWithItems2 =
new
("Group with item 2");
1725
ListViewGroup listViewGroupWithInvisibleItems =
new
("Group with invisible item");
System\Windows\Forms\AccessibleObjects\ListViewGroup.ListViewGroupAccessibleObjectTests.cs (42)
20
ListViewGroup listGroup =
new
("Group1");
30
ListViewGroup listGroupWithoutList =
new
("Group2");
38
ListViewGroup listGroup =
new
("Group1");
53
ListViewGroup listGroup =
new
("Group1");
84
ListViewGroup listGroup =
new
("Group1");
117
ListViewGroup listGroup =
new
(name) { Subtitle = subtitle };
144
groups.Add(new
ListViewGroup
("Group1"));
145
groups.Add(new
ListViewGroup
("Group2"));
213
groups.Add(new
ListViewGroup
("Group1"));
214
groups.Add(new
ListViewGroup
("Group2"));
278
ListViewGroup listGroup =
new
("Group1");
326
ListViewGroup group =
new
();
377
groups.Add(new
ListViewGroup
("Group1"));
378
groups.Add(new
ListViewGroup
("Group2"));
472
groups.Add(new
ListViewGroup
("Group1"));
473
groups.Add(new
ListViewGroup
("Group2"));
508
groups.Add(new
ListViewGroup
("Group1"));
509
groups.Add(new
ListViewGroup
("Group2"));
592
groups.Add(new
ListViewGroup
("Group1"));
593
groups.Add(new
ListViewGroup
("Group2"));
594
groups.Add(new
ListViewGroup
("Group3"));
665
ListViewGroup listViewGroup =
new
("Test Group");
706
ListViewGroup lvgroup1 =
new
()
715
ListViewGroup lvgroup2 =
new
()
740
ListViewGroup listViewGroup =
new
()
793
ListViewGroup group1 =
new
("Group 1") { CollapsedState = firstGroupSate };
794
ListViewGroup group2 =
new
("Group 2") { CollapsedState = ListViewGroupCollapsedState.Expanded };
795
ListViewGroup group3 =
new
("Group 3") { CollapsedState = ListViewGroupCollapsedState.Expanded };
1158
ListViewGroup listViewGroup =
new
();
1219
listView.Groups.Add(new
ListViewGroup
());
1231
ListViewGroup listViewGroupWithoutItems =
new
("Group without items");
1232
ListViewGroup listViewGroupWithItems1 =
new
("Group with item 1");
1233
ListViewGroup listViewGroupWithItems2 =
new
("Group with item 2");
1234
ListViewGroup listViewGroupWithInvisibleItems =
new
("Group with invisible item");
1262
ListViewGroup listGroup1 =
new
("Group1");
1263
ListViewGroup listGroup2 =
new
("Group2");
1323
ListViewGroup listGroup =
new
("Test")
1351
ListViewGroup group =
new
();
1367
ListViewGroup group =
new
();
1381
ListViewGroup group =
new
();
1401
ListViewGroup listViewGroup =
new
("Test group");
1434
ListViewGroup listViewGroup =
new
("Test Group");
System\Windows\Forms\AccessibleObjects\ListViewItem.ListViewItemAccessibleObjectTests.cs (10)
75
ListViewGroup listviewGroup =
new
();
1143
ListViewGroup listViewGroup =
new
("Test");
1204
ListViewGroup listViewGroup =
new
("Test") { CollapsedState = state };
1256
ListViewGroup listViewGroup =
new
("Test group");
1314
listView.Groups.Add(new
ListViewGroup
());
1348
listView.Groups.Add(new
ListViewGroup
());
1406
listView.Groups.Add(new
ListViewGroup
());
1480
listView.Groups.Add(new
ListViewGroup
());
1934
ListViewGroup lvgroup1 =
new
()
1940
ListViewGroup lvgroup2 =
new
()
System\Windows\Forms\AccessibleObjects\ListViewItem.ListViewSubItem.ListViewSubItemAccessibleObjectTests.cs (1)
807
ListViewGroup listViewGroup =
new
("Test");
System\Windows\Forms\BinaryFormat\WinFormsBinaryFormattedObjectTests.cs (1)
134
new
ListViewGroup
(),
System\Windows\Forms\ListViewGroupCollectionTests.cs (96)
28
ListViewGroup group =
new
();
40
collection.Add(new
ListViewGroup
());
49
collection.Add(new
ListViewGroup
());
51
ListViewGroup group =
new
();
64
collection.Add(new
ListViewGroup
());
66
ListViewGroup group =
new
();
79
collection.Add(new
ListViewGroup
());
81
ListViewGroup group =
new
();
100
collection.Add(new
ListViewGroup
());
102
ListViewGroup group =
new
();
121
ListViewGroup group1 =
new
();
122
ListViewGroup group2 =
new
();
135
collection.Add(new
ListViewGroup
());
140
ListViewGroup group =
new
();
155
ListViewGroup oldGroup =
new
();
160
ListViewGroup group =
new
();
174
collection.Add(new
ListViewGroup
());
185
collection.Add(new
ListViewGroup
());
186
Assert.Throws<ArgumentOutOfRangeException>("index", () => collection[index] = new
ListViewGroup
());
195
ListViewGroup group =
new
();
207
collection.Add(new
ListViewGroup
());
216
collection.Add(new
ListViewGroup
());
218
ListViewGroup group =
new
();
229
ListViewGroup group1 =
new
();
230
ListViewGroup group2 =
new
();
245
collection.Add(new
ListViewGroup
());
246
Assert.Throws<ArgumentOutOfRangeException>("index", () => collection[index] = new
ListViewGroup
());
266
ListViewGroup group1 =
new
();
267
ListViewGroup group2 =
new
()
287
ListViewGroup group1 =
new
();
288
ListViewGroup group2 =
new
()
313
ListViewGroup group1 =
new
();
314
ListViewGroup group2 =
new
()
321
ListViewGroup group3 =
new
();
336
ListViewGroup group1 =
new
();
337
ListViewGroup group2 =
new
()
344
ListViewGroup group3 =
new
();
355
collection["text"] = new
ListViewGroup
();
372
ListViewGroup group1 =
new
();
378
ListViewGroup group2 =
new
();
391
ListViewGroup group1 =
new
();
397
ListViewGroup group2 =
new
();
410
ListViewGroup group =
new
();
429
ListViewGroup group1 =
new
();
438
ListViewGroup group2 =
new
();
446
ListViewGroup group1 =
new
();
447
ListViewGroup group2 =
new
();
464
ListViewGroup group =
new
();
491
ListViewGroup group =
new
();
519
ListViewGroup group =
new
();
540
ListViewGroup group1 =
new
();
541
ListViewGroup group2 =
new
();
558
ListViewGroup group1 =
new
();
559
ListViewGroup group2 =
new
();
587
ListViewGroup group =
new
();
597
ListViewGroup group =
new
();
617
ListViewGroup group =
new
();
645
ListViewGroup group =
new
();
649
Assert.False(collection.Contains(new
ListViewGroup
()));
659
Assert.False(collection.Contains(new
ListViewGroup
()));
668
ListViewGroup group =
new
();
672
Assert.False(collection.Contains(new
ListViewGroup
()));
683
Assert.False(collection.Contains(new
ListViewGroup
()));
693
ListViewGroup group =
new
();
697
Assert.Equal(-1, collection.IndexOf(new
ListViewGroup
()));
707
Assert.Equal(-1, collection.IndexOf(new
ListViewGroup
()));
716
ListViewGroup group =
new
();
720
Assert.Equal(-1, collection.IndexOf(new
ListViewGroup
()));
731
Assert.Equal(-1, collection.IndexOf(new
ListViewGroup
()));
741
ListViewGroup group =
new
();
742
collection.Add(new
ListViewGroup
());
756
ListViewGroup group =
new
();
757
collection.Add(new
ListViewGroup
());
771
ListViewGroup group =
new
();
790
ListViewGroup group =
new
();
805
collection.Add(new
ListViewGroup
());
810
ListViewGroup group =
new
();
830
ListViewGroup group1 =
new
();
831
ListViewGroup group2 =
new
();
847
ListViewGroup group =
new
();
863
collection.Add(new
ListViewGroup
());
874
Assert.Throws<ArgumentOutOfRangeException>("index", () => collection.Insert(index, new
ListViewGroup
()));
882
ListViewGroup group =
new
();
883
collection.Add(new
ListViewGroup
());
909
Assert.Throws<ArgumentOutOfRangeException>("index", () => collection.Insert(index, new
ListViewGroup
()));
917
ListViewGroup group =
new
();
941
ListViewGroup group =
new
();
963
ListViewGroup group =
new
();
983
ListViewGroup group =
new
();
995
ListViewGroup group =
new
();
997
collection.Add(new
ListViewGroup
());
998
collection.Add(new
ListViewGroup
());
999
collection.Add(new
ListViewGroup
());
1034
ListViewGroup group =
new
();
1064
Assert.Throws<InvalidOperationException>(() => listView.Groups.Add(new
ListViewGroup
()));
1131
Assert.Throws<InvalidOperationException>(() => listView.Groups.Insert(0, new
ListViewGroup
()));
System\Windows\Forms\ListViewGroupConverterTests.cs (11)
38
ListViewGroup group =
new
("name", "header");
72
ListViewGroup group =
new
("name", "header");
97
listViewWithGroups.Groups.Add(new
ListViewGroup
("name", "header"));
151
ListViewGroup group =
new
("name", "header");
174
new
ListViewGroup
(),
180
new
ListViewGroup
("key", "headerText"),
186
new
ListViewGroup
("header"),
192
new
ListViewGroup
("header", HorizontalAlignment.Center),
237
Assert.Throws<NotSupportedException>(() => converter.ConvertTo(new
ListViewGroup
(), destinationType));
251
ListViewGroup item =
new
();
267
ListViewGroup group =
new
("name", "header");
System\Windows\Forms\ListViewGroupTests.cs (61)
17
ListViewGroup group =
new
();
38
ListViewGroup group =
new
(header);
68
ListViewGroup group =
new
(header, headerAlignment);
96
ListViewGroup group =
new
(key, header);
120
ListViewGroup group =
new
() { CollapsedState = collapsedState };
129
ListViewGroup group =
new
();
138
ListViewGroup group =
new
()
156
ListViewGroup group =
new
();
175
ListViewGroup group =
new
();
222
ListViewGroup group =
new
();
250
ListViewGroup group =
new
();
258
ListViewGroup group =
new
()
276
ListViewGroup group =
new
()
294
ListViewGroup group =
new
();
316
ListViewGroup group =
new
();
362
ListViewGroup group =
new
();
390
ListViewGroup group =
new
()
408
ListViewGroup group =
new
()
426
ListViewGroup group =
new
();
448
ListViewGroup group =
new
();
499
ListViewGroup group =
new
();
530
ListViewGroup group =
new
()
548
ListViewGroup group =
new
();
570
ListViewGroup group =
new
();
612
ListViewGroup group =
new
();
652
ListViewGroup group =
new
()
672
ListViewGroup group =
new
()
696
ListViewGroup group =
new
()
751
ListViewGroup group1 =
new
()
782
ListViewGroup group =
new
();
791
ListViewGroup group =
new
()
809
ListViewGroup group =
new
();
831
ListViewGroup group =
new
();
873
ListViewGroup group =
new
();
904
ListViewGroup group =
new
()
924
ListViewGroup group =
new
()
948
ListViewGroup group =
new
()
1003
ListViewGroup group1 =
new
()
1034
ListViewGroup group =
new
();
1049
ListViewGroup group =
new
()
1066
ListViewGroup group =
new
()
1089
ListViewGroup group =
new
()
1129
ListViewGroup group =
new
();
1170
ListViewGroup group =
new
();
1178
ListViewGroup group =
new
()
1195
ListViewGroup group =
new
()
1213
ListViewGroup group =
new
();
1235
ListViewGroup group =
new
();
1278
ListViewGroup group =
new
();
1307
ListViewGroup group =
new
()
1321
yield return new object[] { new
ListViewGroup
() };
1322
yield return new object[] { new
ListViewGroup
("header", HorizontalAlignment.Center) { Name = "name", Tag = "tag" } };
1324
ListViewGroup groupWithEmptyItems =
new
();
1328
ListViewGroup groupWithItems =
new
();
1359
ListViewGroup group =
new
(header);
1366
ListViewGroup group =
new
();
1382
ListViewGroup group =
new
();
1400
ListViewGroup group =
new
();
1419
ListViewGroup group =
new
();
1431
ListViewGroup listViewGroup =
new
();
1446
ListViewGroup listViewGroup =
new
();
System\Windows\Forms\ListViewItem.IKeyboardToolTipTests.cs (1)
125
ListViewGroup listViewGroup =
new
();
System\Windows\Forms\ListViewItemConverterTests.cs (1)
50
ListViewGroup group =
new
();
System\Windows\Forms\ListViewItemTests.cs (22)
46
yield return new object[] { new string[] { null }, string.Empty, Color.Empty, Color.Empty, null, new
ListViewGroup
(), string.Empty, SystemColors.WindowText, SystemColors.Window, string.Empty };
47
yield return new object[] { new string[] { "text" }, "imageKey", Color.Blue, Color.Red, SystemFonts.MenuFont, new
ListViewGroup
(), "imageKey", Color.Blue, Color.Red, "text" };
84
yield return new object[] { new string[] { null }, 1, Color.Empty, Color.Empty, null, new
ListViewGroup
(), SystemColors.WindowText, SystemColors.Window, string.Empty };
85
yield return new object[] { new string[] { "text" }, 2, Color.Blue, Color.Red, SystemFonts.MenuFont, new
ListViewGroup
(), Color.Blue, Color.Red, "text" };
198
yield return new object[] { new ListViewItem.ListViewSubItem[] { new(null, "text") }, "imageKey", new
ListViewGroup
(), "imageKey", "text" };
235
yield return new object[] { new ListViewItem.ListViewSubItem[] { new(null, "text") }, -1, new
ListViewGroup
(), "text" };
272
yield return new object[] { new string[] { null }, string.Empty, new
ListViewGroup
(), string.Empty, string.Empty };
273
yield return new object[] { new string[] { "text" }, "imageKey", new
ListViewGroup
(), "imageKey", "text" };
310
yield return new object[] { new string[] { null }, 1, new
ListViewGroup
(), string.Empty };
311
yield return new object[] { new string[] { "text" }, 2, new
ListViewGroup
(), "text" };
347
yield return new object[] { string.Empty, string.Empty, new
ListViewGroup
(), string.Empty, string.Empty };
348
yield return new object[] { "text", "imageKey", new
ListViewGroup
(), "text", "imageKey" };
385
yield return new object[] { string.Empty, 0, new
ListViewGroup
(), string.Empty };
386
yield return new object[] { "text", 1, new
ListViewGroup
(), "text" };
498
yield return new object[] { new string[] { null }, new
ListViewGroup
(), string.Empty };
499
yield return new object[] { new string[] { "text" }, new
ListViewGroup
(), "text" };
612
yield return new object[] { "text", new
ListViewGroup
(), "text" };
725
yield return new object[] { new
ListViewGroup
() };
833
Assert.Throws<ArgumentNullException>("subItems", () => new ListViewItem((ListViewItem.ListViewSubItem[])null, "imageKey", new
ListViewGroup
()));
834
Assert.Throws<ArgumentNullException>("subItems", () => new ListViewItem((ListViewItem.ListViewSubItem[])null, 0, new
ListViewGroup
()));
843
Assert.Throws<ArgumentNullException>("subItems", () => new ListViewItem(subItems, "imageKey", new
ListViewGroup
()));
844
Assert.Throws<ArgumentNullException>("subItems", () => new ListViewItem(subItems, 1, new
ListViewGroup
()));
System\Windows\Forms\ListViewTests.cs (20)
1920
ListViewGroup group1 =
new
();
1921
ListViewGroup group2 =
new
()
4541
ListViewGroup group =
new
("Test group");
4567
ListViewGroup group1 =
new
("Test group1");
4568
ListViewGroup group2 =
new
("Test group2");
4569
ListViewGroup group3 =
new
("Test group3");
4618
ListViewGroup group =
new
("Test group");
5651
var groups = new ListViewGroup[] {
new
("Group 1"),
new
("Group 2"),
new
("Group 3") };
5689
var groups = new ListViewGroup[] {
new
("Group 1"),
new
("Group 2"),
new
("Group 3") };
5726
var groups = new ListViewGroup[] {
new
("Group 1"),
new
("Group 2"),
new
("Group 3") };
5762
var groups = new ListViewGroup[] {
new
("Group 1"),
new
("Group 2"),
new
("Group 3") };
6189
ListViewGroup listViewGroup =
new
("Test");
System.Windows.Forms.UI.IntegrationTests (1)
ListViewTests.cs (1)
50
ListViewGroup group =
new
($"Group 1", HorizontalAlignment.Left) { CollapsedState = ListViewGroupCollapsedState.Expanded };
WinFormsControlsTest (3)
ListViewTest.cs (3)
146
ListViewGroup lvgroup1 =
new
()
159
ListViewGroup lvgroup2 =
new
()
186
ListViewGroup lvgroup1 =
new
()
361 references to ListViewGroup
System.Windows.Forms (89)
System\Windows\Forms\Controls\ListView\ListView.cs (23)
16
using static System.Windows.Forms.
ListViewGroup
;
129
private
ListViewGroup
? _defaultGroup;
130
private
ListViewGroup
? _focusedGroup;
736
internal
ListViewGroup
DefaultGroup =>
780
internal
ListViewGroup
? FocusedGroup
916
/// An <see cref="ImageList"/> that contains the icons to use for <see cref="
ListViewGroup
"/>.
925
/// property, you can set the <see cref="
ListViewGroup
.TitleImageIndex"/> property of each <see cref="
ListViewGroup
"/>
1975
/// Occurs when the user clicks a <see cref="
ListViewGroup
.TaskLink"/> on a <see cref="
ListViewGroup
"/>.
2100
/// Occurs when the <see cref="
ListViewGroup
.CollapsedState"/> changes on a <see cref="
ListViewGroup
"/>.
3682
foreach (
ListViewGroup
group in Groups)
3929
internal void InsertGroupInListView(int index,
ListViewGroup
group)
3976
private unsafe void InsertGroupNative(int index,
ListViewGroup
group)
4414
ListViewGroup
listViewGroup = Groups[e.GroupIndex];
5058
foreach (
ListViewGroup
group in Groups)
5073
internal void RemoveGroupFromListView(
ListViewGroup
group)
5098
private void RemoveGroupNative(
ListViewGroup
group)
5678
internal void UpdateGroupNative(
ListViewGroup
group)
5686
private unsafe nint SendGroupMessage(
ListViewGroup
group, uint msg, nint lParam, LVGROUP_MASK additionalMask)
6363
ListViewGroup
targetGroup = _groups[i];
6925
ListViewGroup
? group = selectedItem.Group;
System\Windows\Forms\Controls\ListView\ListView.ListViewAccessibleObject.cs (8)
99
IReadOnlyList<
ListViewGroup
> visibleGroups = GetVisibleGroups();
141
IReadOnlyList<
ListViewGroup
> visibleGroups = GetVisibleGroups();
215
IReadOnlyList<
ListViewGroup
> visibleGroups = GetVisibleGroups();
258
internal IReadOnlyList<
ListViewGroup
> GetVisibleGroups()
260
List<
ListViewGroup
> list = [];
272
foreach (
ListViewGroup
listViewGroup in owningListView.Groups)
274
if (listViewGroup.AccessibilityObject is
ListViewGroup
.ListViewGroupAccessibleObject listViewGroupAccessibleObject
296
IReadOnlyList<
ListViewGroup
> visibleGroups = GetVisibleGroups();
System\Windows\Forms\Controls\ListView\ListViewGroup.ListViewGroupAccessibleObject.cs (3)
17
private readonly
ListViewGroup
_owningGroup;
20
public ListViewGroupAccessibleObject(
ListViewGroup
owningGroup, bool owningGroupIsDefault)
37
=> $"{nameof(
ListViewGroup
)}-{CurrentIndex}";
System\Windows\Forms\Controls\ListView\ListViewGroupCollapsedState.cs (1)
7
/// Specifies the appearance of a <see cref="
ListViewGroup
"/>.
System\Windows\Forms\Controls\ListView\ListViewGroupCollection.cs (20)
17
private List<
ListViewGroup
>? _list;
34
private List<
ListViewGroup
> List => _list ??= [];
36
public
ListViewGroup
this[int index]
54
public
ListViewGroup
? this[string key]
105
if (value is
ListViewGroup
group)
112
public int Add(
ListViewGroup
group)
134
public
ListViewGroup
Add(string? key, string? headerText)
136
ListViewGroup
group = new(key, headerText);
143
if (value is not
ListViewGroup
group)
151
public void AddRange(params
ListViewGroup
[] groups)
173
private void CheckListViewItems(
ListViewGroup
group)
209
public bool Contains(
ListViewGroup
value) => List.Contains(value);
213
if (value is not
ListViewGroup
group)
225
public int IndexOf(
ListViewGroup
value) => List.IndexOf(value);
229
if (value is not
ListViewGroup
group)
237
public void Insert(int index,
ListViewGroup
group)
259
if (value is
ListViewGroup
group)
265
private void MoveGroupItems(
ListViewGroup
group)
278
public void Remove(
ListViewGroup
group)
296
if (value is
ListViewGroup
group)
System\Windows\Forms\Controls\ListView\ListViewGroupConverter.cs (5)
62
foreach (
ListViewGroup
group in item.ListView.Groups)
92
if (destinationType == typeof(InstanceDescriptor) && value is
ListViewGroup
group)
95
ConstructorInfo ctor = typeof(
ListViewGroup
).GetConstructor([typeof(string), typeof(HorizontalAlignment)])!;
117
List<
ListViewGroup
?> list = new();
118
foreach (
ListViewGroup
group in item.ListView.Groups)
System\Windows\Forms\Controls\ListView\ListViewGroupEventArgs.cs (2)
15
/// <param name="groupIndex">The index of the <see cref="
ListViewGroup
"/> associated with the event.</param>
22
/// Gets the index of the <see cref="
ListViewGroup
"/> associated with the event.
System\Windows\Forms\Controls\ListView\ListViewGroupImageIndexer.cs (5)
8
/// ListViewGroupImageIndexer is a class used to support <see cref="
ListViewGroup
.TitleImageIndex"/> and
9
/// <see cref="
ListViewGroup
.TitleImageKey"/>.
13
private readonly
ListViewGroup
_owner;
18
/// <param name="group">The <see cref="
ListViewGroup
"/> that this object belongs to.</param>
19
public ListViewGroupImageIndexer(
ListViewGroup
group)
System\Windows\Forms\Controls\ListView\ListViewGroupItemCollection.cs (4)
10
private readonly
ListViewGroup
_group;
13
public ListViewGroupItemCollection(
ListViewGroup
group)
99
private static void MoveToGroup(ListViewItem item,
ListViewGroup
? newGroup)
101
ListViewGroup
? oldGroup = item.Group;
System\Windows\Forms\Controls\ListView\ListViewItem.cs (17)
37
internal
ListViewGroup
? _group;
132
public ListViewItem(
ListViewGroup
? group)
138
public ListViewItem(string? text,
ListViewGroup
? group)
144
public ListViewItem(string? text, int imageIndex,
ListViewGroup
? group)
150
public ListViewItem(string[]? items,
ListViewGroup
? group)
156
public ListViewItem(string[]? items, int imageIndex,
ListViewGroup
? group)
162
public ListViewItem(string[]? items, int imageIndex, Color foreColor, Color backColor, Font? font,
ListViewGroup
? group)
168
public ListViewItem(ListViewSubItem[] subItems, int imageIndex,
ListViewGroup
? group)
223
public ListViewItem(string? text, string? imageKey,
ListViewGroup
? group)
229
public ListViewItem(string[]? items, string? imageKey,
ListViewGroup
? group)
235
public ListViewItem(string[]? items, string? imageKey, Color foreColor, Color backColor, Font? font,
ListViewGroup
? group)
241
public ListViewItem(ListViewSubItem[] subItems, string? imageKey,
ListViewGroup
? group)
438
public
ListViewGroup
? Group
1147
foreach (
ListViewGroup
lvg in ListView!.Groups)
1234
ListViewGroup
group = (
ListViewGroup
)info.GetValue(nameof(Group), typeof(
ListViewGroup
))!;
System\Windows\Forms\Controls\ListView\ListViewItem.ListViewItemBaseAccessibleObject.cs (1)
32
private protected
ListViewGroup
? OwningGroup => _owningListView.GroupsDisplayed
System.Windows.Forms.Design (4)
System\Windows\Forms\Design\ListViewGroupCollectionEditor.cs (4)
27
ListViewGroup
group = (
ListViewGroup
)base.CreateInstance(itemType);
37
ReadOnlySpan<char> listViewGroupName = nameof(
ListViewGroup
);
42
listViewGroupName = nameService.CreateName(container, typeof(
ListViewGroup
));
System.Windows.Forms.Tests (262)
SerializableAttributeTests.cs (1)
21
{ typeof(
ListViewGroup
).FullName },
SerializableTypesTests.cs (3)
126
ListViewGroup
listViewGroup = new("Header", HorizontalAlignment.Center)
143
ListViewGroup
result = BinarySerialization.EnsureDeserialize<
ListViewGroup
>(blob);
System\Windows\Forms\AccessibleObjects\ListVIew.ListViewAccessibleObjectTests.cs (18)
6
using static System.Windows.Forms.
ListViewGroup
;
89
ListViewGroup
group = new();
119
ListViewGroup
group = new();
143
ListViewGroup
group = new();
273
ListViewGroup
listViewGroup = new("Test Group");
351
ListViewGroup
listViewGroup = new("Test Group");
921
ListViewGroup
listGroup1 = new("Group1");
922
ListViewGroup
listGroup2 = new("Group2");
923
ListViewGroup
listGroup3 = new("Group2");
1391
ListViewGroup
listViewGroup = new("Test");
1454
ListViewGroup
listViewGroupWithItems1 = listView.Groups[1];
1455
ListViewGroup
listViewGroupWithItems2 = listView.Groups[2];
1643
ListViewGroup
listViewGroupWithItems1 = listView.Groups[1];
1644
ListViewGroup
listViewGroupWithItems2 = listView.Groups[2];
1722
ListViewGroup
listViewGroupWithoutItems = new("Group without items");
1723
ListViewGroup
listViewGroupWithItems1 = new("Group with item 1");
1724
ListViewGroup
listViewGroupWithItems2 = new("Group with item 2");
1725
ListViewGroup
listViewGroupWithInvisibleItems = new("Group with invisible item");
System\Windows\Forms\AccessibleObjects\ListViewGroup.ListViewGroupAccessibleObjectTests.cs (32)
10
using static System.Windows.Forms.
ListViewGroup
;
20
ListViewGroup
listGroup = new("Group1");
25
ConstructorInfo ctor = type.GetConstructor([typeof(
ListViewGroup
), typeof(bool)]);
30
ListViewGroup
listGroupWithoutList = new("Group2");
38
ListViewGroup
listGroup = new("Group1");
53
ListViewGroup
listGroup = new("Group1");
84
ListViewGroup
listGroup = new("Group1");
117
ListViewGroup
listGroup = new(name) { Subtitle = subtitle };
278
ListViewGroup
listGroup = new("Group1");
326
ListViewGroup
group = new();
665
ListViewGroup
listViewGroup = new("Test Group");
706
ListViewGroup
lvgroup1 = new()
715
ListViewGroup
lvgroup2 = new()
740
ListViewGroup
listViewGroup = new()
793
ListViewGroup
group1 = new("Group 1") { CollapsedState = firstGroupSate };
794
ListViewGroup
group2 = new("Group 2") { CollapsedState = ListViewGroupCollapsedState.Expanded };
795
ListViewGroup
group3 = new("Group 3") { CollapsedState = ListViewGroupCollapsedState.Expanded };
796
listView.Groups.AddRange((
ListViewGroup
[])[group1, group2, group3]);
1158
ListViewGroup
listViewGroup = new();
1231
ListViewGroup
listViewGroupWithoutItems = new("Group without items");
1232
ListViewGroup
listViewGroupWithItems1 = new("Group with item 1");
1233
ListViewGroup
listViewGroupWithItems2 = new("Group with item 2");
1234
ListViewGroup
listViewGroupWithInvisibleItems = new("Group with invisible item");
1262
ListViewGroup
listGroup1 = new("Group1");
1263
ListViewGroup
listGroup2 = new("Group2");
1323
ListViewGroup
listGroup = new("Test")
1351
ListViewGroup
group = new();
1367
ListViewGroup
group = new();
1381
ListViewGroup
group = new();
1391
private static void EnforceAccessibleObjectCreation(
ListViewGroup
group)
1401
ListViewGroup
listViewGroup = new("Test group");
1434
ListViewGroup
listViewGroup = new("Test Group");
System\Windows\Forms\AccessibleObjects\ListViewItem.ListViewItemAccessibleObjectTests.cs (6)
75
ListViewGroup
listviewGroup = new();
1143
ListViewGroup
listViewGroup = new("Test");
1204
ListViewGroup
listViewGroup = new("Test") { CollapsedState = state };
1256
ListViewGroup
listViewGroup = new("Test group");
1934
ListViewGroup
lvgroup1 = new()
1940
ListViewGroup
lvgroup2 = new()
System\Windows\Forms\AccessibleObjects\ListViewItem.ListViewSubItem.ListViewSubItemAccessibleObjectTests.cs (1)
807
ListViewGroup
listViewGroup = new("Test");
System\Windows\Forms\Layout\TableLayoutSettingsTests.cs (7)
1633
SerializationInfo info = new(typeof(
ListViewGroup
), new FormatterConverter());
1646
SerializationInfo info = new(typeof(
ListViewGroup
), new FormatterConverter());
1678
SerializationInfo info = new(typeof(
ListViewGroup
), new FormatterConverter());
1685
info = new SerializationInfo(typeof(
ListViewGroup
), new FormatterConverter());
1714
SerializationInfo info = new(typeof(
ListViewGroup
), new FormatterConverter());
1730
SerializationInfo info = new(typeof(
ListViewGroup
), new FormatterConverter());
1761
SerializationInfo info = new(typeof(
ListViewGroup
), new FormatterConverter());
System\Windows\Forms\ListViewGroupCollectionTests.cs (75)
28
ListViewGroup
group = new();
51
ListViewGroup
group = new();
66
ListViewGroup
group = new();
81
ListViewGroup
group = new();
102
ListViewGroup
group = new();
121
ListViewGroup
group1 = new();
122
ListViewGroup
group2 = new();
140
ListViewGroup
group = new();
155
ListViewGroup
oldGroup = new();
160
ListViewGroup
group = new();
165
Assert.Same(oldGroup, Assert.Single(collection.Cast<
ListViewGroup
>()));
195
ListViewGroup
group = new();
218
ListViewGroup
group = new();
229
ListViewGroup
group1 = new();
230
ListViewGroup
group2 = new();
266
ListViewGroup
group1 = new();
267
ListViewGroup
group2 = new()
287
ListViewGroup
group1 = new();
288
ListViewGroup
group2 = new()
313
ListViewGroup
group1 = new();
314
ListViewGroup
group2 = new()
321
ListViewGroup
group3 = new();
336
ListViewGroup
group1 = new();
337
ListViewGroup
group2 = new()
344
ListViewGroup
group3 = new();
372
ListViewGroup
group1 = new();
378
ListViewGroup
group2 = new();
380
Assert.Equal(new
ListViewGroup
[] { group1, group2 }, collection.Cast<
ListViewGroup
>());
391
ListViewGroup
group1 = new();
397
ListViewGroup
group2 = new();
399
Assert.Equal(new
ListViewGroup
[] { group1, group2 }, collection.Cast<
ListViewGroup
>());
410
ListViewGroup
group = new();
429
ListViewGroup
group1 = new();
438
ListViewGroup
group2 = new();
446
ListViewGroup
group1 = new();
447
ListViewGroup
group2 = new();
464
ListViewGroup
group = new();
491
ListViewGroup
group = new();
509
ListViewGroup
group = Assert.Single(collection.Cast<
ListViewGroup
>());
519
ListViewGroup
group = new();
540
ListViewGroup
group1 = new();
541
ListViewGroup
group2 = new();
542
var items = new
ListViewGroup
[] { group1, group2 };
558
ListViewGroup
group1 = new();
559
ListViewGroup
group2 = new();
578
Assert.Throws<ArgumentNullException>("groups", () => collection.AddRange((
ListViewGroup
[])null));
587
ListViewGroup
group = new();
588
Assert.Throws<ArgumentNullException>("group", () => collection.AddRange((
ListViewGroup
[])[group, null]));
589
Assert.Same(group, Assert.Single(collection.Cast<
ListViewGroup
>()));
597
ListViewGroup
group = new();
617
ListViewGroup
group = new();
645
ListViewGroup
group = new();
668
ListViewGroup
group = new();
693
ListViewGroup
group = new();
716
ListViewGroup
group = new();
741
ListViewGroup
group = new();
756
ListViewGroup
group = new();
771
ListViewGroup
group = new();
790
ListViewGroup
group = new();
810
ListViewGroup
group = new();
830
ListViewGroup
group1 = new();
831
ListViewGroup
group2 = new();
847
ListViewGroup
group = new();
882
ListViewGroup
group = new();
917
ListViewGroup
group = new();
941
ListViewGroup
group = new();
963
ListViewGroup
group = new();
983
ListViewGroup
group = new();
995
ListViewGroup
group = new();
1034
ListViewGroup
group = new();
1096
Assert.Throws<InvalidOperationException>(() => listView.Groups.AddRange((
ListViewGroup
[])[new(), new()]));
1108
sourceGroup.AddRange((
ListViewGroup
[])[new(), new()]);
System\Windows\Forms\ListViewGroupConverterTests.cs (29)
18
[InlineData(typeof(
ListViewGroup
), false)]
22
TypeConverter converter = TypeDescriptor.GetConverter(typeof(
ListViewGroup
));
38
ListViewGroup
group = new("name", "header");
49
TypeConverter converter = TypeDescriptor.GetConverter(typeof(
ListViewGroup
));
62
TypeConverter converter = TypeDescriptor.GetConverter(typeof(
ListViewGroup
));
72
ListViewGroup
group = new("name", "header");
77
TypeConverter converter = TypeDescriptor.GetConverter(typeof(
ListViewGroup
));
107
TypeConverter converter = TypeDescriptor.GetConverter(typeof(
ListViewGroup
));
123
TypeConverter converter = TypeDescriptor.GetConverter(typeof(
ListViewGroup
));
130
[InlineData(typeof(
ListViewGroup
), false)]
135
TypeConverter converter = TypeDescriptor.GetConverter(typeof(
ListViewGroup
));
151
ListViewGroup
group = new("name", "header");
162
TypeConverter converter = TypeDescriptor.GetConverter(typeof(
ListViewGroup
));
200
public void ListViewGroupConverter_ConvertTo_InstanceDescriptor_ReturnsExpected(
ListViewGroup
value, Type[] parameterTypes, object[] arguments)
202
TypeConverter converter = TypeDescriptor.GetConverter(typeof(
ListViewGroup
));
204
Assert.Equal(typeof(
ListViewGroup
).GetConstructor(parameterTypes), descriptor.MemberInfo);
213
TypeConverter converter = TypeDescriptor.GetConverter(typeof(
ListViewGroup
));
220
TypeConverter converter = TypeDescriptor.GetConverter(typeof(
ListViewGroup
));
227
TypeConverter converter = TypeDescriptor.GetConverter(typeof(
ListViewGroup
));
232
[InlineData(typeof(
ListViewGroup
))]
236
TypeConverter converter = TypeDescriptor.GetConverter(typeof(
ListViewGroup
));
243
TypeConverter converter = TypeDescriptor.GetConverter(typeof(
ListViewGroup
));
250
TypeConverter converter = TypeDescriptor.GetConverter(typeof(
ListViewGroup
));
251
ListViewGroup
item = new();
267
ListViewGroup
group = new("name", "header");
278
TypeConverter converter = TypeDescriptor.GetConverter(typeof(
ListViewGroup
));
289
TypeConverter converter = TypeDescriptor.GetConverter(typeof(
ListViewGroup
));
296
TypeConverter converter = TypeDescriptor.GetConverter(typeof(
ListViewGroup
));
303
TypeConverter converter = TypeDescriptor.GetConverter(typeof(
ListViewGroup
));
System\Windows\Forms\ListViewGroupTests.cs (65)
17
ListViewGroup
group = new();
38
ListViewGroup
group = new(header);
68
ListViewGroup
group = new(header, headerAlignment);
96
ListViewGroup
group = new(key, header);
120
ListViewGroup
group = new() { CollapsedState = collapsedState };
129
ListViewGroup
group = new();
138
ListViewGroup
group = new()
156
ListViewGroup
group = new();
175
ListViewGroup
group = new();
222
ListViewGroup
group = new();
250
ListViewGroup
group = new();
258
ListViewGroup
group = new()
276
ListViewGroup
group = new()
294
ListViewGroup
group = new();
316
ListViewGroup
group = new();
362
ListViewGroup
group = new();
390
ListViewGroup
group = new()
408
ListViewGroup
group = new()
426
ListViewGroup
group = new();
448
ListViewGroup
group = new();
499
ListViewGroup
group = new();
530
ListViewGroup
group = new()
548
ListViewGroup
group = new();
570
ListViewGroup
group = new();
612
ListViewGroup
group = new();
652
ListViewGroup
group = new()
672
ListViewGroup
group = new()
696
ListViewGroup
group = new()
751
ListViewGroup
group1 = new()
782
ListViewGroup
group = new();
791
ListViewGroup
group = new()
809
ListViewGroup
group = new();
831
ListViewGroup
group = new();
873
ListViewGroup
group = new();
904
ListViewGroup
group = new()
924
ListViewGroup
group = new()
948
ListViewGroup
group = new()
1003
ListViewGroup
group1 = new()
1034
ListViewGroup
group = new();
1049
ListViewGroup
group = new()
1066
ListViewGroup
group = new()
1089
ListViewGroup
group = new()
1129
ListViewGroup
group = new();
1170
ListViewGroup
group = new();
1178
ListViewGroup
group = new()
1195
ListViewGroup
group = new()
1213
ListViewGroup
group = new();
1235
ListViewGroup
group = new();
1278
ListViewGroup
group = new();
1307
ListViewGroup
group = new()
1324
ListViewGroup
groupWithEmptyItems = new();
1328
ListViewGroup
groupWithItems = new();
1335
public void ListViewGroup_Serialize_Deserialize_Success(
ListViewGroup
group)
1346
ListViewGroup
result = Assert.IsType<
ListViewGroup
>(formatter.Deserialize(stream)); // CodeQL [SM03722] : Deserialization is performed on trusted data and the types are controlled and validated.
1359
ListViewGroup
group = new(header);
1366
ListViewGroup
group = new();
1368
SerializationInfo info = new(typeof(
ListViewGroup
), new FormatterConverter());
1382
ListViewGroup
group = new();
1386
SerializationInfo info = new(typeof(
ListViewGroup
), new FormatterConverter());
1400
ListViewGroup
group = new();
1404
SerializationInfo info = new(typeof(
ListViewGroup
), new FormatterConverter());
1419
ListViewGroup
group = new();
1431
ListViewGroup
listViewGroup = new();
1446
ListViewGroup
listViewGroup = new();
System\Windows\Forms\ListViewItem.IKeyboardToolTipTests.cs (1)
125
ListViewGroup
listViewGroup = new();
System\Windows\Forms\ListViewItemConverterTests.cs (1)
50
ListViewGroup
group = new();
System\Windows\Forms\ListViewItemTests.cs (11)
52
public void ListViewItem_Ctor_StringArray_String_Color_Color_Font_ListViewGroup(string[] subItems, string imageKey, Color foreColor, Color backColor, Font font,
ListViewGroup
group, string expectedImageKey, Color expectedForeColor, Color expectedBackColor, string expectedText)
90
public void ListViewItem_Ctor_StringArray_Int_Color_Color_Font_ListViewGroup(string[] subItems, int imageIndex, Color foreColor, Color backColor, Font font,
ListViewGroup
group, Color expectedForeColor, Color expectedBackColor, string expectedText)
203
public void ListViewItem_Ctor_ListViewSubItemArray_String_ListViewGroup(ListViewItem.ListViewSubItem[] subItems, string imageKey,
ListViewGroup
group, string expectedImageKey, string expectedText)
240
public void ListViewItem_Ctor_ListViewSubItemArray_Int_ListViewGroup(ListViewItem.ListViewSubItem[] subItems, int imageIndex,
ListViewGroup
group, string expectedText)
278
public void ListViewItem_Ctor_StringArray_String_ListViewGroup(string[] subItems, string imageKey,
ListViewGroup
group, string expectedImageKey, string expectedText)
316
public void ListViewItem_Ctor_StringArray_Int_ListViewGroup(string[] subItems, int imageIndex,
ListViewGroup
group, string expectedText)
353
public void ListViewItem_Ctor_String_String_ListViewGroup(string text, string imageKey,
ListViewGroup
group, string expectedText, string expectedImageKey)
391
public void ListViewItem_Ctor_String_Int_ListViewGroup(string text, int imageIndex,
ListViewGroup
group, string expectedText)
504
public void ListViewItem_Ctor_StringArray_ListViewGroup(string[] subItems,
ListViewGroup
group, string expectedText)
617
public void ListViewItem_Ctor_String_ListViewGroup(string text,
ListViewGroup
group, string expectedText)
730
public void ListViewItem_Ctor_ListViewGroup(
ListViewGroup
group)
System\Windows\Forms\ListViewTests.cs (12)
1920
ListViewGroup
group1 = new();
1921
ListViewGroup
group2 = new()
4541
ListViewGroup
group = new("Test group");
4567
ListViewGroup
group1 = new("Test group1");
4568
ListViewGroup
group2 = new("Test group2");
4569
ListViewGroup
group3 = new("Test group3");
4618
ListViewGroup
group = new("Test group");
5651
var groups = new
ListViewGroup
[] { new("Group 1"), new("Group 2"), new("Group 3") };
5689
var groups = new
ListViewGroup
[] { new("Group 1"), new("Group 2"), new("Group 3") };
5726
var groups = new
ListViewGroup
[] { new("Group 1"), new("Group 2"), new("Group 3") };
5762
var groups = new
ListViewGroup
[] { new("Group 1"), new("Group 2"), new("Group 3") };
6189
ListViewGroup
listViewGroup = new("Test");
System.Windows.Forms.UI.IntegrationTests (1)
ListViewTests.cs (1)
50
ListViewGroup
group = new($"Group 1", HorizontalAlignment.Left) { CollapsedState = ListViewGroupCollapsedState.Expanded };
WinFormsControlsTest (5)
ListViewTest.cs (3)
146
ListViewGroup
lvgroup1 = new()
159
ListViewGroup
lvgroup2 = new()
186
ListViewGroup
lvgroup1 = new()
ListViewTest.Designer.cs (2)
70
this.listView1.Groups.AddRange(new System.Windows.Forms.
ListViewGroup
[] {
71
(System.Windows.Forms.
ListViewGroup
)(resources.GetObject("listView1.Groups"))});