67 references to None
System.Windows.Forms (22)
System\Windows\Forms\Controls\ListBoxes\CheckedListBox.cs (7)
195
if (value is not SelectionMode.One and not SelectionMode.
None
)
581
Color backColor = (SelectionMode != SelectionMode.
None
) ? e.BackColor : BackColor;
582
Color foreColor = (SelectionMode != SelectionMode.
None
) ? e.ForeColor : ForeColor;
594
if (SelectionMode != SelectionMode.
None
&& (e.State & DrawItemState.Selected) == DrawItemState.Selected)
717
Color backColor = (SelectionMode != SelectionMode.
None
) ? e.BackColor : BackColor;
728
Color foreColor = (SelectionMode != SelectionMode.
None
) ? e.ForeColor : ForeColor;
777
if (e.KeyChar == ' ' && SelectionMode != SelectionMode.
None
)
System\Windows\Forms\Controls\ListBoxes\ListBox.AccessibleObject.cs (2)
37
=> this.IsOwnerHandleCreated(out ListBox? owner) && owner.SelectionMode != SelectionMode.
None
;
42
&& owner.SelectionMode != SelectionMode.
None
;
System\Windows\Forms\Controls\ListBoxes\ListBox.cs (11)
311
case SelectionMode.
None
:
810
return _selectionMode != SelectionMode.
None
;
832
if (current == SelectionMode.
None
)
854
if (_selectionMode == SelectionMode.
None
)
1062
if (SelectionMode != SelectionMode.
None
&& SelectedItem is not null)
1084
if (SelectionMode != SelectionMode.
None
&& value is not null && (SelectedItem is null || !value.Equals(GetItemText(SelectedItem))))
1635
Debug.Assert(_selectionMode != SelectionMode.
None
, "Guard against setting selection for None selection mode outside this code.");
1784
if (_selectionMode != SelectionMode.
None
)
1937
if (SelectionMode != SelectionMode.
None
&& DataManager is not null)
2007
if (SelectionMode != SelectionMode.
None
)
2149
if (_selectionMode == SelectionMode.
None
)
System\Windows\Forms\Controls\ListBoxes\ListBox.ItemAccessibleObject.cs (1)
186
|| _owningListBox.SelectionMode == SelectionMode.
None
System\Windows\Forms\Controls\ListBoxes\ListBox.SelectedObjectCollection.cs (1)
41
case SelectionMode.
None
:
System.Windows.Forms.Tests (45)
CheckedListBoxTests.cs (1)
92
[InlineData(SelectionMode.
None
)]
System\Windows\Forms\AccessibleObjects\ListBoxAccessibleObjectTests.cs (2)
161
[InlineData(SelectionMode.
None
, false)]
182
[InlineData(SelectionMode.
None
, false)]
System\Windows\Forms\ListBoxTests.cs (42)
295
[InlineData(SelectionMode.
None
, 0x562140C1)]
2751
SelectionMode = SelectionMode.
None
3263
SelectionMode = SelectionMode.
None
3274
SelectionMode = SelectionMode.
None
3465
control.SelectionMode = SelectionMode.
None
;
3466
Assert.Equal(SelectionMode.
None
, control.SelectionMode);
3474
control.SelectionMode = SelectionMode.
None
;
3475
Assert.Equal(SelectionMode.
None
, control.SelectionMode);
3549
control.SelectionMode = SelectionMode.
None
;
3550
Assert.Equal(SelectionMode.
None
, control.SelectionMode);
3558
control.SelectionMode = SelectionMode.
None
;
3559
Assert.Equal(SelectionMode.
None
, control.SelectionMode);
3577
[InlineData(SelectionMode.
None
, 1)]
3617
yield return new object[] { SelectionMode.
None
, SelectionMode.
None
, 0 };
3618
yield return new object[] { SelectionMode.
None
, SelectionMode.MultiExtended, 1 };
3619
yield return new object[] { SelectionMode.
None
, SelectionMode.MultiSimple, 1 };
3620
yield return new object[] { SelectionMode.
None
, SelectionMode.One, 1 };
3622
yield return new object[] { SelectionMode.MultiExtended, SelectionMode.
None
, 1 };
3627
yield return new object[] { SelectionMode.MultiSimple, SelectionMode.
None
, 1 };
3632
yield return new object[] { SelectionMode.One, SelectionMode.
None
, 1 };
3748
control.SelectionMode = SelectionMode.
None
;
3749
Assert.Equal(SelectionMode.
None
, control.SelectionMode);
3760
control.SelectionMode = SelectionMode.
None
;
3761
Assert.Equal(SelectionMode.
None
, control.SelectionMode);
3864
control.SelectionMode = SelectionMode.
None
;
3865
Assert.Equal(SelectionMode.
None
, control.SelectionMode);
3876
control.SelectionMode = SelectionMode.
None
;
3877
Assert.Equal(SelectionMode.
None
, control.SelectionMode);
4136
yield return new object[] { formattingEnabled, SelectionMode.
None
, null, string.Empty, -1 };
4137
yield return new object[] { formattingEnabled, SelectionMode.
None
, string.Empty, string.Empty, -1 };
4138
yield return new object[] { formattingEnabled, SelectionMode.
None
, "NoSuchItem", "NoSuchItem", -1 };
4139
yield return new object[] { formattingEnabled, SelectionMode.
None
, "item1", "item1", -1 };
4140
yield return new object[] { formattingEnabled, SelectionMode.
None
, "ITEM1", "ITEM1", -1 };
4141
yield return new object[] { formattingEnabled, SelectionMode.
None
, "item2", "item2", -1 };
4184
yield return new object[] { formattingEnabled, SelectionMode.
None
, null, string.Empty, -1 };
4185
yield return new object[] { formattingEnabled, SelectionMode.
None
, string.Empty, string.Empty, -1 };
4186
yield return new object[] { formattingEnabled, SelectionMode.
None
, "NoSuchItem", "NoSuchItem", -1 };
4187
yield return new object[] { formattingEnabled, SelectionMode.
None
, "item1", "item1", -1 };
4188
yield return new object[] { formattingEnabled, SelectionMode.
None
, "ITEM1", "ITEM1", -1 };
4189
yield return new object[] { formattingEnabled, SelectionMode.
None
, "item2", "item2", -1 };
6324
listBox.SelectionMode = SelectionMode.
None
;