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