202 instantiations of ListViewSubItem
System.Windows.Forms (8)
System\Windows\Forms\Controls\ListView\ListViewItem.cs (4)
99_subItems.Add(new ListViewSubItem(this, items[i])); 190_subItems.Add(new ListViewSubItem(this, items[i])); 779_subItems = [new ListViewSubItem(this, string.Empty)]; 890clonedSubItems[index] = new ListViewSubItem(
System\Windows\Forms\Controls\ListView\ListViewItem.ListViewSubItemCollection.cs (4)
120ListViewSubItem item = new(_owner, text); 127ListViewSubItem item = new(_owner, text, foreColor, backColor, font); 159_owner._subItems.Add(new ListViewSubItem(_owner, item)); 176_owner._subItems.Add(new ListViewSubItem(_owner, item, foreColor, backColor, font));
System.Windows.Forms.Tests (193)
SerializableTypesTests.cs (1)
210ListViewSubItem listViewSubItem = new(
System\Windows\Forms\AccessibleObjects\ListViewItem.ListViewItemAccessibleObjectTests.cs (4)
492listView.Items[0].SubItems.Add(new ListViewSubItem() { Text = $"SubItem 0" }); 493listView.Items[1].SubItems.Add(new ListViewSubItem() { Text = $"SubItem 0" }); 1150listItem1.SubItems.Add(new ListViewSubItem() { Text = $"SubItem {i}" }); 1151listItem2.SubItems.Add(new ListViewSubItem() { Text = $"SubItem {i}" });
System\Windows\Forms\AccessibleObjects\ListViewItem.ListViewItemDetailsAccessibleObjectTests.cs (9)
40item.SubItems.AddRange(new ListViewSubItem[] { new(), new(), new(), new(), new() }); 72item.SubItems.AddRange(new ListViewSubItem[] { new(), new(), new(), new() });
System\Windows\Forms\AccessibleObjects\ListViewItem.ListViewSubItem.ListViewSubItemAccessibleObjectTests.cs (14)
859ListViewItem.ListViewSubItem subItem = new(listViewItem, "Test subItem"); 916ListViewItem.ListViewSubItem listViewSubItem = new(listViewItem, "Test subItem"); 929ListViewItem.ListViewSubItem listViewSubItem = new(listViewItem, "Test subItem"); 944ListViewItem.ListViewSubItem listViewSubItem = new(listViewItem, "Test subItem"); 973ListViewItem.ListViewSubItem listViewSubItem = new(listViewItem, "Test subItem"); 1051ListViewItem.ListViewSubItem listViewSubItem = new(); 1063ListViewItem.ListViewSubItem listViewSubItem = new(); 1079ListViewItem.ListViewSubItem listViewSubItem = new(); 1095ListViewItem.ListViewSubItem listViewSubItem = new(); 1111ListViewItem.ListViewSubItem listViewSubItem = new(); 1127ListViewItem.ListViewSubItem listViewSubItem = new(); 1143ListViewItem.ListViewSubItem listViewSubItem = new(); 1159ListViewItem.ListViewSubItem listViewSubItem = new(); 1165listView.Items[0].SubItems[subItemIndex] = new ListViewItem.ListViewSubItem();
System\Windows\Forms\AccessibleObjects\ListViewLabelEditAccessibleObjectTests.cs (1)
164ListViewSubItem subItem = new(item, "Test");
System\Windows\Forms\BinaryFormat\WinFormsBinaryFormattedObjectTests.cs (1)
229new ListViewItem.ListViewSubItem()
System\Windows\Forms\DrawListViewItemEventArgsTests.cs (2)
92subItemsItem.SubItems.Add(new ListViewItem.ListViewSubItem()); 100fullRowSelectListViewItem.SubItems.Add(new ListViewItem.ListViewSubItem());
System\Windows\Forms\DrawListViewSubItemEventArgsTests.cs (19)
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 }; 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 };
System\Windows\Forms\ListView.ListViewItemCollectionTests.cs (3)
28var grandchild1 = new ListViewItem.ListViewSubItem 32var grandchild2 = new ListViewItem.ListViewSubItem 36var grandchild3 = new ListViewItem.ListViewSubItem
System\Windows\Forms\ListViewHitTestInfoTests.cs (1)
12yield return new object[] { new ListViewItem(), new ListViewItem.ListViewSubItem(), ListViewHitTestLocations.None - 1 };
System\Windows\Forms\ListViewItem.IKeyboardToolTipTests.cs (2)
179listViewItem.SubItems.Add(new ListViewSubItem(listViewItem, new string('t', 10))); 194ListViewSubItem listViewSubItem = new(listViewItem, new string('t', 20));
System\Windows\Forms\ListViewItemConverterTests.cs (5)
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")
System\Windows\Forms\ListViewItemTests.cs (9)
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" }; 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" }; 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" }; 460yield return new object[] { new ListViewItem.ListViewSubItem[] { new(null, "text") }, 1, "text" }; 461yield return new object[] { new ListViewItem.ListViewSubItem[] { new(null, "text") }, -1, "text" }; 1050AssertEqualListViewSubItem(expected?.Select(t => new ListViewItem.ListViewSubItem(null, t)).ToArray(), actual);
System\Windows\Forms\ListViewSubItemCollectionTests.cs (86)
44var subItem = new ListViewItem.ListViewSubItem(); 57new ListViewItem.ListViewSubItem() 68new ListViewItem.ListViewSubItem() 71var subItem = new ListViewItem.ListViewSubItem(); 84new ListViewItem.ListViewSubItem() 86Assert.Throws<ArgumentOutOfRangeException>("index", () => collection[index] = new ListViewItem.ListViewSubItem()); 95new ListViewItem.ListViewSubItem() 106var subItem = new ListViewItem.ListViewSubItem(); 119new ListViewItem.ListViewSubItem() 130new ListViewItem.ListViewSubItem() 133var subItem = new ListViewItem.ListViewSubItem(); 146new ListViewItem.ListViewSubItem() 173var subItem1 = new ListViewItem.ListViewSubItem(); 174var subItem2 = new ListViewItem.ListViewSubItem 189var subItem = new ListViewItem.ListViewSubItem(); 202var subItem = new ListViewItem.ListViewSubItem(); 207Assert.Throws<InvalidOperationException>(() => collection.Add(new ListViewItem.ListViewSubItem())); 215var subItem = new ListViewItem.ListViewSubItem(); 232var subItem = new ListViewItem.ListViewSubItem(); 292var subItem = new ListViewItem.ListViewSubItem(); 313var subItem1 = new ListViewItem.ListViewSubItem(null, "text1"); 314var subItem2 = new ListViewItem.ListViewSubItem(null, "text2"); 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"); 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"); 427var subItem = new ListViewItem.ListViewSubItem(); 455var subItem = new ListViewItem.ListViewSubItem(); 459Assert.False(collection.Contains(new ListViewItem.ListViewSubItem())); 469Assert.False(collection.Contains(new ListViewItem.ListViewSubItem())); 485var subItem1 = new ListViewItem.ListViewSubItem(); 486var subItem2 = new ListViewItem.ListViewSubItem 511var subItem = new ListViewItem.ListViewSubItem(); 515Assert.False(collection.Contains(new ListViewItem.ListViewSubItem())); 526Assert.False(collection.Contains(new ListViewItem.ListViewSubItem())); 536var subItem = new ListViewItem.ListViewSubItem(); 540Assert.Equal(-1, collection.IndexOf(new ListViewItem.ListViewSubItem())); 550Assert.Equal(-1, collection.IndexOf(new ListViewItem.ListViewSubItem())); 566var subItem1 = new ListViewItem.ListViewSubItem(); 567var subItem2 = new ListViewItem.ListViewSubItem 596var subItem = new ListViewItem.ListViewSubItem(); 600Assert.Equal(-1, collection.IndexOf(new ListViewItem.ListViewSubItem())); 611Assert.Equal(-1, collection.IndexOf(new ListViewItem.ListViewSubItem())); 621var subItem = new ListViewItem.ListViewSubItem(); 622collection.Add(new ListViewItem.ListViewSubItem()); 636var subItem = new ListViewItem.ListViewSubItem(); 641Assert.Throws<InvalidOperationException>(() => collection.Add(new ListViewItem.ListViewSubItem())); 650new ListViewItem.ListViewSubItem() 670var subItem = new ListViewItem.ListViewSubItem(); 671collection.Add(new ListViewItem.ListViewSubItem()); 695Assert.Throws<ArgumentOutOfRangeException>("index", () => collection.Insert(index, new ListViewItem.ListViewSubItem())); 703var subItem = new ListViewItem.ListViewSubItem(); 725var subItem = new ListViewItem.ListViewSubItem(); 745var subItem = new ListViewItem.ListViewSubItem(); 757var subItem1 = new ListViewItem.ListViewSubItem(); 758var subItem2 = new ListViewItem.ListViewSubItem(); 759var subItem3 = new ListViewItem.ListViewSubItem(); 760var subItem4 = new ListViewItem.ListViewSubItem(); 807new ListViewItem.ListViewSubItem() 834var subItem = new ListViewItem.ListViewSubItem 857var subItem = new ListViewItem.ListViewSubItem(); 879ListViewItem.ListViewSubItem subItem = new(); 912ListViewItem.ListViewSubItem subItem1 = new(); 913ListViewItem.ListViewSubItem subItem2 = new(); 950ListViewItem.ListViewSubItem subItem1 = new(); 951ListViewItem.ListViewSubItem subItem2 = new(); 973ListViewItem.ListViewSubItem subItem = new(); 986ListViewItem.ListViewSubItem subItem1 = new(); 987ListViewItem.ListViewSubItem subItem2 = new(); 989ListViewItem.ListViewSubItem oldSubItem2 = new(); 1018ListViewItem.ListViewSubItem subItem = new(); 1036ListViewItem.ListViewSubItem subItem = new(); 1052ListViewItem.ListViewSubItem subItem1 = new(); 1053ListViewItem.ListViewSubItem subItem2 = new(); 1075ListViewItem.ListViewSubItem subItem = new(); 1094ListViewItem.ListViewSubItem subItem = new(); 1114ListViewItem.ListViewSubItem subItem = new(listViewItem, "Test 2") { Name = "Test 2" };
System\Windows\Forms\ListViewSubItemConverterTests.cs (4)
53new ListViewItem.ListViewSubItem(item, "text"), 60new ListViewItem.ListViewSubItem(null, "text", Color.Red, Color.Blue, SystemFonts.MenuFont), 105Assert.Throws<NotSupportedException>(() => converter.ConvertTo(new ListViewItem.ListViewSubItem(), destinationType)); 119var item = new ListViewItem.ListViewSubItem();
System\Windows\Forms\ListViewSubItemTests.cs (32)
16var subItem = new ListViewItem.ListViewSubItem(); 42var subItem = new ListViewItem.ListViewSubItem(owner, text); 68var subItem = new ListViewItem.ListViewSubItem(owner, text, foreColor, backColor, font); 88var subItem = new ListViewItem.ListViewSubItem(item, "text"); 103var subItem = new ListViewItem.ListViewSubItem(item, "text"); 123var subItem = new ListViewItem.ListViewSubItem(); 142var subItem = new ListViewItem.ListViewSubItem 172var subItem = new ListViewItem.ListViewSubItem(); 191var subItem = new ListViewItem.ListViewSubItem(); 210var subItem = new ListViewItem.ListViewSubItem(item, "text"); 224var subItem = new ListViewItem.ListViewSubItem(item, "text"); 239var subItem = new ListViewItem.ListViewSubItem(item, "text"); 260var subItem = new ListViewItem.ListViewSubItem(); 273var subItem = new ListViewItem.ListViewSubItem 297var subItem = new ListViewItem.ListViewSubItem(); 316var subItem = new ListViewItem.ListViewSubItem(); 337var subItem = new ListViewItem.ListViewSubItem(item, "text"); 352var subItem = new ListViewItem.ListViewSubItem(item, "text"); 372var subItem = new ListViewItem.ListViewSubItem(); 393var subItem = new ListViewItem.ListViewSubItem 423var subItem = new ListViewItem.ListViewSubItem(); 442var subItem = new ListViewItem.ListViewSubItem(); 458var subItem = new ListViewItem.ListViewSubItem(item, "text") 473var subItem = new ListViewItem.ListViewSubItem 488var subItem = new ListViewItem.ListViewSubItem 504var subItem = new ListViewItem.ListViewSubItem(item, "text") 519var subItem = new ListViewItem.ListViewSubItem 540var subItem = new ListViewItem.ListViewSubItem(owner, "text"); 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" } }; 602var subItem = new ListViewItem.ListViewSubItem(null, text);
System.Windows.Forms.UI.IntegrationTests (1)
ListViewTests.cs (1)
559listViewItem.SubItems.Add(new ListViewItem.ListViewSubItem() { Text = $"Test SubItem{i}" });
300 references to ListViewSubItem
System.Windows.Forms (64)
System\Windows\Forms\Controls\ListView\DrawListViewItemEventArgs.cs (1)
103ListViewItem.ListViewSubItem subItem = Item.SubItems[0];
System\Windows\Forms\Controls\ListView\DrawListViewSubItemEventArgs.cs (2)
20ListViewItem.ListViewSubItem? subItem, 64public ListViewItem.ListViewSubItem? SubItem { get; }
System\Windows\Forms\Controls\ListView\ListView.cs (2)
183internal ListViewSubItem? _listViewSubItem; 3327ListViewSubItem listViewSubItem = listViewItem.SubItems[j];
System\Windows\Forms\Controls\ListView\ListViewHitTestInfo.cs (2)
14public ListViewHitTestInfo(ListViewItem? hitItem, ListViewItem.ListViewSubItem? hitSubItem, ListViewHitTestLocations hitLocation) 34public ListViewItem.ListViewSubItem? SubItem { get; }
System\Windows\Forms\Controls\ListView\ListViewItem.cs (15)
41private List<ListViewSubItem> _subItems = []; 114public ListViewItem(ListViewSubItem[] subItems, int imageIndex) 168public ListViewItem(ListViewSubItem[] subItems, int imageIndex, ListViewGroup? group) 187_subItems = new List<ListViewSubItem>(items.Length); 205public ListViewItem(ListViewSubItem[] subItems, string? imageKey) 241public ListViewItem(ListViewSubItem[] subItems, string? imageKey, ListViewGroup? group) 886ListViewSubItem[] clonedSubItems = new ListViewSubItem[SubItems.Count]; 889ListViewSubItem subItem = SubItems[index]; 913foreach (ListViewSubItem subItem in clonedSubItems) 976public ListViewSubItem? GetSubItemAt(int x, int y) 1254ListViewSubItem newItem = (ListViewSubItem)info.GetValue($"SubItem{i}", typeof(ListViewSubItem))!; 1278info.AddValue($"SubItem{i}", _subItems[i], typeof(ListViewSubItem));
System\Windows\Forms\Controls\ListView\ListViewItem.IKeyboardToolTip.cs (1)
127ListViewSubItem subItem = SubItems[1];
System\Windows\Forms\Controls\ListView\ListViewItem.ListViewItemBaseAccessibleObject.cs (1)
250foreach (ListViewSubItem subItem in _owningItem.SubItems)
System\Windows\Forms\Controls\ListView\ListViewItem.ListViewItemDetailsAccessibleObject.cs (5)
28/// Converts the provided index of the <see cref="AccessibleObject"/>'s child to an index of a <see cref="ListViewSubItem"/>. 31/// <returns>The index of an owning <see cref="ListViewSubItem"/>'s object.</returns> 95if (child is not ListViewSubItem.ListViewSubItemAccessibleObject subItemAccessibleObject) 155ListViewSubItem.ListViewSubItemAccessibleObject fakeAccessibleObject = new(owningSubItem: null, _owningItem); 164private int GetFakeSubItemIndex(ListViewSubItem.ListViewSubItemAccessibleObject fakeAccessibleObject)
System\Windows\Forms\Controls\ListView\ListViewItem.ListViewItemTileAccessibleObject.cs (1)
89|| child is not ListViewSubItem.ListViewSubItemAccessibleObject subItemAccessibleObject
System\Windows\Forms\Controls\ListView\ListViewItem.ListViewSubItem.ListViewSubItemAccessibleObject.cs (3)
21internal ListViewSubItem? OwningSubItem { get; private set; } 23public ListViewSubItemAccessibleObject(ListViewSubItem? owningSubItem, ListViewItem owningItem) 157=> $"{nameof(ListViewSubItem)}-{ParentInternal.GetChildIndex(this)}";
System\Windows\Forms\Controls\ListView\ListViewItem.ListViewSubItemCollection.cs (21)
43public ListViewSubItem this[int index] 57ListViewSubItem oldSubItem = _owner._subItems[index]; 74if (value is not ListViewSubItem item) 86public virtual ListViewSubItem? this[string key] 107public ListViewSubItem Add(ListViewSubItem item) 118public ListViewSubItem Add(string? text) 120ListViewSubItem item = new(_owner, text); 125public ListViewSubItem Add(string? text, Color foreColor, Color backColor, Font font) 127ListViewSubItem item = new(_owner, text, foreColor, backColor, font); 132public void AddRange(params ListViewSubItem[] items) 137foreach (ListViewSubItem item in items) 186if (item is not ListViewSubItem itemValue) 211public bool Contains(ListViewSubItem? subItem) => IndexOf(subItem) != -1; 215if (item is not ListViewSubItem itemValue) 242public int IndexOf(ListViewSubItem? subItem) 257if (subItem is not ListViewSubItem subItemValue) 301public void Insert(int index, ListViewSubItem item) 319if (item is not ListViewSubItem subItem) 327public void Remove(ListViewSubItem? item) 338if (item is ListViewSubItem itemValue)
System\Windows\Forms\Controls\ListView\ListViewItemConverter.cs (6)
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\ListViewLabelEditAccessibleObject.cs (1)
6using static System.Windows.Forms.ListViewItem.ListViewSubItem;
System\Windows\Forms\Controls\ListView\ListViewSubItemConverter.cs (3)
28if (destinationType == typeof(InstanceDescriptor) && value is ListViewItem.ListViewSubItem item) 35ctor = typeof(ListViewItem.ListViewSubItem).GetConstructor( 55ctor = typeof(ListViewItem.ListViewSubItem).GetConstructor([typeof(ListViewItem), typeof(string)]);
System.Windows.Forms.Design (2)
System\Windows\Forms\Design\ListViewSubItemCollectionEditor.cs (2)
18private ListViewItem.ListViewSubItem _firstSubItem; 32if (instance is ListViewItem.ListViewSubItem item)
System.Windows.Forms.Tests (234)
SerializableAttributeTests.cs (1)
27{ typeof(ListViewItem.ListViewSubItem).FullName },
SerializableTypesTests.cs (5)
186var item = Assert.Single(result.SubItems) as ListViewSubItem; 210ListViewSubItem listViewSubItem = new( 230ListViewSubItem result = BinarySerialization.EnsureDeserialize<ListViewSubItem>(blob);
System\Windows\Forms\AccessibleObjects\ListViewItem.ListViewItemDetailsAccessibleObjectTests.cs (2)
40item.SubItems.AddRange(new ListViewSubItem[] { new(), new(), new(), new(), new() }); 72item.SubItems.AddRange(new ListViewSubItem[] { new(), new(), new(), new() });
System\Windows\Forms\AccessibleObjects\ListViewItem.ListViewSubItem.ListViewSubItemAccessibleObjectTests.cs (16)
7using static System.Windows.Forms.ListViewItem.ListViewSubItem; 652ListViewItem.ListViewSubItem subItem = listViewItem1.SubItems[0]; 859ListViewItem.ListViewSubItem subItem = new(listViewItem, "Test subItem"); 916ListViewItem.ListViewSubItem listViewSubItem = new(listViewItem, "Test subItem"); 929ListViewItem.ListViewSubItem listViewSubItem = new(listViewItem, "Test subItem"); 944ListViewItem.ListViewSubItem listViewSubItem = new(listViewItem, "Test subItem"); 973ListViewItem.ListViewSubItem listViewSubItem = new(listViewItem, "Test subItem"); 1051ListViewItem.ListViewSubItem listViewSubItem = new(); 1063ListViewItem.ListViewSubItem listViewSubItem = new(); 1079ListViewItem.ListViewSubItem listViewSubItem = new(); 1095ListViewItem.ListViewSubItem listViewSubItem = new(); 1111ListViewItem.ListViewSubItem listViewSubItem = new(); 1127ListViewItem.ListViewSubItem listViewSubItem = new(); 1143ListViewItem.ListViewSubItem listViewSubItem = new(); 1159ListViewItem.ListViewSubItem listViewSubItem = new(); 1175foreach (ListViewItem.ListViewSubItem subItem in item.SubItems)
System\Windows\Forms\AccessibleObjects\ListViewLabelEditAccessibleObjectTests.cs (1)
164ListViewSubItem subItem = new(item, "Test");
System\Windows\Forms\DrawListViewSubItemEventArgsTests.cs (3)
22public void DrawListViewSubItemEventArgs_Ctor_Graphics_ListViewItem_Rectangle_Int_ListViewItemStates(Rectangle bounds, ListViewItem item, ListViewItem.ListViewSubItem subItem, int itemIndex, int columnIndex, ColumnHeader header, ListViewItemStates itemState) 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\ListView.ListViewItemCollectionTests.cs (3)
28var grandchild1 = new ListViewItem.ListViewSubItem 32var grandchild2 = new ListViewItem.ListViewSubItem 36var grandchild3 = new ListViewItem.ListViewSubItem
System\Windows\Forms\ListViewHitTestInfoTests.cs (1)
17public void ListViewHitTestInfo_Ctor_ListViewItem_ListViewSubItem_ListViewHitTestLocations(ListViewItem hitItem, ListViewItem.ListViewSubItem hitSubItem, ListViewHitTestLocations hitTestLocations)
System\Windows\Forms\ListViewItem.IKeyboardToolTipTests.cs (1)
194ListViewSubItem listViewSubItem = new(listViewItem, new string('t', 20));
System\Windows\Forms\ListViewItemConverterTests.cs (13)
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 }
System\Windows\Forms\ListViewItemTests.cs (56)
33ListViewItem.ListViewSubItem subItem = Assert.Single(item.SubItems.Cast<ListViewItem.ListViewSubItem>()); 72AssertEqualListViewSubItem(subItems, item.SubItems.Cast<ListViewItem.ListViewSubItem>().ToArray()); 110AssertEqualListViewSubItem(subItems, item.SubItems.Cast<ListViewItem.ListViewSubItem>().ToArray()); 148AssertEqualListViewSubItem(subItems, item.SubItems.Cast<ListViewItem.ListViewSubItem>().ToArray()); 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) 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) 260AssertEqualListViewSubItem(subItems, item.SubItems.Cast<ListViewItem.ListViewSubItem>().ToArray()); 298AssertEqualListViewSubItem(subItems, item.SubItems.Cast<ListViewItem.ListViewSubItem>().ToArray()); 336AssertEqualListViewSubItem(subItems, item.SubItems.Cast<ListViewItem.ListViewSubItem>().ToArray()); 373ListViewItem.ListViewSubItem subItem = Assert.Single(item.SubItems.Cast<ListViewItem.ListViewSubItem>()); 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) 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) 486AssertEqualListViewSubItem(subItems, item.SubItems.Cast<ListViewItem.ListViewSubItem>().ToArray()); 524AssertEqualListViewSubItem(subItems, item.SubItems.Cast<ListViewItem.ListViewSubItem>().ToArray()); 562AssertEqualListViewSubItem(subItems, item.SubItems.Cast<ListViewItem.ListViewSubItem>().ToArray()); 600AssertEqualListViewSubItem(subItems, item.SubItems.Cast<ListViewItem.ListViewSubItem>().ToArray()); 637ListViewItem.ListViewSubItem subItem = Assert.Single(item.SubItems.Cast<ListViewItem.ListViewSubItem>()); 675ListViewItem.ListViewSubItem subItem = Assert.Single(item.SubItems.Cast<ListViewItem.ListViewSubItem>()); 713ListViewItem.ListViewSubItem subItem = Assert.Single(item.SubItems.Cast<ListViewItem.ListViewSubItem>()); 750ListViewItem.ListViewSubItem subItem = Assert.Single(item.SubItems.Cast<ListViewItem.ListViewSubItem>()); 789AssertEqualListViewSubItem(subItems, item.SubItems.Cast<ListViewItem.ListViewSubItem>().ToArray()); 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 }; 1048private static void AssertEqualListViewSubItem(string[] expected, ListViewItem.ListViewSubItem[] actual) 1053private static void AssertEqualListViewSubItem(ListViewItem.ListViewSubItem[] expected, ListViewItem.ListViewSubItem[] actual) 1057ListViewItem.ListViewSubItem subItem = Assert.Single(actual.Cast<ListViewItem.ListViewSubItem>());
System\Windows\Forms\ListViewSubItemCollectionTests.cs (80)
44var subItem = new ListViewItem.ListViewSubItem(); 71var subItem = new ListViewItem.ListViewSubItem(); 106var subItem = new ListViewItem.ListViewSubItem(); 133var subItem = new ListViewItem.ListViewSubItem(); 173var subItem1 = new ListViewItem.ListViewSubItem(); 174var subItem2 = new ListViewItem.ListViewSubItem 189var subItem = new ListViewItem.ListViewSubItem(); 202var subItem = new ListViewItem.ListViewSubItem(); 215var subItem = new ListViewItem.ListViewSubItem(); 232var subItem = new ListViewItem.ListViewSubItem(); 250ListViewItem.ListViewSubItem subItem = Assert.Single(collection.Cast<ListViewItem.ListViewSubItem>()); 271ListViewItem.ListViewSubItem subItem = Assert.Single(collection.Cast<ListViewItem.ListViewSubItem>()); 284Assert.Throws<ArgumentNullException>("item", () => collection.Add((ListViewItem.ListViewSubItem)null)); 292var subItem = new ListViewItem.ListViewSubItem(); 313var subItem1 = new ListViewItem.ListViewSubItem(null, "text1"); 314var subItem2 = new ListViewItem.ListViewSubItem(null, "text2"); 315var items = new ListViewItem.ListViewSubItem[] { subItem1, null, subItem2 }; 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 }; 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 }; 417Assert.Throws<ArgumentNullException>("items", () => collection.AddRange((ListViewItem.ListViewSubItem[])null)); 427var subItem = new ListViewItem.ListViewSubItem(); 455var subItem = new ListViewItem.ListViewSubItem(); 485var subItem1 = new ListViewItem.ListViewSubItem(); 486var subItem2 = new ListViewItem.ListViewSubItem 511var subItem = new ListViewItem.ListViewSubItem(); 536var subItem = new ListViewItem.ListViewSubItem(); 566var subItem1 = new ListViewItem.ListViewSubItem(); 567var subItem2 = new ListViewItem.ListViewSubItem 596var subItem = new ListViewItem.ListViewSubItem(); 621var subItem = new ListViewItem.ListViewSubItem(); 636var subItem = new ListViewItem.ListViewSubItem(); 670var subItem = new ListViewItem.ListViewSubItem(); 703var subItem = new ListViewItem.ListViewSubItem(); 725var subItem = new ListViewItem.ListViewSubItem(); 745var subItem = new ListViewItem.ListViewSubItem(); 757var subItem1 = new ListViewItem.ListViewSubItem(); 758var subItem2 = new ListViewItem.ListViewSubItem(); 759var subItem3 = new ListViewItem.ListViewSubItem(); 760var subItem4 = new ListViewItem.ListViewSubItem(); 834var subItem = new ListViewItem.ListViewSubItem 857var subItem = new ListViewItem.ListViewSubItem(); 879ListViewItem.ListViewSubItem subItem = new(); 912ListViewItem.ListViewSubItem subItem1 = new(); 913ListViewItem.ListViewSubItem subItem2 = new(); 950ListViewItem.ListViewSubItem subItem1 = new(); 951ListViewItem.ListViewSubItem subItem2 = new(); 952ListViewItem.ListViewSubItem oldSubItem = listViewItem.SubItems[0]; 973ListViewItem.ListViewSubItem subItem = new(); 986ListViewItem.ListViewSubItem subItem1 = new(); 987ListViewItem.ListViewSubItem subItem2 = new(); 988ListViewItem.ListViewSubItem oldSubItem1 = listViewItem.SubItems[0]; 989ListViewItem.ListViewSubItem oldSubItem2 = new(); 1017ListViewItem.ListViewSubItem oldSubItem = listViewItem.SubItems[0]; 1018ListViewItem.ListViewSubItem subItem = new(); 1036ListViewItem.ListViewSubItem subItem = new(); 1037ListViewItem.ListViewSubItem oldSubItem = listViewItem.SubItems[0]; 1052ListViewItem.ListViewSubItem subItem1 = new(); 1053ListViewItem.ListViewSubItem subItem2 = new(); 1054ListViewItem.ListViewSubItem defaultSubItem = listViewItem.SubItems[0]; 1074ListViewItem.ListViewSubItem oldSubItem = listViewItem.SubItems[0]; 1075ListViewItem.ListViewSubItem subItem = new(); 1093ListViewItem.ListViewSubItem oldSubItem = listViewItem.SubItems[0]; 1094ListViewItem.ListViewSubItem subItem = new(); 1112ListViewItem.ListViewSubItem oldSubItem = listViewItem.SubItems[0]; 1114ListViewItem.ListViewSubItem subItem = new(listViewItem, "Test 2") { Name = "Test 2" };
System\Windows\Forms\ListViewSubItemConverterTests.cs (19)
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)); 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)); 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 (33)
16var subItem = new ListViewItem.ListViewSubItem(); 42var subItem = new ListViewItem.ListViewSubItem(owner, text); 68var subItem = new ListViewItem.ListViewSubItem(owner, text, foreColor, backColor, font); 88var subItem = new ListViewItem.ListViewSubItem(item, "text"); 103var subItem = new ListViewItem.ListViewSubItem(item, "text"); 123var subItem = new ListViewItem.ListViewSubItem(); 142var subItem = new ListViewItem.ListViewSubItem 172var subItem = new ListViewItem.ListViewSubItem(); 191var subItem = new ListViewItem.ListViewSubItem(); 210var subItem = new ListViewItem.ListViewSubItem(item, "text"); 224var subItem = new ListViewItem.ListViewSubItem(item, "text"); 239var subItem = new ListViewItem.ListViewSubItem(item, "text"); 260var subItem = new ListViewItem.ListViewSubItem(); 273var subItem = new ListViewItem.ListViewSubItem 297var subItem = new ListViewItem.ListViewSubItem(); 316var subItem = new ListViewItem.ListViewSubItem(); 337var subItem = new ListViewItem.ListViewSubItem(item, "text"); 352var subItem = new ListViewItem.ListViewSubItem(item, "text"); 372var subItem = new ListViewItem.ListViewSubItem(); 393var subItem = new ListViewItem.ListViewSubItem 423var subItem = new ListViewItem.ListViewSubItem(); 442var subItem = new ListViewItem.ListViewSubItem(); 458var subItem = new ListViewItem.ListViewSubItem(item, "text") 473var subItem = new ListViewItem.ListViewSubItem 488var subItem = new ListViewItem.ListViewSubItem 504var subItem = new ListViewItem.ListViewSubItem(item, "text") 519var subItem = new ListViewItem.ListViewSubItem 540var subItem = new ListViewItem.ListViewSubItem(owner, "text"); 556var subItem = new ListViewItem.ListViewSubItem(owner, "text", Color.Red, Color.Blue, SystemFonts.MenuFont); 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);