1 type derived from ListViewItem
System.Windows.Forms.Tests (1)
System\Windows\Forms\ListViewTests.cs (1)
6067private class SubListViewItem : ListViewItem
650 instantiations of ListViewItem
Accessibility_Core_App (5)
CommonControl1.Designer.cs (4)
31System.Windows.Forms.ListViewItem listViewItem1 = new("1"); 32System.Windows.Forms.ListViewItem listViewItem2 = new("2"); 33System.Windows.Forms.ListViewItem listViewItem3 = new("3"); 34System.Windows.Forms.ListViewItem listViewItem4 = new("4");
DataBindingExample.cs (1)
103ListViewItem item = new(itemName, i);
System.Windows.Forms (11)
System\Windows\Forms\Controls\ListView\ListView.ListViewItemCollection.cs (10)
94: new ListViewItem(value!.ToString(), -1); 154ListViewItem item = new(text, imageIndex); 179ListViewItem item = new(text, imageKey); 191ListViewItem item = new(text, imageKey) 206ListViewItem item = new(text, imageIndex) 386return Insert(index, new ListViewItem(text)); 391return Insert(index, new ListViewItem(text, imageIndex)); 409=> Insert(index, new ListViewItem(text, imageKey)); 412=> Insert(index, new ListViewItem(text, imageKey) 418=> Insert(index, new ListViewItem(text, imageIndex)
System\Windows\Forms\Controls\ListView\ListViewItem.cs (1)
906newItem = new ListViewItem(clonedSubItems, ImageIndexer.Index);
System.Windows.Forms.Design (4)
System\Windows\Forms\Design\MaskDesignerDialog.cs (2)
520_listViewCannedMasks.Items.Add(new ListViewItem([maskDescriptor.Name!, sample, validatingType])); 525_listViewCannedMasks.Items.Add(new ListViewItem([_customMaskDescriptor.Name, "", nullEntry]));
System\Windows\Forms\Design\StyleEditorForm.cs (2)
600_columnsAndRowsListView.Items.Add(new ListViewItem([baseName + (i + 1).ToString(CultureInfo.InvariantCulture), sizeType, sizeValue])); 829new ListViewItem(
System.Windows.Forms.Tests (611)
SerializableTypesTests.cs (3)
132listViewGroup.Items.Add(new ListViewItem("Item")); 163ListViewItem listViewItem = new("Item1", 0) 211new ListViewItem(),
System\Windows\Forms\AccessibleObjects\ListVIew.ListViewAccessibleObjectTests.cs (64)
86listView.Items.Add(new ListViewItem()); 87ListViewItem item = new(); 88ListViewItem item2 = new(); 116listView.Items.Add(new ListViewItem()); 117ListViewItem item = new(); 118ListViewItem item2 = new(); 140listView.Items.Add(new ListViewItem()); 141ListViewItem item = new(); 142ListViewItem item2 = new(); 164listView.Items.Add(new ListViewItem()); 165listView.Items.Add(new ListViewItem()); 181listView.Items.Add(new ListViewItem()); 182listView.Items.Add(new ListViewItem()); 268ListViewItem listViewItem1 = new("Test item 1"); 269ListViewItem listViewItem2 = new("Test item 2"); 391ListViewItem listViewItem1 = new("Test item 1"); 392ListViewItem listViewItem2 = new("Test item 2"); 393ListViewItem listViewItem3 = new("Test item 3"); 514ListViewItem listViewItem1 = new("Test item 1"); 515ListViewItem listViewItem2 = new("Test item 2"); 516ListViewItem listViewItem3 = new("Test item 3"); 585ListViewItem listViewItem1 = new("Test item 1"); 586ListViewItem listViewItem2 = new("Test item 2"); 587ListViewItem listViewItem3 = new("Test item 3"); 640ListViewItem listViewItem1 = new("Test item 1"); 641ListViewItem listViewItem2 = new("Test item 2"); 642ListViewItem listViewItem3 = new("Test item 3"); 720ListViewItem listViewItem1 = new("Test item 1"); 721ListViewItem listViewItem2 = new("Test item 2"); 722ListViewItem listViewItem3 = new("Test item 3"); 805listView.Groups[0].Items.Add(new ListViewItem()); 854ListViewItem listViewItem1 = new("Test item 1"); 855ListViewItem listViewItem2 = new("Test item 2"); 856ListViewItem listViewItem3 = new("Test item 3"); 924ListViewItem listItem1 = new(listGroup1); 925ListViewItem listItem2 = new(); 926ListViewItem listItem3 = new(listGroup2); 927ListViewItem listItem4 = new(listGroup2); 957ListViewItem listItem1 = new(); 975ListViewItem listItem1 = new(); 1014ListViewItem listItem2 = new("Group item 2"); 1015ListViewItem listItem3 = new("Item 3"); 1059ListViewItem listItem1 = new(); 1090ListViewItem listItem1 = new(); 1151listView.Items.Add(new ListViewItem(["Item 1", "SubItem 1"])); 1152listView.Items.Add(new ListViewItem(["Item 1", "SubItem 1"])); 1174listView.Items.Add(new ListViewItem(["Item 1", "SubItem 1"])); 1175listView.Items.Add(new ListViewItem(["Item 1", "SubItem 1"])); 1194listView.Items.Add(new ListViewItem(["Item 1", "SubItem 11", "SubItem 12"])); 1195listView.Items.Add(new ListViewItem(["Item 2", "SubItem 21", "SubItem 22"])); 1220listView.Items.Add(new ListViewItem(["Item 1"])); 1221listView.Items.Add(new ListViewItem(["Item 2"])); 1393ListViewItem listItem2 = new("Group item 2", listViewGroup); 1394ListViewItem listItem3 = new("Item 3"); 1488ListViewItem listViewItem1 = new(); 1489ListViewItem listViewItem2 = new(); 1573ListViewItem listViewItem1 = new(); 1574ListViewItem listViewItem2 = new(); 1674ListViewItem listViewItem1 = new(); 1675ListViewItem listViewItem2 = new(); 1730ListViewItem listViewItem1 = new(); 1731ListViewItem listViewItem2 = new(); 1732ListViewItem listViewItem3 = new(); 1751listView.Items.AddRange(Enumerable.Range(0, 11).Select(i => new ListViewItem()).ToArray());
System\Windows\Forms\AccessibleObjects\ListViewGroup.ListViewGroupAccessibleObjectTests.cs (73)
21listGroup.Items.Add(new ListViewItem()); 39listGroup.Items.Add(new ListViewItem()); 54listGroup.Items.Add(new ListViewItem()); 85listGroup.Items.Add(new ListViewItem()); 86list.Items.Add(new ListViewItem()); 118listGroup.Items.Add(new ListViewItem()); 146items.Add(new ListViewItem(groups[0])); 147items.Add(new ListViewItem(groups[0])); 148items.Add(new ListViewItem()); 149items.Add(new ListViewItem(groups[1])); 150items.Add(new ListViewItem(groups[1])); 151items.Add(new ListViewItem(groups[1])); 215items.Add(new ListViewItem(groups[0])); 216items.Add(new ListViewItem(groups[0])); 217items.Add(new ListViewItem(groups[0])); 218items.Add(new ListViewItem(groups[1])); 219items.Add(new ListViewItem(groups[1])); 220items.Add(new ListViewItem(groups[1])); 279ListViewItem listItem1 = new("Item1"); 280ListViewItem listItem2 = new("Item2"); 328listView.Items.Add(new ListViewItem("a", group)); 379items.Add(new ListViewItem(groups[0])); 380items.Add(new ListViewItem(groups[0])); 381items.Add(new ListViewItem()); 382items.Add(new ListViewItem(groups[1])); 383items.Add(new ListViewItem(groups[1])); 384items.Add(new ListViewItem(groups[1])); 385items.Add(new ListViewItem(groups[1])); 386items.Add(new ListViewItem(groups[1])); 388ListViewItem itemWithoutListView1 = new(groups[1]); 389ListViewItem itemWithoutListView2 = new(groups[1]); 474items.Add(new ListViewItem(groups[0])); 475items.Add(new ListViewItem(groups[0])); 476items.Add(new ListViewItem()); 477items.Add(new ListViewItem(groups[1])); 478items.Add(new ListViewItem(groups[1])); 479items.Add(new ListViewItem(groups[1])); 480items.Add(new ListViewItem(groups[1])); 481items.Add(new ListViewItem(groups[1])); 510items.Add(new ListViewItem(groups[0])); 511items.Add(new ListViewItem(groups[0])); 512items.Add(new ListViewItem()); 513items.Add(new ListViewItem(groups[1])); 514items.Add(new ListViewItem(groups[1])); 515items.Add(new ListViewItem(groups[1])); 595items.Add(new ListViewItem(groups[0])); 596items.Add(new ListViewItem()); 597items.Add(new ListViewItem(groups[1])); 598items.Add(new ListViewItem(groups[1])); 666ListViewItem listViewItem = new("Test item", listViewGroup); 713listView.Items.Add(new ListViewItem("Item1", lvgroup1)); 722listView.Items.Add(new ListViewItem("Item2", lvgroup2)); 747listView.Items.Add(new ListViewItem("Group Item 1", listViewGroup)); 748listView.Items.Add(new ListViewItem("Group Item 2", listViewGroup)); 797ListViewItem item1 = new("Item 1", group1); 798ListViewItem item2 = new("Item 2", group2); 799ListViewItem item3 = new("Item 2", group3); 889ListViewItem listViewItem1 = new(); 890ListViewItem listViewItem2 = new(); 1220listView.Items.Add(new ListViewItem()); 1239ListViewItem listViewItem1 = new(); 1240ListViewItem listViewItem2 = new(); 1241ListViewItem listViewItem3 = new(); 1264ListViewItem listItem1 = new(listGroup1); 1265ListViewItem listItem2 = new(listGroup1); 1266ListViewItem listItem3 = new(); 1329ListViewItem item = new("Test") 1402ListViewItem listViewInvisibleItem1 = new("Invisible item 1"); 1403ListViewItem listViewVisibleItem1 = new("Visible item 1"); 1404ListViewItem listViewInvisibleItem2 = new("Invisible item 1"); 1405ListViewItem listViewVisibleItem2 = new("Visible item 1"); 1431ListViewItem listViewItem1 = new("Test item 1"); 1439ListViewItem listViewItem2 = new("Test item 2");
System\Windows\Forms\AccessibleObjects\ListViewItem.ListViewItemAccessibleObjectTests.cs (49)
17ListViewItem listItem = new(); 27ListViewItem itemWithoutList = new(); 36ListViewItem listItem = new(); 76ListViewItem listViewItem1 = new(); 77ListViewItem listViewItem2 = new(listviewGroup); 94ListViewItem listItem = new("ListItem"); 843ListViewItem listViewItem = new("Item"); 891ListViewItem listViewItem = new("Item"); 926ListViewItem listViewItem = new("Item"); 1138ListViewItem listItem1 = new("Item 1"); 1139ListViewItem listItem2 = new("Item 2"); 1198ListViewItem listItem2 = new("Group item 2"); 1199ListViewItem listItem3 = new("Item 3"); 1257ListViewItem listViewInvisibleItem1 = new("Invisible item 1"); 1258ListViewItem listViewVisibleItem1 = new("Visible item 1"); 1259ListViewItem listViewInvisibleItem2 = new("Invisible item 1"); 1260ListViewItem listViewVisibleItem2 = new("Visible item 1"); 1291listView.Items.Add(new ListViewItem("Item 1")); 1292listView.Items.Add(new ListViewItem("Item 2")); 1293listView.Items.Add(new ListViewItem("Item 3")); 1350listView.Items.Add(new ListViewItem("Item 1")); 1351listView.Items.Add(new ListViewItem("Item 2", group: listView.Groups[0])); 1352listView.Items.Add(new ListViewItem("Item 3")); 1408listView.Items.Add(new ListViewItem("Item 1")); 1409listView.Items.Add(new ListViewItem("Item 2", group: listView.Groups[0])); 1410listView.Items.Add(new ListViewItem("Item 3")); 1455listView.Items.Add(new ListViewItem("Item 1")); 1456listView.Items.Add(new ListViewItem("Item 2")); 1457listView.Items.Add(new ListViewItem("Item 3")); 1537listView.Items.Add(new ListViewItem(["Item 1", "SubItem 1", "SubItem 2"])); 1567listView.Items.Add(new ListViewItem(["Item 1", "SubItem 1", "SubItem 2"])); 1585listView.Items.Add(new ListViewItem(["Item 1", "SubItem 11", "SubItem 12"])); 1586listView.Items.Add(new ListViewItem(["Item 2", "SubItem 21", "SubItem 22"])); 1600listView.Items.Add(new ListViewItem(["Item 1"])); 1624ListViewItem listViewItem = new("Item 1", imageIndex: hasImage ? 0 : -1); 1644listView.Items.Add(new ListViewItem(["Item 1", "SubItem 11", "SubItem 12"])); 1659listView.Items.Add(new ListViewItem("Test")); 1700listView.Items.Add(new ListViewItem("Test")); 1754listView.Items.Add(new ListViewItem(["1", "2"])); 1787listView.Items.Add(new ListViewItem(["1"])); 1846ListViewItem item = new("ListItem"); 1860ListViewItem item = new("ListItem"); 1874ListViewItem item = new("ListItem"); 1888ListViewItem item = new("ListItem"); 1902ListViewItem item = new("ListItem"); 1906listView.Items[0] = new ListViewItem(); 1928ListViewItem listViewItem1 = new("Item1"); 1929ListViewItem listViewItem2 = new("Item2"); 1930ListViewItem listViewItem3 = new("Item3");
System\Windows\Forms\AccessibleObjects\ListViewItem.ListViewItemBaseAccessibleObjectTests.cs (25)
23ListViewItem item = new(); 34ListViewItem item = new(); 45ListViewItem item = new(); 58ListViewItem item = new(); 70ListViewItem item = new() { Selected = isSelected }; 81ListViewItem item = new(); 98ListViewItem item = new(); 116ListViewItem item = new(); 133ListViewItem item = new(); 151ListViewItem item = new(); 181ListViewItem item = new(); 200ListViewItem item = new(); 218ListViewItem item = new(); 231ListViewItem item = new(); 244ListViewItem item = new(); 257ListViewItem item = new(); 270ListViewItem item = new(); 286ListViewItem item = new(); 302ListViewItem item = new(); 318ListViewItem item = new() 339ListViewItem item = new(); 350ListViewItem item = new(); 363ListViewItem item = new() { Checked = isChecked }; 376ListViewItem item = new() { Checked = isChecked }; 393ListViewItem item = new();
System\Windows\Forms\AccessibleObjects\ListViewItem.ListViewItemDetailsAccessibleObjectTests.cs (8)
22ListViewItem item = new(); 37ListViewItem item = new(); 53ListViewItem item = new(); 69ListViewItem item = new(); 87ListViewItem item = new(); 100ListViewItem item = new(); 115ListViewItem item = new(); 151ListViewItem listViewItem = new("1", 0);
System\Windows\Forms\AccessibleObjects\ListViewItem.ListViewItemImageAccessibleObjectTests.cs (2)
17ListViewItem listViewItem = new("Test", 0); 42ListViewItem listViewItem = new("Test", 0);
System\Windows\Forms\AccessibleObjects\ListViewItem.ListViewItemListAccessibleObjectTests.cs (3)
21Assert.Throws<InvalidOperationException>(() => new ListViewItemListAccessibleObject(new ListViewItem())); 29control.Items.Add(new ListViewItem()); 40control.Items.Add(new ListViewItem());
System\Windows\Forms\AccessibleObjects\ListViewItem.ListViewItemTileAccessibleObjectTests.cs (1)
19Assert.Throws<InvalidOperationException>(() => new ListViewItemTileAccessibleObject(new ListViewItem()));
System\Windows\Forms\AccessibleObjects\ListViewItem.ListViewItemWithImageAccessibleObjectTests.cs (6)
17control.Items.Add(new ListViewItem()); 33ListViewItem listViewItem = new("Test", 0); 63control.Items.Add(new ListViewItem()); 78ListViewItem listViewItem = new("Test", 0); 99control.Items.Add(new ListViewItem()); 115ListViewItem listViewItem = new("Test", 0);
System\Windows\Forms\AccessibleObjects\ListViewItem.ListViewSubItem.ListViewSubItemAccessibleObjectTests.cs (19)
104list.Items.Add(new ListViewItem(["Test 1", "Test 2"])); 802ListViewItem listItem1 = new("Item 1"); 803ListViewItem listItem2 = new("Item 2"); 855ListViewItem listViewItem = new("Test item") 878listView.Items.Add(new ListViewItem("Test item 11")); 900listView.Items.Add(new ListViewItem("Test item 11")); 914ListViewItem listViewItem = new("Test item"); 927ListViewItem listViewItem = new("Test item"); 942ListViewItem listViewItem = new("Test item"); 971ListViewItem listViewItem = new("Test item"); 1050ListViewItem listViewItem = new(); 1062ListViewItem listViewItem = new(); 1078ListViewItem listViewItem = new(); 1094ListViewItem listViewItem = new(); 1110ListViewItem listViewItem = new(); 1126ListViewItem listViewItem = new(); 1142ListViewItem listViewItem = new(); 1148listView.Items[0] = new ListViewItem(); 1158ListViewItem listViewItem = new();
System\Windows\Forms\AccessibleObjects\ListViewLabelEditAccessibleObjectTests.cs (1)
163ListViewItem item = new("Test", 0);
System\Windows\Forms\BinaryFormat\WinFormsBinaryFormattedObjectTests.cs (1)
226new ListViewItem(),
System\Windows\Forms\DrawListViewItemEventArgsTests.cs (15)
25ListViewItem item = new(); 38Assert.Throws<ArgumentNullException>("graphics", () => new DrawListViewItemEventArgs(null, new ListViewItem(), new Rectangle(1, 2, 3, 4), 0, ListViewItemStates.Default)); 55DrawListViewItemEventArgs e = new(graphics, new ListViewItem(), new Rectangle(1, 2, 3, 4), -1, ListViewItemStates.Checked) 72yield return new object[] { new ListViewItem(), new Rectangle(1, 2, 3, 4), ListViewItemStates.Default }; 73yield return new object[] { new ListViewItem(), new Rectangle(1, 2, 3, 4), ListViewItemStates.Focused }; 74yield return new object[] { new ListViewItem(), new Rectangle(1, 2, 3, 4), ListViewItemStates.Checked }; 75yield return new object[] { new ListViewItem(), Rectangle.Empty, ListViewItemStates.Default }; 76yield return new object[] { new ListViewItem(), Rectangle.Empty, ListViewItemStates.Focused }; 77yield return new object[] { new ListViewItem(), Rectangle.Empty, ListViewItemStates.Checked }; 78yield return new object[] { new ListViewItem(), new Rectangle(-1, -2, -3, -4), ListViewItemStates.Default }; 79yield return new object[] { new ListViewItem(), new Rectangle(-1, -2, -3, -4), ListViewItemStates.Focused }; 80yield return new object[] { new ListViewItem(), new Rectangle(-1, -2, -3, -4), ListViewItemStates.Checked }; 85ListViewItem listViewItem = new(); 91ListViewItem subItemsItem = new(); 99ListViewItem fullRowSelectListViewItem = new();
System\Windows\Forms\DrawListViewSubItemEventArgsTests.cs (20)
13yield return new object[] { Rectangle.Empty, new ListViewItem(), new ListViewItem.ListViewSubItem(), -2, -2, null, ListViewItemStates.Checked - 1 }; 14yield return new object[] { new Rectangle(1, 2, 3, 4), new ListViewItem(), null, -1, -1, new ColumnHeader(), ListViewItemStates.Checked }; 15yield return new object[] { new Rectangle(1, 2, 3, 4), new ListViewItem(), new ListViewItem.ListViewSubItem(), -1, -1, new ColumnHeader(), ListViewItemStates.Checked }; 16yield return new object[] { new Rectangle(-1, 2, -3, -4), new ListViewItem(), new ListViewItem.ListViewSubItem(), 0, 0, new ColumnHeader(), ListViewItemStates.Focused }; 17yield return new object[] { new Rectangle(1, 2, 3, 4), new ListViewItem(), new ListViewItem.ListViewSubItem(), 1, 2, new ColumnHeader(), ListViewItemStates.Checked }; 41Assert.Throws<ArgumentNullException>("graphics", () => new DrawListViewSubItemEventArgs(null, new Rectangle(1, 2, 3, 4), new ListViewItem(), new ListViewItem.ListViewSubItem(), -1, 0, new ColumnHeader(), ListViewItemStates.Default)); 59Assert.Throws<ArgumentNullException>("subItem", () => new DrawListViewSubItemEventArgs(graphics, new Rectangle(1, 2, 3, 4), new ListViewItem(), null, itemIndex, 0, new ColumnHeader(), ListViewItemStates.Default)); 68DrawListViewSubItemEventArgs e = new(graphics, new Rectangle(1, 2, 3, 4), new ListViewItem(), null, -1, -1, new ColumnHeader(), ListViewItemStates.Checked) 85yield return new object[] { new Rectangle(-1, -2, -3, -4), new ListViewItem(), null, -1, null, ListViewItemStates.Default }; 86yield return new object[] { new Rectangle(-1, -2, -3, -4), new ListViewItem(), null, -1, null, ListViewItemStates.Checked }; 87yield return new object[] { new Rectangle(-1, -2, -3, -4), new ListViewItem(), null, -1, null, ListViewItemStates.Focused }; 88yield return new object[] { new Rectangle(-1, -2, -3, -4), new ListViewItem(), null, -1, new ColumnHeader(), ListViewItemStates.Default }; 89yield return new object[] { new Rectangle(-1, -2, -3, -4), new ListViewItem(), null, -1, new ColumnHeader(), ListViewItemStates.Checked }; 90yield return new object[] { new Rectangle(-1, -2, -3, -4), new ListViewItem(), null, -1, new ColumnHeader(), ListViewItemStates.Focused }; 91yield return new object[] { new Rectangle(1, 2, 3, 4), new ListViewItem(), null, -1, null, ListViewItemStates.Default }; 92yield return new object[] { new Rectangle(1, 2, 3, 4), new ListViewItem(), null, -1, null, ListViewItemStates.Checked }; 93yield return new object[] { new Rectangle(1, 2, 3, 4), new ListViewItem(), null, -1, null, ListViewItemStates.Focused }; 94yield return new object[] { new Rectangle(1, 2, 3, 4), new ListViewItem(), null, -1, new ColumnHeader(), ListViewItemStates.Default }; 95yield return new object[] { new Rectangle(1, 2, 3, 4), new ListViewItem(), null, -1, new ColumnHeader(), ListViewItemStates.Checked }; 96yield return new object[] { new Rectangle(1, 2, 3, 4), new ListViewItem(), null, -1, new ColumnHeader(), ListViewItemStates.Focused };
System\Windows\Forms\ItemCheckedEventArgsTests.cs (1)
18ListViewItem listViewItem = new();
System\Windows\Forms\ListView.ListViewItemCollectionTests.cs (6)
15ListViewItem child1 = new() 19ListViewItem child2 = new() 23ListViewItem child3 = new() 71ListViewItem child1 = new() 75ListViewItem child2 = new() 79ListViewItem child3 = new()
System\Windows\Forms\ListViewGroupCollectionTests.cs (15)
76ListViewItem item = new(); 82group.Items.Add(new ListViewItem()); 97ListViewItem item = new(); 103group.Items.Add(new ListViewItem()); 159ListViewItem item = new(); 407ListViewItem item = new(); 411group.Items.Add(new ListViewItem()); 426ListViewItem item = new(); 430group1.Items.Add(new ListViewItem()); 490ListViewItem item = new(); 768ListViewItem item = new(); 772group.Items.Add(new ListViewItem()); 787ListViewItem item = new(); 791group.Items.Add(new ListViewItem()); 846ListViewItem item = new();
System\Windows\Forms\ListViewGroupConverterTests.cs (13)
30yield return new object[] { new ListViewItem(), true }; 33ListViewItem item1 = new(); 40ListViewItem item2 = new(); 74ListViewItem item = new(); 89yield return new object[] { new ListViewItem() }; 92ListViewItem item1 = new(); 98ListViewItem item2 = new(); 143yield return new object[] { new ListViewItem(), true }; 146ListViewItem item1 = new(); 153ListViewItem item2 = new(); 259yield return new object[] { new ListViewItem(), null }; 262ListViewItem item1 = new(); 269ListViewItem item2 = new();
System\Windows\Forms\ListViewGroupTests.cs (5)
1329groupWithItems.Items.Add(new ListViewItem("text")); 1401group.Items.Add(new ListViewItem("text")); 1429ListViewItem listViewItem = new(); 1430ListViewItem listViewItemGroup = new(); 1445ListViewItem listViewItem = new();
System\Windows\Forms\ListViewHitTestInfoTests.cs (1)
12yield return new object[] { new ListViewItem(), new ListViewItem.ListViewSubItem(), ListViewHitTestLocations.None - 1 };
System\Windows\Forms\ListViewItem.IKeyboardToolTipTests.cs (19)
19ListViewItem listViewItem = new(); 41ListViewItem listViewItem = new(); 63ListViewItem listViewItem = new(); 86ListViewItem listViewItem = new() { ToolTipText = toolTipText }; 105ListViewItem listViewItem = new(); 124ListViewItem listViewItem = new(); 147ListViewItem listViewItem = AssignItemToListView(listView, new ListViewItem(new string('t', 500))); 167ListViewItem listViewItem = AssignItemToListView(listView, new ListViewItem(new string('t', 1))); 177ListViewItem listViewItem = new(new string('t', 20)); 193ListViewItem listViewItem = new(new string('t', 10)); 209ListViewItem listViewItem = new(); 220ListViewItem listViewItem = AssignItemToListView(listView, new ListViewItem()); 229ListViewItem listViewItem = AssignItemToListView(listView, new ListViewItem()); 645ListViewItem listViewItem = new(); 672ListViewItem listViewItem = new(); 700ListViewItem listViewItem = new(); 738ListViewItem listViewItem = new(); 757_ => new ListViewItem(), 783ListViewItem listViewItem = new(i.ToString());
System\Windows\Forms\ListViewItemConverterTests.cs (32)
69new ListViewItem(), 75new ListViewItem(group), 81new ListViewItem("text"), 87new ListViewItem("text", group), 93new ListViewItem("text", "imageKey"), 99new ListViewItem("text", 1), 105new ListViewItem("text", "imageKey", group), 111new ListViewItem("text", 1, group), 119new ListViewItem([subItem1], "imageKey"), 125new ListViewItem([subItem1], 1), 131new ListViewItem([subItem1], "imageKey", group), 137new ListViewItem([subItem1], 1, group), 143new ListViewItem([subItem1, subItem2], "imageKey"), 149new ListViewItem([subItem1, subItem2], 1), 155new ListViewItem([subItem1, subItem2], "imageKey", group), 161new ListViewItem([subItem1, subItem2], 1, group), 167new ListViewItem([subItem1, subItem2, subItem3, subItem4, subItem5], "imageKey"), 173new ListViewItem([subItem1, subItem2, subItem3, subItem4, subItem5], 1), 179new ListViewItem([subItem1, subItem2, subItem3, subItem4, subItem5], "imageKey", group), 185new ListViewItem([subItem1, subItem2, subItem3, subItem4, subItem5], 1, group), 191new ListViewItem([subItem3], 1), 197new ListViewItem([subItem4], 1), 203new ListViewItem([subItem5], 1), 209new ListViewItem([subItem3], "imageKey"), 215new ListViewItem([subItem4], "imageKey"), 221new ListViewItem([subItem5], "imageKey"), 229new ListViewItem(["text"], "imageKey", Color.Red, Color.Blue, SystemFonts.MenuFont), 235new ListViewItem(["text"], 1, Color.Red, Color.Blue, SystemFonts.MenuFont), 241new ListViewItem(["text"], "imageKey", Color.Red, Color.Blue, SystemFonts.MenuFont, group), 247new ListViewItem(["text"], 1, Color.Red, Color.Blue, SystemFonts.MenuFont, group), 292Assert.Throws<NotSupportedException>(() => converter.ConvertTo(new ListViewItem(), destinationType)); 306ListViewItem item = new();
System\Windows\Forms\ListViewItemMouseHoverEventArgsTests.cs (1)
12yield return new object[] { new ListViewItem() };
System\Windows\Forms\ListViewItemSelectionChangedEventArgsTests.cs (2)
12yield return new object[] { new ListViewItem(), -1, true }; 13yield return new object[] { new ListViewItem(), 0, true };
System\Windows\Forms\ListViewItemTests.cs (47)
15ListViewItem item = new(); 54ListViewItem item = new(subItems, imageKey, foreColor, backColor, font, group); 92ListViewItem item = new(subItems, imageIndex, foreColor, backColor, font, group); 130ListViewItem item = new(subItems, imageKey, foreColor, backColor, font); 168ListViewItem item = new(subItems, imageIndex, foreColor, backColor, font); 205ListViewItem item = new(subItems, imageKey, group); 242ListViewItem item = new(subItems, imageIndex, group); 280ListViewItem item = new(subItems, imageKey, group); 318ListViewItem item = new(subItems, imageIndex, group); 355ListViewItem item = new(text, imageKey, group); 393ListViewItem item = new(text, imageIndex, group); 431ListViewItem item = new(subItems, imageKey); 468ListViewItem item = new(subItems, imageIndex); 506ListViewItem item = new(subItems, group); 544ListViewItem item = new(subItems, imageKey); 582ListViewItem item = new(subItems, imageIndex); 619ListViewItem item = new(text, group); 657ListViewItem item = new(text, imageKey); 695ListViewItem item = new(text, imageIndex); 732ListViewItem item = new(group); 771ListViewItem item = new(subItems); 801ListViewItem item = new(text); 831Assert.Throws<ArgumentNullException>("subItems", () => new ListViewItem((ListViewItem.ListViewSubItem[])null, "imageKey")); 832Assert.Throws<ArgumentNullException>("subItems", () => new ListViewItem((ListViewItem.ListViewSubItem[])null, 1)); 833Assert.Throws<ArgumentNullException>("subItems", () => new ListViewItem((ListViewItem.ListViewSubItem[])null, "imageKey", new ListViewGroup())); 834Assert.Throws<ArgumentNullException>("subItems", () => new ListViewItem((ListViewItem.ListViewSubItem[])null, 0, new ListViewGroup())); 841Assert.Throws<ArgumentNullException>("subItems", () => new ListViewItem(subItems, "imageKey")); 842Assert.Throws<ArgumentNullException>("subItems", () => new ListViewItem(subItems, 1)); 843Assert.Throws<ArgumentNullException>("subItems", () => new ListViewItem(subItems, "imageKey", new ListViewGroup())); 844Assert.Throws<ArgumentNullException>("subItems", () => new ListViewItem(subItems, 1, new ListViewGroup())); 862ListViewItem item = new(); 875ListViewItem item = new() 891ListViewItem item = new(); 919ListViewItem item = new(); 932ListViewItem item = new() 949ListViewItem item = new(); 969ListViewItem item = new(); 982ListViewItem item = new() 1003ListViewItem item = new(); 1018ListViewItem item = new(); 1026ListViewItem item = new(); 1034ListViewItem item = new(); 1044ListViewItem item = new(); 1074ListViewItem item = new(); 1083ListViewItem item = new(); 1093ListViewItem item = new(); 1107ListViewItem item = new();
System\Windows\Forms\ListViewSubItemCollectionTests.cs (73)
15ListViewItem item = new(); 29ListViewItem item = new(); 41ListViewItem item = new(); 54ListViewItem item = new(); 65ListViewItem item = new(); 81ListViewItem item = new(); 92ListViewItem item = new(); 103ListViewItem item = new(); 116ListViewItem item = new(); 127ListViewItem item = new(); 143ListViewItem item = new(); 156ListViewItem item = new(); 171ListViewItem item = new(); 187ListViewItem item = new(); 198ListViewItem item = new(); 213ListViewItem item = new(); 227ListViewItem item = new(); 245ListViewItem item = new(); 266ListViewItem item = new(); 282ListViewItem item = new(); 290ListViewItem item = new(); 303ListViewItem item = new(); 311ListViewItem item = new(); 326ListViewItem item = new(); 345ListViewItem item = new(); 375ListViewItem item = new(); 396ListViewItem item = new(); 415ListViewItem item = new(); 425ListViewItem item = new(); 443ListViewItem item = new(); 453ListViewItem item = new(); 466ListViewItem item = new(); 483ListViewItem item = new(); 499ListViewItem item = new(); 509ListViewItem item = new(); 523ListViewItem item = new(); 534ListViewItem item = new(); 547ListViewItem item = new(); 564ListViewItem item = new(); 584ListViewItem item = new(); 594ListViewItem item = new(); 608ListViewItem item = new(); 619ListViewItem item = new(); 632ListViewItem item = new(); 647ListViewItem item = new(); 660ListViewItem item = new(); 668ListViewItem item = new(); 683ListViewItem item = new(); 693ListViewItem item = new(); 701ListViewItem item = new(); 723ListViewItem item = new(); 743ListViewItem item = new(); 755ListViewItem item = new(); 804ListViewItem item = new(); 817ListViewItem item = new(); 832ListViewItem item = new(); 855ListViewItem item = new(); 868ListViewItem item = new(); 878ListViewItem listViewItem = new(); 891ListViewItem listViewItem = new(); 901ListViewItem listViewItem = new(); 911ListViewItem listViewItem = new(); 927ListViewItem listViewItem = new(); 938ListViewItem listViewItem = new(); 949ListViewItem listViewItem = new(); 972ListViewItem listViewItem = new(); 985ListViewItem listViewItem = new(); 1016ListViewItem listViewItem = new(); 1035ListViewItem listViewItem = new(); 1051ListViewItem listViewItem = new(); 1073ListViewItem listViewItem = new(); 1092ListViewItem listViewItem = new(); 1111ListViewItem listViewItem = new("Test 1");
System\Windows\Forms\ListViewSubItemConverterTests.cs (1)
50ListViewItem item = new();
System\Windows\Forms\ListViewSubItemTests.cs (27)
29yield return new object[] { new ListViewItem(), string.Empty, string.Empty }; 30yield return new object[] { new ListViewItem(), "reasonable", "reasonable" }; 31yield return new object[] { new ListViewItem() { BackColor = Color.Yellow, ForeColor = Color.Yellow, Font = SystemFonts.StatusFont }, "reasonable", "reasonable" }; 33ListViewItem item = new(); 55yield return new object[] { new ListViewItem(), string.Empty, Color.Red, Color.Blue, SystemFonts.MenuFont, Color.Red, Color.Blue, string.Empty }; 56yield return new object[] { new ListViewItem(), "reasonable", Color.Red, Color.Blue, SystemFonts.MenuFont, Color.Red, Color.Blue, "reasonable" }; 57yield return new object[] { new ListViewItem() { BackColor = Color.Yellow, ForeColor = Color.Yellow, Font = SystemFonts.StatusFont }, string.Empty, Color.Red, Color.Blue, SystemFonts.MenuFont, Color.Red, Color.Blue, string.Empty }; 59ListViewItem item = new(); 85ListViewItem item = new(); 99ListViewItem item = new() 118ListViewItem item = new() 167ListViewItem item = new() 187ListViewItem item = new() 206ListViewItem item = new(); 221ListViewItem item = new(); 235ListViewItem item = new() 254ListViewItem item = new() 292ListViewItem item = new() 312ListViewItem item = new() 334ListViewItem item = new(); 348ListViewItem item = new() 367ListViewItem item = new() 418ListViewItem item = new() 438ListViewItem item = new() 457ListViewItem item = new(); 503ListViewItem item = new(); 533yield return new object[] { new ListViewItem() };
System\Windows\Forms\ListViewTests.cs (77)
870ListViewItem item1 = new() 874ListViewItem item2 = new(); 1043ListViewItem item1 = new() 1047ListViewItem item2 = new(); 1218yield return new object[] { new ListViewItem(), false }; 1244ListViewItem value = new(); 1286ListViewItem value = new(); 4084ListViewItem item1 = new(); 4085ListViewItem item2 = new(); 4108ListViewItem item1 = new(); 4109ListViewItem item2 = new(); 4155ListViewItem item = new(); 4184ListViewItem item = new(); 4223ListViewItem item1 = new(); 4244ListViewItem item1 = new(); 4413ListViewItem listItem1 = new("Test 1"); 4481control.Items.Add(new ListViewItem()); 4482control.Items.Add(new ListViewItem()); 4501ListViewItem item1 = new() 4505ListViewItem item2 = new() 4532ListViewItem item1 = new() 4536ListViewItem item2 = new() 4570ListViewItem item1 = new(group1) 4574ListViewItem item2 = new(group2) 4578ListViewItem item3 = new(group3) 46250 => new ListViewItem(group) { Selected = true }, 4626_ => new ListViewItem(group), 4650ListViewItem item1 = new(); 4651ListViewItem item2 = new(); 4719ListViewItem listItem = new(); 4867ListViewItem listViewItem = new(); 4880ListViewItem listViewItem1 = new(); 4881ListViewItem listViewItem2 = new(); 4882ListViewItem listViewItem3 = new(); 4899ListViewItem listViewItem = new(); 4912ListViewItem listViewItem = new(); 4929ListViewItem listViewItem = new(); 4943ListViewItem listViewItem = new(); 4952ListViewItem listViewItem = new(); 4961ListViewItem listViewItem = new(); 4975ListViewItem listViewItem = new(); 5003ListViewItem listViewItem1 = new("1"); 5004ListViewItem listViewItem2 = new("2"); 5005ListViewItem listViewItem3 = new("3"); 5006ListViewItem listViewItem4 = new("4"); 5007ListViewItem listViewItem5 = new("5"); 5008ListViewItem listViewItem6 = new("6"); 5009ListViewItem listViewItem7 = new("7"); 5010ListViewItem listViewItem8 = new("8"); 5011ListViewItem listViewItem9 = new("9"); 5059ListViewItem listViewItem1 = new("Item1"); 5060ListViewItem listViewItem2 = new("item2") { ImageKey = "SmallABlue.bmp" }; 5061ListViewItem listViewItem3 = new("item3"); 5062ListViewItem listViewItem4 = new("Items 4") { ImageKey = "SmallA.bmp" }; 5063ListViewItem listViewItem5 = new("Items 5"); 5064ListViewItem listViewItem6 = new("Items 6") { ImageKey = "SmallABlue.bmp" }; 5065ListViewItem listViewItem7 = new("Items 7") { ImageKey = "SmallA.bmp" }; 5066ListViewItem listViewItem8 = new("Items 8"); 5067ListViewItem listViewItem9 = new("Items 9"); 5150listView.Items.Add(new ListViewItem("Test")); 5175listView.Items.Add(new ListViewItem("Test")); 5200listView.Items.Add(new ListViewItem("Test")); 5227listView.Items.Add(new ListViewItem("Test")); 5241{ new("Item 1") }, 5282ListViewItem listItem1 = new("Item 1"); 5436ListViewItem item = new("Test"); 5478listView.Items.Add(new ListViewItem("Group Item 0")); 5797listView.Items.Add(new ListViewItem("Test 1")); 5798listView.Items.Add(new ListViewItem("Test 2")); 5813listView.Items.Add(new ListViewItem("Test 1")); 5814listView.Items.Add(new ListViewItem("Test 2")); 5829listView.Items.Add(new ListViewItem("Test 1") { Name = "Test 1" }); 5830listView.Items.Add(new ListViewItem("Test 2")); 5845listView.Items.Add(new ListViewItem("Test 1")); 5846listView.Items.Add(new ListViewItem("Test 2")); 6184ListViewItem listItem1 = new("Test Item 1"); 6185ListViewItem listItem2 = new("Test Item 2");
System\Windows\Forms\RetrieveVirtualItemEventArgsTests.cs (1)
23yield return new object[] { new ListViewItem() };
System.Windows.Forms.UI.IntegrationTests (5)
DragDropTests.cs (1)
308listViewItem = new("listViewItem1")
ListViewTests.cs (4)
51ListViewItem item1 = new("g1-1") { Group = group }; 52ListViewItem item2 = new("g1-2") { Group = group }; 53ListViewItem item3 = new("g1-3") { Group = group }; 556ListViewItem listViewItem = new("Test");
TrimTestBinaryDeserialization (1)
Form1.Designer.cs (1)
33ListViewItem listViewItem1 = new ListViewItem("This is a ListViewItem with an image", 0);
WinFormsControlsTest (13)
ListViewTest.cs (10)
440 => new ListViewItem(TestItems[0]), 451 => new ListViewItem(TestItems[1]), 462 => new ListViewItem(TestItems[2]), 82ListViewItem item1 = new("item1", 0) 90ListViewItem item2 = new("item2", 1); 94ListViewItem item3 = new("item3") 153listView1.Items.Add(new ListViewItem 166listView1.Items.Add(new ListViewItem 193listView1.Items.Add(new ListViewItem 252ListViewItem item = new ListViewItem
MultipleControls.cs (3)
44ListViewItem item1 = new("item1", 0) 52ListViewItem item2 = new("item2", 1); 56ListViewItem item3 = new("item3", 0)
1201 references to ListViewItem
Accessibility_Core_App (6)
CommonControl1.Designer.cs (5)
31System.Windows.Forms.ListViewItem listViewItem1 = new("1"); 32System.Windows.Forms.ListViewItem listViewItem2 = new("2"); 33System.Windows.Forms.ListViewItem listViewItem3 = new("3"); 34System.Windows.Forms.ListViewItem listViewItem4 = new("4"); 382this.listView1.Items.AddRange(new System.Windows.Forms.ListViewItem[] {
DataBindingExample.cs (1)
103ListViewItem item = new(itemName, i);
System.Windows.Forms (276)
System\Windows\Forms\Controls\ListView\DrawListViewItemEventArgs.cs (3)
18ListViewItem item, 38public ListViewItem Item { get; } 103ListViewItem.ListViewSubItem subItem = Item.SubItems[0];
System\Windows\Forms\Controls\ListView\DrawListViewSubItemEventArgs.cs (4)
19ListViewItem? item, 20ListViewItem.ListViewSubItem? subItem, 59public ListViewItem? Item { get; } 64public ListViewItem.ListViewSubItem? SubItem { get; }
System\Windows\Forms\Controls\ListView\LabelEditEventArgs.cs (6)
13/// class with the specified index to the <see cref="ListViewItem"/> 22/// class with the specified index to the <see cref="ListViewItem"/> 23/// being edited and the new text for the label of the <see cref="ListViewItem"/>. 32/// Gets the zero-based index of the <see cref="ListViewItem"/> containing 38/// Gets the new text assigned to the label of the <see cref="ListViewItem"/>. 44/// <see cref="ListViewItem"/> should be canceled.
System\Windows\Forms\Controls\ListView\ListView.CheckedIndexCollection.cs (2)
37foreach (ListViewItem item in _owner.Items) 81ListViewItem item = _owner.Items[i];
System\Windows\Forms\Controls\ListView\ListView.CheckedListViewItemCollection.cs (12)
44private ListViewItem[] ItemArray 48ListViewItem[] items = new ListViewItem[Count]; 65public ListViewItem this[int index] 99public virtual ListViewItem? this[string? key] 159public bool Contains(ListViewItem? item) 183if (item is ListViewItem listViewItem) 206public int IndexOf(ListViewItem item) 213ListViewItem[] items = ItemArray; 280if (item is ListViewItem listViewItem) 335ListViewItem[] items = ItemArray; 342return Array.Empty<ListViewItem>().GetEnumerator();
System\Windows\Forms\Controls\ListView\ListView.cs (73)
17using static System.Windows.Forms.ListViewItem; 120internal ListViewItem? _selectedItem; 136private readonly Dictionary<int, ListViewItem> _listItemsTable = []; // elements are ListViewItem's 137private List<ListViewItem>? _listViewItems = []; 170private List<ListViewItem>? _savedSelectedItems; 171private List<ListViewItem>? _savedCheckedItems; 176private ListViewItem? _prevHoveredItem; 461_savedCheckedItems = new List<ListViewItem>(CheckedItems.Count); 462ListViewItem[] items = new ListViewItem[CheckedItems.Count]; 478foreach (ListViewItem item in _savedCheckedItems) 506_savedCheckedItems = new List<ListViewItem>(CheckedItems.Count); 507ListViewItem[] items = new ListViewItem[CheckedItems.Count]; 542foreach (ListViewItem item in _savedCheckedItems) 802public ListViewItem? FocusedItem 1708public ListViewItem? TopItem 1753ListViewItem? topItem = TopItem; 1891ListViewItem lvItem = Items[topIndex]; 2219if (Properties.TryGetValue(s_propDelayedUpdateItems, out List<ListViewItem>? newItems)) 2355Properties.AddValue(s_propDelayedUpdateItems, new List<ListViewItem>()); 2359internal void CacheSelectedStateForItem(ListViewItem lvi, bool selected) 2464_listItemsTable.TryGetValue((int)lparam1, out ListViewItem? x); 2465_listItemsTable.TryGetValue((int)lparam2, out ListViewItem? y); 2753ListViewItem item = Items[(int)nmcd->nmcd.dwItemSpec]; 3193public ListViewItem? FindItemWithText(string text) => Items.Count == 0 3197public ListViewItem? FindItemWithText(string text, bool includeSubItemsInSearch, int startIndex) => 3200public ListViewItem? FindItemWithText(string text, bool includeSubItemsInSearch, int startIndex, bool isPrefixSearch) 3208public ListViewItem? FindNearestItem(SearchDirectionHint dir, Point point) 3213public ListViewItem? FindNearestItem(SearchDirectionHint searchDirection, int x, int y) 3228ListViewItem? lvi = GetItemAt(x, y); 3267private unsafe ListViewItem? FindItem(bool isTextSearch, string text, bool isPrefixSearch, Point pt, SearchDirectionHint dir, int startIndex, bool includeSubItemsInSearch) 3324ListViewItem listViewItem = Items[i]; 3396internal int GetDisplayIndex(ListViewItem item, int lastIndex) 3432foreach (ListViewItem listViewItem in _listViewItems) 3472public ListViewItem? GetItemAt(int x, int y) 3481ListViewItem? li = null; 3492internal int GetNativeGroupId(ListViewItem item) 3719ListViewItem? item = (iItem == -1) ? null : Items[iItem]; 3753private void NotifyAboutGotFocus(ListViewItem listViewItem) 3768private void NotifyAboutLostFocus(ListViewItem? listViewItem) 3947ListViewItem item = Items[i]; 3961ListViewItem item = Items[i]; 3990private void InsertItems(int displayIndex, ListViewItem[] items, bool checkHosting) 4004if (_updateCounter > 0 && Properties.TryGetValue(s_propDelayedUpdateItems, out List<ListViewItem>? itemList)) 4036ListViewItem item = items[i]; 4086private unsafe int InsertItemsNative(int index, ListViewItem[] items) 4116ListViewItem li = items[i]; 4310foreach (ListViewItem item in Items) 4319internal void ListViewItemToolTipChanged(ListViewItem item) 4364ListViewItem? item = null; 4595ListViewItem[]? listViewItemsToAdd = null; 4676ListViewItem[] lviArr = new ListViewItem[SelectedItems.Count]; 4678_savedSelectedItems = new List<ListViewItem>(lviArr.Length); 4688var items = new ListViewItem[tempItems.Count]; 4708if (ShowItemToolTips && Items.Count > 0 && (FocusedItem ?? Items[0]) is ListViewItem focusedItem) 4756ListViewItem item = e.Item; 4855ListViewItem firstSelectedItem = Items[SelectedIndices[0]]; 5077foreach (ListViewItem item in group.Items) 5349internal void UpdateSavedCheckedItems(ListViewItem item, bool addItem) 5834ListViewItem clickedItem = Items[displayIndex]; 5846foreach (ListViewItem item in SelectedItems) 5875ListViewItem clickedItem = Items[displayIndex]; 6336foreach (ListViewItem listViewItem in Items) 6506ListViewItem item = Items[nmlv->iItem]; 6521ListViewItem item = Items[nmlv->iItem]; 6578ListViewItem item = Items[indexItem]; 6719ListViewItem? focusedItem = FocusedItem; 6723foreach (ListViewItem item in SelectedItems) 6752ListViewItem lvItem = rVI.Item ?? throw new InvalidOperationException(SR.ListViewVirtualItemRequired); 6814ListViewItem lvi = Items[infoTip->iItem]; 6923foreach (ListViewItem selectedItem in SelectedItems)
System\Windows\Forms\Controls\ListView\ListView.IconComparer.cs (4)
33ListViewItem? currentItem = (ListViewItem?)obj1; 34ListViewItem? nextItem = (ListViewItem?)obj2;
System\Windows\Forms\Controls\ListView\ListView.ListViewAccessibleObject.cs (5)
51foreach (ListViewItem? item in owningListView.Items) 125if (child is ListViewItem.ListViewItemBaseAccessibleObject itemAccessibleObject) 316View.Details => ((ListViewItem.ListViewItemDetailsAccessibleObject)itemAccessibleObject) 326if (itemAccessibleObject is ListViewItem.ListViewItemDetailsAccessibleObject itemDetailsAccessibleObject) 336else if (itemAccessibleObject is ListViewItem.ListViewItemWithImageAccessibleObject itemIconAccessibleObject)
System\Windows\Forms\Controls\ListView\ListView.ListViewItemCollection.cs (35)
58public virtual ListViewItem this[int index] 76internal ListViewItem? GetItemByIndex(int index) 92this[index] = value is ListViewItem item 101public virtual ListViewItem? this[string key] 127public virtual ListViewItem Add(string? text) 134if (item is ListViewItem listViewItem) 152public virtual ListViewItem Add(string? text, int imageIndex) 154ListViewItem item = new(text, imageIndex); 164public virtual ListViewItem Add(ListViewItem value) 177public virtual ListViewItem Add(string? text, string? imageKey) 179ListViewItem item = new(text, imageKey); 189public virtual ListViewItem Add(string? key, string? text, string? imageKey) 191ListViewItem item = new(text, imageKey) 204public virtual ListViewItem Add(string? key, string? text, int imageIndex) 206ListViewItem item = new(text, imageIndex) 216public void AddRange(params ListViewItem[] items) 227var itemArray = new ListViewItem[items.Count]; 240public bool Contains(ListViewItem item) 246=> item is ListViewItem listViewItem && Contains(listViewItem); 265public ListViewItem[] Find(string key, bool searchAllSubItems) 269List<ListViewItem> foundItems = []; 279private static void FindInternal(string? key, bool searchAllSubItems, ListViewItemCollection listViewItems, List<ListViewItem> foundItems) 316public int IndexOf(ListViewItem item) 330=> item is ListViewItem listViewItem ? IndexOf(listViewItem) : -1; 375public ListViewItem Insert(int index, ListViewItem item) 384public ListViewItem Insert(int index, string? text) 389public ListViewItem Insert(int index, string? text, int imageIndex) 396if (item is ListViewItem listViewItem) 408public ListViewItem Insert(int index, string? text, string? imageKey) 411public virtual ListViewItem Insert(int index, string? key, string? text, string? imageKey) 417public virtual ListViewItem Insert(int index, string? key, string? text, int imageIndex) 428public virtual void Remove(ListViewItem item) 458if (item is ListViewItem listViewItem)
System\Windows\Forms\Controls\ListView\ListView.ListViewItemCollection.IInnerList.cs (10)
17ListViewItem this[int index] { get; set; } 19ListViewItem Add(ListViewItem item); 20void AddRange(params ListViewItem[] items); 22bool Contains(ListViewItem item); 25int IndexOf(ListViewItem item); 26ListViewItem Insert(int index, ListViewItem item); 27void Remove(ListViewItem item); 29ListViewItem? GetItemByIndex(int index)
System\Windows\Forms\Controls\ListView\ListView.ListViewNativeItemCollection.cs (17)
35public ListViewItem this[int displayIndex] 59public ListViewItem? GetItemByIndex(int index) => 62private ListViewItem? GetItemByIndexInternal(int index, [NotNullWhen(true)] bool throwInVirtualMode) 86_owner._listItemsTable.TryGetValue(DisplayIndexToID(index), out ListViewItem? item); 97public ListViewItem Add(ListViewItem value) 128public void AddRange(params ListViewItem[] values) 234ListViewItem item = _owner.Items[i]; 285ListViewItem item = _owner.Items[i]; 307public bool Contains(ListViewItem item) 312return _owner._listItemsTable.TryGetValue(item._id, out ListViewItem? itemOut) 322public ListViewItem Insert(int index, ListViewItem item) 364public int IndexOf(ListViewItem item) 378public void Remove(ListViewItem item) 454ListViewItem[] items = new ListViewItem[_owner._itemCount];
System\Windows\Forms\Controls\ListView\ListView.SelectedListViewItemCollection.cs (15)
27private ListViewItem[] SelectedItemArray 35ListViewItem[] lvitems = new ListViewItem[cnt]; 64ListViewItem[] cloned = new ListViewItem[_owner._savedSelectedItems.Count]; 112public ListViewItem this[int index] 152public virtual ListViewItem? this[string? key] 272ListViewItem[] items = SelectedItemArray; 292public bool Contains(ListViewItem? item) 309if (item is ListViewItem listViewItem) 339ListViewItem[] items = SelectedItemArray; 346return Array.Empty<ListViewItem>().GetEnumerator(); 350public int IndexOf(ListViewItem? item) 357ListViewItem[] items = SelectedItemArray; 376if (item is ListViewItem listViewItem)
System\Windows\Forms\Controls\ListView\ListViewGroup.cs (5)
381ListViewItem[] items = new ListViewItem[count]; 384items[i] = (ListViewItem)info.GetValue($"Item{i}", typeof(ListViewItem))!; 471info.AddValue($"Item{i}", Items[i], typeof(ListViewItem));
System\Windows\Forms\Controls\ListView\ListViewGroup.ListViewGroupAccessibleObject.cs (7)
198internal IReadOnlyList<ListViewItem> GetVisibleItems() 200List<ListViewItem> visibleItems = []; 203foreach (ListViewItem? listViewItem in _owningListView.Items) 214foreach (ListViewItem listViewItem in _owningGroup.Items) 246IReadOnlyList<ListViewItem> visibleItems = GetVisibleItems(); 261IReadOnlyList<ListViewItem> visibleItems = GetVisibleItems(); 277IReadOnlyList<ListViewItem> visibleItems = GetVisibleItems();
System\Windows\Forms\Controls\ListView\ListViewGroupCollection.cs (2)
177ListViewItem item = group.Items[i]; 269foreach (ListViewItem item in group.Items)
System\Windows\Forms\Controls\ListView\ListViewGroupConverter.cs (4)
23if (sourceType == typeof(string) && context is not null && context.Instance is ListViewItem) 42if (destinationType == typeof(string) && context is not null && context.Instance is ListViewItem) 60if (context.Instance is ListViewItem item && item.ListView is not null) 115if (context is not null && context.Instance is ListViewItem item && item.ListView is not null)
System\Windows\Forms\Controls\ListView\ListViewGroupItemCollection.cs (14)
11private List<ListViewItem>? _items; 20private List<ListViewItem> Items => _items ??= []; 26public ListViewItem this[int index] 40public ListViewItem Add(ListViewItem value) 49public void AddRange(params ListViewItem[] items) 64private void CheckListViewItem(ListViewItem item) 82public bool Contains(ListViewItem item) => Items.Contains(item); 88public int IndexOf(ListViewItem item) => Items.IndexOf(item); 90public ListViewItem Insert(int index, ListViewItem item) 99private static void MoveToGroup(ListViewItem item, ListViewGroup? newGroup) 110public void Remove(ListViewItem item) 123private static void UpdateNativeListViewItem(ListViewItem item)
System\Windows\Forms\Controls\ListView\ListViewHitTestInfo.cs (4)
14public ListViewHitTestInfo(ListViewItem? hitItem, ListViewItem.ListViewSubItem? hitSubItem, ListViewHitTestLocations hitLocation) 29public ListViewItem? Item { get; } 34public ListViewItem.ListViewSubItem? SubItem { get; }
System\Windows\Forms\Controls\ListView\ListViewItem.cs (4)
903ListViewItem newItem; 904if (clonedType == typeof(ListViewItem)) 910newItem = (ListViewItem)Activator.CreateInstance(clonedType)!; 953public ListViewItem? FindNearestItem(SearchDirectionHint searchDirection)
System\Windows\Forms\Controls\ListView\ListViewItem.IKeyboardToolTip.cs (4)
36ListViewItem? neighboringItem = FindNearestItem(searchDirectionHint); 89ListViewItem item = _listView.Items[index]; 107private static Rectangle GetDetailsListRectangle(Point point, ListViewItem item, Rectangle itemBounds) 118private Rectangle GetTileRectangle(Point point, ListViewItem item, Rectangle itemBounds)
System\Windows\Forms\Controls\ListView\ListViewItem.ListViewItemBaseAccessibleObject.cs (3)
24private protected readonly ListViewItem _owningItem; 26public ListViewItemBaseAccessibleObject(ListViewItem owningItem) 37=> $"{nameof(ListViewItem)}-{CurrentIndex}";
System\Windows\Forms\Controls\ListView\ListViewItem.ListViewItemDetailsAccessibleObject.cs (1)
16public ListViewItemDetailsAccessibleObject(ListViewItem owningItem) : base(owningItem)
System\Windows\Forms\Controls\ListView\ListViewItem.ListViewItemImageAccessibleObject.cs (2)
14private readonly ListViewItem _owningItem; 16public ListViewItemImageAccessibleObject(ListViewItem owner)
System\Windows\Forms\Controls\ListView\ListViewItem.ListViewItemLargeIconAccessibleObject.cs (1)
10public ListViewItemLargeIconAccessibleObject(ListViewItem owningItem) : base(owningItem)
System\Windows\Forms\Controls\ListView\ListViewItem.ListViewItemListAccessibleObject.cs (1)
13public ListViewItemListAccessibleObject(ListViewItem owningItem) : base(owningItem)
System\Windows\Forms\Controls\ListView\ListViewItem.ListViewItemSmallIconAccessibleObject.cs (1)
10public ListViewItemSmallIconAccessibleObject(ListViewItem owningItem) : base(owningItem)
System\Windows\Forms\Controls\ListView\ListViewItem.ListViewItemTileAccessibleObject.cs (1)
14public ListViewItemTileAccessibleObject(ListViewItem owningItem) : base(owningItem)
System\Windows\Forms\Controls\ListView\ListViewItem.ListViewItemWithImageAccessibleObject.cs (1)
19public ListViewItemWithImageAccessibleObject(ListViewItem owningItem) : base(owningItem)
System\Windows\Forms\Controls\ListView\ListViewItem.ListViewSubItem.cs (3)
20internal ListViewItem? _owner; 40public ListViewSubItem(ListViewItem? owner, string? text) 46public ListViewSubItem(ListViewItem? owner, string? text, Color foreColor, Color backColor, Font font)
System\Windows\Forms\Controls\ListView\ListViewItem.ListViewSubItem.ListViewSubItemAccessibleObject.cs (2)
17private readonly ListViewItem _owningItem; 23public ListViewSubItemAccessibleObject(ListViewSubItem? owningSubItem, ListViewItem owningItem)
System\Windows\Forms\Controls\ListView\ListViewItem.ListViewSubItemCollection.cs (2)
14private readonly ListViewItem _owner; 21public ListViewSubItemCollection(ListViewItem owner)
System\Windows\Forms\Controls\ListView\ListViewItemConverter.cs (9)
45if (destinationType == typeof(InstanceDescriptor) && value is ListViewItem item) 55ctor = typeof(ListViewItem).GetConstructor([typeof(ListViewItem.ListViewSubItem[]), typeof(string)]); 57ListViewItem.ListViewSubItem[] subItemArray = new ListViewItem.ListViewSubItem[item.SubItems.Count]; 63ctor = typeof(ListViewItem).GetConstructor([typeof(ListViewItem.ListViewSubItem[]), typeof(int)]); 65ListViewItem.ListViewSubItem[] subItemArray = new ListViewItem.ListViewSubItem[item.SubItems.Count];
System\Windows\Forms\Controls\ListView\ListViewItemImageIndexer.cs (6)
8/// ListViewItemImageIndexer is a class used to support <see cref="ListViewItem.ImageIndex"/> and 9/// <see cref="ListViewItem.ImageKey"/>. 13private readonly ListViewItem _owner; 18/// <param name="item">The <see cref="ListViewItem"/> that this object belongs to.</param> 19public ListViewItemImageIndexer(ListViewItem item) 25/// Gets the <see cref="ListViewItem.ImageList"/> associated with the item.
System\Windows\Forms\Controls\ListView\ListViewItemMouseHoverEventArgs.cs (2)
11public ListViewItemMouseHoverEventArgs(ListViewItem? item) 16public ListViewItem? Item { get; }
System\Windows\Forms\Controls\ListView\ListViewItemSelectionChangedEventArgs.cs (2)
14public ListViewItemSelectionChangedEventArgs(ListViewItem? item, int itemIndex, bool isSelected) 24public ListViewItem? Item { get; }
System\Windows\Forms\Controls\ListView\ListViewLabelEditAccessibleObject.cs (1)
6using static System.Windows.Forms.ListViewItem.ListViewSubItem;
System\Windows\Forms\Controls\ListView\ListViewSubItemConverter.cs (5)
28if (destinationType == typeof(InstanceDescriptor) && value is ListViewItem.ListViewSubItem item) 35ctor = typeof(ListViewItem.ListViewSubItem).GetConstructor( 37typeof(ListViewItem), 55ctor = typeof(ListViewItem.ListViewSubItem).GetConstructor([typeof(ListViewItem), typeof(string)]);
System\Windows\Forms\Controls\ListView\RetrieveVirtualItemEventArgs.cs (1)
15public ListViewItem? Item { get; set; }
System\Windows\Forms\ItemCheckedEventArgs.cs (2)
11public ItemCheckedEventArgs(ListViewItem item) 19public ListViewItem Item { get; }
System.Windows.Forms.Design (3)
System\Windows\Forms\Design\ListViewSubItemCollectionEditor.cs (3)
18private ListViewItem.ListViewSubItem _firstSubItem; 32if (instance is ListViewItem.ListViewSubItem item) 74var subItems = (ListViewItem.ListViewSubItemCollection)editValue;
System.Windows.Forms.Design.Tests (4)
EnsureEditorsTests.cs (4)
112[InlineData(typeof(ListViewItem), "ImageIndex", typeof(ImageIndexEditor))] 113[InlineData(typeof(ListViewItem), "ImageKey", typeof(ImageIndexEditor))] 114[InlineData(typeof(ListViewItem), "StateImageIndex", typeof(ImageIndexEditor))] 115[InlineData(typeof(ListViewItem), "SubItems", typeof(ListViewSubItemCollectionEditor))]
System.Windows.Forms.Tests (883)
SerializableAttributeTests.cs (3)
15typeof(ListViewItem).Assembly, 26{ typeof(ListViewItem).FullName }, 27{ typeof(ListViewItem.ListViewSubItem).FullName },
SerializableTypesTests.cs (6)
8using static System.Windows.Forms.ListViewItem; 149var item = Assert.Single(result.Items) as ListViewItem; 163ListViewItem listViewItem = new("Item1", 0) 181ListViewItem result = BinarySerialization.EnsureDeserialize<ListViewItem>(blob);
System\Windows\Forms\AccessibleObjects\ListVIew.ListViewAccessibleObjectTests.cs (52)
7using static System.Windows.Forms.ListViewItem; 87ListViewItem item = new(); 88ListViewItem item2 = new(); 117ListViewItem item = new(); 118ListViewItem item2 = new(); 141ListViewItem item = new(); 142ListViewItem item2 = new(); 268ListViewItem listViewItem1 = new("Test item 1"); 269ListViewItem listViewItem2 = new("Test item 2"); 391ListViewItem listViewItem1 = new("Test item 1"); 392ListViewItem listViewItem2 = new("Test item 2"); 393ListViewItem listViewItem3 = new("Test item 3"); 514ListViewItem listViewItem1 = new("Test item 1"); 515ListViewItem listViewItem2 = new("Test item 2"); 516ListViewItem listViewItem3 = new("Test item 3"); 585ListViewItem listViewItem1 = new("Test item 1"); 586ListViewItem listViewItem2 = new("Test item 2"); 587ListViewItem listViewItem3 = new("Test item 3"); 640ListViewItem listViewItem1 = new("Test item 1"); 641ListViewItem listViewItem2 = new("Test item 2"); 642ListViewItem listViewItem3 = new("Test item 3"); 720ListViewItem listViewItem1 = new("Test item 1"); 721ListViewItem listViewItem2 = new("Test item 2"); 722ListViewItem listViewItem3 = new("Test item 3"); 854ListViewItem listViewItem1 = new("Test item 1"); 855ListViewItem listViewItem2 = new("Test item 2"); 856ListViewItem listViewItem3 = new("Test item 3"); 924ListViewItem listItem1 = new(listGroup1); 925ListViewItem listItem2 = new(); 926ListViewItem listItem3 = new(listGroup2); 927ListViewItem listItem4 = new(listGroup2); 957ListViewItem listItem1 = new(); 975ListViewItem listItem1 = new(); 1013ListViewItem listItem1 = new(["Item 1", "Item A"], -1); 1014ListViewItem listItem2 = new("Group item 2"); 1015ListViewItem listItem3 = new("Item 3"); 1016ListViewItem listItem4 = new(["Item 4", "Item B"], -1); 1059ListViewItem listItem1 = new(); 1090ListViewItem listItem1 = new(); 1392ListViewItem listItem1 = new(["Test Item 1", "Item A"], -1, listViewGroup); 1393ListViewItem listItem2 = new("Group item 2", listViewGroup); 1394ListViewItem listItem3 = new("Item 3"); 1395ListViewItem listItem4 = new(["Test Item 4", "Item B", "Item C", "Item D"], -1); 1488ListViewItem listViewItem1 = new(); 1489ListViewItem listViewItem2 = new(); 1573ListViewItem listViewItem1 = new(); 1574ListViewItem listViewItem2 = new(); 1674ListViewItem listViewItem1 = new(); 1675ListViewItem listViewItem2 = new(); 1730ListViewItem listViewItem1 = new(); 1731ListViewItem listViewItem2 = new(); 1732ListViewItem listViewItem3 = new();
System\Windows\Forms\AccessibleObjects\ListViewGroup.ListViewGroupAccessibleObjectTests.cs (26)
279ListViewItem listItem1 = new("Item1"); 280ListViewItem listItem2 = new("Item2"); 388ListViewItem itemWithoutListView1 = new(groups[1]); 389ListViewItem itemWithoutListView2 = new(groups[1]); 666ListViewItem listViewItem = new("Test item", listViewGroup); 797ListViewItem item1 = new("Item 1", group1); 798ListViewItem item2 = new("Item 2", group2); 799ListViewItem item3 = new("Item 2", group3); 800listView.Items.AddRange((ListViewItem[])[item1, item2, item3]); 889ListViewItem listViewItem1 = new(); 890ListViewItem listViewItem2 = new(); 1239ListViewItem listViewItem1 = new(); 1240ListViewItem listViewItem2 = new(); 1241ListViewItem listViewItem3 = new(); 1264ListViewItem listItem1 = new(listGroup1); 1265ListViewItem listItem2 = new(listGroup1); 1266ListViewItem listItem3 = new(); 1329ListViewItem item = new("Test") 1402ListViewItem listViewInvisibleItem1 = new("Invisible item 1"); 1403ListViewItem listViewVisibleItem1 = new("Visible item 1"); 1404ListViewItem listViewInvisibleItem2 = new("Invisible item 1"); 1405ListViewItem listViewVisibleItem2 = new("Visible item 1"); 1408listView.Items.AddRange((ListViewItem[])[listViewVisibleItem1, listViewVisibleItem2]); 1409listViewGroup.Items.AddRange((ListViewItem[]) 1431ListViewItem listViewItem1 = new("Test item 1"); 1439ListViewItem listViewItem2 = new("Test item 2");
System\Windows\Forms\AccessibleObjects\ListViewItem.ListViewItemAccessibleObjectTests.cs (42)
7using static System.Windows.Forms.ListViewItem; 17ListViewItem listItem = new(); 21ConstructorInfo ctor = type.GetConstructor([typeof(ListViewItem)]); 27ListViewItem itemWithoutList = new(); 36ListViewItem listItem = new(); 76ListViewItem listViewItem1 = new(); 77ListViewItem listViewItem2 = new(listviewGroup); 94ListViewItem listItem = new("ListItem"); 565ListViewItem listItem1 = new( 571ListViewItem listItem2 = new( 577ListViewItem listItem3 = new( 655ListViewItem listItem1 = new(["Test A", "Alpha"], -1); 699ListViewItem listItem1 = new(["Test A", "Alpha"], -1); 783private void AddItemToListView(ListView listView, ListViewItem listViewItem, bool virtualMode) 843ListViewItem listViewItem = new("Item"); 891ListViewItem listViewItem = new("Item"); 926ListViewItem listViewItem = new("Item"); 1061((ListViewItem.ListViewItemDetailsAccessibleObject)accessibleObject1).GetDetailsSubItemOrFake(2), 1067((ListViewItem.ListViewItemDetailsAccessibleObject)accessibleObject2).GetDetailsSubItemOrFake(2), 1138ListViewItem listItem1 = new("Item 1"); 1139ListViewItem listItem2 = new("Item 2"); 1176listView.Items.AddRange((ListViewItem[])[listItem1, listItem2]); 1197ListViewItem listItem1 = new(["Test Item 1", "Item A"], -1); 1198ListViewItem listItem2 = new("Group item 2"); 1199ListViewItem listItem3 = new("Item 3"); 1200ListViewItem listItem4 = new(["Test Item 4", "Item B", "Item C", "Item D"], -1); 1257ListViewItem listViewInvisibleItem1 = new("Invisible item 1"); 1258ListViewItem listViewVisibleItem1 = new("Visible item 1"); 1259ListViewItem listViewInvisibleItem2 = new("Invisible item 1"); 1260ListViewItem listViewVisibleItem2 = new("Visible item 1"); 1263listView.Items.AddRange((ListViewItem[])[listViewVisibleItem1, listViewVisibleItem2]); 1264listViewGroup.Items.AddRange((ListViewItem[]) 1624ListViewItem listViewItem = new("Item 1", imageIndex: hasImage ? 0 : -1); 1846ListViewItem item = new("ListItem"); 1860ListViewItem item = new("ListItem"); 1874ListViewItem item = new("ListItem"); 1888ListViewItem item = new("ListItem"); 1902ListViewItem item = new("ListItem"); 1912private static void EnforceAccessibleObjectCreation(ListViewItem listViewItem) 1928ListViewItem listViewItem1 = new("Item1"); 1929ListViewItem listViewItem2 = new("Item2"); 1930ListViewItem listViewItem3 = new("Item3");
System\Windows\Forms\AccessibleObjects\ListViewItem.ListViewItemBaseAccessibleObjectTests.cs (29)
7using static System.Windows.Forms.ListViewItem; 23ListViewItem item = new(); 34ListViewItem item = new(); 45ListViewItem item = new(); 58ListViewItem item = new(); 70ListViewItem item = new() { Selected = isSelected }; 81ListViewItem item = new(); 98ListViewItem item = new(); 116ListViewItem item = new(); 133ListViewItem item = new(); 151ListViewItem item = new(); 165control.Items.AddRange((ListViewItem[])[new(), new(), new()]); 181ListViewItem item = new(); 200ListViewItem item = new(); 218ListViewItem item = new(); 231ListViewItem item = new(); 244ListViewItem item = new(); 257ListViewItem item = new(); 270ListViewItem item = new(); 286ListViewItem item = new(); 302ListViewItem item = new(); 318ListViewItem item = new() 339ListViewItem item = new(); 350ListViewItem item = new(); 363ListViewItem item = new() { Checked = isChecked }; 376ListViewItem item = new() { Checked = isChecked }; 393ListViewItem item = new(); 397string expected = $"{nameof(ListViewItem)}-{accessibleObject.CurrentIndex}"; 406public SubListViewItemBaseAccessibleObject(ListViewItem owningItem) : base(owningItem)
System\Windows\Forms\AccessibleObjects\ListViewItem.ListViewItemDetailsAccessibleObjectTests.cs (12)
6using static System.Windows.Forms.ListViewItem; 22ListViewItem item = new(); 37ListViewItem item = new(); 53ListViewItem item = new(); 69ListViewItem item = new(); 87ListViewItem item = new(); 100ListViewItem item = new(); 115ListViewItem item = new(); 151ListViewItem listViewItem = new("1", 0); 166ListViewItem listViewItem1 = new(["Item1", "sub1", "sub2"], 0); 167ListViewItem listViewItem2 = new(["Item2", "sub1", "sub2"], 0); 170listView1.Items.AddRange((ListViewItem[])[listViewItem1, listViewItem2]);
System\Windows\Forms\AccessibleObjects\ListViewItem.ListViewItemImageAccessibleObjectTests.cs (3)
5using static System.Windows.Forms.ListViewItem; 17ListViewItem listViewItem = new("Test", 0); 42ListViewItem listViewItem = new("Test", 0);
System\Windows\Forms\AccessibleObjects\ListViewItem.ListViewItemListAccessibleObjectTests.cs (3)
6using static System.Windows.Forms.ListViewItem; 52control.Items.AddRange((ListViewItem[])[new(), new(), new()]); 71control.Items.AddRange((ListViewItem[])[new(), new(), new()]);
System\Windows\Forms\AccessibleObjects\ListViewItem.ListViewItemTileAccessibleObjectTests.cs (1)
4using static System.Windows.Forms.ListViewItem;
System\Windows\Forms\AccessibleObjects\ListViewItem.ListViewItemWithImageAccessibleObjectTests.cs (4)
5using static System.Windows.Forms.ListViewItem; 33ListViewItem listViewItem = new("Test", 0); 78ListViewItem listViewItem = new("Test", 0); 115ListViewItem listViewItem = new("Test", 0);
System\Windows\Forms\AccessibleObjects\ListViewItem.ListViewSubItem.ListViewSubItemAccessibleObjectTests.cs (72)
7using static System.Windows.Forms.ListViewItem.ListViewSubItem; 17ListViewItem listViewItem1 = new( 54ListViewItem listViewItem1 = new( 140ListViewItem listViewItem = listView.Items[0]; 141ListViewItem listViewItemInGroup = listView.Items[1]; 187ListViewItem listViewItem = listView.Items[0]; 188ListViewItem listViewItemInGroup = listView.Items[1]; 217ListViewItem listViewItem = listView.Items[0]; 218ListViewItem listViewItemInGroup = listView.Items[1]; 247ListViewItem listViewItem = listView.Items[0]; 248ListViewItem listViewItemInGroup = listView.Items[1]; 288ListViewItem listViewItem = listView.Items[0]; 289ListViewItem listViewItemInGroup = listView.Items[1]; 324ListViewItem listViewItem = listView.Items[0]; 325ListViewItem listViewItemInGroup = listView.Items[1]; 357ListViewItem listViewItem = listView.Items[0]; 358ListViewItem listViewItemInGroup = listView.Items[1]; 383ListViewItem listViewItem = listView.Items[0]; 384ListViewItem listViewItemInGroup = listView.Items[1]; 409ListViewItem listViewItem = listView.Items[0]; 410ListViewItem listViewItemInGroup = listView.Items[1]; 428ListViewItem listViewItem = listView.Items[0]; 429ListViewItem listViewItemInGroup = listView.Items[1]; 462ListViewItem listViewItem = listView.Items[0]; 463ListViewItem listViewItemInGroup = listView.Items[1]; 485ListViewItem listViewItem = listView.Items[0]; 486ListViewItem listViewItemInGroup = listView.Items[1]; 508ListViewItem listViewItem = listView.Items[0]; 509ListViewItem listViewItemInGroup = listView.Items[1]; 531ListViewItem listViewItem = listView.Items[0]; 532ListViewItem listViewItemInGroup = listView.Items[1]; 554ListViewItem listViewItem = listView.Items[0]; 555ListViewItem listViewItemInGroup = listView.Items[1]; 592ListViewItem listViewItem = listView.Items[0]; 593ListViewItem listViewItemInGroup = listView.Items[1]; 629ListViewItem listViewItem1 = new( 652ListViewItem.ListViewSubItem subItem = listViewItem1.SubItems[0]; 679ListViewItem listViewItem1 = new( 720ListViewItem listViewItem1 = new( 753ListViewItem listViewItem1 = new( 802ListViewItem listItem1 = new("Item 1"); 803ListViewItem listItem2 = new("Item 2"); 840listView.Items.AddRange((ListViewItem[])[listItem1, listItem2]); 855ListViewItem listViewItem = new("Test item") 859ListViewItem.ListViewSubItem subItem = new(listViewItem, "Test subItem"); 914ListViewItem listViewItem = new("Test item"); 916ListViewItem.ListViewSubItem listViewSubItem = new(listViewItem, "Test subItem"); 927ListViewItem listViewItem = new("Test item"); 929ListViewItem.ListViewSubItem listViewSubItem = new(listViewItem, "Test subItem"); 942ListViewItem listViewItem = new("Test item"); 944ListViewItem.ListViewSubItem listViewSubItem = new(listViewItem, "Test subItem"); 971ListViewItem listViewItem = new("Test item"); 973ListViewItem.ListViewSubItem listViewSubItem = new(listViewItem, "Test subItem"); 1050ListViewItem listViewItem = new(); 1051ListViewItem.ListViewSubItem listViewSubItem = new(); 1062ListViewItem listViewItem = new(); 1063ListViewItem.ListViewSubItem listViewSubItem = new(); 1078ListViewItem listViewItem = new(); 1079ListViewItem.ListViewSubItem listViewSubItem = new(); 1094ListViewItem listViewItem = new(); 1095ListViewItem.ListViewSubItem listViewSubItem = new(); 1110ListViewItem listViewItem = new(); 1111ListViewItem.ListViewSubItem listViewSubItem = new(); 1126ListViewItem listViewItem = new(); 1127ListViewItem.ListViewSubItem listViewSubItem = new(); 1142ListViewItem listViewItem = new(); 1143ListViewItem.ListViewSubItem listViewSubItem = new(); 1158ListViewItem listViewItem = new(); 1159ListViewItem.ListViewSubItem listViewSubItem = new(); 1165listView.Items[0].SubItems[subItemIndex] = new ListViewItem.ListViewSubItem(); 1171private static void EnforceAccessibleObjectCreation(ListViewItem item) 1175foreach (ListViewItem.ListViewSubItem subItem in item.SubItems)
System\Windows\Forms\AccessibleObjects\ListViewLabelEditAccessibleObjectTests.cs (2)
7using static System.Windows.Forms.ListViewItem; 163ListViewItem item = new("Test", 0);
System\Windows\Forms\BinaryFormat\WinFormsBinaryFormattedObjectTests.cs (1)
229new ListViewItem.ListViewSubItem()
System\Windows\Forms\ControlTests.cs (1)
1054listView1.Items.AddRange((ListViewItem[])[new("Foo"), new("Foo"), new("Foo")]);
System\Windows\Forms\DrawListViewItemEventArgsTests.cs (10)
25ListViewItem item = new(); 85ListViewItem listViewItem = new(); 91ListViewItem subItemsItem = new(); 92subItemsItem.SubItems.Add(new ListViewItem.ListViewSubItem()); 99ListViewItem fullRowSelectListViewItem = new(); 100fullRowSelectListViewItem.SubItems.Add(new ListViewItem.ListViewSubItem()); 110public void DrawListViewItemEventArgs_DrawBackground_Invoke_Success(ListViewItem item, Rectangle bounds, ListViewItemStates state) 120public void DrawListViewItemEventArgs_DrawFocusRectangle_HasGraphicsFocused_Success(ListViewItem item, Rectangle bounds, ListViewItemStates state) 130public void DrawListViewItemEventArgs_DrawText_Invoke_Success(ListViewItem item, Rectangle bounds, ListViewItemStates state) 140public void DrawListViewItemEventArgs_DrawText_InvokeTextFormatFlags(ListViewItem item, Rectangle bounds, ListViewItemStates state)
System\Windows\Forms\DrawListViewSubItemEventArgsTests.cs (25)
12yield return new object[] { Rectangle.Empty, null, new ListViewItem.ListViewSubItem(), -2, -2, null, ListViewItemStates.Checked - 1 }; 13yield return new object[] { Rectangle.Empty, new ListViewItem(), new ListViewItem.ListViewSubItem(), -2, -2, null, ListViewItemStates.Checked - 1 }; 15yield return new object[] { new Rectangle(1, 2, 3, 4), new ListViewItem(), new ListViewItem.ListViewSubItem(), -1, -1, new ColumnHeader(), ListViewItemStates.Checked }; 16yield return new object[] { new Rectangle(-1, 2, -3, -4), new ListViewItem(), new ListViewItem.ListViewSubItem(), 0, 0, new ColumnHeader(), ListViewItemStates.Focused }; 17yield return new object[] { new Rectangle(1, 2, 3, 4), new ListViewItem(), new ListViewItem.ListViewSubItem(), 1, 2, new ColumnHeader(), ListViewItemStates.Checked }; 22public void DrawListViewSubItemEventArgs_Ctor_Graphics_ListViewItem_Rectangle_Int_ListViewItemStates(Rectangle bounds, ListViewItem item, ListViewItem.ListViewSubItem subItem, int itemIndex, int columnIndex, ColumnHeader header, ListViewItemStates itemState) 41Assert.Throws<ArgumentNullException>("graphics", () => new DrawListViewSubItemEventArgs(null, new Rectangle(1, 2, 3, 4), new ListViewItem(), new ListViewItem.ListViewSubItem(), -1, 0, new ColumnHeader(), ListViewItemStates.Default)); 49Assert.Throws<ArgumentNullException>("item", () => new DrawListViewSubItemEventArgs(graphics, new Rectangle(1, 2, 3, 4), null, new ListViewItem.ListViewSubItem(), -1, 0, new ColumnHeader(), ListViewItemStates.Default)); 98yield return new object[] { new Rectangle(-1, -2, -3, -4), null, new ListViewItem.ListViewSubItem(), 0, null, ListViewItemStates.Default }; 99yield return new object[] { new Rectangle(-1, -2, -3, -4), null, new ListViewItem.ListViewSubItem(), 0, null, ListViewItemStates.Checked }; 100yield return new object[] { new Rectangle(-1, -2, -3, -4), null, new ListViewItem.ListViewSubItem(), 0, null, ListViewItemStates.Focused }; 101yield return new object[] { new Rectangle(-1, -2, -3, -4), null, new ListViewItem.ListViewSubItem(), 0, new ColumnHeader(), ListViewItemStates.Default }; 102yield return new object[] { new Rectangle(-1, -2, -3, -4), null, new ListViewItem.ListViewSubItem(), 0, new ColumnHeader(), ListViewItemStates.Checked }; 103yield return new object[] { new Rectangle(-1, -2, -3, -4), null, new ListViewItem.ListViewSubItem(), 0, new ColumnHeader(), ListViewItemStates.Focused }; 104yield return new object[] { new Rectangle(1, 2, 3, 4), null, new ListViewItem.ListViewSubItem(), 0, null, ListViewItemStates.Default }; 105yield return new object[] { new Rectangle(1, 2, 3, 4), null, new ListViewItem.ListViewSubItem(), 0, null, ListViewItemStates.Checked }; 106yield return new object[] { new Rectangle(1, 2, 3, 4), null, new ListViewItem.ListViewSubItem(), 0, null, ListViewItemStates.Focused }; 107yield return new object[] { new Rectangle(1, 2, 3, 4), null, new ListViewItem.ListViewSubItem(), 0, new ColumnHeader(), ListViewItemStates.Default }; 108yield return new object[] { new Rectangle(1, 2, 3, 4), null, new ListViewItem.ListViewSubItem(), 0, new ColumnHeader(), ListViewItemStates.Checked }; 109yield return new object[] { new Rectangle(1, 2, 3, 4), null, new ListViewItem.ListViewSubItem(), 0, new ColumnHeader(), ListViewItemStates.Focused }; 114public void DrawListViewSubItemEventArgs_DrawBackground_HasGraphics_Success(Rectangle bounds, ListViewItem item, ListViewItem.ListViewSubItem subItem, int itemIndex, ColumnHeader header, ListViewItemStates itemState) 124public void DrawListViewSubItemEventArgs_DrawFocusRectangle_HasGraphics_Success(Rectangle bounds, ListViewItem item, ListViewItem.ListViewSubItem subItem, int itemIndex, ColumnHeader header, ListViewItemStates itemState)
System\Windows\Forms\ItemCheckedEventArgsTests.cs (1)
18ListViewItem listViewItem = new();
System\Windows\Forms\ListView.ListViewItemCollectionTests.cs (9)
15ListViewItem child1 = new() 19ListViewItem child2 = new() 23ListViewItem child3 = new() 28var grandchild1 = new ListViewItem.ListViewSubItem 32var grandchild2 = new ListViewItem.ListViewSubItem 36var grandchild3 = new ListViewItem.ListViewSubItem 71ListViewItem child1 = new() 75ListViewItem child2 = new() 79ListViewItem child3 = new()
System\Windows\Forms\ListViewGroupCollectionTests.cs (9)
76ListViewItem item = new(); 97ListViewItem item = new(); 159ListViewItem item = new(); 407ListViewItem item = new(); 426ListViewItem item = new(); 490ListViewItem item = new(); 768ListViewItem item = new(); 787ListViewItem item = new(); 846ListViewItem item = new();
System\Windows\Forms\ListViewGroupConverterTests.cs (9)
33ListViewItem item1 = new(); 40ListViewItem item2 = new(); 74ListViewItem item = new(); 92ListViewItem item1 = new(); 98ListViewItem item2 = new(); 146ListViewItem item1 = new(); 153ListViewItem item2 = new(); 262ListViewItem item1 = new(); 269ListViewItem item2 = new();
System\Windows\Forms\ListViewGroupTests.cs (7)
1350Assert.Equal(group.Items.Cast<ListViewItem>().Select(i => i.Text), result.Items.Cast<ListViewItem>().Select(i => i.Text)); 1413Assert.Equal("text", ((ListViewItem)info.GetValue("Item0", typeof(ListViewItem))).Text); 1429ListViewItem listViewItem = new(); 1430ListViewItem listViewItemGroup = new(); 1445ListViewItem listViewItem = new();
System\Windows\Forms\ListViewHitTestInfoTests.cs (3)
12yield return new object[] { new ListViewItem(), new ListViewItem.ListViewSubItem(), ListViewHitTestLocations.None - 1 }; 17public void ListViewHitTestInfo_Ctor_ListViewItem_ListViewSubItem_ListViewHitTestLocations(ListViewItem hitItem, ListViewItem.ListViewSubItem hitSubItem, ListViewHitTestLocations hitTestLocations)
System\Windows\Forms\ListViewItem.IKeyboardToolTipTests.cs (24)
5using static System.Windows.Forms.ListViewItem; 19ListViewItem listViewItem = new(); 41ListViewItem listViewItem = new(); 63ListViewItem listViewItem = new(); 86ListViewItem listViewItem = new() { ToolTipText = toolTipText }; 105ListViewItem listViewItem = new(); 124ListViewItem listViewItem = new(); 147ListViewItem listViewItem = AssignItemToListView(listView, new ListViewItem(new string('t', 500))); 167ListViewItem listViewItem = AssignItemToListView(listView, new ListViewItem(new string('t', 1))); 177ListViewItem listViewItem = new(new string('t', 20)); 193ListViewItem listViewItem = new(new string('t', 10)); 209ListViewItem listViewItem = new(); 220ListViewItem listViewItem = AssignItemToListView(listView, new ListViewItem()); 229ListViewItem listViewItem = AssignItemToListView(listView, new ListViewItem()); 645ListViewItem listViewItem = new(); 672ListViewItem listViewItem = new(); 700ListViewItem listViewItem = new(); 738ListViewItem listViewItem = new(); 748private ListViewItem AssignItemToListView(ListView listView, ListViewItem listViewItem) 779List<ListViewItem> listViewItems = []; 783ListViewItem listViewItem = new(i.ToString()); 800listView.Items.AddRange((ListViewItem[])[.. listViewItems]); 823private Rectangle GetNativeScreenRectangle(ListViewItem listView)
System\Windows\Forms\ListViewItemConverterTests.cs (19)
18[InlineData(typeof(ListViewItem), false)] 39[InlineData(typeof(ListViewItem), false)] 51var subItem1 = new ListViewItem.ListViewSubItem(null, "text1"); 52var subItem2 = new ListViewItem.ListViewSubItem(null, "text2"); 53var subItem3 = new ListViewItem.ListViewSubItem(null, "text3") 57var subItem4 = new ListViewItem.ListViewSubItem(null, "text4") 61var subItem5 = new ListViewItem.ListViewSubItem(null, "text5") 168new Type[] { typeof(ListViewItem.ListViewSubItem[]), typeof(string) }, 169new object[] { new ListViewItem.ListViewSubItem[] { subItem1, subItem2, subItem3, subItem4, subItem5 }, "imageKey" } 174new Type[] { typeof(ListViewItem.ListViewSubItem[]), typeof(int) }, 175new object[] { new ListViewItem.ListViewSubItem[] { subItem1, subItem2, subItem3, subItem4, subItem5 }, 1 } 180new Type[] { typeof(ListViewItem.ListViewSubItem[]), typeof(string) }, 181new object[] { new ListViewItem.ListViewSubItem[] { subItem1, subItem2, subItem3, subItem4, subItem5 }, "imageKey" } 186new Type[] { typeof(ListViewItem.ListViewSubItem[]), typeof(int) }, 187new object[] { new ListViewItem.ListViewSubItem[] { subItem1, subItem2, subItem3, subItem4, subItem5 }, 1 } 255public void ListViewItemConverter_ConvertTo_InstanceDescriptor_ReturnsExpected(ListViewItem value, Type[] parameterTypes, object[] arguments) 259Assert.Equal(typeof(ListViewItem).GetConstructor(parameterTypes), descriptor.MemberInfo); 287[InlineData(typeof(ListViewItem))] 306ListViewItem item = new();
System\Windows\Forms\ListViewItemMouseHoverEventArgsTests.cs (1)
17public void Ctor_ListViewItem(ListViewItem item)
System\Windows\Forms\ListViewItemSelectionChangedEventArgsTests.cs (1)
18public void Ctor_ListViewItem_Int_Bool(ListViewItem item, int itemIndex, bool isSelected)
System\Windows\Forms\ListViewItemTests.cs (96)
15ListViewItem item = new(); 33ListViewItem.ListViewSubItem subItem = Assert.Single(item.SubItems.Cast<ListViewItem.ListViewSubItem>()); 54ListViewItem item = new(subItems, imageKey, foreColor, backColor, font, group); 72AssertEqualListViewSubItem(subItems, item.SubItems.Cast<ListViewItem.ListViewSubItem>().ToArray()); 92ListViewItem item = new(subItems, imageIndex, foreColor, backColor, font, group); 110AssertEqualListViewSubItem(subItems, item.SubItems.Cast<ListViewItem.ListViewSubItem>().ToArray()); 130ListViewItem item = new(subItems, imageKey, foreColor, backColor, font); 148AssertEqualListViewSubItem(subItems, item.SubItems.Cast<ListViewItem.ListViewSubItem>().ToArray()); 168ListViewItem item = new(subItems, imageIndex, foreColor, backColor, font); 186AssertEqualListViewSubItem(subItems, item.SubItems.Cast<ListViewItem.ListViewSubItem>().ToArray()); 196yield return new object[] { Array.Empty<ListViewItem.ListViewSubItem>(), null, null, string.Empty, string.Empty }; 197yield return new object[] { new ListViewItem.ListViewSubItem[] { new(null, "text") }, string.Empty, null, string.Empty, "text" }; 198yield return new object[] { new ListViewItem.ListViewSubItem[] { new(null, "text") }, "imageKey", new ListViewGroup(), "imageKey", "text" }; 203public void ListViewItem_Ctor_ListViewSubItemArray_String_ListViewGroup(ListViewItem.ListViewSubItem[] subItems, string imageKey, ListViewGroup group, string expectedImageKey, string expectedText) 205ListViewItem item = new(subItems, imageKey, group); 223AssertEqualListViewSubItem(subItems, item.SubItems.Cast<ListViewItem.ListViewSubItem>().ToArray()); 233yield return new object[] { Array.Empty<ListViewItem.ListViewSubItem>(), 0, null, string.Empty }; 234yield return new object[] { new ListViewItem.ListViewSubItem[] { new(null, "text") }, 1, null, "text" }; 235yield return new object[] { new ListViewItem.ListViewSubItem[] { new(null, "text") }, -1, new ListViewGroup(), "text" }; 240public void ListViewItem_Ctor_ListViewSubItemArray_Int_ListViewGroup(ListViewItem.ListViewSubItem[] subItems, int imageIndex, ListViewGroup group, string expectedText) 242ListViewItem item = new(subItems, imageIndex, group); 260AssertEqualListViewSubItem(subItems, item.SubItems.Cast<ListViewItem.ListViewSubItem>().ToArray()); 280ListViewItem item = new(subItems, imageKey, group); 298AssertEqualListViewSubItem(subItems, item.SubItems.Cast<ListViewItem.ListViewSubItem>().ToArray()); 318ListViewItem item = new(subItems, imageIndex, group); 336AssertEqualListViewSubItem(subItems, item.SubItems.Cast<ListViewItem.ListViewSubItem>().ToArray()); 355ListViewItem item = new(text, imageKey, group); 373ListViewItem.ListViewSubItem subItem = Assert.Single(item.SubItems.Cast<ListViewItem.ListViewSubItem>()); 393ListViewItem item = new(text, imageIndex, group); 411ListViewItem.ListViewSubItem subItem = Assert.Single(item.SubItems.Cast<ListViewItem.ListViewSubItem>()); 422yield return new object[] { Array.Empty<ListViewItem.ListViewSubItem>(), null, string.Empty, string.Empty }; 423yield return new object[] { new ListViewItem.ListViewSubItem[] { new(null, "text") }, string.Empty, string.Empty, "text" }; 424yield return new object[] { new ListViewItem.ListViewSubItem[] { new(null, "text") }, "imageKey", "imageKey", "text" }; 429public void ListViewItem_Ctor_ListViewSubItemArray_String(ListViewItem.ListViewSubItem[] subItems, string imageKey, string expectedImageKey, string expectedText) 431ListViewItem item = new(subItems, imageKey); 449AssertEqualListViewSubItem(subItems, item.SubItems.Cast<ListViewItem.ListViewSubItem>().ToArray()); 459yield return new object[] { Array.Empty<ListViewItem.ListViewSubItem>(), 0, string.Empty }; 460yield return new object[] { new ListViewItem.ListViewSubItem[] { new(null, "text") }, 1, "text" }; 461yield return new object[] { new ListViewItem.ListViewSubItem[] { new(null, "text") }, -1, "text" }; 466public void ListViewItem_Ctor_ListViewSubItemArray_Int(ListViewItem.ListViewSubItem[] subItems, int imageIndex, string expectedText) 468ListViewItem item = new(subItems, imageIndex); 486AssertEqualListViewSubItem(subItems, item.SubItems.Cast<ListViewItem.ListViewSubItem>().ToArray()); 506ListViewItem item = new(subItems, group); 524AssertEqualListViewSubItem(subItems, item.SubItems.Cast<ListViewItem.ListViewSubItem>().ToArray()); 544ListViewItem item = new(subItems, imageKey); 562AssertEqualListViewSubItem(subItems, item.SubItems.Cast<ListViewItem.ListViewSubItem>().ToArray()); 582ListViewItem item = new(subItems, imageIndex); 600AssertEqualListViewSubItem(subItems, item.SubItems.Cast<ListViewItem.ListViewSubItem>().ToArray()); 619ListViewItem item = new(text, group); 637ListViewItem.ListViewSubItem subItem = Assert.Single(item.SubItems.Cast<ListViewItem.ListViewSubItem>()); 657ListViewItem item = new(text, imageKey); 675ListViewItem.ListViewSubItem subItem = Assert.Single(item.SubItems.Cast<ListViewItem.ListViewSubItem>()); 695ListViewItem item = new(text, imageIndex); 713ListViewItem.ListViewSubItem subItem = Assert.Single(item.SubItems.Cast<ListViewItem.ListViewSubItem>()); 732ListViewItem item = new(group); 750ListViewItem.ListViewSubItem subItem = Assert.Single(item.SubItems.Cast<ListViewItem.ListViewSubItem>()); 771ListViewItem item = new(subItems); 789AssertEqualListViewSubItem(subItems, item.SubItems.Cast<ListViewItem.ListViewSubItem>().ToArray()); 801ListViewItem item = new(text); 819ListViewItem.ListViewSubItem subItem = Assert.Single(item.SubItems.Cast<ListViewItem.ListViewSubItem>()); 831Assert.Throws<ArgumentNullException>("subItems", () => new ListViewItem((ListViewItem.ListViewSubItem[])null, "imageKey")); 832Assert.Throws<ArgumentNullException>("subItems", () => new ListViewItem((ListViewItem.ListViewSubItem[])null, 1)); 833Assert.Throws<ArgumentNullException>("subItems", () => new ListViewItem((ListViewItem.ListViewSubItem[])null, "imageKey", new ListViewGroup())); 834Assert.Throws<ArgumentNullException>("subItems", () => new ListViewItem((ListViewItem.ListViewSubItem[])null, 0, new ListViewGroup())); 840var subItems = new ListViewItem.ListViewSubItem[] { null }; 862ListViewItem item = new(); 875ListViewItem item = new() 891ListViewItem item = new(); 919ListViewItem item = new(); 932ListViewItem item = new() 949ListViewItem item = new(); 969ListViewItem item = new(); 982ListViewItem item = new() 1003ListViewItem item = new(); 1018ListViewItem item = new(); 1026ListViewItem item = new(); 1034ListViewItem item = new(); 1044ListViewItem item = new(); 1048private static void AssertEqualListViewSubItem(string[] expected, ListViewItem.ListViewSubItem[] actual) 1050AssertEqualListViewSubItem(expected?.Select(t => new ListViewItem.ListViewSubItem(null, t)).ToArray(), actual); 1053private static void AssertEqualListViewSubItem(ListViewItem.ListViewSubItem[] expected, ListViewItem.ListViewSubItem[] actual) 1057ListViewItem.ListViewSubItem subItem = Assert.Single(actual.Cast<ListViewItem.ListViewSubItem>()); 1074ListViewItem item = new(); 1083ListViewItem item = new(); 1093ListViewItem item = new(); 1107ListViewItem item = new();
System\Windows\Forms\ListViewSubItemCollectionTests.cs (236)
15ListViewItem item = new(); 16var collection = new ListViewItem.ListViewSubItemCollection(item); 23Assert.Throws<ArgumentNullException>("owner", () => new ListViewItem.ListViewSubItemCollection(null)); 29ListViewItem item = new(); 30IList collection = new ListViewItem.ListViewSubItemCollection(item); 41ListViewItem item = new(); 42var collection = new ListViewItem.ListViewSubItemCollection(item); 44var subItem = new ListViewItem.ListViewSubItem(); 54ListViewItem item = new(); 55var collection = new ListViewItem.ListViewSubItemCollection(item) 57new ListViewItem.ListViewSubItem() 65ListViewItem item = new(); 66var collection = new ListViewItem.ListViewSubItemCollection(item) 68new ListViewItem.ListViewSubItem() 71var subItem = new ListViewItem.ListViewSubItem(); 81ListViewItem item = new(); 82var collection = new ListViewItem.ListViewSubItemCollection(item) 84new ListViewItem.ListViewSubItem() 86Assert.Throws<ArgumentOutOfRangeException>("index", () => collection[index] = new ListViewItem.ListViewSubItem()); 92ListViewItem item = new(); 93var collection = new ListViewItem.ListViewSubItemCollection(item) 95new ListViewItem.ListViewSubItem() 103ListViewItem item = new(); 104IList collection = new ListViewItem.ListViewSubItemCollection(item); 106var subItem = new ListViewItem.ListViewSubItem(); 116ListViewItem item = new(); 117IList collection = new ListViewItem.ListViewSubItemCollection(item) 119new ListViewItem.ListViewSubItem() 127ListViewItem item = new(); 128IList collection = new ListViewItem.ListViewSubItemCollection(item) 130new ListViewItem.ListViewSubItem() 133var subItem = new ListViewItem.ListViewSubItem(); 143ListViewItem item = new(); 144IList collection = new ListViewItem.ListViewSubItemCollection(item) 146new ListViewItem.ListViewSubItem() 156ListViewItem item = new(); 157IList collection = new ListViewItem.ListViewSubItemCollection(item); 171ListViewItem item = new(); 172var collection = new ListViewItem.ListViewSubItemCollection(item); 173var subItem1 = new ListViewItem.ListViewSubItem(); 174var subItem2 = new ListViewItem.ListViewSubItem 187ListViewItem item = new(); 188var collection = new ListViewItem.ListViewSubItemCollection(item); 189var subItem = new ListViewItem.ListViewSubItem(); 198ListViewItem item = new(); 199var collection = new ListViewItem.ListViewSubItemCollection(item); 202var subItem = new ListViewItem.ListViewSubItem(); 207Assert.Throws<InvalidOperationException>(() => collection.Add(new ListViewItem.ListViewSubItem())); 213ListViewItem item = new(); 214var collection = new ListViewItem.ListViewSubItemCollection(item); 215var subItem = new ListViewItem.ListViewSubItem(); 227ListViewItem item = new(); 228var collection = new ListViewItem.ListViewSubItemCollection(item); 230var otherCollection = new ListViewItem.ListViewSubItemCollection(item); 232var subItem = new ListViewItem.ListViewSubItem(); 245ListViewItem item = new(); 246var collection = new ListViewItem.ListViewSubItemCollection(item) 250ListViewItem.ListViewSubItem subItem = Assert.Single(collection.Cast<ListViewItem.ListViewSubItem>()); 266ListViewItem item = new(); 267var collection = new ListViewItem.ListViewSubItemCollection(item) 271ListViewItem.ListViewSubItem subItem = Assert.Single(collection.Cast<ListViewItem.ListViewSubItem>()); 282ListViewItem item = new(); 283var collection = new ListViewItem.ListViewSubItemCollection(item); 284Assert.Throws<ArgumentNullException>("item", () => collection.Add((ListViewItem.ListViewSubItem)null)); 290ListViewItem item = new(); 291IList collection = new ListViewItem.ListViewSubItemCollection(item); 292var subItem = new ListViewItem.ListViewSubItem(); 303ListViewItem item = new(); 304IList collection = new ListViewItem.ListViewSubItemCollection(item); 311ListViewItem item = new(); 312var collection = new ListViewItem.ListViewSubItemCollection(item); 313var subItem1 = new ListViewItem.ListViewSubItem(null, "text1"); 314var subItem2 = new ListViewItem.ListViewSubItem(null, "text2"); 315var items = new ListViewItem.ListViewSubItem[] { subItem1, null, subItem2 }; 326ListViewItem item = new(); 327var collection = new ListViewItem.ListViewSubItemCollection(item); 328var subItem1 = new ListViewItem.ListViewSubItem(null, "text1"); 329var subItem2 = new ListViewItem.ListViewSubItem(null, "text2"); 330var subItem3 = new ListViewItem.ListViewSubItem(null, "text3"); 331var subItem4 = new ListViewItem.ListViewSubItem(null, "text4"); 332var items = new ListViewItem.ListViewSubItem[] { subItem1, null, subItem2, subItem3, subItem4 }; 345ListViewItem item = new(); 346var collection = new ListViewItem.ListViewSubItemCollection(item); 347var subItem1 = new ListViewItem.ListViewSubItem(null, "text1"); 348var subItem2 = new ListViewItem.ListViewSubItem(null, "text2"); 349var subItem3 = new ListViewItem.ListViewSubItem(null, "text3"); 350var subItem4 = new ListViewItem.ListViewSubItem(null, "text4"); 351var subItem5 = new ListViewItem.ListViewSubItem(null, "text5"); 352var subItem6 = new ListViewItem.ListViewSubItem(null, "text6"); 353var subItem7 = new ListViewItem.ListViewSubItem(null, "text7"); 354var subItem8 = new ListViewItem.ListViewSubItem(null, "text8"); 355var subItem9 = new ListViewItem.ListViewSubItem(null, "text8"); 356var items = new ListViewItem.ListViewSubItem[] { subItem2, null, subItem3, subItem4, subItem5, subItem6, subItem7, subItem8, subItem9 }; 375ListViewItem item = new(); 376var collection = new ListViewItem.ListViewSubItemCollection(item); 396ListViewItem item = new(); 397var collection = new ListViewItem.ListViewSubItemCollection(item); 415ListViewItem item = new(); 416var collection = new ListViewItem.ListViewSubItemCollection(item); 417Assert.Throws<ArgumentNullException>("items", () => collection.AddRange((ListViewItem.ListViewSubItem[])null)); 425ListViewItem item = new(); 426var collection = new ListViewItem.ListViewSubItemCollection(item); 427var subItem = new ListViewItem.ListViewSubItem(); 443ListViewItem item = new(); 444var collection = new ListViewItem.ListViewSubItemCollection(item); 453ListViewItem item = new(); 454var collection = new ListViewItem.ListViewSubItemCollection(item); 455var subItem = new ListViewItem.ListViewSubItem(); 459Assert.False(collection.Contains(new ListViewItem.ListViewSubItem())); 466ListViewItem item = new(); 467var collection = new ListViewItem.ListViewSubItemCollection(item); 469Assert.False(collection.Contains(new ListViewItem.ListViewSubItem())); 483ListViewItem item = new(); 484var collection = new ListViewItem.ListViewSubItemCollection(item); 485var subItem1 = new ListViewItem.ListViewSubItem(); 486var subItem2 = new ListViewItem.ListViewSubItem 499ListViewItem item = new(); 500var collection = new ListViewItem.ListViewSubItemCollection(item); 509ListViewItem item = new(); 510IList collection = new ListViewItem.ListViewSubItemCollection(item); 511var subItem = new ListViewItem.ListViewSubItem(); 515Assert.False(collection.Contains(new ListViewItem.ListViewSubItem())); 523ListViewItem item = new(); 524IList collection = new ListViewItem.ListViewSubItemCollection(item); 526Assert.False(collection.Contains(new ListViewItem.ListViewSubItem())); 534ListViewItem item = new(); 535var collection = new ListViewItem.ListViewSubItemCollection(item); 536var subItem = new ListViewItem.ListViewSubItem(); 540Assert.Equal(-1, collection.IndexOf(new ListViewItem.ListViewSubItem())); 547ListViewItem item = new(); 548var collection = new ListViewItem.ListViewSubItemCollection(item); 550Assert.Equal(-1, collection.IndexOf(new ListViewItem.ListViewSubItem())); 564ListViewItem item = new(); 565var collection = new ListViewItem.ListViewSubItemCollection(item); 566var subItem1 = new ListViewItem.ListViewSubItem(); 567var subItem2 = new ListViewItem.ListViewSubItem 584ListViewItem item = new(); 585var collection = new ListViewItem.ListViewSubItemCollection(item); 594ListViewItem item = new(); 595IList collection = new ListViewItem.ListViewSubItemCollection(item); 596var subItem = new ListViewItem.ListViewSubItem(); 600Assert.Equal(-1, collection.IndexOf(new ListViewItem.ListViewSubItem())); 608ListViewItem item = new(); 609IList collection = new ListViewItem.ListViewSubItemCollection(item); 611Assert.Equal(-1, collection.IndexOf(new ListViewItem.ListViewSubItem())); 619ListViewItem item = new(); 620var collection = new ListViewItem.ListViewSubItemCollection(item); 621var subItem = new ListViewItem.ListViewSubItem(); 622collection.Add(new ListViewItem.ListViewSubItem()); 632ListViewItem item = new(); 633var collection = new ListViewItem.ListViewSubItemCollection(item); 636var subItem = new ListViewItem.ListViewSubItem(); 641Assert.Throws<InvalidOperationException>(() => collection.Add(new ListViewItem.ListViewSubItem())); 647ListViewItem item = new(); 648var collection = new ListViewItem.ListViewSubItemCollection(item) 650new ListViewItem.ListViewSubItem() 660ListViewItem item = new(); 661var collection = new ListViewItem.ListViewSubItemCollection(item); 668ListViewItem item = new(); 669IList collection = new ListViewItem.ListViewSubItemCollection(item); 670var subItem = new ListViewItem.ListViewSubItem(); 671collection.Add(new ListViewItem.ListViewSubItem()); 683ListViewItem item = new(); 684IList collection = new ListViewItem.ListViewSubItemCollection(item); 693ListViewItem item = new(); 694IList collection = new ListViewItem.ListViewSubItemCollection(item); 695Assert.Throws<ArgumentOutOfRangeException>("index", () => collection.Insert(index, new ListViewItem.ListViewSubItem())); 701ListViewItem item = new(); 702var collection = new ListViewItem.ListViewSubItemCollection(item); 703var subItem = new ListViewItem.ListViewSubItem(); 723ListViewItem item = new(); 724IList collection = new ListViewItem.ListViewSubItemCollection(item); 725var subItem = new ListViewItem.ListViewSubItem(); 743ListViewItem item = new(); 744IList collection = new ListViewItem.ListViewSubItemCollection(item); 745var subItem = new ListViewItem.ListViewSubItem(); 755ListViewItem item = new(); 756var collection = new ListViewItem.ListViewSubItemCollection(item); 757var subItem1 = new ListViewItem.ListViewSubItem(); 758var subItem2 = new ListViewItem.ListViewSubItem(); 759var subItem3 = new ListViewItem.ListViewSubItem(); 760var subItem4 = new ListViewItem.ListViewSubItem(); 804ListViewItem item = new(); 805var collection = new ListViewItem.ListViewSubItemCollection(item) 807new ListViewItem.ListViewSubItem() 817ListViewItem item = new(); 818var collection = new ListViewItem.ListViewSubItemCollection(item); 832ListViewItem item = new(); 833var collection = new ListViewItem.ListViewSubItemCollection(item); 834var subItem = new ListViewItem.ListViewSubItem 855ListViewItem item = new(); 856IList collection = new ListViewItem.ListViewSubItemCollection(item); 857var subItem = new ListViewItem.ListViewSubItem(); 868ListViewItem item = new(); 869IList collection = new ListViewItem.ListViewSubItemCollection(item); 878ListViewItem listViewItem = new(); 879ListViewItem.ListViewSubItem subItem = new(); 891ListViewItem listViewItem = new(); 901ListViewItem listViewItem = new(); 911ListViewItem listViewItem = new(); 912ListViewItem.ListViewSubItem subItem1 = new(); 913ListViewItem.ListViewSubItem subItem2 = new(); 927ListViewItem listViewItem = new(); 938ListViewItem listViewItem = new(); 949ListViewItem listViewItem = new(); 950ListViewItem.ListViewSubItem subItem1 = new(); 951ListViewItem.ListViewSubItem subItem2 = new(); 952ListViewItem.ListViewSubItem oldSubItem = listViewItem.SubItems[0]; 972ListViewItem listViewItem = new(); 973ListViewItem.ListViewSubItem subItem = new(); 985ListViewItem listViewItem = new(); 986ListViewItem.ListViewSubItem subItem1 = new(); 987ListViewItem.ListViewSubItem subItem2 = new(); 988ListViewItem.ListViewSubItem oldSubItem1 = listViewItem.SubItems[0]; 989ListViewItem.ListViewSubItem oldSubItem2 = new(); 1016ListViewItem listViewItem = new(); 1017ListViewItem.ListViewSubItem oldSubItem = listViewItem.SubItems[0]; 1018ListViewItem.ListViewSubItem subItem = new(); 1035ListViewItem listViewItem = new(); 1036ListViewItem.ListViewSubItem subItem = new(); 1037ListViewItem.ListViewSubItem oldSubItem = listViewItem.SubItems[0]; 1051ListViewItem listViewItem = new(); 1052ListViewItem.ListViewSubItem subItem1 = new(); 1053ListViewItem.ListViewSubItem subItem2 = new(); 1054ListViewItem.ListViewSubItem defaultSubItem = listViewItem.SubItems[0]; 1073ListViewItem listViewItem = new(); 1074ListViewItem.ListViewSubItem oldSubItem = listViewItem.SubItems[0]; 1075ListViewItem.ListViewSubItem subItem = new(); 1092ListViewItem listViewItem = new(); 1093ListViewItem.ListViewSubItem oldSubItem = listViewItem.SubItems[0]; 1094ListViewItem.ListViewSubItem subItem = new(); 1111ListViewItem listViewItem = new("Test 1"); 1112ListViewItem.ListViewSubItem oldSubItem = listViewItem.SubItems[0]; 1114ListViewItem.ListViewSubItem subItem = new(listViewItem, "Test 2") { Name = "Test 2" };
System\Windows\Forms\ListViewSubItemConverterTests.cs (25)
18[InlineData(typeof(ListViewItem.ListViewSubItem), false)] 22TypeConverter converter = TypeDescriptor.GetConverter(typeof(ListViewItem.ListViewSubItem)); 32TypeConverter converter = TypeDescriptor.GetConverter(typeof(ListViewItem.ListViewSubItem)); 39[InlineData(typeof(ListViewItem.ListViewSubItem), false)] 44TypeConverter converter = TypeDescriptor.GetConverter(typeof(ListViewItem.ListViewSubItem)); 50ListViewItem item = new(); 53new ListViewItem.ListViewSubItem(item, "text"), 54new Type[] { typeof(ListViewItem), typeof(string) }, 60new ListViewItem.ListViewSubItem(null, "text", Color.Red, Color.Blue, SystemFonts.MenuFont), 61new Type[] { typeof(ListViewItem), typeof(string), typeof(Color), typeof(Color), typeof(Font) }, 68public void ListViewSubItemConverter_ConvertTo_InstanceDescriptor_ReturnsExpected(ListViewItem.ListViewSubItem value, Type[] parameterTypes, object[] arguments) 70TypeConverter converter = TypeDescriptor.GetConverter(typeof(ListViewItem.ListViewSubItem)); 72Assert.Equal(typeof(ListViewItem.ListViewSubItem).GetConstructor(parameterTypes), descriptor.MemberInfo); 81TypeConverter converter = TypeDescriptor.GetConverter(typeof(ListViewItem.ListViewSubItem)); 88TypeConverter converter = TypeDescriptor.GetConverter(typeof(ListViewItem.ListViewSubItem)); 95TypeConverter converter = TypeDescriptor.GetConverter(typeof(ListViewItem.ListViewSubItem)); 100[InlineData(typeof(ListViewItem.ListViewSubItem))] 104TypeConverter converter = TypeDescriptor.GetConverter(typeof(ListViewItem.ListViewSubItem)); 105Assert.Throws<NotSupportedException>(() => converter.ConvertTo(new ListViewItem.ListViewSubItem(), destinationType)); 111TypeConverter converter = TypeDescriptor.GetConverter(typeof(ListViewItem.ListViewSubItem)); 118TypeConverter converter = TypeDescriptor.GetConverter(typeof(ListViewItem.ListViewSubItem)); 119var item = new ListViewItem.ListViewSubItem(); 126TypeConverter converter = TypeDescriptor.GetConverter(typeof(ListViewItem.ListViewSubItem)); 133TypeConverter converter = TypeDescriptor.GetConverter(typeof(ListViewItem.ListViewSubItem)); 140TypeConverter converter = TypeDescriptor.GetConverter(typeof(ListViewItem.ListViewSubItem));
System\Windows\Forms\ListViewSubItemTests.cs (59)
16var subItem = new ListViewItem.ListViewSubItem(); 33ListViewItem item = new(); 40public void ListViewSubItem_Ctor_ListViewItem_String(ListViewItem owner, string text, string expectedText) 42var subItem = new ListViewItem.ListViewSubItem(owner, text); 59ListViewItem item = new(); 66public void ListViewSubItem_Ctor_ListViewItem_String_Color_Color_Font(ListViewItem owner, string text, Color foreColor, Color backColor, Font font, Color expectedForeColor, Color expectedBackColor, string expectedText) 68var subItem = new ListViewItem.ListViewSubItem(owner, text, foreColor, backColor, font); 85ListViewItem item = new(); 88var subItem = new ListViewItem.ListViewSubItem(item, "text"); 99ListViewItem item = new() 103var subItem = new ListViewItem.ListViewSubItem(item, "text"); 118ListViewItem item = new() 123var subItem = new ListViewItem.ListViewSubItem(); 142var subItem = new ListViewItem.ListViewSubItem 167ListViewItem item = new() 172var subItem = new ListViewItem.ListViewSubItem(); 187ListViewItem item = new() 191var subItem = new ListViewItem.ListViewSubItem(); 206ListViewItem item = new(); 210var subItem = new ListViewItem.ListViewSubItem(item, "text"); 221ListViewItem item = new(); 224var subItem = new ListViewItem.ListViewSubItem(item, "text"); 235ListViewItem item = new() 239var subItem = new ListViewItem.ListViewSubItem(item, "text"); 254ListViewItem item = new() 260var subItem = new ListViewItem.ListViewSubItem(); 273var subItem = new ListViewItem.ListViewSubItem 292ListViewItem item = new() 297var subItem = new ListViewItem.ListViewSubItem(); 312ListViewItem item = new() 316var subItem = new ListViewItem.ListViewSubItem(); 334ListViewItem item = new(); 337var subItem = new ListViewItem.ListViewSubItem(item, "text"); 348ListViewItem item = new() 352var subItem = new ListViewItem.ListViewSubItem(item, "text"); 367ListViewItem item = new() 372var subItem = new ListViewItem.ListViewSubItem(); 393var subItem = new ListViewItem.ListViewSubItem 418ListViewItem item = new() 423var subItem = new ListViewItem.ListViewSubItem(); 438ListViewItem item = new() 442var subItem = new ListViewItem.ListViewSubItem(); 457ListViewItem item = new(); 458var subItem = new ListViewItem.ListViewSubItem(item, "text") 473var subItem = new ListViewItem.ListViewSubItem 488var subItem = new ListViewItem.ListViewSubItem 503ListViewItem item = new(); 504var subItem = new ListViewItem.ListViewSubItem(item, "text") 519var subItem = new ListViewItem.ListViewSubItem 538public void ListViewSubItem_ResetStyle_NoStyle_Nop(ListViewItem owner) 540var subItem = new ListViewItem.ListViewSubItem(owner, "text"); 554public void ListViewSubItem_ResetStyle_HasStyleWithOwner_Success(ListViewItem owner) 556var subItem = new ListViewItem.ListViewSubItem(owner, "text", Color.Red, Color.Blue, SystemFonts.MenuFont); 571yield return new object[] { new ListViewItem.ListViewSubItem() }; 572yield return new object[] { new ListViewItem.ListViewSubItem(null, "header", Color.Red, Color.Blue, SystemFonts.MenuFont) { Name = "name", Tag = "tag" } }; 577public void ListViewSubItem_Serialize_Deserialize_Success(ListViewItem.ListViewSubItem subItem) 588ListViewItem.ListViewSubItem result = Assert.IsType<ListViewItem.ListViewSubItem>(formatter.Deserialize(stream)); // CodeQL[SM03722] : Testing legacy feature. This is a safe use of BinaryFormatter because the data is trusted and the types are controlled and validated. 602var subItem = new ListViewItem.ListViewSubItem(null, text);
System\Windows\Forms\ListViewTests.cs (91)
9using static System.Windows.Forms.ListViewItem; 870ListViewItem item1 = new() 874ListViewItem item2 = new(); 878Assert.Equal(new ListViewItem[] { item1, item2 }, listView.Items.Cast<ListViewItem>()); 1043ListViewItem item1 = new() 1047ListViewItem item2 = new(); 1051Assert.Equal(new ListViewItem[] { item1, item2 }, listView.Items.Cast<ListViewItem>()); 1224public void ListView_FocusedItem_Set_GetReturnsExpected(ListViewItem value, bool? expectedFocused) 1244ListViewItem value = new(); 1268public void ListView_FocusedItem_SetWithHandle_GetReturnsExpected(ListViewItem value, bool? expectedFocused) 1286ListViewItem value = new(); 4084ListViewItem item1 = new(); 4085ListViewItem item2 = new(); 4108ListViewItem item1 = new(); 4109ListViewItem item2 = new(); 4155ListViewItem item = new(); 4184ListViewItem item = new(); 4223ListViewItem item1 = new(); 4244ListViewItem item1 = new(); 4413ListViewItem listItem1 = new("Test 1"); 4435var clone = (ListViewItem)listView.Items[0].Clone(); 4501ListViewItem item1 = new() 4505ListViewItem item2 = new() 4532ListViewItem item1 = new() 4536ListViewItem item2 = new() 4570ListViewItem item1 = new(group1) 4574ListViewItem item2 = new(group2) 4578ListViewItem item3 = new(group3) 4650ListViewItem item1 = new(); 4651ListViewItem item2 = new(); 4719ListViewItem listItem = new(); 4867ListViewItem listViewItem = new(); 4880ListViewItem listViewItem1 = new(); 4881ListViewItem listViewItem2 = new(); 4882ListViewItem listViewItem3 = new(); 4885listView.Items.AddRange((ListViewItem[])[listViewItem1, listViewItem2, listViewItem3]); 4899ListViewItem listViewItem = new(); 4912ListViewItem listViewItem = new(); 4929ListViewItem listViewItem = new(); 4943ListViewItem listViewItem = new(); 4952ListViewItem listViewItem = new(); 4961ListViewItem listViewItem = new(); 4975ListViewItem listViewItem = new(); 5003ListViewItem listViewItem1 = new("1"); 5004ListViewItem listViewItem2 = new("2"); 5005ListViewItem listViewItem3 = new("3"); 5006ListViewItem listViewItem4 = new("4"); 5007ListViewItem listViewItem5 = new("5"); 5008ListViewItem listViewItem6 = new("6"); 5009ListViewItem listViewItem7 = new("7"); 5010ListViewItem listViewItem8 = new("8"); 5011ListViewItem listViewItem9 = new("9"); 5022var listItems = new ListViewItem[] 5038var listViewItemToTest = listItems[item]; 5059ListViewItem listViewItem1 = new("Item1"); 5060ListViewItem listViewItem2 = new("item2") { ImageKey = "SmallABlue.bmp" }; 5061ListViewItem listViewItem3 = new("item3"); 5062ListViewItem listViewItem4 = new("Items 4") { ImageKey = "SmallA.bmp" }; 5063ListViewItem listViewItem5 = new("Items 5"); 5064ListViewItem listViewItem6 = new("Items 6") { ImageKey = "SmallABlue.bmp" }; 5065ListViewItem listViewItem7 = new("Items 7") { ImageKey = "SmallA.bmp" }; 5066ListViewItem listViewItem8 = new("Items 8"); 5067ListViewItem listViewItem9 = new("Items 9"); 5078var listItems = new ListViewItem[] 5094var listViewItemToTest = listItems[item]; 5101private void ListView_FindNearestItem_Check_Result(ListViewItem[] listItems, ListViewItem item, SearchDirectionHint direction, int? resultItem) 5239public static TheoryData<ListViewItem> GetListViewItemTheoryData() => new() 5248public void ListView_VirtualMode_ReleaseUiaProvider_Success(ListViewItem listItem) 5282ListViewItem listItem1 = new("Item 1"); 5283ListViewItem listItem2 = null; 5345ListViewItem listViewItem = listView.Items[0]; 5436ListViewItem item = new("Test"); 5528listView.Items.AddRange((ListViewItem[])[new("test 1"), new("test 2"), new("test 3")]); 5560listView.Items.AddRange((ListViewItem[])[new("test 1"), new("test 2"), new("test 3")]); 5564ListViewItem item = listView.Items[0]; 5590listView.Items.AddRange((ListViewItem[])[new("test 1"), new("test 2"), new("test 3")]); 5620listView.Items.AddRange((ListViewItem[])[new("test 1"), new("test 2"), new("test 3")]); 5624ListViewItem item = listView.Items[0]; 5653listView.Items.AddRange((ListViewItem[])[new("test 1", groups[0]), new("test 2", groups[1]), new("test 3", groups[2])]); 5691listView.Items.AddRange((ListViewItem[])[new("test 1", groups[0]), new("test 2", groups[1]), new("test 3", groups[2])]); 5696ListViewItem item = listView.Items[i]; 5728listView.Items.AddRange((ListViewItem[])[new("test 1", groups[0]), new("test 2", groups[1]), new("test 3", groups[2])]); 5764listView.Items.AddRange((ListViewItem[])[new("test 1", groups[0]), new("test 2", groups[1]), new("test 3", groups[2])]); 5769ListViewItem item = listView.Items[i]; 6084public SubListViewItemAccessibleObject(ListViewItem owningItem) : base(owningItem) 6184ListViewItem listItem1 = new("Test Item 1"); 6185ListViewItem listItem2 = new("Test Item 2");
System\Windows\Forms\RetrieveVirtualItemEventArgsTests.cs (1)
28public void Item_Set_GetReturnsExpected(ListViewItem value)
System.Windows.Forms.UI.IntegrationTests (13)
DragDropTests.cs (3)
280ListViewItem? listViewItem = null; 281ListViewItem? data = null; 298data = (ListViewItem?)e.Data?.GetData(DataFormats.Serializable);
ListViewTests.cs (10)
51ListViewItem item1 = new("g1-1") { Group = group }; 52ListViewItem item2 = new("g1-2") { Group = group }; 53ListViewItem item3 = new("g1-3") { Group = group }; 488foreach (ListViewItem item in listView.Items) 507foreach (ListViewItem item in listView.Items) 521ListViewItem listViewItem1 = new(["row1", "row1Col2", "row1Col3"], -1) { StateImageIndex = 0 }; 522ListViewItem listViewItem2 = new(["row2", "row2Col2", "row2Col3"], -1) { StateImageIndex = 0 }; 523ListViewItem listViewItem3 = new(["row3", "row3Col2", "row3Col3"], -1) { StateImageIndex = 0 }; 556ListViewItem listViewItem = new("Test"); 559listViewItem.SubItems.Add(new ListViewItem.ListViewSubItem() { Text = $"Test SubItem{i}" });
TrimTestBinaryDeserialization (2)
Form1.Designer.cs (2)
33ListViewItem listViewItem1 = new ListViewItem("This is a ListViewItem with an image", 0); 47listView1.Items.AddRange(new ListViewItem[] { listViewItem1 });
WinFormsControlsTest (14)
ListViewTest.cs (7)
82ListViewItem item1 = new("item1", 0) 90ListViewItem item2 = new("item2", 1); 94ListViewItem item3 = new("item3") 213var item = ((ListView)sender).FocusedItem; 214var clone = (ListViewItem)item.Clone(); 252ListViewItem item = new ListViewItem
ListViewTest.Designer.cs (4)
73this.listView1.Items.AddRange(new System.Windows.Forms.ListViewItem[] { 74(System.Windows.Forms.ListViewItem)(resources.GetObject("listView1.Items")), 75(System.Windows.Forms.ListViewItem)(resources.GetObject("listView1.Items1")), 76(System.Windows.Forms.ListViewItem)(resources.GetObject("listView1.Items2"))});
MultipleControls.cs (3)
44ListViewItem item1 = new("item1", 0) 52ListViewItem item2 = new("item2", 1); 56ListViewItem item3 = new("item3", 0)