8 writes to Items
System.Windows.Forms.Tests (4)
System\Windows\Forms\AccessibleObjects\ListBoxAccessibleObjectTests.cs (1)
347using ListBox listBox = new() { Parent = form, Items = { "Item 1", "Item 2" } };
System\Windows\Forms\ListBoxTests.cs (3)
6291Items = { "Item1", "Item2", "Item3" } 6357Items = { "Item 1", "Item 2", "Item 3" } 6381Items = { "Item 1", "Item 2", "Item 3" }
System.Windows.Forms.UI.IntegrationTests (4)
ListBoxAccesibleObjectTests.cs (2)
36using ListBox listBox = new() { Parent = form, Items = { "Item 1", "Item 2" } }; 50using ListBox listBox = new() { Parent = form, Items = { "Item 1", "Item 2" } };
ListBoxItemAccessibleObjestTests.cs (2)
38using ListBox listBoxDoubleClick = new() { Items = { "Item 1" }, Parent = formDoubleClick }; 44using ListBox listBoxNullAction = new ListBox { Items = { "Item 2" } };
1023 references to Items
Accessibility_Core_App (1)
CommonControl1.Designer.cs (1)
576this.listBox1.Items.AddRange(new object[] {
DesignSurface (1)
MainForm.cs (1)
205lb1.Items.AddRange(new string[] { "a1", "b2", "c3" });
PresentationUI (13)
MS\Internal\Documents\CredentialManagerDialog.cs (3)
75_credListBox.SelectedIndex = _credListBox.Items.IndexOf(defaultAccount); 113(string) _credListBox.Items[_credListBox.SelectedIndex]); 128(string)_credListBox.Items[_credListBox.SelectedIndex]);
MS\Internal\Documents\SignatureSummaryDialog.cs (10)
311_listBoxSummary.Items.Add(signatureResources); 322if (_showRequestDialog && _listBoxSummary.Items.Count > 0) 352(SignatureResources)_listBoxSummary.Items[_listBoxSummary.SelectedIndex], 378(SignatureResources)_listBoxSummary.Items[_listBoxSummary.SelectedIndex], 411_listBoxSummary.Items[_listBoxSummary.SelectedIndex] 444_listBoxSummary.Items.Clear(); 477if (_documentSignatureManager.HasCertificate((SignatureResources)_listBoxSummary.Items[_listBoxSummary.SelectedIndex])) 524(SignatureResources)_listBoxSummary.Items[e.Index] 590if (e.Index > -1 && e.Index < _listBoxSummary.Items.Count) 593SignatureResources item = (SignatureResources)_listBoxSummary.Items[e.Index];
System.Windows.Forms (49)
System\Windows\Forms\Controls\ListBoxes\CheckedListBox.cs (1)
171return (ObjectCollection)base.Items;
System\Windows\Forms\Controls\ListBoxes\ListBox.AccessibleObject.cs (6)
80int childCount = this.TryGetOwnerAs(out ListBox? owner) ? owner.Items.Count : 0; 148IReadOnlyList<ItemArray.Entry?> entries = owner.Items.InnerArray.Entries; 193if (index < 0 || index >= owner.Items.Count || owner.Items.InnerArray.Count == 0) 198ItemArray.Entry? item = owner.Items.InnerArray.Entries[index]; 216return this.TryGetOwnerAs(out ListBox? owner) ? owner.Items.Count : 0;
System\Windows\Forms\Controls\ListBoxes\ListBox.cs (24)
22[DefaultProperty(nameof(Items))] 635if (Items.Count == _itemsCount) 640_itemsCount = Items.Count; 844return Items.IndexOfIdentifier(SelectedItems.GetObjectAt(0)); 1086int cnt = Items.Count; 1089if (string.Compare(value, GetItemText(Items[index]), true, CultureInfo.CurrentCulture) == 0) 1183Items.AddRangeInternal(value); 1272ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(index, Items.Count); 1300string?[] strings = new string[Items.Count]; 1302for (int i = 0; i < Items.Count; i++) 1304strings[i] = GetItemText(Items[i]); 1657int cnt = Items.Count; 1883AccessibilityObject?.GetChild(Items.Count - 1)?.RaiseAutomationEvent(UIA_EVENT_ID.UIA_AutomationFocusChangedEventId); 1922Items.ClearInternal(); 1952int cnt = Items.Count; 2003Items.AddRangeInternal(newItems); 2036Items.SetItemInternal(index, Items[index]); 2101Items.ClearInternal(); 2102Items.AddRangeInternal(value); 2135Items.SetItemInternal(index, value); 2213s += $", Items.Count: {Items.Count}"; 2214if (Items.Count > 0) 2216string? z = GetItemText(Items[0]);
System\Windows\Forms\Controls\ListBoxes\ListBox.ItemAccessibleObject.cs (3)
28protected int CurrentIndex => _owningListBox.Items.InnerArray.IndexOf(_itemEntry); 132int lastItemIndex = _owningListBox.Items.Count - 1; 220int itemsCount = _owningListBox.Items.Count;
System\Windows\Forms\Controls\ListBoxes\ListBox.ObjectCollection.cs (1)
244int cnt = _owner.Items.Count;
System\Windows\Forms\Controls\ListBoxes\ListBox.SelectedIndexCollection.cs (3)
167return _owner.Items.InnerArray; 189ObjectCollection items = _owner.Items; 204ObjectCollection items = _owner.Items;
System\Windows\Forms\Controls\ListBoxes\ListBox.SelectedObjectCollection.cs (4)
114return _owner.Items.InnerArray; 233bool selected = _owner.Items.InnerArray.GetState(index, SelectedObjectMask); 259ObjectCollection items = _owner.Items; 275ObjectCollection items = _owner.Items;
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\PropertyGridView.cs (5)
2260if (DropDownListBox.Items.Count == 0) 2290string text = (string)DropDownListBox.Items[e.Index]; 3680DropDownListBox.Items.Clear(); 3705DropDownListBox.Items.Add(value); 3727bool resizable = DropDownListBox.Items.Count > (DropDownListBox.Height / DropDownListBox.ItemHeight);
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\PropertyGridView.DropDownHolder.cs (1)
589if (listBox.Items.Count == 0)
System\Windows\Forms\MDI\MDIWindowDialog.cs (1)
49int n = _itemList.Items.Add(new ListItem(all[i]));
System.Windows.Forms.Design (116)
System\ComponentModel\Design\CollectionEditor.CollectionEditorCollectionForm.cs (36)
141_listBox.Items.Add(created); 153UpdateItemWidths(_listBox.Items[^1] as ListItem); 164_listBox.SelectedIndex = _listBox.Items.Count - 1; 166object[] items = new object[_listBox.Items.Count]; 169items[i] = ((ListItem)_listBox.Items[i]).Value; 176if (_listBox.Items.Count > 0 && _listBox.SelectedIndex != _listBox.Items.Count - 1) 179_listBox.SelectedIndex = _listBox.Items.Count - 1; 211int c = Math.Max(2, _listBox.Items.Count); 245_listBox.Items.Clear(); 321if (index == _listBox.Items.Count - 1) 327(_listBox.Items[index + 1], _listBox.Items[index]) = (_listBox.Items[index], _listBox.Items[index + 1]); 329if (ti < _listBox.Items.Count - 1) 537foreach (ListItem i in _listBox.Items) 557ListItem item = (ListItem)_listBox.Items[e.Index]; 561int c = _listBox.Items.Count; 677object[] items = new object[_listBox.Items.Count]; 680items[i] = ((ListItem)_listBox.Items[i]).Value; 701_listBox.Items.Clear(); 747_listBox.Items.Clear(); 757_listBox.Items.Add(new ListItem(_editor, items[i])); 761if (_listBox.Items.Count > 0) 821if (index < _listBox.Items.Count) 825else if (_listBox.Items.Count > 0) 827_listBox.SelectedIndex = _listBox.Items.Count - 1; 882_listBox.Items.Remove(item); 893_listBox.Items.Remove(item); 996(_listBox.Items[index - 1], _listBox.Items[index]) = (_listBox.Items[index], _listBox.Items[index - 1]); 1033_upButton.Enabled = editEnabled && _listBox.Items.Count > 1; 1034_downButton.Enabled = editEnabled && _listBox.Items.Count > 1;
System\ComponentModel\Design\DesignerActionPanel.EditorPropertyLine.cs (3)
67listBox.Items.Add(newItem); 87if (listBox.Items.Count > 0) 89foreach (string s in listBox.Items)
System\Drawing\Design\ColorEditor.ColorUI.cs (5)
208_lbCommon.Items.Clear(); 211_lbCommon.Items.Add(color); 214_lbSystem.Items.Clear(); 217_lbSystem.Items.Add(color); 258Color value = (Color)lb.Items[die.Index];
System\Drawing\Design\CursorEditor.CursorUI.cs (4)
37Items.Add(obj); 63Cursor cursor = (Cursor)Items[e.Index]; 96for (int i = 0; i < Items.Count; i++) 98if (Items[i] == value)
System\Windows\Forms\Design\DataGridViewAddColumnDialog.cs (5)
179bool dataGridViewIsDataBound = _dataColumns.Items.Count > 0; 708_dataColumns.Items.Clear(); 738_dataColumns.Items.Add(new ListBoxItem(propertyDescriptor.PropertyType, propertyDescriptor.Name)); 743_dataColumns.SelectedIndex = selectedIndex != -1 && selectedIndex < _dataColumns.Items.Count 745: _dataColumns.Items.Count > 0 ? 0 : -1;
System\Windows\Forms\Design\DataGridViewColumnCollectionDialog.cs (36)
143_selectedColumns.Items.RemoveAt(selectedIndex); 144_selectedColumns.Items.Insert(selectedIndex, new ListBoxItem(newColumn!, this, newColumnDesigner)); 288if (e.Component is ListBoxItem && _selectedColumns.Items.Contains(e.Component)) 663Debug.Assert(selectedIndex > -1 && selectedIndex < _selectedColumns.Items.Count - 1); 669_selectedColumns.Items.RemoveAt(selectedIndex); 670_selectedColumns.Items.Insert(selectedIndex + 1, item); 703_moveDown.Enabled = _selectedColumns.SelectedIndex < _selectedColumns.Items.Count - 1; 714ListBoxItem item = (ListBoxItem)_selectedColumns.Items[selectedIndex - 1]; 715_selectedColumns.Items.RemoveAt(selectedIndex - 1); 716_selectedColumns.Items.Insert(selectedIndex, item); 747_moveDown.Enabled = _selectedColumns.SelectedIndex < _selectedColumns.Items.Count - 1; 761for (int i = 0; i < _selectedColumns.Items.Count; i++) 763ListBoxItem? lbi = _selectedColumns.Items[i] as ListBoxItem; 805_selectedColumns.SelectedIndex = Math.Min(0, _selectedColumns.Items.Count - 1); 808_moveDown.Enabled = _selectedColumns.SelectedIndex < _selectedColumns.Items.Count - 1; 809_deleteButton.Enabled = _selectedColumns.Items.Count > 0 && _selectedColumns.SelectedIndex != -1; 834_selectedColumns.SelectedIndex = Math.Min(_selectedColumns.Items.Count - 1, selectedIndex); 837_moveDown.Enabled = _selectedColumns.SelectedIndex < _selectedColumns.Items.Count - 1; 838_deleteButton.Enabled = _selectedColumns.Items.Count > 0 && _selectedColumns.SelectedIndex != -1; 844int insertIndex = _selectedColumns.SelectedIndex == -1 ? _selectedColumns.Items.Count : _selectedColumns.SelectedIndex + 1; 863for (int i = 0; i < _selectedColumns.Items.Count; i++) 865ListBoxItem? lbi = _selectedColumns.Items[i] as ListBoxItem; 872_selectedColumns.Items.Clear(); 878_selectedColumns.Items.Add(new ListBoxItem(_columnsPrivateCopy[i], this, columnDesigner)); 881_selectedColumns.SelectedIndex = Math.Min(selectedIndex, _selectedColumns.Items.Count - 1); 885if (_selectedColumns.Items.Count == 0) 910_selectedColumns.Items[selectedIndex] = _selectedColumns.Items[selectedIndex]; 954ListBoxItem? listBoxItem = _selectedColumns.Items[e.Index] as ListBoxItem; 999string columnName = ((ListBoxItem)_selectedColumns.Items[e.Index]).ToString(); 1066_moveDown.Enabled = _selectedColumns.Items.Count > 0 && _selectedColumns.SelectedIndex != _selectedColumns.Items.Count - 1; 1067_moveUp.Enabled = _selectedColumns.Items.Count > 0 && _selectedColumns.SelectedIndex > 0; 1068_deleteButton.Enabled = _selectedColumns.Items.Count > 0 && _selectedColumns.SelectedIndex != -1; 1158for (int i = 0; i < _selectedColumns.Items.Count; i++) 1160int itemWidth = TextRenderer.MeasureText(_selectedColumns.Items[i].ToString(), _selectedColumns.Font).Width;
System\Windows\Forms\Design\DataGridViewColumnTypeEditor.Picker.cs (6)
47for (int i = 0; i < _typesListBox.Items.Count; i++) 49ListBoxItem item = (ListBoxItem)_typesListBox.Items[i]; 81_typesListBox.Items.Clear(); 108_typesListBox.Items.Add(new ListBoxItem(t)); 127for (int i = 0; i < _typesListBox.Items.Count; i++) 129if (type == ((ListBoxItem)_typesListBox.Items[i]).ColumnType)
System\Windows\Forms\Design\FormatControl.cs (19)
48for (int i = 0; i < formatTypeListBox.Items.Count; i++) 50var formatType = (FormatTypeClass)formatTypeListBox.Items[i]; 328dateTimeFormatsListBox.Items.Clear(); 329dateTimeFormatsListBox.Items.Add(new DateTimeFormatsListBoxItem(s_dateTimeFormatValue, "d")); 330dateTimeFormatsListBox.Items.Add(new DateTimeFormatsListBoxItem(s_dateTimeFormatValue, "D")); 331dateTimeFormatsListBox.Items.Add(new DateTimeFormatsListBoxItem(s_dateTimeFormatValue, "f")); 332dateTimeFormatsListBox.Items.Add(new DateTimeFormatsListBoxItem(s_dateTimeFormatValue, "F")); 333dateTimeFormatsListBox.Items.Add(new DateTimeFormatsListBoxItem(s_dateTimeFormatValue, "g")); 334dateTimeFormatsListBox.Items.Add(new DateTimeFormatsListBoxItem(s_dateTimeFormatValue, "G")); 335dateTimeFormatsListBox.Items.Add(new DateTimeFormatsListBoxItem(s_dateTimeFormatValue, "t")); 336dateTimeFormatsListBox.Items.Add(new DateTimeFormatsListBoxItem(s_dateTimeFormatValue, "T")); 337dateTimeFormatsListBox.Items.Add(new DateTimeFormatsListBoxItem(s_dateTimeFormatValue, "M")); 389formatTypeListBox.Items.Clear(); 390formatTypeListBox.Items.Add(new NoFormattingFormatType()); 391formatTypeListBox.Items.Add(new NumericFormatType(this)); 392formatTypeListBox.Items.Add(new CurrencyFormatType(this)); 393formatTypeListBox.Items.Add(new DateTimeFormatType(this)); 394formatTypeListBox.Items.Add(new ScientificFormatType(this)); 395formatTypeListBox.Items.Add(new CustomFormatType(this));
System\Windows\Forms\Design\ListBoxDesigner.cs (2)
155&& e.Member.Name == nameof(ListBox.Items) 184if (listBox.IsHandleCreated && listBox.Items.Count == 0)
System.Windows.Forms.Tests (829)
System\Windows\Forms\AccessibleObjects\ListBox.ListBoxItemAccessibleObjectTests.cs (7)
52listBox.Items.Add(item: "testItem"); 75listBox.Items.Add(item: "testItem"); 91listBox.Items.Add(item: "testItem"); 108listBox.Items.Add(item: "testItem"); 124listBox.Items.Add(item: "testItem"); 155listBox.Items.Add(item: "testItem"); 169listBox.Items.Add("Item 1");
System\Windows\Forms\AccessibleObjects\ListBoxAccessibleObjectTests.cs (10)
114listBox.Items.Clear(); 124ItemArray.Entry item = listBox.Items.InnerArray.Entries[0]; 127listBox.Items.Remove(item); 148listBox.Items.Add(item: "testItem"); 153listBox.Items.Clear(); 222listBox.Items.AddRange((object[]) 257listBox.Items.AddRange(new[] { "Item 1", "Item 2" }); 282listBox.Items.Add($"Item {i + 1}"); 294listBox.Items.AddRange(new[] { "Item 1", "Item 2" }); 315listBox.Items.AddRange(new[] { "Item 1", "Item 2", "Item 3" });
System\Windows\Forms\ControlTests.cs (1)
1050listBox1.Items.AddRange((object[])["Foo", "Foo", "Foo"]);
System\Windows\Forms\ListBox.ObjectCollectionTests.cs (546)
17Assert.Empty(owner.Items); 28Assert.Empty(owner.Items); 41Assert.Empty(owner.Items); 68Assert.Empty(owner.Items); 170Assert.Empty(owner.Items); 177Assert.Empty(owner.Items); 184Assert.Empty(owner.Items); 191Assert.Empty(owner.Items); 211Assert.Empty(owner.Items); 218Assert.Empty(owner.Items); 225Assert.Empty(owner.Items); 232Assert.Empty(owner.Items); 241ListBox.ObjectCollection collection = owner.Items; 249Assert.Equal(new int[] { 4, 1, 3 }, owner.Items.Cast<int>()); 256Assert.Equal(new int[] { 4, 2, 3 }, owner.Items.Cast<int>()); 263Assert.Equal(new int[] { 4, 2, 5 }, owner.Items.Cast<int>()); 270Assert.Equal(new int[] { 4, 2, 5 }, owner.Items.Cast<int>()); 282ListBox.ObjectCollection collection = owner.Items; 290Assert.Equal(new int[] { 4, 2, 3 }, owner.Items.Cast<int>()); 297Assert.Equal(new int[] { 4, 1, 3 }, owner.Items.Cast<int>()); 304Assert.Equal(new int[] { 4, 1, 5 }, owner.Items.Cast<int>()); 311Assert.Equal(new int[] { 4, 1, 5 }, owner.Items.Cast<int>()); 497ListBox.ObjectCollection collection = owner.Items; 513Assert.Equal(new int[] { 4, 1, 3 }, owner.Items.Cast<int>()); 530Assert.Equal(new int[] { 4, 2, 3 }, owner.Items.Cast<int>()); 547Assert.Equal(new int[] { 4, 2, 5 }, owner.Items.Cast<int>()); 564Assert.Equal(new int[] { 4, 2, 5 }, owner.Items.Cast<int>()); 586ListBox.ObjectCollection collection = owner.Items; 602Assert.Equal(new int[] { 4, 2, 3 }, owner.Items.Cast<int>()); 619Assert.Equal(new int[] { 4, 1, 3 }, owner.Items.Cast<int>()); 636Assert.Equal(new int[] { 4, 1, 5 }, owner.Items.Cast<int>()); 653Assert.Equal(new int[] { 4, 1, 5 }, owner.Items.Cast<int>()); 672ListBox.ObjectCollection collection = owner.Items; 721ListBox.ObjectCollection collection = owner.Items; 772ListBox.ObjectCollection collection = owner.Items; 842ListBox.ObjectCollection collection = owner.Items; 906ListBox.ObjectCollection collection = owner.Items; 979ListBox.ObjectCollection collection = owner.Items; 1054ListBox.ObjectCollection collection = owner.Items; 1154ListBox.ObjectCollection collection = owner.Items; 1308Assert.Empty(owner.Items); 1316Assert.Empty(owner.Items); 1324Assert.Empty(owner.Items); 1332Assert.Empty(owner.Items); 1341ListBox.ObjectCollection collection = owner.Items; 1349Assert.Equal(new object[] { 2 }, owner.Items.Cast<object>()); 1357Assert.Equal(new object[] { 2, 1 }, owner.Items.Cast<object>()); 1365Assert.Equal(new object[] { 2, 1, 1 }, owner.Items.Cast<object>()); 1373Assert.Equal(new object[] { 2, 1, 1, 3 }, owner.Items.Cast<object>()); 1393Assert.Empty(owner.Items); 1401Assert.Empty(owner.Items); 1409Assert.Empty(owner.Items); 1417Assert.Empty(owner.Items); 1429ListBox.ObjectCollection collection = owner.Items; 1437Assert.Equal(new object[] { 2 }, owner.Items.Cast<object>()); 1445Assert.Equal(new object[] { 1, 2 }, owner.Items.Cast<object>()); 1453Assert.Equal(new object[] { 1, 1, 2 }, owner.Items.Cast<object>()); 1461Assert.Equal(new object[] { 1, 1, 2, 3 }, owner.Items.Cast<object>()); 1484Assert.Empty(owner.Items); 1497Assert.Empty(owner.Items); 1512Assert.Empty(owner.Items); 1529Assert.Empty(owner.Items); 1549ListBox.ObjectCollection collection = owner.Items; 1563Assert.Equal(new object[] { 2 }, owner.Items.Cast<object>()); 1576Assert.Equal(new object[] { 2, 1 }, owner.Items.Cast<object>()); 1591Assert.Equal(new object[] { 2, 1, 1 }, owner.Items.Cast<object>()); 1608Assert.Equal(new object[] { 2, 1, 1, 3 }, owner.Items.Cast<object>()); 1645Assert.Empty(owner.Items); 1658Assert.Empty(owner.Items); 1673Assert.Empty(owner.Items); 1690Assert.Empty(owner.Items); 1713ListBox.ObjectCollection collection = owner.Items; 1727Assert.Equal(new object[] { 2 }, owner.Items.Cast<object>()); 1740Assert.Equal(new object[] { 1, 2 }, owner.Items.Cast<object>()); 1755Assert.Equal(new object[] { 1, 1, 2 }, owner.Items.Cast<object>()); 1772Assert.Equal(new object[] { 1, 1, 2, 3 }, owner.Items.Cast<object>()); 1792ListBox.ObjectCollection collection = owner.Items; 1824ListBox.ObjectCollection collection = owner.Items; 1858ListBox.ObjectCollection collection = owner.Items; 1903ListBox.ObjectCollection collection = owner.Items; 1938ListBox.ObjectCollection collection = owner.Items; 1983ListBox.ObjectCollection collection = owner.Items; 2030ListBox.ObjectCollection collection = owner.Items; 2091ListBox.ObjectCollection collection = owner.Items; 2161ListBox.ObjectCollection collection = owner.Items; 2226Assert.Empty(owner.Items); 2234Assert.Empty(owner.Items); 2243ListBox.ObjectCollection collection = owner.Items; 2250Assert.Equal(new object[] { 2, 1, 1, 3 }, owner.Items.Cast<object>()); 2258Assert.Equal(new object[] { 2, 1, 1, 3 }, owner.Items.Cast<object>()); 2277Assert.Empty(owner.Items); 2285Assert.Empty(owner.Items); 2297ListBox.ObjectCollection collection = owner.Items; 2304Assert.Equal(new object[] { 1, 1, 2, 3 }, owner.Items.Cast<object>()); 2312Assert.Equal(new object[] { 1, 1, 2, 3 }, owner.Items.Cast<object>()); 2334Assert.Empty(owner.Items); 2353Assert.Empty(owner.Items); 2373ListBox.ObjectCollection collection = owner.Items; 2386Assert.Equal(new object[] { 2, 1, 1, 3 }, owner.Items.Cast<object>()); 2405Assert.Equal(new object[] { 2, 1, 1, 3 }, owner.Items.Cast<object>()); 2441Assert.Empty(owner.Items); 2460Assert.Empty(owner.Items); 2483ListBox.ObjectCollection collection = owner.Items; 2496Assert.Equal(new object[] { 1, 1, 2, 3 }, owner.Items.Cast<object>()); 2515Assert.Equal(new object[] { 1, 1, 2, 3 }, owner.Items.Cast<object>()); 2535ListBox.ObjectCollection collection = owner.Items; 2566ListBox.ObjectCollection collection = owner.Items; 2599ListBox.ObjectCollection collection = owner.Items; 2635ListBox.ObjectCollection collection = owner.Items; 2662ListBox.ObjectCollection collection = owner.Items; 2706ListBox.ObjectCollection collection = owner.Items; 2752ListBox.ObjectCollection collection = owner.Items; 2801ListBox.ObjectCollection collection = owner.Items; 2854ListBox.ObjectCollection collection = owner.Items; 2883Assert.Empty(owner.Items); 2893Assert.Empty(owner.Items); 2902ListBox.ObjectCollection collection = owner.Items; 2912Assert.Equal(new object[] { 2, 1, 1, 3 }, owner.Items.Cast<object>()); 2922Assert.Equal(new object[] { 2, 1, 1, 3 }, owner.Items.Cast<object>()); 2944Assert.Empty(owner.Items); 2954Assert.Empty(owner.Items); 2966ListBox.ObjectCollection collection = owner.Items; 2976Assert.Equal(new object[] { 1, 1, 2, 3 }, owner.Items.Cast<object>()); 2986Assert.Equal(new object[] { 1, 1, 2, 3 }, owner.Items.Cast<object>()); 3011Assert.Empty(owner.Items); 3032Assert.Empty(owner.Items); 3052ListBox.ObjectCollection collection = owner.Items; 3068Assert.Equal(new object[] { 2, 1, 1, 3 }, owner.Items.Cast<object>()); 3089Assert.Equal(new object[] { 2, 1, 1, 3 }, owner.Items.Cast<object>()); 3128Assert.Empty(owner.Items); 3149Assert.Empty(owner.Items); 3172ListBox.ObjectCollection collection = owner.Items; 3188Assert.Equal(new object[] { 1, 1, 2, 3 }, owner.Items.Cast<object>()); 3209Assert.Equal(new object[] { 1, 1, 2, 3 }, owner.Items.Cast<object>()); 3229ListBox.ObjectCollection collection = owner.Items; 3265ListBox.ObjectCollection collection = owner.Items; 3303ListBox.ObjectCollection collection = owner.Items; 3344ListBox.ObjectCollection collection = owner.Items; 3376ListBox.ObjectCollection collection = owner.Items; 3425ListBox.ObjectCollection collection = owner.Items; 3476ListBox.ObjectCollection collection = owner.Items; 3530ListBox.ObjectCollection collection = owner.Items; 3591ListBox.ObjectCollection collection = owner.Items; 3705Assert.Empty(owner.Items); 3707Assert.Empty(owner.Items); 3713Assert.Empty(owner.Items); 3715Assert.Empty(owner.Items); 3723ListBox.ObjectCollection collection = owner.Items; 3726Assert.Empty(owner.Items); 3728Assert.Empty(owner.Items); 3734Assert.Empty(owner.Items); 3736Assert.Empty(owner.Items); 3751Assert.Empty(owner.Items); 3753Assert.Empty(owner.Items); 3759Assert.Empty(owner.Items); 3761Assert.Empty(owner.Items); 3769ListBox.ObjectCollection collection = owner.Items; 3774Assert.Empty(owner.Items); 3776Assert.Empty(owner.Items); 3782Assert.Empty(owner.Items); 3784Assert.Empty(owner.Items); 3803Assert.Empty(owner.Items); 3805Assert.Empty(owner.Items); 3815Assert.Empty(owner.Items); 3817Assert.Empty(owner.Items); 3829ListBox.ObjectCollection collection = owner.Items; 3840Assert.Empty(owner.Items); 3842Assert.Empty(owner.Items); 3852Assert.Empty(owner.Items); 3854Assert.Empty(owner.Items); 3878Assert.Empty(owner.Items); 3880Assert.Empty(owner.Items); 3890Assert.Empty(owner.Items); 3892Assert.Empty(owner.Items); 3904ListBox.ObjectCollection collection = owner.Items; 3916Assert.Empty(owner.Items); 3918Assert.Empty(owner.Items); 3928Assert.Empty(owner.Items); 3930Assert.Empty(owner.Items); 4131Assert.Empty(owner.Items); 4139Assert.Empty(owner.Items); 4147Assert.Empty(owner.Items); 4155Assert.Empty(owner.Items); 4164ListBox.ObjectCollection collection = owner.Items; 4172Assert.Equal(new object[] { 1 }, owner.Items.Cast<object>()); 4180Assert.Equal(new object[] { 2, 1 }, owner.Items.Cast<object>()); 4188Assert.Equal(new object[] { 2, 2, 1 }, owner.Items.Cast<object>()); 4196Assert.Equal(new object[] { 2, 2, 1, 3 }, owner.Items.Cast<object>()); 4216Assert.Empty(owner.Items); 4224Assert.Empty(owner.Items); 4232Assert.Empty(owner.Items); 4240Assert.Empty(owner.Items); 4252ListBox.ObjectCollection collection = owner.Items; 4260Assert.Equal(new object[] { 1 }, owner.Items.Cast<object>()); 4268Assert.Equal(new object[] { 1, 2 }, owner.Items.Cast<object>()); 4276Assert.Equal(new object[] { 1, 2, 2 }, owner.Items.Cast<object>()); 4284Assert.Equal(new object[] { 1, 2, 2, 3 }, owner.Items.Cast<object>()); 4307Assert.Empty(owner.Items); 4320Assert.Empty(owner.Items); 4335Assert.Empty(owner.Items); 4352Assert.Empty(owner.Items); 4372ListBox.ObjectCollection collection = owner.Items; 4386Assert.Equal(new object[] { 1 }, owner.Items.Cast<object>()); 4399Assert.Equal(new object[] { 2, 1 }, owner.Items.Cast<object>()); 4414Assert.Equal(new object[] { 2, 2, 1 }, owner.Items.Cast<object>()); 4431Assert.Equal(new object[] { 2, 2, 1, 3 }, owner.Items.Cast<object>()); 4468Assert.Empty(owner.Items); 4481Assert.Empty(owner.Items); 4496Assert.Empty(owner.Items); 4513Assert.Empty(owner.Items); 4536ListBox.ObjectCollection collection = owner.Items; 4550Assert.Equal(new object[] { 1 }, owner.Items.Cast<object>()); 4563Assert.Equal(new object[] { 1, 2 }, owner.Items.Cast<object>()); 4578Assert.Equal(new object[] { 1, 2, 2 }, owner.Items.Cast<object>()); 4595Assert.Equal(new object[] { 1, 2, 2, 3 }, owner.Items.Cast<object>()); 4615ListBox.ObjectCollection collection = owner.Items; 4647ListBox.ObjectCollection collection = owner.Items; 4675ListBox.ObjectCollection collection = owner.Items; 4720ListBox.ObjectCollection collection = owner.Items; 4753ListBox.ObjectCollection collection = owner.Items; 4798ListBox.ObjectCollection collection = owner.Items; 4845ListBox.ObjectCollection collection = owner.Items; 4906ListBox.ObjectCollection collection = owner.Items; 4974ListBox.ObjectCollection collection = owner.Items; 5070Assert.Empty(owner.Items); 5078Assert.Empty(owner.Items); 5086Assert.Empty(owner.Items); 5094Assert.Empty(owner.Items); 5103ListBox.ObjectCollection collection = owner.Items; 5114Assert.Equal(new int[] { 2, 3 }, owner.Items.Cast<int>()); 5121Assert.Equal(new int[] { 2, 3 }, owner.Items.Cast<int>()); 5128Assert.Equal(new int[] { 2 }, owner.Items.Cast<int>()); 5135Assert.Empty(owner.Items); 5160Assert.Empty(owner.Items); 5168Assert.Empty(owner.Items); 5176Assert.Empty(owner.Items); 5184Assert.Empty(owner.Items); 5196ListBox.ObjectCollection collection = owner.Items; 5207Assert.Equal(new int[] { 1, 3 }, owner.Items.Cast<int>()); 5214Assert.Equal(new int[] { 1, 3 }, owner.Items.Cast<int>()); 5221Assert.Equal(new int[] { 1 }, owner.Items.Cast<int>()); 5228Assert.Empty(owner.Items); 5254Assert.Empty(owner.Items); 5269Assert.Empty(owner.Items); 5284Assert.Empty(owner.Items); 5297Assert.Empty(owner.Items); 5309ListBox.ObjectCollection collection = owner.Items; 5328Assert.Equal(new int[] { 2, 3 }, owner.Items.Cast<int>()); 5344Assert.Equal(new int[] { 2, 3 }, owner.Items.Cast<int>()); 5360Assert.Equal(new int[] { 2 }, owner.Items.Cast<int>()); 5374Assert.Empty(owner.Items); 5406Assert.Empty(owner.Items); 5421Assert.Empty(owner.Items); 5436Assert.Empty(owner.Items); 5449Assert.Empty(owner.Items); 5464ListBox.ObjectCollection collection = owner.Items; 5483Assert.Equal(new int[] { 1, 3 }, owner.Items.Cast<int>()); 5499Assert.Equal(new int[] { 1, 3 }, owner.Items.Cast<int>()); 5515Assert.Equal(new int[] { 1 }, owner.Items.Cast<int>()); 5529Assert.Empty(owner.Items); 5541ListBox.ObjectCollection collection = owner.Items; 5582ListBox.ObjectCollection collection = owner.Items; 5625ListBox.ObjectCollection collection = owner.Items; 5678ListBox.ObjectCollection collection = owner.Items; 5724ListBox.ObjectCollection collection = owner.Items; 5786ListBox.ObjectCollection collection = owner.Items; 5850ListBox.ObjectCollection collection = owner.Items; 5919ListBox.ObjectCollection collection = owner.Items; 6017Assert.Empty(owner.Items); 6025Assert.Empty(owner.Items); 6033Assert.Empty(owner.Items); 6042ListBox.ObjectCollection collection = owner.Items; 6053Assert.Equal(new int[] { 2, 3 }, owner.Items.Cast<int>()); 6060Assert.Equal(new int[] { 2 }, owner.Items.Cast<int>()); 6067Assert.Empty(owner.Items); 6092Assert.Empty(owner.Items); 6100Assert.Empty(owner.Items); 6108Assert.Empty(owner.Items); 6120ListBox.ObjectCollection collection = owner.Items; 6131Assert.Equal(new int[] { 1, 3 }, owner.Items.Cast<int>()); 6138Assert.Equal(new int[] { 1 }, owner.Items.Cast<int>()); 6145Assert.Empty(owner.Items); 6171Assert.Empty(owner.Items); 6186Assert.Empty(owner.Items); 6199Assert.Empty(owner.Items); 6211ListBox.ObjectCollection collection = owner.Items; 6230Assert.Equal(new int[] { 2, 3 }, owner.Items.Cast<int>()); 6246Assert.Equal(new int[] { 2 }, owner.Items.Cast<int>()); 6260Assert.Empty(owner.Items); 6292Assert.Empty(owner.Items); 6307Assert.Empty(owner.Items); 6320Assert.Empty(owner.Items); 6335ListBox.ObjectCollection collection = owner.Items; 6354Assert.Equal(new int[] { 1, 3 }, owner.Items.Cast<int>()); 6370Assert.Equal(new int[] { 1 }, owner.Items.Cast<int>()); 6384Assert.Empty(owner.Items); 6396ListBox.ObjectCollection collection = owner.Items; 6437ListBox.ObjectCollection collection = owner.Items; 6480ListBox.ObjectCollection collection = owner.Items; 6533ListBox.ObjectCollection collection = owner.Items; 6579ListBox.ObjectCollection collection = owner.Items; 6641ListBox.ObjectCollection collection = owner.Items; 6705ListBox.ObjectCollection collection = owner.Items; 6774ListBox.ObjectCollection collection = owner.Items; 6959Assert.Empty(owner.Items); 6966Assert.Empty(owner.Items); 6973Assert.Empty(owner.Items); 6980Assert.Empty(owner.Items); 7004Assert.Empty(owner.Items); 7011Assert.Empty(owner.Items); 7018Assert.Empty(owner.Items); 7025Assert.Empty(owner.Items); 7034IList collection = owner.Items; 7044Assert.Equal(new int[] { 4, 1, 3 }, owner.Items.Cast<int>()); 7051Assert.Equal(new int[] { 4, 2, 3 }, owner.Items.Cast<int>()); 7058Assert.Equal(new int[] { 4, 2, 5 }, owner.Items.Cast<int>()); 7065Assert.Equal(new int[] { 4, 2, 5 }, owner.Items.Cast<int>()); 7077IList collection = owner.Items; 7087Assert.Equal(new int[] { 4, 2, 3 }, owner.Items.Cast<int>()); 7094Assert.Equal(new int[] { 4, 1, 3 }, owner.Items.Cast<int>()); 7101Assert.Equal(new int[] { 4, 1, 5 }, owner.Items.Cast<int>()); 7108Assert.Equal(new int[] { 4, 1, 5 }, owner.Items.Cast<int>()); 7298IList collection = owner.Items; 7316Assert.Equal(new int[] { 4, 1, 3 }, owner.Items.Cast<int>()); 7333Assert.Equal(new int[] { 4, 2, 3 }, owner.Items.Cast<int>()); 7350Assert.Equal(new int[] { 4, 2, 5 }, owner.Items.Cast<int>()); 7367Assert.Equal(new int[] { 4, 2, 5 }, owner.Items.Cast<int>()); 7389IList collection = owner.Items; 7407Assert.Equal(new int[] { 4, 2, 3 }, owner.Items.Cast<int>()); 7424Assert.Equal(new int[] { 4, 1, 3 }, owner.Items.Cast<int>()); 7441Assert.Equal(new int[] { 4, 1, 5 }, owner.Items.Cast<int>()); 7458Assert.Equal(new int[] { 4, 1, 5 }, owner.Items.Cast<int>()); 7477IList collection = owner.Items; 7526IList collection = owner.Items; 7577IList collection = owner.Items; 7647IList collection = owner.Items; 7711IList collection = owner.Items; 7784IList collection = owner.Items; 7859IList collection = owner.Items; 7959IList collection = owner.Items; 8113Assert.Empty(owner.Items); 8121Assert.Empty(owner.Items); 8129Assert.Empty(owner.Items); 8137Assert.Empty(owner.Items); 8146IList collection = owner.Items; 8154Assert.Equal(new object[] { 2 }, owner.Items.Cast<object>()); 8162Assert.Equal(new object[] { 2, 1 }, owner.Items.Cast<object>()); 8170Assert.Equal(new object[] { 2, 1, 1 }, owner.Items.Cast<object>()); 8178Assert.Equal(new object[] { 2, 1, 1, 3 }, owner.Items.Cast<object>()); 8198Assert.Empty(owner.Items); 8206Assert.Empty(owner.Items); 8214Assert.Empty(owner.Items); 8222Assert.Empty(owner.Items); 8234IList collection = owner.Items; 8242Assert.Equal(new object[] { 2 }, owner.Items.Cast<object>()); 8250Assert.Equal(new object[] { 1, 2 }, owner.Items.Cast<object>()); 8258Assert.Equal(new object[] { 1, 1, 2 }, owner.Items.Cast<object>()); 8266Assert.Equal(new object[] { 1, 1, 2, 3 }, owner.Items.Cast<object>()); 8289Assert.Empty(owner.Items); 8302Assert.Empty(owner.Items); 8317Assert.Empty(owner.Items); 8334Assert.Empty(owner.Items); 8354IList collection = owner.Items; 8368Assert.Equal(new object[] { 2 }, owner.Items.Cast<object>()); 8381Assert.Equal(new object[] { 2, 1 }, owner.Items.Cast<object>()); 8396Assert.Equal(new object[] { 2, 1, 1 }, owner.Items.Cast<object>()); 8413Assert.Equal(new object[] { 2, 1, 1, 3 }, owner.Items.Cast<object>()); 8450Assert.Empty(owner.Items); 8463Assert.Empty(owner.Items); 8478Assert.Empty(owner.Items); 8495Assert.Empty(owner.Items); 8518IList collection = owner.Items; 8532Assert.Equal(new object[] { 2 }, owner.Items.Cast<object>()); 8545Assert.Equal(new object[] { 1, 2 }, owner.Items.Cast<object>()); 8560Assert.Equal(new object[] { 1, 1, 2 }, owner.Items.Cast<object>()); 8577Assert.Equal(new object[] { 1, 1, 2, 3 }, owner.Items.Cast<object>()); 8597IList collection = owner.Items; 8629IList collection = owner.Items; 8663IList collection = owner.Items; 8708IList collection = owner.Items; 8743IList collection = owner.Items; 8788IList collection = owner.Items; 8835IList collection = owner.Items; 8896IList collection = owner.Items; 8966IList collection = owner.Items; 9027Assert.Empty(owner.Items); 9029Assert.Empty(owner.Items); 9035Assert.Empty(owner.Items); 9037Assert.Empty(owner.Items); 9045IList collection = owner.Items; 9048Assert.Empty(owner.Items); 9050Assert.Empty(owner.Items); 9056Assert.Empty(owner.Items); 9058Assert.Empty(owner.Items); 9073Assert.Empty(owner.Items); 9075Assert.Empty(owner.Items); 9081Assert.Empty(owner.Items); 9083Assert.Empty(owner.Items); 9091IList collection = owner.Items; 9096Assert.Empty(owner.Items); 9098Assert.Empty(owner.Items); 9104Assert.Empty(owner.Items); 9106Assert.Empty(owner.Items); 9125Assert.Empty(owner.Items); 9127Assert.Empty(owner.Items); 9137Assert.Empty(owner.Items); 9139Assert.Empty(owner.Items); 9151IList collection = owner.Items; 9162Assert.Empty(owner.Items); 9164Assert.Empty(owner.Items); 9174Assert.Empty(owner.Items); 9176Assert.Empty(owner.Items); 9200Assert.Empty(owner.Items); 9202Assert.Empty(owner.Items); 9212Assert.Empty(owner.Items); 9214Assert.Empty(owner.Items); 9226IList collection = owner.Items; 9238Assert.Empty(owner.Items); 9240Assert.Empty(owner.Items); 9250Assert.Empty(owner.Items); 9252Assert.Empty(owner.Items); 9453Assert.Empty(owner.Items); 9461Assert.Empty(owner.Items); 9469Assert.Empty(owner.Items); 9477Assert.Empty(owner.Items); 9486IList collection = owner.Items; 9494Assert.Equal(new object[] { 1 }, owner.Items.Cast<object>()); 9502Assert.Equal(new object[] { 2, 1 }, owner.Items.Cast<object>()); 9510Assert.Equal(new object[] { 2, 2, 1 }, owner.Items.Cast<object>()); 9518Assert.Equal(new object[] { 2, 2, 1, 3 }, owner.Items.Cast<object>()); 9538Assert.Empty(owner.Items); 9546Assert.Empty(owner.Items); 9554Assert.Empty(owner.Items); 9562Assert.Empty(owner.Items); 9574IList collection = owner.Items; 9582Assert.Equal(new object[] { 1 }, owner.Items.Cast<object>()); 9590Assert.Equal(new object[] { 1, 2 }, owner.Items.Cast<object>()); 9598Assert.Equal(new object[] { 1, 2, 2 }, owner.Items.Cast<object>()); 9606Assert.Equal(new object[] { 1, 2, 2, 3 }, owner.Items.Cast<object>()); 9629Assert.Empty(owner.Items); 9642Assert.Empty(owner.Items); 9657Assert.Empty(owner.Items); 9674Assert.Empty(owner.Items); 9694IList collection = owner.Items; 9708Assert.Equal(new object[] { 1 }, owner.Items.Cast<object>()); 9721Assert.Equal(new object[] { 2, 1 }, owner.Items.Cast<object>()); 9736Assert.Equal(new object[] { 2, 2, 1 }, owner.Items.Cast<object>()); 9753Assert.Equal(new object[] { 2, 2, 1, 3 }, owner.Items.Cast<object>()); 9790Assert.Empty(owner.Items); 9803Assert.Empty(owner.Items); 9818Assert.Empty(owner.Items); 9835Assert.Empty(owner.Items); 9858IList collection = owner.Items; 9872Assert.Equal(new object[] { 1 }, owner.Items.Cast<object>()); 9885Assert.Equal(new object[] { 1, 2 }, owner.Items.Cast<object>()); 9900Assert.Equal(new object[] { 1, 2, 2 }, owner.Items.Cast<object>()); 9917Assert.Equal(new object[] { 1, 2, 2, 3 }, owner.Items.Cast<object>()); 9937IList collection = owner.Items; 9969IList collection = owner.Items; 9997IList collection = owner.Items; 10042IList collection = owner.Items; 10075IList collection = owner.Items; 10120IList collection = owner.Items; 10167IList collection = owner.Items; 10228IList collection = owner.Items; 10296IList collection = owner.Items; 10392Assert.Empty(owner.Items); 10400Assert.Empty(owner.Items); 10408Assert.Empty(owner.Items); 10416Assert.Empty(owner.Items); 10425IList collection = owner.Items; 10436Assert.Equal(new int[] { 2, 3 }, owner.Items.Cast<int>()); 10443Assert.Equal(new int[] { 2, 3 }, owner.Items.Cast<int>()); 10450Assert.Equal(new int[] { 2 }, owner.Items.Cast<int>()); 10457Assert.Empty(owner.Items); 10482Assert.Empty(owner.Items); 10490Assert.Empty(owner.Items); 10498Assert.Empty(owner.Items); 10506Assert.Empty(owner.Items); 10518IList collection = owner.Items; 10529Assert.Equal(new int[] { 1, 3 }, owner.Items.Cast<int>()); 10536Assert.Equal(new int[] { 1, 3 }, owner.Items.Cast<int>()); 10543Assert.Equal(new int[] { 1 }, owner.Items.Cast<int>()); 10550Assert.Empty(owner.Items); 10576Assert.Empty(owner.Items); 10591Assert.Empty(owner.Items); 10606Assert.Empty(owner.Items); 10619Assert.Empty(owner.Items); 10631IList collection = owner.Items; 10650Assert.Equal(new int[] { 2, 3 }, owner.Items.Cast<int>()); 10666Assert.Equal(new int[] { 2, 3 }, owner.Items.Cast<int>()); 10682Assert.Equal(new int[] { 2 }, owner.Items.Cast<int>()); 10696Assert.Empty(owner.Items); 10728Assert.Empty(owner.Items); 10743Assert.Empty(owner.Items); 10758Assert.Empty(owner.Items); 10771Assert.Empty(owner.Items); 10786IList collection = owner.Items; 10805Assert.Equal(new int[] { 1, 3 }, owner.Items.Cast<int>()); 10821Assert.Equal(new int[] { 1, 3 }, owner.Items.Cast<int>()); 10837Assert.Equal(new int[] { 1 }, owner.Items.Cast<int>()); 10851Assert.Empty(owner.Items); 10863IList collection = owner.Items; 10904IList collection = owner.Items; 10947IList collection = owner.Items; 11000IList collection = owner.Items; 11046IList collection = owner.Items; 11108IList collection = owner.Items; 11172IList collection = owner.Items; 11241IList collection = owner.Items; 11339Assert.Empty(owner.Items); 11347Assert.Empty(owner.Items); 11355Assert.Empty(owner.Items); 11364IList collection = owner.Items; 11375Assert.Equal(new int[] { 2, 3 }, owner.Items.Cast<int>()); 11382Assert.Equal(new int[] { 2 }, owner.Items.Cast<int>()); 11389Assert.Empty(owner.Items); 11414Assert.Empty(owner.Items); 11422Assert.Empty(owner.Items); 11430Assert.Empty(owner.Items); 11442IList collection = owner.Items; 11453Assert.Equal(new int[] { 1, 3 }, owner.Items.Cast<int>()); 11460Assert.Equal(new int[] { 1 }, owner.Items.Cast<int>()); 11467Assert.Empty(owner.Items); 11493Assert.Empty(owner.Items); 11508Assert.Empty(owner.Items); 11521Assert.Empty(owner.Items); 11533IList collection = owner.Items; 11552Assert.Equal(new int[] { 2, 3 }, owner.Items.Cast<int>()); 11568Assert.Equal(new int[] { 2 }, owner.Items.Cast<int>()); 11582Assert.Empty(owner.Items); 11614Assert.Empty(owner.Items); 11629Assert.Empty(owner.Items); 11642Assert.Empty(owner.Items); 11657IList collection = owner.Items; 11676Assert.Equal(new int[] { 1, 3 }, owner.Items.Cast<int>()); 11692Assert.Equal(new int[] { 1 }, owner.Items.Cast<int>()); 11706Assert.Empty(owner.Items); 11718IList collection = owner.Items; 11759IList collection = owner.Items; 11802IList collection = owner.Items; 11855IList collection = owner.Items; 11901IList collection = owner.Items; 11963IList collection = owner.Items; 12027IList collection = owner.Items; 12096IList collection = owner.Items;
System\Windows\Forms\ListBoxTests.cs (265)
87Assert.Empty(control.Items); 88Assert.Same(control.Items, control.Items); 763control.Items.Add("Value"); 1061Assert.Empty(control.Items); 1069Assert.Empty(control.Items); 1081control.Items.Add("item1"); 1082control.Items.Add("item2"); 1083control.Items.Add("item1"); 1089Assert.Equal(new string[] { "item1", "item2", "item1" }, control.Items.Cast<object>()); 1097Assert.Equal(new string[] { "item1", "item2", "item1" }, control.Items.Cast<object>()); 1129Assert.Empty(control.Items); 1140Assert.Empty(control.Items); 1163control.Items.Add("item1"); 1164control.Items.Add("item2"); 1165control.Items.Add("item1"); 1178Assert.Equal(new string[] { "item1", "item2", "item1" }, control.Items.Cast<object>()); 1189Assert.Equal(new string[] { "item1", "item2", "item1" }, control.Items.Cast<object>()); 1486Assert.Empty(control.Items); 1492Assert.Empty(control.Items); 1498Assert.Empty(control.Items); 1510control.Items.Add("item1"); 1511control.Items.Add("item2"); 1512control.Items.Add("item1"); 1516Assert.Equal(new string[] { "item1", "item2", "item1" }, control.Items.Cast<string>()); 1522Assert.Equal(new string[] { "item1", "item2", "item1" }, control.Items.Cast<string>()); 1528Assert.Equal(new string[] { "item1", "item2", "item1" }, control.Items.Cast<string>()); 1558Assert.Empty(control.Items); 1567Assert.Empty(control.Items); 1576Assert.Empty(control.Items); 1599control.Items.Add("item1"); 1600control.Items.Add("item2"); 1601control.Items.Add("item1"); 1612Assert.Equal(new string[] { "item1", "item2", "item1" }, control.Items.Cast<string>()); 1621Assert.Equal(new string[] { "item1", "item2", "item1" }, control.Items.Cast<string>()); 1630Assert.Equal(new string[] { "item1", "item2", "item1" }, control.Items.Cast<string>()); 1860Assert.Same(result, control.Items); 1861Assert.Same(control.Items, control.Items); 2102control.Items.Add("Item1"); 2103control.Items.Add("Item2"); 2156control.Items.Add("Item1"); 2157control.Items.Add("Item2"); 2314control.Items.Add("Item"); 2353control.Items.Add("item1"); 2354control.Items.Add("item2"); 2355control.Items.Add("item1"); 2398control.Items.Add("item1"); 2399control.Items.Add("item2"); 2400control.Items.Add("item1"); 2496control.Items.Add("item1"); 2497control.Items.Add("item2"); 2498control.Items.Add("item1"); 2560control.Items.Add("item1"); 2561control.Items.Add("item2"); 2562control.Items.Add("item1"); 2623control.Items.Add("item1"); 2624control.Items.Add("item2"); 2625control.Items.Add("item1"); 2650control.Items.Add("item1"); 2651control.Items.Add("item2"); 2652control.Items.Add("item1"); 2685control.Items.Add("item1"); 2686control.Items.Add("item2"); 2687control.Items.Add("item1"); 2742control.Items.Add("Item"); 2777control.Items.Add("Item"); 2819control.Items.Add("item1"); 2820control.Items.Add("item2"); 2821control.Items.Add("item1"); 2872control.Items.Add("item1"); 2873control.Items.Add("item2"); 2874control.Items.Add("item1"); 2987control.Items.Add("item1"); 2988control.Items.Add("item2"); 2989control.Items.Add("item1"); 3062control.Items.Add("item1"); 3063control.Items.Add("item2"); 3064control.Items.Add("item1"); 3136control.Items.Add("item1"); 3137control.Items.Add("item2"); 3138control.Items.Add("item1"); 3167control.Items.Add("item1"); 3168control.Items.Add("item2"); 3169control.Items.Add("item1"); 3209control.Items.Add("item1"); 3210control.Items.Add("item2"); 3211control.Items.Add("item1"); 3276control.Items.Add("item"); 3294control.Items.Add("Item0"); 3295control.Items.Add("Item1"); 3296control.Items.Add("Item2"); 3297control.Items.Add("Item3"); 3298control.Items.Add("Item4"); 3424control.Items.Add("item1"); 3425control.Items.Add("item2"); 3426control.Items.Add("item1"); 3460control.Items.Add("item1"); 3461control.Items.Add("item2"); 3462control.Items.Add("item1"); 3501control.Items.Add("item1"); 3502control.Items.Add("item2"); 3503control.Items.Add("item1"); 3543control.Items.Add("item1"); 3544control.Items.Add("item2"); 3545control.Items.Add("item1"); 3684control.Items.Add("item1"); 3685control.Items.Add("item2"); 3686control.Items.Add("item1"); 3736control.Items.Add("item1"); 3737control.Items.Add("item2"); 3738control.Items.Add("item1"); 3793control.Items.Add("item1"); 3794control.Items.Add("item2"); 3795control.Items.Add("item1"); 3851control.Items.Add("item1"); 3852control.Items.Add("item2"); 3853control.Items.Add("item1"); 3917Assert.Empty(control.Items); 3923Assert.Empty(control.Items); 3929Assert.Empty(control.Items); 3938Assert.Empty(control.Items); 3942Assert.Empty(control.Items); 3948Assert.Empty(control.Items); 3954Assert.Empty(control.Items); 3969control.Items.Add("item2"); 3970control.Items.Add("item1"); 3974Assert.Equal(expected, control.Items.Cast<string>()); 3980Assert.Equal(expected, control.Items.Cast<string>()); 3986Assert.Equal(new string[] { "item1", "item2" }, control.Items.Cast<string>()); 4005Assert.Empty(control.Items); 4014Assert.Empty(control.Items); 4023Assert.Empty(control.Items); 4042Assert.Empty(control.Items); 4046Assert.Empty(control.Items); 4055Assert.Empty(control.Items); 4064Assert.Empty(control.Items); 4076control.Items.Add("item2"); 4077control.Items.Add("item1"); 4088Assert.Equal(expected, control.Items.Cast<string>()); 4097Assert.Equal(expected, control.Items.Cast<string>()); 4106Assert.Equal(new string[] { "item1", "item2" }, control.Items.Cast<string>()); 4164control.Items.Add("item1"); 4165control.Items.Add("item2"); 4166control.Items.Add("item1"); 4214control.Items.Add("item1"); 4215control.Items.Add("item2"); 4216control.Items.Add("item1"); 4337control.Items.Add("item1"); 4338control.Items.Add("item2"); 4339control.Items.Add("item1"); 4395control.Items.Add("item1"); 4396control.Items.Add("item2"); 4425control.Items.Add("item1"); 4426control.Items.Add("item2"); 4427control.Items.Add("item1"); 4561Assert.Equal(new string[] { "item1", "item2" }, control.Items.Cast<object>()); 4566Assert.Equal(new string[] { "item1", "item2", "item3" }, control.Items.Cast<object>()); 4571Assert.Equal(new string[] { "item1", "item2", "item3" }, control.Items.Cast<object>()); 4576Assert.Equal(new string[] { "item1", "item2", "item3" }, control.Items.Cast<object>()); 4594Assert.Equal(new string[] { "item1", "item2" }, control.Items.Cast<object>()); 4602Assert.Equal(new string[] { "item1", "item2", "item3" }, control.Items.Cast<object>()); 4610Assert.Equal(new string[] { "item1", "item2", "item3" }, control.Items.Cast<object>()); 4618Assert.Equal(new string[] { "item1", "item2", "item3" }, control.Items.Cast<object>()); 4942Assert.Empty(controlWithNoItems.Items); 4952controlWithItems.Items.Add(new DataClass { Value = "abc" }); 4953controlWithItems.Items.Add(new DataClass { Value = "abc" }); 4954controlWithItems.Items.Add(new DataClass { Value = "ABC" }); 4955controlWithItems.Items.Add(new DataClass { Value = "def" }); 4956controlWithItems.Items.Add(new DataClass { Value = "" }); 4957controlWithItems.Items.Add(new DataClass { Value = null }); 5033control.Items.Add("item"); 5046Assert.Empty(controlWithNoItems.Items); 5056controlWithItems.Items.Add(new DataClass { Value = "abc" }); 5057controlWithItems.Items.Add(new DataClass { Value = "abc" }); 5058controlWithItems.Items.Add(new DataClass { Value = "ABC" }); 5059controlWithItems.Items.Add(new DataClass { Value = "def" }); 5060controlWithItems.Items.Add(new DataClass { Value = "" }); 5061controlWithItems.Items.Add(new DataClass { Value = null }); 5137control.Items.Add("item"); 5170control.Items.Add("Item1"); 5171control.Items.Add("Item2"); 5209control.Items.Add("Item1"); 5210control.Items.Add("Item2"); 5249control.Items.Add("Item1"); 5250control.Items.Add("Item2"); 5280control.Items.Add("Item"); 5319control.Items.Add("Item"); 5327control.Items.Add("Item1"); 5328control.Items.Add("Item1"); 5350control.Items.Add("Item1"); 5351control.Items.Add("Item1"); 5396control.Items.Add("Item"); 5424control.Items.Add("Item"); 5462control.Items.Add("Item"); 5482control.Items.Add("Item"); 5887Assert.Empty(control.Items); 5892Assert.Empty(control.Items); 5900control.Items.Add("item1"); 5901control.Items.Add("item2"); 5904Assert.Equal(new object[] { "item1", "item2" }, control.Items.Cast<object>()); 5909Assert.Equal(new object[] { "item1", "item2" }, control.Items.Cast<object>()); 5926Assert.Empty(control.Items); 5934Assert.Empty(control.Items); 5945control.Items.Add("item1"); 5946control.Items.Add("item2"); 5956Assert.Equal(new object[] { "item1", "item2" }, control.Items.Cast<object>()); 5964Assert.Equal(new object[] { "item1", "item2" }, control.Items.Cast<object>()); 6021Assert.Equal(value, control.Items.Cast<object>()); 6026Assert.Equal(value, control.Items.Cast<object>()); 6044Assert.Equal(value, control.Items.Cast<object>()); 6052Assert.Equal(value, control.Items.Cast<object>()); 6064Assert.Empty(control.Items); 6071control.Items.Add("item1"); 6072control.Items.Add("item2"); 6074Assert.Equal(new object[] { "item1", "item2" }, control.Items.Cast<object>()); 6088Assert.Empty(control.Items); 6104control.Items.Add(item1); 6105control.Items.Add("item2"); 6121listBox.Items.AddRange((object[])["1", "2", "3"]); 6122listBox.SelectedItem = listBox.Items[0]; 6124Assert.Equal(3, listBox.Items.Count); 6125Assert.Equal(listBox.Items[0], listBox.SelectedItem); 6130listBox.Items.Remove(listBox.Items[2]); 6132Assert.Equal(2, listBox.Items.Count); 6133Assert.Equal(listBox.Items[0], listBox.SelectedItem); 6138listBox.Items.Remove(listBox.Items[1]); 6140Assert.Single(listBox.Items); 6141Assert.Equal(listBox.Items[0], listBox.SelectedItem); 6162listBox.Items.AddRange((object[])["1", "2", "3", "4"]); 6163listBox.SelectedItems.Add(listBox.Items[0]); 6164listBox.SelectedItems.Add(listBox.Items[1]); 6166Assert.Equal(4, listBox.Items.Count); 6167Assert.Equal(listBox.Items[0], listBox.SelectedItem); 6172listBox.Items.Remove(listBox.Items[3]); 6174Assert.Equal(3, listBox.Items.Count); 6175Assert.Equal(listBox.Items[0], listBox.SelectedItem); 6180listBox.Items.Remove(listBox.Items[2]); 6182Assert.Equal(2, listBox.Items.Count); 6183Assert.Equal(listBox.Items[0], listBox.SelectedItem); 6202listBox.Items.AddRange((object[])["1", "2", "3"]); 6204for (int count = listBox.Items.Count; count > 1; count -= 1) 6206listBox.SelectedItem = listBox.Items[0]; 6208Assert.Equal(listBox.Items[0], listBox.SelectedItem); 6213listBox.Items.Remove(listBox.Items[0]); 6216Assert.Equal(count, listBox.Items.Count); 6238listBox.Items.AddRange((object[])["1", "2", "3"]); 6240for (int count = listBox.Items.Count; count > 1; count -= 1) 6242listBox.SelectedItems.Add(listBox.Items[0]); 6244Assert.Equal(listBox.Items[0], listBox.SelectedItem); 6249listBox.Items.Remove(listBox.Items[0]); 6253Assert.Equal(count, listBox.Items.Count); 6270listBox.Items.Add(selectedItem); 6313listBox.Items.Add(item); 6316int itemCount = listBox.Items.Count; 6326listBox.Items.Add("Item1"); 6343listBox.Items.Add("Item1"); 6364for (int i = 0; i < listBox.Items.Count; i++) 6388for (int i = 0; i < listBox.Items.Count; i++)
System.Windows.Forms.UI.IntegrationTests (10)
DragDropTests.cs (8)
52Assert.Single(form.ListDragTarget.Items); 413Assert.Equal(2, form.ListDragTarget.Items.Count); 606ListDragSource.Items.AddRange("one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "ten"); 710ListDragSource.Items[_indexOfItemUnderMouseToDrag], 716ListDragSource.Items.RemoveAt(_indexOfItemUnderMouseToDrag); 722else if (ListDragSource.Items.Count > 0) 835ListDragTarget.Items.Insert(_indexOfItemUnderMouseToDrop, item); 837ListDragTarget.Items.Add(item);
ListBoxItemAccessibleObjestTests.cs (2)
16listBox.Items.Add("Test Item"); 54listBox.Items.Add("Test Item");
WinFormsControlsTest (4)
ListBoxes.cs (3)
21listBox.Items.Add(textBox.Text); 28listBox.Items.Clear(); 46e.Graphics.DrawString(listBox.Items[e.Index].ToString(),
ScrollableControls.Designer.cs (1)
428listBox1.Items.AddRange(new object[] { "asdfasdf", "as", "df", "asd", "f", "a", "sd", "f", "asd", "f", "a", "asdfadsf", "sdf" });