581 references to SelectedItems
System.Windows.Forms (25)
System\Windows\Forms\Controls\ListBoxes\ListBox.cs (22)
842if (_itemsCollection is not null && SelectedItems.Count > 0) 844return Items.IndexOfIdentifier(SelectedItems.GetObjectAt(0)); 868SelectedItems.SetSelected(currentIndex, false); 871SelectedItems.SetSelected(value, true); 891if (!SelectedItems.GetSelected(value)) 895SelectedItems.SetSelected(value, true); 941if (SelectedItems.Count > 0) 943return SelectedItems[0]; 1003SelectedItems.EnsureUpToDate(); 1329if (SelectedItems.GetSelected(x)) 1332SelectedItems.SetSelected(x, false); 1490if (_itemsCollection is not null && SelectedItems.GetSelected(index)) 1660SelectedItems.SetSelected(i, false); 1669SelectedItems.SetSelected(index, true); 1687SelectedItems.SetSelected(i, true); 1795SelectedItems.Dirty(); 1796SelectedItems.EnsureUpToDate(); 1810SelectedItems.EnsureUpToDate(); 2104SelectedItems.Dirty(); 2154SelectedItems.SetSelected(index, value); 2160SelectedItems.Dirty(); 2180SelectedObjectCollection currentSelections = SelectedItems;
System\Windows\Forms\Controls\ListBoxes\ListBox.ObjectCollection.cs (1)
427_owner.SelectedItems.SetSelected(index, false);
System\Windows\Forms\Controls\ListBoxes\ListBox.SelectedIndexCollection.cs (2)
28return _owner.SelectedItems.Count; 166_owner.SelectedItems.EnsureUpToDate();
System.Windows.Forms.Design (7)
System\ComponentModel\Design\CollectionEditor.CollectionEditorCollectionForm.cs (7)
83foreach (ListItem item in _listBox.SelectedItems) 808if (_listBox.SelectedItems.Count > 1) 810List<ListItem> toBeDeleted = _listBox.SelectedItems.Cast<ListItem>().ToList(); 1046items = [new SelectionWrapper(CollectionType, CollectionItemType, _listBox, _listBox.SelectedItems)]; 1050items = new object[_listBox.SelectedItems.Count]; 1053items[i] = ((ListItem)_listBox.SelectedItems[i]!).Value; 1057int selectedItemCount = _listBox.SelectedItems.Count;
System.Windows.Forms.Tests (549)
CheckedListBoxTests.cs (5)
512Assert.Single(checkedListBox.SelectedItems); 520Assert.Single(checkedListBox.SelectedItems); 528Assert.Single(checkedListBox.SelectedItems); 553Assert.Single(checkedListBox.SelectedItems); 562Assert.Empty(checkedListBox.SelectedItems);
System\Windows\Forms\ListBox.ObjectCollectionTests.cs (448)
677owner.SelectedItems.Add(1); 683Assert.Equal(new object[] { 1 }, owner.SelectedItems.Cast<object>()); 691Assert.Equal(new object[] { 1 }, owner.SelectedItems.Cast<object>()); 699Assert.Equal(new object[] { 2 }, owner.SelectedItems.Cast<object>()); 707Assert.Equal(new object[] { 2 }, owner.SelectedItems.Cast<object>()); 726owner.SelectedItems.Add(1); 732Assert.Equal(new object[] { 1 }, owner.SelectedItems.Cast<object>()); 740Assert.Equal(new object[] { 1 }, owner.SelectedItems.Cast<object>()); 748Assert.Equal(new object[] { 2 }, owner.SelectedItems.Cast<object>()); 756Assert.Equal(new object[] { 2 }, owner.SelectedItems.Cast<object>()); 778owner.SelectedItems.Add(1); 779owner.SelectedItems.Add(3); 785Assert.Equal(new object[] { 1, 3 }, owner.SelectedItems.Cast<object>()); 793Assert.Equal(new object[] { 1, 3 }, owner.SelectedItems.Cast<object>()); 801Assert.Equal(new object[] { 2, 3 }, owner.SelectedItems.Cast<object>()); 809Assert.Equal(new object[] { 2, 3 }, owner.SelectedItems.Cast<object>()); 817Assert.Equal(new object[] { 2, 4 }, owner.SelectedItems.Cast<object>()); 825Assert.Equal(new object[] { 2, 4 }, owner.SelectedItems.Cast<object>()); 848owner.SelectedItems.Add(1); 849owner.SelectedItems.Add(3); 855Assert.Equal(new object[] { 1, 3 }, owner.SelectedItems.Cast<object>()); 863Assert.Equal(new object[] { 1, 3 }, owner.SelectedItems.Cast<object>()); 871Assert.Equal(new object[] { 2, 3 }, owner.SelectedItems.Cast<object>()); 879Assert.Equal(new object[] { 2, 3 }, owner.SelectedItems.Cast<object>()); 887Assert.Equal(new object[] { 2, 4 }, owner.SelectedItems.Cast<object>()); 895Assert.Equal(new object[] { 2, 4 }, owner.SelectedItems.Cast<object>()); 911owner.SelectedItems.Add(1); 929Assert.Equal(new object[] { 1 }, owner.SelectedItems.Cast<object>()); 940Assert.Equal(new object[] { 1 }, owner.SelectedItems.Cast<object>()); 951Assert.Equal(new object[] { 2 }, owner.SelectedItems.Cast<object>()); 962Assert.Equal(new object[] { 2 }, owner.SelectedItems.Cast<object>()); 984owner.SelectedItems.Add(1); 1002Assert.Equal(new object[] { 1 }, owner.SelectedItems.Cast<object>()); 1013Assert.Equal(new object[] { 1 }, owner.SelectedItems.Cast<object>()); 1024Assert.Equal(new object[] { 2 }, owner.SelectedItems.Cast<object>()); 1035Assert.Equal(new object[] { 2 }, owner.SelectedItems.Cast<object>()); 1060owner.SelectedItems.Add(1); 1061owner.SelectedItems.Add(3); 1079Assert.Equal(new object[] { 1, 3 }, owner.SelectedItems.Cast<object>()); 1090Assert.Equal(new object[] { 1, 3 }, owner.SelectedItems.Cast<object>()); 1101Assert.Equal(new object[] { 2, 3 }, owner.SelectedItems.Cast<object>()); 1112Assert.Equal(new object[] { 2, 3 }, owner.SelectedItems.Cast<object>()); 1123Assert.Equal(new object[] { 2 }, owner.SelectedItems.Cast<object>()); 1134Assert.Equal(new object[] { 2 }, owner.SelectedItems.Cast<object>()); 1160owner.SelectedItems.Add(1); 1161owner.SelectedItems.Add(3); 1179Assert.Equal(new object[] { 1, 3 }, owner.SelectedItems.Cast<object>()); 1190Assert.Equal(new object[] { 1, 3 }, owner.SelectedItems.Cast<object>()); 1201Assert.Equal(new object[] { 2, 3 }, owner.SelectedItems.Cast<object>()); 1212Assert.Equal(new object[] { 2, 3 }, owner.SelectedItems.Cast<object>()); 1223Assert.Equal(new object[] { 2 }, owner.SelectedItems.Cast<object>()); 1234Assert.Equal(new object[] { 2 }, owner.SelectedItems.Cast<object>()); 1796owner.SelectedItems.Add(1); 1802Assert.Equal(new object[] { 1 }, owner.SelectedItems.Cast<object>()); 1810Assert.Equal(new object[] { 1 }, owner.SelectedItems.Cast<object>()); 1828owner.SelectedItems.Add(1); 1834Assert.Equal(new object[] { 1 }, owner.SelectedItems.Cast<object>()); 1842Assert.Equal(new object[] { 1 }, owner.SelectedItems.Cast<object>()); 1863owner.SelectedItems.Add(1); 1864owner.SelectedItems.Add(3); 1870Assert.Equal(new object[] { 1, 3 }, owner.SelectedItems.Cast<object>()); 1878Assert.Equal(new object[] { 1, 3 }, owner.SelectedItems.Cast<object>()); 1886Assert.Equal(new object[] { 1, 3 }, owner.SelectedItems.Cast<object>()); 1907owner.SelectedItems.Add(1); 1908owner.SelectedItems.Add(3); 1914Assert.Equal(new object[] { 1, 3 }, owner.SelectedItems.Cast<object>()); 1921Assert.Equal(new object[] { 1, 3 }, owner.SelectedItems.Cast<object>()); 1928Assert.Equal(new object[] { 1, 3 }, owner.SelectedItems.Cast<object>()); 1942owner.SelectedItems.Add(1); 1955Assert.Equal(new object[] { 1 }, owner.SelectedItems.Cast<object>()); 1966Assert.Equal(new object[] { 1 }, owner.SelectedItems.Cast<object>()); 1987owner.SelectedItems.Add(1); 2000Assert.Equal(new object[] { 1 }, owner.SelectedItems.Cast<object>()); 2011Assert.Equal(new object[] { 1 }, owner.SelectedItems.Cast<object>()); 2035owner.SelectedItems.Add(1); 2036owner.SelectedItems.Add(3); 2049Assert.Equal(new object[] { 1, 3 }, owner.SelectedItems.Cast<object>()); 2060Assert.Equal(new object[] { 1, 3 }, owner.SelectedItems.Cast<object>()); 2071Assert.Equal(new object[] { 1, 3 }, owner.SelectedItems.Cast<object>()); 2095owner.SelectedItems.Add(1); 2096owner.SelectedItems.Add(3); 2109Assert.Equal(new object[] { 1, 3 }, owner.SelectedItems.Cast<object>()); 2120Assert.Equal(new object[] { 1, 3 }, owner.SelectedItems.Cast<object>()); 2131Assert.Equal(new object[] { 1, 3 }, owner.SelectedItems.Cast<object>()); 2539owner.SelectedItems.Add(1); 2544Assert.Equal(new object[] { 1 }, owner.SelectedItems.Cast<object>()); 2552Assert.Equal(new object[] { 1 }, owner.SelectedItems.Cast<object>()); 2570owner.SelectedItems.Add(1); 2575Assert.Equal(new object[] { 1 }, owner.SelectedItems.Cast<object>()); 2583Assert.Equal(new object[] { 1 }, owner.SelectedItems.Cast<object>()); 2604owner.SelectedItems.Add(1); 2605owner.SelectedItems.Add(3); 2610Assert.Equal(new object[] { 1, 3 }, owner.SelectedItems.Cast<object>()); 2618Assert.Equal(new object[] { 1, 3 }, owner.SelectedItems.Cast<object>()); 2639owner.SelectedItems.Add(1); 2640owner.SelectedItems.Add(3); 2645Assert.Equal(new object[] { 1, 3 }, owner.SelectedItems.Cast<object>()); 2652Assert.Equal(new object[] { 1, 3 }, owner.SelectedItems.Cast<object>()); 2666owner.SelectedItems.Add(1); 2678Assert.Equal(new object[] { 1 }, owner.SelectedItems.Cast<object>()); 2689Assert.Equal(new object[] { 1 }, owner.SelectedItems.Cast<object>()); 2710owner.SelectedItems.Add(1); 2722Assert.Equal(new object[] { 1 }, owner.SelectedItems.Cast<object>()); 2733Assert.Equal(new object[] { 1 }, owner.SelectedItems.Cast<object>()); 2757owner.SelectedItems.Add(1); 2758owner.SelectedItems.Add(3); 2770Assert.Equal(new object[] { 1, 3 }, owner.SelectedItems.Cast<object>()); 2781Assert.Equal(new object[] { 1, 3 }, owner.SelectedItems.Cast<object>()); 2805owner.SelectedItems.Add(1); 2806owner.SelectedItems.Add(3); 2818Assert.Equal(new object[] { 1, 3 }, owner.SelectedItems.Cast<object>()); 2829Assert.Equal(new object[] { 1, 3 }, owner.SelectedItems.Cast<object>()); 3233owner.SelectedItems.Add(1); 3241Assert.Equal(new object[] { 1 }, owner.SelectedItems.Cast<object>()); 3251Assert.Equal(new object[] { 1 }, owner.SelectedItems.Cast<object>()); 3269owner.SelectedItems.Add(1); 3277Assert.Equal(new object[] { 1 }, owner.SelectedItems.Cast<object>()); 3287Assert.Equal(new object[] { 1 }, owner.SelectedItems.Cast<object>()); 3308owner.SelectedItems.Add(1); 3309owner.SelectedItems.Add(3); 3317Assert.Equal(new object[] { 1, 3 }, owner.SelectedItems.Cast<object>()); 3327Assert.Equal(new object[] { 1, 3 }, owner.SelectedItems.Cast<object>()); 3348owner.SelectedItems.Add(1); 3349owner.SelectedItems.Add(3); 3357Assert.Equal(new object[] { 1, 3 }, owner.SelectedItems.Cast<object>()); 3366Assert.Equal(new object[] { 1, 3 }, owner.SelectedItems.Cast<object>()); 3380owner.SelectedItems.Add(1); 3395Assert.Equal(new object[] { 1 }, owner.SelectedItems.Cast<object>()); 3408Assert.Equal(new object[] { 1 }, owner.SelectedItems.Cast<object>()); 3429owner.SelectedItems.Add(1); 3444Assert.Equal(new object[] { 1 }, owner.SelectedItems.Cast<object>()); 3457Assert.Equal(new object[] { 1 }, owner.SelectedItems.Cast<object>()); 3481owner.SelectedItems.Add(1); 3482owner.SelectedItems.Add(3); 3497Assert.Equal(new object[] { 1, 3 }, owner.SelectedItems.Cast<object>()); 3510Assert.Equal(new object[] { 1, 3 }, owner.SelectedItems.Cast<object>()); 3534owner.SelectedItems.Add(1); 3535owner.SelectedItems.Add(3); 3550Assert.Equal(new object[] { 1, 3 }, owner.SelectedItems.Cast<object>()); 3563Assert.Equal(new object[] { 1, 3 }, owner.SelectedItems.Cast<object>()); 4619owner.SelectedItems.Add(1); 4625Assert.Equal(new object[] { 1 }, owner.SelectedItems.Cast<object>()); 4633Assert.Equal(new object[] { 1 }, owner.SelectedItems.Cast<object>()); 4651owner.SelectedItems.Add(1); 4655Assert.Equal(new object[] { 1 }, owner.SelectedItems.Cast<object>()); 4661Assert.Equal(new object[] { 1 }, owner.SelectedItems.Cast<object>()); 4680owner.SelectedItems.Add(1); 4681owner.SelectedItems.Add(3); 4687Assert.Equal(new object[] { 1, 3 }, owner.SelectedItems.Cast<object>()); 4695Assert.Equal(new object[] { 1, 3 }, owner.SelectedItems.Cast<object>()); 4703Assert.Equal(new object[] { 1, 3 }, owner.SelectedItems.Cast<object>()); 4724owner.SelectedItems.Add(1); 4725owner.SelectedItems.Add(3); 4729Assert.Equal(new object[] { 1, 3 }, owner.SelectedItems.Cast<object>()); 4736Assert.Equal(new object[] { 1, 3 }, owner.SelectedItems.Cast<object>()); 4743Assert.Equal(new object[] { 1, 3 }, owner.SelectedItems.Cast<object>()); 4757owner.SelectedItems.Add(1); 4770Assert.Equal(new object[] { 1 }, owner.SelectedItems.Cast<object>()); 4781Assert.Equal(new object[] { 1 }, owner.SelectedItems.Cast<object>()); 4802owner.SelectedItems.Add(1); 4815Assert.Equal(new object[] { 1 }, owner.SelectedItems.Cast<object>()); 4826Assert.Equal(new object[] { 1 }, owner.SelectedItems.Cast<object>()); 4850owner.SelectedItems.Add(1); 4851owner.SelectedItems.Add(3); 4864Assert.Equal(new object[] { 1, 3 }, owner.SelectedItems.Cast<object>()); 4875Assert.Equal(new object[] { 1, 3 }, owner.SelectedItems.Cast<object>()); 4886Assert.Equal(new object[] { 1, 3 }, owner.SelectedItems.Cast<object>()); 4910owner.SelectedItems.Add(1); 4911owner.SelectedItems.Add(3); 4924Assert.Equal(new object[] { 1, 3 }, owner.SelectedItems.Cast<object>()); 4935Assert.Equal(new object[] { 1, 3 }, owner.SelectedItems.Cast<object>()); 4946Assert.Equal(new object[] { 1, 3 }, owner.SelectedItems.Cast<object>()); 5546owner.SelectedItems.Add(1); 5552Assert.Equal(new object[] { 1 }, owner.SelectedItems.Cast<object>()); 5560Assert.Equal(new object[] { 1 }, owner.SelectedItems.Cast<object>()); 5568Assert.Empty(owner.SelectedItems); 5587owner.SelectedItems.Add(1); 5593Assert.Equal(new object[] { 1 }, owner.SelectedItems.Cast<object>()); 5601Assert.Equal(new object[] { 1 }, owner.SelectedItems.Cast<object>()); 5609Assert.Empty(owner.SelectedItems); 5631owner.SelectedItems.Add(1); 5632owner.SelectedItems.Add(3); 5638Assert.Equal(new object[] { 1, 3 }, owner.SelectedItems.Cast<object>()); 5646Assert.Equal(new object[] { 1, 3 }, owner.SelectedItems.Cast<object>()); 5654Assert.Equal(new object[] { 3 }, owner.SelectedItems.Cast<object>()); 5662Assert.Empty(owner.SelectedItems); 5683owner.SelectedItems.Add(1); 5684owner.SelectedItems.Add(3); 5690Assert.Equal(new object[] { 1, 3 }, owner.SelectedItems.Cast<object>()); 5698Assert.Equal(new object[] { 1, 3 }, owner.SelectedItems.Cast<object>()); 5706Assert.Equal(new object[] { 3 }, owner.SelectedItems.Cast<object>()); 5714Assert.Empty(owner.SelectedItems); 5729owner.SelectedItems.Add(1); 5747Assert.Equal(new object[] { 1 }, owner.SelectedItems.Cast<object>()); 5758Assert.Equal(new object[] { 1 }, owner.SelectedItems.Cast<object>()); 5769Assert.Empty(owner.SelectedItems); 5791owner.SelectedItems.Add(1); 5809Assert.Equal(new object[] { 1 }, owner.SelectedItems.Cast<object>()); 5820Assert.Equal(new object[] { 1 }, owner.SelectedItems.Cast<object>()); 5831Assert.Empty(owner.SelectedItems); 5856owner.SelectedItems.Add(1); 5857owner.SelectedItems.Add(3); 5870Assert.Equal(new object[] { 1, 3 }, owner.SelectedItems.Cast<object>()); 5880Assert.Equal(new object[] { 1, 3 }, owner.SelectedItems.Cast<object>()); 5890Assert.Equal(new object[] { 3 }, owner.SelectedItems.Cast<object>()); 5900Assert.Empty(owner.SelectedItems); 5924owner.SelectedItems.Add(1); 5925owner.SelectedItems.Add(3); 5938Assert.Equal(new object[] { 1, 3 }, owner.SelectedItems.Cast<object>()); 5948Assert.Equal(new object[] { 1, 3 }, owner.SelectedItems.Cast<object>()); 5958Assert.Equal(new object[] { 3 }, owner.SelectedItems.Cast<object>()); 5968Assert.Empty(owner.SelectedItems); 6401owner.SelectedItems.Add(1); 6407Assert.Equal(new object[] { 1 }, owner.SelectedItems.Cast<object>()); 6415Assert.Equal(new object[] { 1 }, owner.SelectedItems.Cast<object>()); 6423Assert.Empty(owner.SelectedItems); 6442owner.SelectedItems.Add(1); 6448Assert.Equal(new object[] { 1 }, owner.SelectedItems.Cast<object>()); 6456Assert.Equal(new object[] { 1 }, owner.SelectedItems.Cast<object>()); 6464Assert.Empty(owner.SelectedItems); 6486owner.SelectedItems.Add(1); 6487owner.SelectedItems.Add(3); 6493Assert.Equal(new object[] { 1, 3 }, owner.SelectedItems.Cast<object>()); 6501Assert.Equal(new object[] { 1, 3 }, owner.SelectedItems.Cast<object>()); 6509Assert.Equal(new object[] { 3 }, owner.SelectedItems.Cast<object>()); 6517Assert.Empty(owner.SelectedItems); 6538owner.SelectedItems.Add(1); 6539owner.SelectedItems.Add(3); 6545Assert.Equal(new object[] { 1, 3 }, owner.SelectedItems.Cast<object>()); 6553Assert.Equal(new object[] { 1, 3 }, owner.SelectedItems.Cast<object>()); 6561Assert.Equal(new object[] { 3 }, owner.SelectedItems.Cast<object>()); 6569Assert.Empty(owner.SelectedItems); 6584owner.SelectedItems.Add(1); 6602Assert.Equal(new object[] { 1 }, owner.SelectedItems.Cast<object>()); 6613Assert.Equal(new object[] { 1 }, owner.SelectedItems.Cast<object>()); 6624Assert.Empty(owner.SelectedItems); 6646owner.SelectedItems.Add(1); 6664Assert.Equal(new object[] { 1 }, owner.SelectedItems.Cast<object>()); 6675Assert.Equal(new object[] { 1 }, owner.SelectedItems.Cast<object>()); 6686Assert.Empty(owner.SelectedItems); 6711owner.SelectedItems.Add(1); 6712owner.SelectedItems.Add(3); 6725Assert.Equal(new object[] { 1, 3 }, owner.SelectedItems.Cast<object>()); 6735Assert.Equal(new object[] { 1, 3 }, owner.SelectedItems.Cast<object>()); 6745Assert.Equal(new object[] { 3 }, owner.SelectedItems.Cast<object>()); 6755Assert.Empty(owner.SelectedItems); 6779owner.SelectedItems.Add(1); 6780owner.SelectedItems.Add(3); 6793Assert.Equal(new object[] { 1, 3 }, owner.SelectedItems.Cast<object>()); 6803Assert.Equal(new object[] { 1, 3 }, owner.SelectedItems.Cast<object>()); 6813Assert.Equal(new object[] { 3 }, owner.SelectedItems.Cast<object>()); 6823Assert.Empty(owner.SelectedItems); 7482owner.SelectedItems.Add(1); 7488Assert.Equal(new object[] { 1 }, owner.SelectedItems.Cast<object>()); 7496Assert.Equal(new object[] { 1 }, owner.SelectedItems.Cast<object>()); 7504Assert.Equal(new object[] { 2 }, owner.SelectedItems.Cast<object>()); 7512Assert.Equal(new object[] { 2 }, owner.SelectedItems.Cast<object>()); 7531owner.SelectedItems.Add(1); 7537Assert.Equal(new object[] { 1 }, owner.SelectedItems.Cast<object>()); 7545Assert.Equal(new object[] { 1 }, owner.SelectedItems.Cast<object>()); 7553Assert.Equal(new object[] { 2 }, owner.SelectedItems.Cast<object>()); 7561Assert.Equal(new object[] { 2 }, owner.SelectedItems.Cast<object>()); 7583owner.SelectedItems.Add(1); 7584owner.SelectedItems.Add(3); 7590Assert.Equal(new object[] { 1, 3 }, owner.SelectedItems.Cast<object>()); 7598Assert.Equal(new object[] { 1, 3 }, owner.SelectedItems.Cast<object>()); 7606Assert.Equal(new object[] { 2, 3 }, owner.SelectedItems.Cast<object>()); 7614Assert.Equal(new object[] { 2, 3 }, owner.SelectedItems.Cast<object>()); 7622Assert.Equal(new object[] { 2, 4 }, owner.SelectedItems.Cast<object>()); 7630Assert.Equal(new object[] { 2, 4 }, owner.SelectedItems.Cast<object>()); 7653owner.SelectedItems.Add(1); 7654owner.SelectedItems.Add(3); 7660Assert.Equal(new object[] { 1, 3 }, owner.SelectedItems.Cast<object>()); 7668Assert.Equal(new object[] { 1, 3 }, owner.SelectedItems.Cast<object>()); 7676Assert.Equal(new object[] { 2, 3 }, owner.SelectedItems.Cast<object>()); 7684Assert.Equal(new object[] { 2, 3 }, owner.SelectedItems.Cast<object>()); 7692Assert.Equal(new object[] { 2, 4 }, owner.SelectedItems.Cast<object>()); 7700Assert.Equal(new object[] { 2, 4 }, owner.SelectedItems.Cast<object>()); 7716owner.SelectedItems.Add(1); 7734Assert.Equal(new object[] { 1 }, owner.SelectedItems.Cast<object>()); 7745Assert.Equal(new object[] { 1 }, owner.SelectedItems.Cast<object>()); 7756Assert.Equal(new object[] { 2 }, owner.SelectedItems.Cast<object>()); 7767Assert.Equal(new object[] { 2 }, owner.SelectedItems.Cast<object>()); 7789owner.SelectedItems.Add(1); 7807Assert.Equal(new object[] { 1 }, owner.SelectedItems.Cast<object>()); 7818Assert.Equal(new object[] { 1 }, owner.SelectedItems.Cast<object>()); 7829Assert.Equal(new object[] { 2 }, owner.SelectedItems.Cast<object>()); 7840Assert.Equal(new object[] { 2 }, owner.SelectedItems.Cast<object>()); 7865owner.SelectedItems.Add(1); 7866owner.SelectedItems.Add(3); 7884Assert.Equal(new object[] { 1, 3 }, owner.SelectedItems.Cast<object>()); 7895Assert.Equal(new object[] { 1, 3 }, owner.SelectedItems.Cast<object>()); 7906Assert.Equal(new object[] { 2, 3 }, owner.SelectedItems.Cast<object>()); 7917Assert.Equal(new object[] { 2, 3 }, owner.SelectedItems.Cast<object>()); 7928Assert.Equal(new object[] { 2 }, owner.SelectedItems.Cast<object>()); 7939Assert.Equal(new object[] { 2 }, owner.SelectedItems.Cast<object>()); 7965owner.SelectedItems.Add(1); 7966owner.SelectedItems.Add(3); 7984Assert.Equal(new object[] { 1, 3 }, owner.SelectedItems.Cast<object>()); 7995Assert.Equal(new object[] { 1, 3 }, owner.SelectedItems.Cast<object>()); 8006Assert.Equal(new object[] { 2, 3 }, owner.SelectedItems.Cast<object>()); 8017Assert.Equal(new object[] { 2, 3 }, owner.SelectedItems.Cast<object>()); 8028Assert.Equal(new object[] { 2 }, owner.SelectedItems.Cast<object>()); 8039Assert.Equal(new object[] { 2 }, owner.SelectedItems.Cast<object>()); 8601owner.SelectedItems.Add(1); 8607Assert.Equal(new object[] { 1 }, owner.SelectedItems.Cast<object>()); 8615Assert.Equal(new object[] { 1 }, owner.SelectedItems.Cast<object>()); 8633owner.SelectedItems.Add(1); 8639Assert.Equal(new object[] { 1 }, owner.SelectedItems.Cast<object>()); 8647Assert.Equal(new object[] { 1 }, owner.SelectedItems.Cast<object>()); 8668owner.SelectedItems.Add(1); 8669owner.SelectedItems.Add(3); 8675Assert.Equal(new object[] { 1, 3 }, owner.SelectedItems.Cast<object>()); 8683Assert.Equal(new object[] { 1, 3 }, owner.SelectedItems.Cast<object>()); 8691Assert.Equal(new object[] { 1, 3 }, owner.SelectedItems.Cast<object>()); 8712owner.SelectedItems.Add(1); 8713owner.SelectedItems.Add(3); 8719Assert.Equal(new object[] { 1, 3 }, owner.SelectedItems.Cast<object>()); 8726Assert.Equal(new object[] { 1, 3 }, owner.SelectedItems.Cast<object>()); 8733Assert.Equal(new object[] { 1, 3 }, owner.SelectedItems.Cast<object>()); 8747owner.SelectedItems.Add(1); 8760Assert.Equal(new object[] { 1 }, owner.SelectedItems.Cast<object>()); 8771Assert.Equal(new object[] { 1 }, owner.SelectedItems.Cast<object>()); 8792owner.SelectedItems.Add(1); 8805Assert.Equal(new object[] { 1 }, owner.SelectedItems.Cast<object>()); 8816Assert.Equal(new object[] { 1 }, owner.SelectedItems.Cast<object>()); 8840owner.SelectedItems.Add(1); 8841owner.SelectedItems.Add(3); 8854Assert.Equal(new object[] { 1, 3 }, owner.SelectedItems.Cast<object>()); 8865Assert.Equal(new object[] { 1, 3 }, owner.SelectedItems.Cast<object>()); 8876Assert.Equal(new object[] { 1, 3 }, owner.SelectedItems.Cast<object>()); 8900owner.SelectedItems.Add(1); 8901owner.SelectedItems.Add(3); 8914Assert.Equal(new object[] { 1, 3 }, owner.SelectedItems.Cast<object>()); 8925Assert.Equal(new object[] { 1, 3 }, owner.SelectedItems.Cast<object>()); 8936Assert.Equal(new object[] { 1, 3 }, owner.SelectedItems.Cast<object>()); 9941owner.SelectedItems.Add(1); 9947Assert.Equal(new object[] { 1 }, owner.SelectedItems.Cast<object>()); 9955Assert.Equal(new object[] { 1 }, owner.SelectedItems.Cast<object>()); 9973owner.SelectedItems.Add(1); 9977Assert.Equal(new object[] { 1 }, owner.SelectedItems.Cast<object>()); 9983Assert.Equal(new object[] { 1 }, owner.SelectedItems.Cast<object>()); 10002owner.SelectedItems.Add(1); 10003owner.SelectedItems.Add(3); 10009Assert.Equal(new object[] { 1, 3 }, owner.SelectedItems.Cast<object>()); 10017Assert.Equal(new object[] { 1, 3 }, owner.SelectedItems.Cast<object>()); 10025Assert.Equal(new object[] { 1, 3 }, owner.SelectedItems.Cast<object>()); 10046owner.SelectedItems.Add(1); 10047owner.SelectedItems.Add(3); 10051Assert.Equal(new object[] { 1, 3 }, owner.SelectedItems.Cast<object>()); 10058Assert.Equal(new object[] { 1, 3 }, owner.SelectedItems.Cast<object>()); 10065Assert.Equal(new object[] { 1, 3 }, owner.SelectedItems.Cast<object>()); 10079owner.SelectedItems.Add(1); 10092Assert.Equal(new object[] { 1 }, owner.SelectedItems.Cast<object>()); 10103Assert.Equal(new object[] { 1 }, owner.SelectedItems.Cast<object>()); 10124owner.SelectedItems.Add(1); 10137Assert.Equal(new object[] { 1 }, owner.SelectedItems.Cast<object>()); 10148Assert.Equal(new object[] { 1 }, owner.SelectedItems.Cast<object>()); 10172owner.SelectedItems.Add(1); 10173owner.SelectedItems.Add(3); 10186Assert.Equal(new object[] { 1, 3 }, owner.SelectedItems.Cast<object>()); 10197Assert.Equal(new object[] { 1, 3 }, owner.SelectedItems.Cast<object>()); 10208Assert.Equal(new object[] { 1, 3 }, owner.SelectedItems.Cast<object>()); 10232owner.SelectedItems.Add(1); 10233owner.SelectedItems.Add(3); 10246Assert.Equal(new object[] { 1, 3 }, owner.SelectedItems.Cast<object>()); 10257Assert.Equal(new object[] { 1, 3 }, owner.SelectedItems.Cast<object>()); 10268Assert.Equal(new object[] { 1, 3 }, owner.SelectedItems.Cast<object>()); 10868owner.SelectedItems.Add(1); 10874Assert.Equal(new object[] { 1 }, owner.SelectedItems.Cast<object>()); 10882Assert.Equal(new object[] { 1 }, owner.SelectedItems.Cast<object>()); 10890Assert.Empty(owner.SelectedItems); 10909owner.SelectedItems.Add(1); 10915Assert.Equal(new object[] { 1 }, owner.SelectedItems.Cast<object>()); 10923Assert.Equal(new object[] { 1 }, owner.SelectedItems.Cast<object>()); 10931Assert.Empty(owner.SelectedItems); 10953owner.SelectedItems.Add(1); 10954owner.SelectedItems.Add(3); 10960Assert.Equal(new object[] { 1, 3 }, owner.SelectedItems.Cast<object>()); 10968Assert.Equal(new object[] { 1, 3 }, owner.SelectedItems.Cast<object>()); 10976Assert.Equal(new object[] { 3 }, owner.SelectedItems.Cast<object>()); 10984Assert.Empty(owner.SelectedItems); 11005owner.SelectedItems.Add(1); 11006owner.SelectedItems.Add(3); 11012Assert.Equal(new object[] { 1, 3 }, owner.SelectedItems.Cast<object>()); 11020Assert.Equal(new object[] { 1, 3 }, owner.SelectedItems.Cast<object>()); 11028Assert.Equal(new object[] { 3 }, owner.SelectedItems.Cast<object>()); 11036Assert.Empty(owner.SelectedItems); 11051owner.SelectedItems.Add(1); 11069Assert.Equal(new object[] { 1 }, owner.SelectedItems.Cast<object>()); 11080Assert.Equal(new object[] { 1 }, owner.SelectedItems.Cast<object>()); 11091Assert.Empty(owner.SelectedItems); 11113owner.SelectedItems.Add(1); 11131Assert.Equal(new object[] { 1 }, owner.SelectedItems.Cast<object>()); 11142Assert.Equal(new object[] { 1 }, owner.SelectedItems.Cast<object>()); 11153Assert.Empty(owner.SelectedItems); 11178owner.SelectedItems.Add(1); 11179owner.SelectedItems.Add(3); 11192Assert.Equal(new object[] { 1, 3 }, owner.SelectedItems.Cast<object>()); 11202Assert.Equal(new object[] { 1, 3 }, owner.SelectedItems.Cast<object>()); 11212Assert.Equal(new object[] { 3 }, owner.SelectedItems.Cast<object>()); 11222Assert.Empty(owner.SelectedItems); 11246owner.SelectedItems.Add(1); 11247owner.SelectedItems.Add(3); 11260Assert.Equal(new object[] { 1, 3 }, owner.SelectedItems.Cast<object>()); 11270Assert.Equal(new object[] { 1, 3 }, owner.SelectedItems.Cast<object>()); 11280Assert.Equal(new object[] { 3 }, owner.SelectedItems.Cast<object>()); 11290Assert.Empty(owner.SelectedItems); 11723owner.SelectedItems.Add(1); 11729Assert.Equal(new object[] { 1 }, owner.SelectedItems.Cast<object>()); 11737Assert.Equal(new object[] { 1 }, owner.SelectedItems.Cast<object>()); 11745Assert.Empty(owner.SelectedItems); 11764owner.SelectedItems.Add(1); 11770Assert.Equal(new object[] { 1 }, owner.SelectedItems.Cast<object>()); 11778Assert.Equal(new object[] { 1 }, owner.SelectedItems.Cast<object>()); 11786Assert.Empty(owner.SelectedItems); 11808owner.SelectedItems.Add(1); 11809owner.SelectedItems.Add(3); 11815Assert.Equal(new object[] { 1, 3 }, owner.SelectedItems.Cast<object>()); 11823Assert.Equal(new object[] { 1, 3 }, owner.SelectedItems.Cast<object>()); 11831Assert.Equal(new object[] { 3 }, owner.SelectedItems.Cast<object>()); 11839Assert.Empty(owner.SelectedItems); 11860owner.SelectedItems.Add(1); 11861owner.SelectedItems.Add(3); 11867Assert.Equal(new object[] { 1, 3 }, owner.SelectedItems.Cast<object>()); 11875Assert.Equal(new object[] { 1, 3 }, owner.SelectedItems.Cast<object>()); 11883Assert.Equal(new object[] { 3 }, owner.SelectedItems.Cast<object>()); 11891Assert.Empty(owner.SelectedItems); 11906owner.SelectedItems.Add(1); 11924Assert.Equal(new object[] { 1 }, owner.SelectedItems.Cast<object>()); 11935Assert.Equal(new object[] { 1 }, owner.SelectedItems.Cast<object>()); 11946Assert.Empty(owner.SelectedItems); 11968owner.SelectedItems.Add(1); 11986Assert.Equal(new object[] { 1 }, owner.SelectedItems.Cast<object>()); 11997Assert.Equal(new object[] { 1 }, owner.SelectedItems.Cast<object>()); 12008Assert.Empty(owner.SelectedItems); 12033owner.SelectedItems.Add(1); 12034owner.SelectedItems.Add(3); 12047Assert.Equal(new object[] { 1, 3 }, owner.SelectedItems.Cast<object>()); 12057Assert.Equal(new object[] { 1, 3 }, owner.SelectedItems.Cast<object>()); 12067Assert.Equal(new object[] { 3 }, owner.SelectedItems.Cast<object>()); 12077Assert.Empty(owner.SelectedItems); 12101owner.SelectedItems.Add(1); 12102owner.SelectedItems.Add(3); 12115Assert.Equal(new object[] { 1, 3 }, owner.SelectedItems.Cast<object>()); 12125Assert.Equal(new object[] { 1, 3 }, owner.SelectedItems.Cast<object>()); 12135Assert.Equal(new object[] { 3 }, owner.SelectedItems.Cast<object>()); 12145Assert.Empty(owner.SelectedItems);
System\Windows\Forms\ListBoxTests.cs (96)
114Assert.Empty(control.SelectedItems); 115Assert.Same(control.SelectedItems, control.SelectedItems); 2334Assert.Empty(control.SelectedItems); 2342Assert.Empty(control.SelectedItems); 2362Assert.Equal("item2", Assert.Single(control.SelectedItems)); 2370Assert.Equal("item2", Assert.Single(control.SelectedItems)); 2377Assert.Equal("item1", Assert.Single(control.SelectedItems)); 2385Assert.Empty(control.SelectedItems); 2407Assert.Equal("item2", Assert.Single(control.SelectedItems)); 2415Assert.Equal("item2", Assert.Single(control.SelectedItems)); 2423Assert.Equal(new string[] { "item1", "item2" }, control.SelectedItems.Cast<string>()); 2431Assert.Empty(control.SelectedItems); 2457Assert.Equal("item2", Assert.Single(control.SelectedItems)); 2466Assert.Equal("item2", Assert.Single(control.SelectedItems)); 2475Assert.Equal("item1", Assert.Single(control.SelectedItems)); 2484Assert.Empty(control.SelectedItems); 2512Assert.Equal("item2", Assert.Single(control.SelectedItems)); 2523Assert.Equal("item2", Assert.Single(control.SelectedItems)); 2533Assert.Equal("item1", Assert.Single(control.SelectedItems)); 2544Assert.Empty(control.SelectedItems); 2576Assert.Equal("item2", Assert.Single(control.SelectedItems)); 2587Assert.Equal("item2", Assert.Single(control.SelectedItems)); 2598Assert.Equal(new string[] { "item1", "item2" }, control.SelectedItems.Cast<string>()); 2609Assert.Empty(control.SelectedItems); 2800Assert.Empty(control.SelectedItems); 2808Assert.Empty(control.SelectedItems); 2828Assert.Equal("item2", Assert.Single(control.SelectedItems)); 2836Assert.Equal("item2", Assert.Single(control.SelectedItems)); 2844Assert.Equal("item2", Assert.Single(control.SelectedItems)); 2851Assert.Equal("item1", Assert.Single(control.SelectedItems)); 2859Assert.Empty(control.SelectedItems); 2881Assert.Equal("item2", Assert.Single(control.SelectedItems)); 2889Assert.Equal("item2", Assert.Single(control.SelectedItems)); 2897Assert.Equal("item2", Assert.Single(control.SelectedItems)); 2905Assert.Equal(new string[] { "item1", "item2" }, control.SelectedItems.Cast<string>()); 2913Assert.Empty(control.SelectedItems); 2939Assert.Equal("item2", Assert.Single(control.SelectedItems)); 2948Assert.Equal("item2", Assert.Single(control.SelectedItems)); 2957Assert.Equal("item2", Assert.Single(control.SelectedItems)); 2966Assert.Equal("item1", Assert.Single(control.SelectedItems)); 2975Assert.Empty(control.SelectedItems); 3003Assert.Equal("item2", Assert.Single(control.SelectedItems)); 3014Assert.Equal("item2", Assert.Single(control.SelectedItems)); 3025Assert.Equal("item2", Assert.Single(control.SelectedItems)); 3035Assert.Equal("item1", Assert.Single(control.SelectedItems)); 3046Assert.Empty(control.SelectedItems); 3078Assert.Equal("item2", Assert.Single(control.SelectedItems)); 3089Assert.Equal("item2", Assert.Single(control.SelectedItems)); 3100Assert.Equal("item2", Assert.Single(control.SelectedItems)); 3111Assert.Equal(new string[] { "item1", "item2" }, control.SelectedItems.Cast<string>()); 3122Assert.Empty(control.SelectedItems); 3367Assert.Empty(control.SelectedItems); 3376Assert.Empty(control.SelectedItems); 3405Assert.Empty(control.SelectedItems); 3414Assert.Empty(control.SelectedItems); 3434Assert.Equal("item2", Assert.Single(control.SelectedItems)); 3443Assert.Equal("item2", Assert.Single(control.SelectedItems)); 3452Assert.Equal("item2", Assert.Single(control.SelectedItems)); 3470Assert.Equal("item2", Assert.Single(control.SelectedItems)); 3479Assert.Equal("item2", Assert.Single(control.SelectedItems)); 3488Assert.Equal("item2", Assert.Single(control.SelectedItems)); 3512Assert.Equal(new string[] { "item1", "item2" }, control.SelectedItems.Cast<object>()); 3521Assert.Equal(new string[] { "item1", "item2" }, control.SelectedItems.Cast<object>()); 3530Assert.Equal(new string[] { "item1", "item2" }, control.SelectedItems.Cast<object>()); 3554Assert.Equal(new string[] { "item1", "item2" }, control.SelectedItems.Cast<object>()); 3563Assert.Equal(new string[] { "item1", "item2" }, control.SelectedItems.Cast<object>()); 3572Assert.Equal(new string[] { "item1", "item2" }, control.SelectedItems.Cast<object>()); 3608Assert.Empty(control.SelectedItems); 3659Assert.Empty(control.SelectedItems); 3671Assert.Empty(control.SelectedItems); 3701Assert.Equal("item2", Assert.Single(control.SelectedItems)); 3713Assert.Equal("item2", Assert.Single(control.SelectedItems)); 3725Assert.Equal("item2", Assert.Single(control.SelectedItems)); 3753Assert.Empty(control.SelectedItems); 3765Assert.Empty(control.SelectedItems); 3777Assert.Empty(control.SelectedItems); 3811Assert.Equal("item2", Assert.Single(control.SelectedItems)); 3823Assert.Equal("item2", Assert.Single(control.SelectedItems)); 3835Assert.Equal("item2", Assert.Single(control.SelectedItems)); 3869Assert.Empty(control.SelectedItems); 3881Assert.Empty(control.SelectedItems); 3893Assert.Empty(control.SelectedItems); 6128Assert.Single(listBox.SelectedItems); 6136Assert.Single(listBox.SelectedItems); 6144Assert.Single(listBox.SelectedItems); 6163listBox.SelectedItems.Add(listBox.Items[0]); 6164listBox.SelectedItems.Add(listBox.Items[1]); 6170Assert.Equal(2, listBox.SelectedItems.Count); 6178Assert.Equal(2, listBox.SelectedItems.Count); 6186Assert.Equal(2, listBox.SelectedItems.Count); 6211Assert.Single(listBox.SelectedItems); 6220Assert.Empty(listBox.SelectedItems); 6242listBox.SelectedItems.Add(listBox.Items[0]); 6247Assert.Single(listBox.SelectedItems); 6257Assert.Empty(listBox.SelectedItems);