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)
128
ListViewGroup listViewGroup =
new
("Header", HorizontalAlignment.Center)
System\Windows\Forms\AccessibleObjects\ListVIew.ListViewAccessibleObjectTests.cs (25)
91
ListViewGroup group =
new
();
121
ListViewGroup group =
new
();
145
ListViewGroup group =
new
();
275
ListViewGroup listViewGroup =
new
("Test Group");
353
ListViewGroup listViewGroup =
new
("Test Group");
399
listView.Groups.Add(new
ListViewGroup
("Test Group"));
456
listView.Groups.Add(new
ListViewGroup
("Test Group"));
522
listView.Groups.Add(new
ListViewGroup
("Test Group"));
593
listView.Groups.Add(new
ListViewGroup
("Test Group"));
648
listView.Groups.Add(new
ListViewGroup
("Test Group 1"));
649
listView.Groups.Add(new
ListViewGroup
("Test Group 2"));
728
listView.Groups.Add(new
ListViewGroup
("Test Group 1"));
729
listView.Groups.Add(new
ListViewGroup
("Test Group 2"));
806
listView.Groups.Add(new
ListViewGroup
("Test Group 1"));
808
listView.Groups.Add(new
ListViewGroup
("Test Group 2"));
862
listView.Groups.Add(new
ListViewGroup
("Test Group 1"));
863
listView.Groups.Add(new
ListViewGroup
("Test Group 2"));
923
ListViewGroup listGroup1 =
new
("Group1");
924
ListViewGroup listGroup2 =
new
("Group2");
925
ListViewGroup listGroup3 =
new
("Group2");
1393
ListViewGroup listViewGroup =
new
("Test");
1724
ListViewGroup listViewGroupWithoutItems =
new
("Group without items");
1725
ListViewGroup listViewGroupWithItems1 =
new
("Group with item 1");
1726
ListViewGroup listViewGroupWithItems2 =
new
("Group with item 2");
1727
ListViewGroup listViewGroupWithInvisibleItems =
new
("Group with invisible item");
System\Windows\Forms\AccessibleObjects\ListViewGroup.ListViewGroupAccessibleObjectTests.cs (42)
22
ListViewGroup listGroup =
new
("Group1");
32
ListViewGroup listGroupWithoutList =
new
("Group2");
40
ListViewGroup listGroup =
new
("Group1");
55
ListViewGroup listGroup =
new
("Group1");
86
ListViewGroup listGroup =
new
("Group1");
119
ListViewGroup listGroup =
new
(name) { Subtitle = subtitle };
146
groups.Add(new
ListViewGroup
("Group1"));
147
groups.Add(new
ListViewGroup
("Group2"));
215
groups.Add(new
ListViewGroup
("Group1"));
216
groups.Add(new
ListViewGroup
("Group2"));
280
ListViewGroup listGroup =
new
("Group1");
328
ListViewGroup group =
new
();
379
groups.Add(new
ListViewGroup
("Group1"));
380
groups.Add(new
ListViewGroup
("Group2"));
474
groups.Add(new
ListViewGroup
("Group1"));
475
groups.Add(new
ListViewGroup
("Group2"));
510
groups.Add(new
ListViewGroup
("Group1"));
511
groups.Add(new
ListViewGroup
("Group2"));
594
groups.Add(new
ListViewGroup
("Group1"));
595
groups.Add(new
ListViewGroup
("Group2"));
596
groups.Add(new
ListViewGroup
("Group3"));
667
ListViewGroup listViewGroup =
new
("Test Group");
708
ListViewGroup lvgroup1 =
new
()
717
ListViewGroup lvgroup2 =
new
()
742
ListViewGroup listViewGroup =
new
()
795
ListViewGroup group1 =
new
("Group 1") { CollapsedState = firstGroupSate };
796
ListViewGroup group2 =
new
("Group 2") { CollapsedState = ListViewGroupCollapsedState.Expanded };
797
ListViewGroup group3 =
new
("Group 3") { CollapsedState = ListViewGroupCollapsedState.Expanded };
1160
ListViewGroup listViewGroup =
new
();
1221
listView.Groups.Add(new
ListViewGroup
());
1233
ListViewGroup listViewGroupWithoutItems =
new
("Group without items");
1234
ListViewGroup listViewGroupWithItems1 =
new
("Group with item 1");
1235
ListViewGroup listViewGroupWithItems2 =
new
("Group with item 2");
1236
ListViewGroup listViewGroupWithInvisibleItems =
new
("Group with invisible item");
1264
ListViewGroup listGroup1 =
new
("Group1");
1265
ListViewGroup listGroup2 =
new
("Group2");
1325
ListViewGroup listGroup =
new
("Test")
1353
ListViewGroup group =
new
();
1369
ListViewGroup group =
new
();
1383
ListViewGroup group =
new
();
1403
ListViewGroup listViewGroup =
new
("Test group");
1436
ListViewGroup listViewGroup =
new
("Test Group");
System\Windows\Forms\AccessibleObjects\ListViewItem.ListViewItemAccessibleObjectTests.cs (10)
77
ListViewGroup listviewGroup =
new
();
1145
ListViewGroup listViewGroup =
new
("Test");
1206
ListViewGroup listViewGroup =
new
("Test") { CollapsedState = state };
1258
ListViewGroup listViewGroup =
new
("Test group");
1316
listView.Groups.Add(new
ListViewGroup
());
1350
listView.Groups.Add(new
ListViewGroup
());
1408
listView.Groups.Add(new
ListViewGroup
());
1482
listView.Groups.Add(new
ListViewGroup
());
1936
ListViewGroup lvgroup1 =
new
()
1942
ListViewGroup lvgroup2 =
new
()
System\Windows\Forms\AccessibleObjects\ListViewItem.ListViewSubItem.ListViewSubItemAccessibleObjectTests.cs (1)
809
ListViewGroup listViewGroup =
new
("Test");
System\Windows\Forms\BinaryFormat\WinFormsBinaryFormattedObjectTests.cs (1)
238
new
ListViewGroup
(),
System\Windows\Forms\ListViewGroupCollectionTests.cs (96)
30
ListViewGroup group =
new
();
42
collection.Add(new
ListViewGroup
());
51
collection.Add(new
ListViewGroup
());
53
ListViewGroup group =
new
();
66
collection.Add(new
ListViewGroup
());
68
ListViewGroup group =
new
();
81
collection.Add(new
ListViewGroup
());
83
ListViewGroup group =
new
();
102
collection.Add(new
ListViewGroup
());
104
ListViewGroup group =
new
();
123
ListViewGroup group1 =
new
();
124
ListViewGroup group2 =
new
();
137
collection.Add(new
ListViewGroup
());
142
ListViewGroup group =
new
();
157
ListViewGroup oldGroup =
new
();
162
ListViewGroup group =
new
();
176
collection.Add(new
ListViewGroup
());
187
collection.Add(new
ListViewGroup
());
188
Assert.Throws<ArgumentOutOfRangeException>("index", () => collection[index] = new
ListViewGroup
());
197
ListViewGroup group =
new
();
209
collection.Add(new
ListViewGroup
());
218
collection.Add(new
ListViewGroup
());
220
ListViewGroup group =
new
();
231
ListViewGroup group1 =
new
();
232
ListViewGroup group2 =
new
();
247
collection.Add(new
ListViewGroup
());
248
Assert.Throws<ArgumentOutOfRangeException>("index", () => collection[index] = new
ListViewGroup
());
268
ListViewGroup group1 =
new
();
269
ListViewGroup group2 =
new
()
289
ListViewGroup group1 =
new
();
290
ListViewGroup group2 =
new
()
315
ListViewGroup group1 =
new
();
316
ListViewGroup group2 =
new
()
323
ListViewGroup group3 =
new
();
338
ListViewGroup group1 =
new
();
339
ListViewGroup group2 =
new
()
346
ListViewGroup group3 =
new
();
357
collection["text"] = new
ListViewGroup
();
374
ListViewGroup group1 =
new
();
380
ListViewGroup group2 =
new
();
393
ListViewGroup group1 =
new
();
399
ListViewGroup group2 =
new
();
412
ListViewGroup group =
new
();
431
ListViewGroup group1 =
new
();
440
ListViewGroup group2 =
new
();
448
ListViewGroup group1 =
new
();
449
ListViewGroup group2 =
new
();
466
ListViewGroup group =
new
();
493
ListViewGroup group =
new
();
521
ListViewGroup group =
new
();
542
ListViewGroup group1 =
new
();
543
ListViewGroup group2 =
new
();
560
ListViewGroup group1 =
new
();
561
ListViewGroup group2 =
new
();
589
ListViewGroup group =
new
();
599
ListViewGroup group =
new
();
619
ListViewGroup group =
new
();
647
ListViewGroup group =
new
();
651
Assert.False(collection.Contains(new
ListViewGroup
()));
661
Assert.False(collection.Contains(new
ListViewGroup
()));
670
ListViewGroup group =
new
();
674
Assert.False(collection.Contains(new
ListViewGroup
()));
685
Assert.False(collection.Contains(new
ListViewGroup
()));
695
ListViewGroup group =
new
();
699
Assert.Equal(-1, collection.IndexOf(new
ListViewGroup
()));
709
Assert.Equal(-1, collection.IndexOf(new
ListViewGroup
()));
718
ListViewGroup group =
new
();
722
Assert.Equal(-1, collection.IndexOf(new
ListViewGroup
()));
733
Assert.Equal(-1, collection.IndexOf(new
ListViewGroup
()));
743
ListViewGroup group =
new
();
744
collection.Add(new
ListViewGroup
());
758
ListViewGroup group =
new
();
759
collection.Add(new
ListViewGroup
());
773
ListViewGroup group =
new
();
792
ListViewGroup group =
new
();
807
collection.Add(new
ListViewGroup
());
812
ListViewGroup group =
new
();
832
ListViewGroup group1 =
new
();
833
ListViewGroup group2 =
new
();
849
ListViewGroup group =
new
();
865
collection.Add(new
ListViewGroup
());
876
Assert.Throws<ArgumentOutOfRangeException>("index", () => collection.Insert(index, new
ListViewGroup
()));
884
ListViewGroup group =
new
();
885
collection.Add(new
ListViewGroup
());
911
Assert.Throws<ArgumentOutOfRangeException>("index", () => collection.Insert(index, new
ListViewGroup
()));
919
ListViewGroup group =
new
();
943
ListViewGroup group =
new
();
965
ListViewGroup group =
new
();
985
ListViewGroup group =
new
();
997
ListViewGroup group =
new
();
999
collection.Add(new
ListViewGroup
());
1000
collection.Add(new
ListViewGroup
());
1001
collection.Add(new
ListViewGroup
());
1036
ListViewGroup group =
new
();
1066
Assert.Throws<InvalidOperationException>(() => listView.Groups.Add(new
ListViewGroup
()));
1133
Assert.Throws<InvalidOperationException>(() => listView.Groups.Insert(0, new
ListViewGroup
()));
System\Windows\Forms\ListViewGroupConverterTests.cs (11)
40
ListViewGroup group =
new
("name", "header");
74
ListViewGroup group =
new
("name", "header");
99
listViewWithGroups.Groups.Add(new
ListViewGroup
("name", "header"));
153
ListViewGroup group =
new
("name", "header");
176
new
ListViewGroup
(),
182
new
ListViewGroup
("key", "headerText"),
188
new
ListViewGroup
("header"),
194
new
ListViewGroup
("header", HorizontalAlignment.Center),
239
Assert.Throws<NotSupportedException>(() => converter.ConvertTo(new
ListViewGroup
(), destinationType));
253
ListViewGroup item =
new
();
269
ListViewGroup group =
new
("name", "header");
System\Windows\Forms\ListViewGroupTests.cs (61)
19
ListViewGroup group =
new
();
40
ListViewGroup group =
new
(header);
70
ListViewGroup group =
new
(header, headerAlignment);
98
ListViewGroup group =
new
(key, header);
122
ListViewGroup group =
new
() { CollapsedState = collapsedState };
131
ListViewGroup group =
new
();
140
ListViewGroup group =
new
()
158
ListViewGroup group =
new
();
177
ListViewGroup group =
new
();
224
ListViewGroup group =
new
();
252
ListViewGroup group =
new
();
260
ListViewGroup group =
new
()
278
ListViewGroup group =
new
()
296
ListViewGroup group =
new
();
318
ListViewGroup group =
new
();
364
ListViewGroup group =
new
();
392
ListViewGroup group =
new
()
410
ListViewGroup group =
new
()
428
ListViewGroup group =
new
();
450
ListViewGroup group =
new
();
501
ListViewGroup group =
new
();
532
ListViewGroup group =
new
()
550
ListViewGroup group =
new
();
572
ListViewGroup group =
new
();
614
ListViewGroup group =
new
();
654
ListViewGroup group =
new
()
674
ListViewGroup group =
new
()
698
ListViewGroup group =
new
()
753
ListViewGroup group1 =
new
()
784
ListViewGroup group =
new
();
793
ListViewGroup group =
new
()
811
ListViewGroup group =
new
();
833
ListViewGroup group =
new
();
875
ListViewGroup group =
new
();
906
ListViewGroup group =
new
()
926
ListViewGroup group =
new
()
950
ListViewGroup group =
new
()
1005
ListViewGroup group1 =
new
()
1036
ListViewGroup group =
new
();
1051
ListViewGroup group =
new
()
1068
ListViewGroup group =
new
()
1091
ListViewGroup group =
new
()
1131
ListViewGroup group =
new
();
1172
ListViewGroup group =
new
();
1180
ListViewGroup group =
new
()
1197
ListViewGroup group =
new
()
1215
ListViewGroup group =
new
();
1237
ListViewGroup group =
new
();
1280
ListViewGroup group =
new
();
1309
ListViewGroup group =
new
()
1323
yield return new object[] { new
ListViewGroup
() };
1324
yield return new object[] { new
ListViewGroup
("header", HorizontalAlignment.Center) { Name = "name", Tag = "tag" } };
1326
ListViewGroup groupWithEmptyItems =
new
();
1330
ListViewGroup groupWithItems =
new
();
1361
ListViewGroup group =
new
(header);
1368
ListViewGroup group =
new
();
1384
ListViewGroup group =
new
();
1402
ListViewGroup group =
new
();
1421
ListViewGroup group =
new
();
1433
ListViewGroup listViewGroup =
new
();
1448
ListViewGroup listViewGroup =
new
();
System\Windows\Forms\ListViewItem.IKeyboardToolTipTests.cs (1)
127
ListViewGroup listViewGroup =
new
();
System\Windows\Forms\ListViewItemConverterTests.cs (1)
52
ListViewGroup group =
new
();
System\Windows\Forms\ListViewItemTests.cs (22)
48
yield return new object[] { new string[] { null }, string.Empty, Color.Empty, Color.Empty, null, new
ListViewGroup
(), string.Empty, SystemColors.WindowText, SystemColors.Window, string.Empty };
49
yield return new object[] { new string[] { "text" }, "imageKey", Color.Blue, Color.Red, SystemFonts.MenuFont, new
ListViewGroup
(), "imageKey", Color.Blue, Color.Red, "text" };
86
yield return new object[] { new string[] { null }, 1, Color.Empty, Color.Empty, null, new
ListViewGroup
(), SystemColors.WindowText, SystemColors.Window, string.Empty };
87
yield return new object[] { new string[] { "text" }, 2, Color.Blue, Color.Red, SystemFonts.MenuFont, new
ListViewGroup
(), Color.Blue, Color.Red, "text" };
200
yield return new object[] { new ListViewItem.ListViewSubItem[] { new(null, "text") }, "imageKey", new
ListViewGroup
(), "imageKey", "text" };
237
yield return new object[] { new ListViewItem.ListViewSubItem[] { new(null, "text") }, -1, new
ListViewGroup
(), "text" };
274
yield return new object[] { new string[] { null }, string.Empty, new
ListViewGroup
(), string.Empty, string.Empty };
275
yield return new object[] { new string[] { "text" }, "imageKey", new
ListViewGroup
(), "imageKey", "text" };
312
yield return new object[] { new string[] { null }, 1, new
ListViewGroup
(), string.Empty };
313
yield return new object[] { new string[] { "text" }, 2, new
ListViewGroup
(), "text" };
349
yield return new object[] { string.Empty, string.Empty, new
ListViewGroup
(), string.Empty, string.Empty };
350
yield return new object[] { "text", "imageKey", new
ListViewGroup
(), "text", "imageKey" };
387
yield return new object[] { string.Empty, 0, new
ListViewGroup
(), string.Empty };
388
yield return new object[] { "text", 1, new
ListViewGroup
(), "text" };
500
yield return new object[] { new string[] { null }, new
ListViewGroup
(), string.Empty };
501
yield return new object[] { new string[] { "text" }, new
ListViewGroup
(), "text" };
614
yield return new object[] { "text", new
ListViewGroup
(), "text" };
727
yield return new object[] { new
ListViewGroup
() };
835
Assert.Throws<ArgumentNullException>("subItems", () => new ListViewItem((ListViewItem.ListViewSubItem[])null, "imageKey", new
ListViewGroup
()));
836
Assert.Throws<ArgumentNullException>("subItems", () => new ListViewItem((ListViewItem.ListViewSubItem[])null, 0, new
ListViewGroup
()));
845
Assert.Throws<ArgumentNullException>("subItems", () => new ListViewItem(subItems, "imageKey", new
ListViewGroup
()));
846
Assert.Throws<ArgumentNullException>("subItems", () => new ListViewItem(subItems, 1, new
ListViewGroup
()));
System\Windows\Forms\ListViewTests.cs (20)
1922
ListViewGroup group1 =
new
();
1923
ListViewGroup group2 =
new
()
4543
ListViewGroup group =
new
("Test group");
4569
ListViewGroup group1 =
new
("Test group1");
4570
ListViewGroup group2 =
new
("Test group2");
4571
ListViewGroup group3 =
new
("Test group3");
4620
ListViewGroup group =
new
("Test group");
5653
var groups = new ListViewGroup[] {
new
("Group 1"),
new
("Group 2"),
new
("Group 3") };
5691
var groups = new ListViewGroup[] {
new
("Group 1"),
new
("Group 2"),
new
("Group 3") };
5728
var groups = new ListViewGroup[] {
new
("Group 1"),
new
("Group 2"),
new
("Group 3") };
5764
var groups = new ListViewGroup[] {
new
("Group 1"),
new
("Group 2"),
new
("Group 3") };
6191
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)
25
{ typeof(
ListViewGroup
).FullName },
SerializableTypesTests.cs (3)
128
ListViewGroup
listViewGroup = new("Header", HorizontalAlignment.Center)
145
ListViewGroup
result = BinarySerialization.EnsureDeserialize<
ListViewGroup
>(blob);
System\Windows\Forms\AccessibleObjects\ListVIew.ListViewAccessibleObjectTests.cs (18)
8
using static System.Windows.Forms.
ListViewGroup
;
91
ListViewGroup
group = new();
121
ListViewGroup
group = new();
145
ListViewGroup
group = new();
275
ListViewGroup
listViewGroup = new("Test Group");
353
ListViewGroup
listViewGroup = new("Test Group");
923
ListViewGroup
listGroup1 = new("Group1");
924
ListViewGroup
listGroup2 = new("Group2");
925
ListViewGroup
listGroup3 = new("Group2");
1393
ListViewGroup
listViewGroup = new("Test");
1456
ListViewGroup
listViewGroupWithItems1 = listView.Groups[1];
1457
ListViewGroup
listViewGroupWithItems2 = listView.Groups[2];
1645
ListViewGroup
listViewGroupWithItems1 = listView.Groups[1];
1646
ListViewGroup
listViewGroupWithItems2 = listView.Groups[2];
1724
ListViewGroup
listViewGroupWithoutItems = new("Group without items");
1725
ListViewGroup
listViewGroupWithItems1 = new("Group with item 1");
1726
ListViewGroup
listViewGroupWithItems2 = new("Group with item 2");
1727
ListViewGroup
listViewGroupWithInvisibleItems = new("Group with invisible item");
System\Windows\Forms\AccessibleObjects\ListViewGroup.ListViewGroupAccessibleObjectTests.cs (32)
12
using static System.Windows.Forms.
ListViewGroup
;
22
ListViewGroup
listGroup = new("Group1");
27
ConstructorInfo ctor = type.GetConstructor([typeof(
ListViewGroup
), typeof(bool)]);
32
ListViewGroup
listGroupWithoutList = new("Group2");
40
ListViewGroup
listGroup = new("Group1");
55
ListViewGroup
listGroup = new("Group1");
86
ListViewGroup
listGroup = new("Group1");
119
ListViewGroup
listGroup = new(name) { Subtitle = subtitle };
280
ListViewGroup
listGroup = new("Group1");
328
ListViewGroup
group = new();
667
ListViewGroup
listViewGroup = new("Test Group");
708
ListViewGroup
lvgroup1 = new()
717
ListViewGroup
lvgroup2 = new()
742
ListViewGroup
listViewGroup = new()
795
ListViewGroup
group1 = new("Group 1") { CollapsedState = firstGroupSate };
796
ListViewGroup
group2 = new("Group 2") { CollapsedState = ListViewGroupCollapsedState.Expanded };
797
ListViewGroup
group3 = new("Group 3") { CollapsedState = ListViewGroupCollapsedState.Expanded };
798
listView.Groups.AddRange((
ListViewGroup
[])[group1, group2, group3]);
1160
ListViewGroup
listViewGroup = new();
1233
ListViewGroup
listViewGroupWithoutItems = new("Group without items");
1234
ListViewGroup
listViewGroupWithItems1 = new("Group with item 1");
1235
ListViewGroup
listViewGroupWithItems2 = new("Group with item 2");
1236
ListViewGroup
listViewGroupWithInvisibleItems = new("Group with invisible item");
1264
ListViewGroup
listGroup1 = new("Group1");
1265
ListViewGroup
listGroup2 = new("Group2");
1325
ListViewGroup
listGroup = new("Test")
1353
ListViewGroup
group = new();
1369
ListViewGroup
group = new();
1383
ListViewGroup
group = new();
1393
private static void EnforceAccessibleObjectCreation(
ListViewGroup
group)
1403
ListViewGroup
listViewGroup = new("Test group");
1436
ListViewGroup
listViewGroup = new("Test Group");
System\Windows\Forms\AccessibleObjects\ListViewItem.ListViewItemAccessibleObjectTests.cs (6)
77
ListViewGroup
listviewGroup = new();
1145
ListViewGroup
listViewGroup = new("Test");
1206
ListViewGroup
listViewGroup = new("Test") { CollapsedState = state };
1258
ListViewGroup
listViewGroup = new("Test group");
1936
ListViewGroup
lvgroup1 = new()
1942
ListViewGroup
lvgroup2 = new()
System\Windows\Forms\AccessibleObjects\ListViewItem.ListViewSubItem.ListViewSubItemAccessibleObjectTests.cs (1)
809
ListViewGroup
listViewGroup = new("Test");
System\Windows\Forms\Layout\TableLayoutSettingsTests.cs (7)
1635
SerializationInfo info = new(typeof(
ListViewGroup
), new FormatterConverter());
1648
SerializationInfo info = new(typeof(
ListViewGroup
), new FormatterConverter());
1680
SerializationInfo info = new(typeof(
ListViewGroup
), new FormatterConverter());
1687
info = new SerializationInfo(typeof(
ListViewGroup
), new FormatterConverter());
1716
SerializationInfo info = new(typeof(
ListViewGroup
), new FormatterConverter());
1732
SerializationInfo info = new(typeof(
ListViewGroup
), new FormatterConverter());
1763
SerializationInfo info = new(typeof(
ListViewGroup
), new FormatterConverter());
System\Windows\Forms\ListViewGroupCollectionTests.cs (75)
30
ListViewGroup
group = new();
53
ListViewGroup
group = new();
68
ListViewGroup
group = new();
83
ListViewGroup
group = new();
104
ListViewGroup
group = new();
123
ListViewGroup
group1 = new();
124
ListViewGroup
group2 = new();
142
ListViewGroup
group = new();
157
ListViewGroup
oldGroup = new();
162
ListViewGroup
group = new();
167
Assert.Same(oldGroup, Assert.Single(collection.Cast<
ListViewGroup
>()));
197
ListViewGroup
group = new();
220
ListViewGroup
group = new();
231
ListViewGroup
group1 = new();
232
ListViewGroup
group2 = new();
268
ListViewGroup
group1 = new();
269
ListViewGroup
group2 = new()
289
ListViewGroup
group1 = new();
290
ListViewGroup
group2 = new()
315
ListViewGroup
group1 = new();
316
ListViewGroup
group2 = new()
323
ListViewGroup
group3 = new();
338
ListViewGroup
group1 = new();
339
ListViewGroup
group2 = new()
346
ListViewGroup
group3 = new();
374
ListViewGroup
group1 = new();
380
ListViewGroup
group2 = new();
382
Assert.Equal(new
ListViewGroup
[] { group1, group2 }, collection.Cast<
ListViewGroup
>());
393
ListViewGroup
group1 = new();
399
ListViewGroup
group2 = new();
401
Assert.Equal(new
ListViewGroup
[] { group1, group2 }, collection.Cast<
ListViewGroup
>());
412
ListViewGroup
group = new();
431
ListViewGroup
group1 = new();
440
ListViewGroup
group2 = new();
448
ListViewGroup
group1 = new();
449
ListViewGroup
group2 = new();
466
ListViewGroup
group = new();
493
ListViewGroup
group = new();
511
ListViewGroup
group = Assert.Single(collection.Cast<
ListViewGroup
>());
521
ListViewGroup
group = new();
542
ListViewGroup
group1 = new();
543
ListViewGroup
group2 = new();
544
var items = new
ListViewGroup
[] { group1, group2 };
560
ListViewGroup
group1 = new();
561
ListViewGroup
group2 = new();
580
Assert.Throws<ArgumentNullException>("groups", () => collection.AddRange((
ListViewGroup
[])null));
589
ListViewGroup
group = new();
590
Assert.Throws<ArgumentNullException>("group", () => collection.AddRange((
ListViewGroup
[])[group, null]));
591
Assert.Same(group, Assert.Single(collection.Cast<
ListViewGroup
>()));
599
ListViewGroup
group = new();
619
ListViewGroup
group = new();
647
ListViewGroup
group = new();
670
ListViewGroup
group = new();
695
ListViewGroup
group = new();
718
ListViewGroup
group = new();
743
ListViewGroup
group = new();
758
ListViewGroup
group = new();
773
ListViewGroup
group = new();
792
ListViewGroup
group = new();
812
ListViewGroup
group = new();
832
ListViewGroup
group1 = new();
833
ListViewGroup
group2 = new();
849
ListViewGroup
group = new();
884
ListViewGroup
group = new();
919
ListViewGroup
group = new();
943
ListViewGroup
group = new();
965
ListViewGroup
group = new();
985
ListViewGroup
group = new();
997
ListViewGroup
group = new();
1036
ListViewGroup
group = new();
1098
Assert.Throws<InvalidOperationException>(() => listView.Groups.AddRange((
ListViewGroup
[])[new(), new()]));
1110
sourceGroup.AddRange((
ListViewGroup
[])[new(), new()]);
System\Windows\Forms\ListViewGroupConverterTests.cs (29)
20
[InlineData(typeof(
ListViewGroup
), false)]
24
TypeConverter converter = TypeDescriptor.GetConverter(typeof(
ListViewGroup
));
40
ListViewGroup
group = new("name", "header");
51
TypeConverter converter = TypeDescriptor.GetConverter(typeof(
ListViewGroup
));
64
TypeConverter converter = TypeDescriptor.GetConverter(typeof(
ListViewGroup
));
74
ListViewGroup
group = new("name", "header");
79
TypeConverter converter = TypeDescriptor.GetConverter(typeof(
ListViewGroup
));
109
TypeConverter converter = TypeDescriptor.GetConverter(typeof(
ListViewGroup
));
125
TypeConverter converter = TypeDescriptor.GetConverter(typeof(
ListViewGroup
));
132
[InlineData(typeof(
ListViewGroup
), false)]
137
TypeConverter converter = TypeDescriptor.GetConverter(typeof(
ListViewGroup
));
153
ListViewGroup
group = new("name", "header");
164
TypeConverter converter = TypeDescriptor.GetConverter(typeof(
ListViewGroup
));
202
public void ListViewGroupConverter_ConvertTo_InstanceDescriptor_ReturnsExpected(
ListViewGroup
value, Type[] parameterTypes, object[] arguments)
204
TypeConverter converter = TypeDescriptor.GetConverter(typeof(
ListViewGroup
));
206
Assert.Equal(typeof(
ListViewGroup
).GetConstructor(parameterTypes), descriptor.MemberInfo);
215
TypeConverter converter = TypeDescriptor.GetConverter(typeof(
ListViewGroup
));
222
TypeConverter converter = TypeDescriptor.GetConverter(typeof(
ListViewGroup
));
229
TypeConverter converter = TypeDescriptor.GetConverter(typeof(
ListViewGroup
));
234
[InlineData(typeof(
ListViewGroup
))]
238
TypeConverter converter = TypeDescriptor.GetConverter(typeof(
ListViewGroup
));
245
TypeConverter converter = TypeDescriptor.GetConverter(typeof(
ListViewGroup
));
252
TypeConverter converter = TypeDescriptor.GetConverter(typeof(
ListViewGroup
));
253
ListViewGroup
item = new();
269
ListViewGroup
group = new("name", "header");
280
TypeConverter converter = TypeDescriptor.GetConverter(typeof(
ListViewGroup
));
291
TypeConverter converter = TypeDescriptor.GetConverter(typeof(
ListViewGroup
));
298
TypeConverter converter = TypeDescriptor.GetConverter(typeof(
ListViewGroup
));
305
TypeConverter converter = TypeDescriptor.GetConverter(typeof(
ListViewGroup
));
System\Windows\Forms\ListViewGroupTests.cs (65)
19
ListViewGroup
group = new();
40
ListViewGroup
group = new(header);
70
ListViewGroup
group = new(header, headerAlignment);
98
ListViewGroup
group = new(key, header);
122
ListViewGroup
group = new() { CollapsedState = collapsedState };
131
ListViewGroup
group = new();
140
ListViewGroup
group = new()
158
ListViewGroup
group = new();
177
ListViewGroup
group = new();
224
ListViewGroup
group = new();
252
ListViewGroup
group = new();
260
ListViewGroup
group = new()
278
ListViewGroup
group = new()
296
ListViewGroup
group = new();
318
ListViewGroup
group = new();
364
ListViewGroup
group = new();
392
ListViewGroup
group = new()
410
ListViewGroup
group = new()
428
ListViewGroup
group = new();
450
ListViewGroup
group = new();
501
ListViewGroup
group = new();
532
ListViewGroup
group = new()
550
ListViewGroup
group = new();
572
ListViewGroup
group = new();
614
ListViewGroup
group = new();
654
ListViewGroup
group = new()
674
ListViewGroup
group = new()
698
ListViewGroup
group = new()
753
ListViewGroup
group1 = new()
784
ListViewGroup
group = new();
793
ListViewGroup
group = new()
811
ListViewGroup
group = new();
833
ListViewGroup
group = new();
875
ListViewGroup
group = new();
906
ListViewGroup
group = new()
926
ListViewGroup
group = new()
950
ListViewGroup
group = new()
1005
ListViewGroup
group1 = new()
1036
ListViewGroup
group = new();
1051
ListViewGroup
group = new()
1068
ListViewGroup
group = new()
1091
ListViewGroup
group = new()
1131
ListViewGroup
group = new();
1172
ListViewGroup
group = new();
1180
ListViewGroup
group = new()
1197
ListViewGroup
group = new()
1215
ListViewGroup
group = new();
1237
ListViewGroup
group = new();
1280
ListViewGroup
group = new();
1309
ListViewGroup
group = new()
1326
ListViewGroup
groupWithEmptyItems = new();
1330
ListViewGroup
groupWithItems = new();
1337
public void ListViewGroup_Serialize_Deserialize_Success(
ListViewGroup
group)
1348
ListViewGroup
result = Assert.IsType<
ListViewGroup
>(formatter.Deserialize(stream)); // CodeQL [SM03722] : Deserialization is performed on trusted data and the types are controlled and validated.
1361
ListViewGroup
group = new(header);
1368
ListViewGroup
group = new();
1370
SerializationInfo info = new(typeof(
ListViewGroup
), new FormatterConverter());
1384
ListViewGroup
group = new();
1388
SerializationInfo info = new(typeof(
ListViewGroup
), new FormatterConverter());
1402
ListViewGroup
group = new();
1406
SerializationInfo info = new(typeof(
ListViewGroup
), new FormatterConverter());
1421
ListViewGroup
group = new();
1433
ListViewGroup
listViewGroup = new();
1448
ListViewGroup
listViewGroup = new();
System\Windows\Forms\ListViewItem.IKeyboardToolTipTests.cs (1)
127
ListViewGroup
listViewGroup = new();
System\Windows\Forms\ListViewItemConverterTests.cs (1)
52
ListViewGroup
group = new();
System\Windows\Forms\ListViewItemTests.cs (11)
54
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)
92
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)
205
public void ListViewItem_Ctor_ListViewSubItemArray_String_ListViewGroup(ListViewItem.ListViewSubItem[] subItems, string imageKey,
ListViewGroup
group, string expectedImageKey, string expectedText)
242
public void ListViewItem_Ctor_ListViewSubItemArray_Int_ListViewGroup(ListViewItem.ListViewSubItem[] subItems, int imageIndex,
ListViewGroup
group, string expectedText)
280
public void ListViewItem_Ctor_StringArray_String_ListViewGroup(string[] subItems, string imageKey,
ListViewGroup
group, string expectedImageKey, string expectedText)
318
public void ListViewItem_Ctor_StringArray_Int_ListViewGroup(string[] subItems, int imageIndex,
ListViewGroup
group, string expectedText)
355
public void ListViewItem_Ctor_String_String_ListViewGroup(string text, string imageKey,
ListViewGroup
group, string expectedText, string expectedImageKey)
393
public void ListViewItem_Ctor_String_Int_ListViewGroup(string text, int imageIndex,
ListViewGroup
group, string expectedText)
506
public void ListViewItem_Ctor_StringArray_ListViewGroup(string[] subItems,
ListViewGroup
group, string expectedText)
619
public void ListViewItem_Ctor_String_ListViewGroup(string text,
ListViewGroup
group, string expectedText)
732
public void ListViewItem_Ctor_ListViewGroup(
ListViewGroup
group)
System\Windows\Forms\ListViewTests.cs (12)
1922
ListViewGroup
group1 = new();
1923
ListViewGroup
group2 = new()
4543
ListViewGroup
group = new("Test group");
4569
ListViewGroup
group1 = new("Test group1");
4570
ListViewGroup
group2 = new("Test group2");
4571
ListViewGroup
group3 = new("Test group3");
4620
ListViewGroup
group = new("Test group");
5653
var groups = new
ListViewGroup
[] { new("Group 1"), new("Group 2"), new("Group 3") };
5691
var groups = new
ListViewGroup
[] { new("Group 1"), new("Group 2"), new("Group 3") };
5728
var groups = new
ListViewGroup
[] { new("Group 1"), new("Group 2"), new("Group 3") };
5764
var groups = new
ListViewGroup
[] { new("Group 1"), new("Group 2"), new("Group 3") };
6191
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"))});