508 references to CheckState
Accessibility_Core_App (11)
CommonControl1.Designer.cs (1)
292
this.checkBox1.CheckState = System.Windows.Forms.
CheckState
.Checked;
ContainerControls.Designer.cs (1)
339
this.checkBox2.CheckState = System.Windows.Forms.
CheckState
.Checked;
ContainerControls2.Designer.cs (1)
190
this.checkBox2.CheckState = System.Windows.Forms.
CheckState
.Checked;
Menu_Toolbars_controls.Designer.cs (8)
374
checkCheckOnClickToolStripMenuItem.CheckState =
CheckState
.Checked;
382
checkedCheckOnClickFToolStripMenuItem.CheckState =
CheckState
.Checked;
391
indeterminateToolStripMenuItem.CheckState =
CheckState
.Indeterminate;
399
indeterminateCheckOnClickFToolStripMenuItem.CheckState =
CheckState
.Indeterminate;
548
toolStripButton3.CheckState =
CheckState
.Checked;
559
toolStripButton4.CheckState =
CheckState
.Checked;
571
toolStripButton5.CheckState =
CheckState
.Indeterminate;
582
toolStripButton6.CheckState =
CheckState
.Indeterminate;
DesignSurface (2)
MainForm.cs (2)
147
checkbox2.CheckState =
CheckState
.Indeterminate;
150
checkbox3.CheckState =
CheckState
.Checked;
PresentationUI (1)
MS\Internal\Documents\SigningDialog.Designer.cs (1)
120
_addDocPropCheckBox.CheckState = System.Windows.Forms.
CheckState
.Checked;
System.Windows.Forms (273)
System\Windows\Forms\Controls\Buttons\ButtonInternal\ButtonBaseAdapter.cs (6)
36
PaintDown(e,
CheckState
.Unchecked);
40
PaintOver(e,
CheckState
.Unchecked);
44
PaintUp(e,
CheckState
.Unchecked);
62
internal abstract void PaintUp(PaintEventArgs e,
CheckState
state);
64
internal abstract void PaintDown(PaintEventArgs e,
CheckState
state);
66
internal abstract void PaintOver(PaintEventArgs e,
CheckState
state);
System\Windows\Forms\Controls\Buttons\ButtonInternal\ButtonFlatAdapter.cs (25)
21
internal override void PaintUp(PaintEventArgs e,
CheckState
state)
28
|| (SystemInformation.HighContrast ? state !=
CheckState
.Indeterminate : state ==
CheckState
.Unchecked),
29
check: !hasCustomBorder && SystemInformation.HighContrast && state ==
CheckState
.Checked,
46
case
CheckState
.Checked:
49
case
CheckState
.Indeterminate:
58
case
CheckState
.Checked:
61
case
CheckState
.Indeterminate:
99
else if (state ==
CheckState
.Checked && SystemInformation.HighContrast)
104
else if (state ==
CheckState
.Indeterminate)
114
internal override void PaintDown(PaintEventArgs e,
CheckState
state)
121
|| (SystemInformation.HighContrast ? state !=
CheckState
.Indeterminate : state ==
CheckState
.Unchecked),
122
!hasCustomBorder && SystemInformation.HighContrast && state ==
CheckState
.Checked,
143
case
CheckState
.Unchecked:
144
case
CheckState
.Checked:
147
case
CheckState
.Indeterminate:
187
else if (state ==
CheckState
.Checked && SystemInformation.HighContrast)
192
else if (state ==
CheckState
.Indeterminate)
202
internal override void PaintOver(PaintEventArgs e,
CheckState
state)
214
up: !Control.FlatAppearance.CheckedBackColor.IsEmpty || state ==
CheckState
.Unchecked,
233
backColor = state is
CheckState
.Checked or
CheckState
.Indeterminate
239
backColor = state is
CheckState
.Indeterminate
281
else if (state ==
CheckState
.Unchecked)
System\Windows\Forms\Controls\Buttons\ButtonInternal\ButtonPopupAdapter.cs (9)
13
internal override void PaintUp(PaintEventArgs e,
CheckState
state)
16
LayoutData layout = PaintPopupLayout(state ==
CheckState
.Unchecked, 1).Layout();
20
if (state ==
CheckState
.Indeterminate)
40
state !=
CheckState
.Indeterminate && IsHighContrastHighlighted() ? SystemColors.HighlightText : colors.WindowText,
49
if (state ==
CheckState
.Unchecked)
59
internal override void PaintOver(PaintEventArgs e,
CheckState
state)
62
LayoutData layout = PaintPopupLayout(state ==
CheckState
.Unchecked, SystemInformation.HighContrast ? 2 : 1).Layout();
66
if (state ==
CheckState
.Indeterminate)
117
internal override void PaintDown(PaintEventArgs e,
CheckState
state)
System\Windows\Forms\Controls\Buttons\ButtonInternal\ButtonStandardAdapter.cs (6)
40
internal override void PaintUp(PaintEventArgs e,
CheckState
state) => PaintWorker(e, up: true, state);
42
internal override void PaintDown(PaintEventArgs e,
CheckState
state) => PaintWorker(e, up: false, state);
44
internal override void PaintOver(PaintEventArgs e,
CheckState
state) => PaintUp(e, state);
106
private void PaintWorker(PaintEventArgs e, bool up,
CheckState
state)
108
up = up && state ==
CheckState
.Unchecked;
130
if (state ==
CheckState
.Indeterminate)
System\Windows\Forms\Controls\Buttons\ButtonInternal\CheckBoxBaseAdapter.cs (10)
62
if (Control.CheckState ==
CheckState
.Indeterminate)
84
CheckState
controlCheckState,
98
else if (controlCheckState ==
CheckState
.Indeterminate && checkBackground == SystemColors.Window && disabledColors)
126
if (Control.CheckState ==
CheckState
.Indeterminate)
151
CheckState
controlCheckState,
166
else if (controlCheckState ==
CheckState
.Indeterminate)
184
if (controlCheckState ==
CheckState
.Checked)
191
controlCheckState ==
CheckState
.Indeterminate,
236
if (Control.CheckState ==
CheckState
.Unchecked)
262
if (Control.CheckState ==
CheckState
.Indeterminate)
System\Windows\Forms\Controls\Buttons\ButtonInternal\CheckBoxFlatAdapter.cs (3)
14
internal override void PaintDown(PaintEventArgs e,
CheckState
state)
33
internal override void PaintOver(PaintEventArgs e,
CheckState
state)
52
internal override void PaintUp(PaintEventArgs e,
CheckState
state)
System\Windows\Forms\Controls\Buttons\ButtonInternal\CheckBoxPopupAdapter.cs (3)
15
internal override void PaintUp(PaintEventArgs e,
CheckState
state)
50
internal override void PaintOver(PaintEventArgs e,
CheckState
state)
93
internal override void PaintDown(PaintEventArgs e,
CheckState
state)
System\Windows\Forms\Controls\Buttons\ButtonInternal\CheckBoxStandardAdapter.cs (3)
15
internal override void PaintUp(PaintEventArgs e,
CheckState
state)
64
internal override void PaintDown(PaintEventArgs e,
CheckState
state)
76
internal override void PaintOver(PaintEventArgs e,
CheckState
state)
System\Windows\Forms\Controls\Buttons\ButtonInternal\RadioButtonFlatAdapter.cs (9)
14
internal override void PaintDown(PaintEventArgs e,
CheckState
state)
19
adapter.PaintDown(e, Control.Checked ?
CheckState
.Checked :
CheckState
.Unchecked);
34
internal override void PaintOver(PaintEventArgs e,
CheckState
state)
39
adapter.PaintOver(e, Control.Checked ?
CheckState
.Checked :
CheckState
.Unchecked);
54
internal override void PaintUp(PaintEventArgs e,
CheckState
state)
59
adapter.PaintUp(e, Control.Checked ?
CheckState
.Checked :
CheckState
.Unchecked);
System\Windows\Forms\Controls\Buttons\ButtonInternal\RadioButtonPopupAdapter.cs (9)
12
internal override void PaintUp(PaintEventArgs e,
CheckState
state)
17
adapter.PaintUp(e, Control.Checked ?
CheckState
.Checked :
CheckState
.Unchecked);
41
internal override void PaintOver(PaintEventArgs e,
CheckState
state)
46
adapter.PaintOver(e, Control.Checked ?
CheckState
.Checked :
CheckState
.Unchecked);
66
internal override void PaintDown(PaintEventArgs e,
CheckState
state)
71
adapter.PaintDown(e, Control.Checked ?
CheckState
.Checked :
CheckState
.Unchecked);
System\Windows\Forms\Controls\Buttons\ButtonInternal\RadioButtonStandardAdapter.cs (9)
10
internal override void PaintUp(PaintEventArgs e,
CheckState
state)
14
ButtonAdapter.PaintUp(e, Control.Checked ?
CheckState
.Checked :
CheckState
.Unchecked);
29
internal override void PaintDown(PaintEventArgs e,
CheckState
state)
33
ButtonAdapter.PaintDown(e, Control.Checked ?
CheckState
.Checked :
CheckState
.Unchecked);
41
internal override void PaintOver(PaintEventArgs e,
CheckState
state)
45
ButtonAdapter.PaintOver(e, Control.Checked ?
CheckState
.Checked :
CheckState
.Unchecked);
System\Windows\Forms\Controls\Buttons\CheckBox.CheckBoxAccessibleObject.cs (9)
27
CheckState
.Checked => AccessibleStates.Checked | base.State,
28
CheckState
.Indeterminate => AccessibleStates.Indeterminate | base.State,
35
CheckState
.Checked => ToggleState.ToggleState_On,
36
CheckState
.Unchecked => ToggleState.ToggleState_Off,
83
CheckState
.Unchecked =>
CheckState
.Checked,
84
CheckState
.Checked =>
CheckState
.Indeterminate,
85
_ =>
CheckState
.Unchecked
System\Windows\Forms\Controls\Buttons\CheckBox.cs (12)
29
private
CheckState
_checkState;
151
get => _checkState !=
CheckState
.Unchecked;
156
CheckState = value ?
CheckState
.Checked :
CheckState
.Unchecked;
166
[DefaultValue(
CheckState
.Unchecked)]
169
public
CheckState
CheckState
439
case
CheckState
.Unchecked:
440
CheckState =
CheckState
.Checked;
442
case
CheckState
.Checked:
445
CheckState =
CheckState
.Indeterminate;
456
CheckState =
CheckState
.Unchecked;
461
CheckState =
CheckState
.Unchecked;
System\Windows\Forms\Controls\DataGridView\DataGridView.DataConnection.cs (2)
913
if (type.Equals(typeof(bool)) || type.Equals(typeof(
CheckState
)))
915
dataGridViewColumn = new DataGridViewCheckBoxColumn(type.Equals(typeof(
CheckState
)));
System\Windows\Forms\Controls\DataGridView\DataGridViewCheckBoxCell.cs (61)
35
private static readonly Type s_defaultCheckStateType = typeof(
CheckState
);
69
if (value is
CheckState
valueAsCheckState)
71
if (valueAsCheckState ==
CheckState
.Checked)
76
else if (valueAsCheckState ==
CheckState
.Indeterminate)
139
return
CheckState
.Checked;
148
return
CheckState
.Indeterminate;
157
return
CheckState
.Unchecked;
329
private
CheckState
CheckState
337
if ((!EditingCellValueChanged && FormattedValue is
CheckState
checkState && checkState ==
CheckState
.Indeterminate) ||
340
return
CheckState
.Indeterminate;
343
if ((!EditingCellValueChanged && FormattedValue is
CheckState
checkState2 && checkState2 ==
CheckState
.Checked) ||
346
return
CheckState
.Checked;
352
return
CheckState
.Checked;
355
return
CheckState
.Unchecked;
564
value = (
CheckState
)intValue switch
566
CheckState
.Checked =>
CheckState
.Checked,
567
CheckState
.Unchecked =>
CheckState
.Unchecked,
568
CheckState
.Indeterminate =>
CheckState
.Indeterminate,
581
value =
CheckState
.Checked;
585
value =
CheckState
.Unchecked;
589
value =
CheckState
.Indeterminate;
614
else if (ret is
CheckState
retCheckState)
616
if (retCheckState ==
CheckState
.Checked)
620
else if (retCheckState ==
CheckState
.Unchecked)
626
Debug.Assert(retCheckState ==
CheckState
.Indeterminate);
956
CheckState
.Checked => string.Format(SR.DataGridViewCheckBoxCellCheckedStateDescription, cellName),
957
CheckState
.Unchecked => string.Format(SR.DataGridViewCheckBoxCellUncheckedStateDescription, cellName),
1068
CheckState
checkState;
1078
if (formattedValue is not null and
CheckState
state)
1081
bs = (checkState ==
CheckState
.Unchecked) ? ButtonState.Normal : ButtonState.Checked;
1082
drawAsMixedCheckBox = (checkState ==
CheckState
.Indeterminate);
1088
checkState =
CheckState
.Checked;
1093
checkState =
CheckState
.Unchecked;
1101
checkState =
CheckState
.Unchecked;
1322
if (checkState ==
CheckState
.Indeterminate)
1333
if (checkState !=
CheckState
.Unchecked)
1371
checkState ==
CheckState
.Indeterminate
1423
checkState is
CheckState
.Checked or
CheckState
.Indeterminate,
1473
checkState is
CheckState
.Checked or
CheckState
.Indeterminate,
1520
checkState is
CheckState
.Checked or
CheckState
.Indeterminate,
1583
return
CheckState
.Checked;
1598
return
CheckState
.Unchecked;
1602
else if (formattedValue is
CheckState
state)
1606
case
CheckState
.Checked:
1617
return
CheckState
.Checked;
1621
case
CheckState
.Unchecked:
1632
return
CheckState
.Unchecked;
1636
case
CheckState
.Indeterminate:
1643
return
CheckState
.Indeterminate;
1667
if (FormattedValueType.IsAssignableFrom(typeof(
CheckState
)))
1671
editingCell.EditingCellFormattedValue =
CheckState
.Indeterminate;
1675
editingCell.EditingCellFormattedValue =
CheckState
.Unchecked;
1679
editingCell.EditingCellFormattedValue =
CheckState
.Checked;
System\Windows\Forms\Controls\DataGridView\DataGridViewCheckBoxCell.DataGridViewCheckBoxCellAccessibleObject.cs (7)
35
CheckState
state => state switch
37
CheckState
.Checked => AccessibleStates.Checked | base.State,
38
CheckState
.Indeterminate => AccessibleStates.Indeterminate | base.State,
65
case
CheckState
checkState:
66
switchToCheckedState = checkState ==
CheckState
.Unchecked;
160
CheckState
.Checked => ToggleState.ToggleState_On,
161
CheckState
.Unchecked => ToggleState.ToggleState_Off,
System\Windows\Forms\Controls\DataGridView\DataGridViewCheckBoxColumn.cs (5)
23
NullValue = threeState ?
CheckState
.Indeterminate : false
229
DefaultCellStyle.NullValue =
CheckState
.Indeterminate;
231
else if (!value && DefaultCellStyle.NullValue is
CheckState
state && state ==
CheckState
.Indeterminate)
291
defaultNullValue = templateCell.ThreeState ?
CheckState
.Indeterminate : false;
System\Windows\Forms\Controls\ListBoxes\CheckedListBox.CheckedItemCollection.cs (7)
149
internal
CheckState
GetCheckedState(int index)
156
return
CheckState
.Indeterminate;
160
return
CheckState
.Checked;
163
return
CheckState
.Unchecked;
174
internal void SetCheckedState(int index,
CheckState
value)
181
case
CheckState
.Checked:
186
case
CheckState
.Indeterminate:
System\Windows\Forms\Controls\ListBoxes\CheckedListBox.CheckedListBoxItemAccessibleObject.cs (5)
84
case
CheckState
.Checked:
87
case
CheckState
.Indeterminate:
90
case
CheckState
.Unchecked:
119
case
CheckState
.Checked:
122
case
CheckState
.Indeterminate:
System\Windows\Forms\Controls\ListBoxes\CheckedListBox.cs (15)
370
public
CheckState
GetItemCheckState(int index)
382
public bool GetItemChecked(int index) => GetItemCheckState(index) !=
CheckState
.Unchecked;
428
CheckState
currentValue = CheckedItems.GetCheckedState(index);
429
CheckState
newValue = (currentValue !=
CheckState
.Unchecked)
430
?
CheckState
.Unchecked
431
:
CheckState
.Checked;
511
case
CheckState
.Checked:
514
case
CheckState
.Indeterminate:
835
CheckState
[] savedCheckedItems = new
CheckState
[Items.Count];
855
public void SetItemCheckState(int index,
CheckState
value)
862
CheckState
currentValue = CheckedItems.GetCheckedState(index);
883
SetItemCheckState(index, value ?
CheckState
.Checked :
CheckState
.Unchecked);
System\Windows\Forms\Controls\ListBoxes\CheckedListBox.ObjectCollection.cs (3)
23
return Add(item, isChecked ?
CheckState
.Checked :
CheckState
.Unchecked);
30
public int Add(object item,
CheckState
check)
System\Windows\Forms\Controls\ListView\ListView.cs (8)
6531
CheckState
oldState = (
CheckState
)(((int)((LIST_VIEW_ITEM_STATE_FLAGS)nmlv->uOldState & LIST_VIEW_ITEM_STATE_FLAGS.LVIS_STATEIMAGEMASK) >> 12) == 1 ? 0 : 1);
6532
CheckState
newState = (
CheckState
)(((int)((LIST_VIEW_ITEM_STATE_FLAGS)nmlv->uNewState & LIST_VIEW_ITEM_STATE_FLAGS.LVIS_STATEIMAGEMASK) >> 12) == 1 ? 0 : 1);
6553
CheckState
oldValue = (
CheckState
)(((int)((LIST_VIEW_ITEM_STATE_FLAGS)nmlv->uOldState & LIST_VIEW_ITEM_STATE_FLAGS.LVIS_STATEIMAGEMASK) >> 12) == 1 ? 0 : 1);
6554
CheckState
newValue = (
CheckState
)(((int)((LIST_VIEW_ITEM_STATE_FLAGS)nmlv->uNewState & LIST_VIEW_ITEM_STATE_FLAGS.LVIS_STATEIMAGEMASK) >> 12) == 1 ? 0 : 1);
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\DropDownButton.DropDownButtonAdapter.cs (1)
66
internal override void PaintUp(PaintEventArgs pevent,
CheckState
state)
System\Windows\Forms\Controls\ToolStrips\ToolStripButton.cs (12)
13
private
CheckState
_checkState =
CheckState
.Unchecked;
14
private
CheckState
_prevCheckState =
CheckState
.Unchecked;
76
get => _checkState !=
CheckState
.Unchecked;
81
CheckState = value ?
CheckState
.Checked :
CheckState
.Unchecked;
91
[DefaultValue(
CheckState
.Unchecked)]
93
public
CheckState
CheckState
98
if (value is <
CheckState
.Unchecked or >
CheckState
.Indeterminate)
100
throw new InvalidEnumArgumentException(nameof(value), (int)value, typeof(
CheckState
));
System\Windows\Forms\Controls\ToolStrips\ToolStripButton.ToolStripButtonAccessibleObject.cs (5)
82
internal void OnCheckStateChanged(
CheckState
oldValue,
CheckState
newValue)
90
private static ToggleState CheckStateToToggleState(
CheckState
checkState)
93
CheckState
.Checked => ToggleState.ToggleState_On,
94
CheckState
.Unchecked => ToggleState.ToggleState_Off,
System\Windows\Forms\Controls\ToolStrips\ToolStripMenuItem.cs (10)
255
get => CheckState !=
CheckState
.Unchecked;
260
CheckState = value ?
CheckState
.Checked :
CheckState
.Unchecked;
272
CheckState
.Indeterminate => t_indeterminateCheckedImage ??= ScaleHelper.GetIconResourceAsBitmap(
276
CheckState
.Checked => t_checkedImage ??= ScaleHelper.GetIconResourceAsBitmap(
297
[DefaultValue(
CheckState
.Unchecked)]
300
public
CheckState
CheckState
302
get => Properties.GetValueOrDefault(s_propCheckState,
CheckState
.Unchecked);
310
Properties.AddOrRemoveValue(s_propCheckState, value, defaultValue:
CheckState
.Unchecked);
977
if (CheckState !=
CheckState
.Unchecked && menuItemInternalLayout.PaintCheck)
System\Windows\Forms\Controls\ToolStrips\ToolStripMenuItem.ToolStripMenuItemAccessibleObject.cs (2)
144
CheckState
.Checked => ToggleState.ToggleState_On,
145
CheckState
.Unchecked => ToggleState.ToggleState_Off,
System\Windows\Forms\Controls\ToolStrips\ToolstripProfessionalRenderer.cs (3)
349
if (item is not null && item.CheckState ==
CheckState
.Unchecked)
660
else if (item is ToolStripMenuItem menuItem && menuItem.CheckState ==
CheckState
.Checked)
749
if (item is not null && item.CheckState !=
CheckState
.Unchecked)
System\Windows\Forms\Internal\Formatter.cs (10)
16
private static readonly Type s_checkStateType = typeof(
CheckState
);
115
return
CheckState
.Indeterminate;
175
return ((bool)value) ?
CheckState
.Checked :
CheckState
.Unchecked;
184
?
CheckState
.Checked
185
:
CheckState
.Unchecked;
331
else if (value is
CheckState
state)
333
if (state ==
CheckState
.Indeterminate)
341
return (state ==
CheckState
.Checked);
348
return targetConverter.ConvertFrom(context: null, GetFormatterCulture(formatInfo), state ==
CheckState
.Checked);
System\Windows\Forms\ItemCheckEventArgs.cs (4)
11
public ItemCheckEventArgs(int index,
CheckState
newCheckValue,
CheckState
currentValue)
26
public
CheckState
NewValue { get; set; }
31
public
CheckState
CurrentValue { get; }
System.Windows.Forms.Design (4)
System\Windows\Forms\Design\DataGridViewAddColumnDialog.cs (2)
352
_visibleCheckBox.CheckState =
CheckState
.Checked;
825
if (type == typeof(bool) || type == typeof(
CheckState
))
System\Windows\Forms\Design\DataGridViewDesigner.cs (1)
643
else if (propType == typeof(bool) || propType == typeof(
CheckState
))
System\Windows\Forms\Design\MaskDesignerDialog.cs (1)
207
_checkBoxUseValidatingType.CheckState =
CheckState
.Checked;
System.Windows.Forms.Tests (192)
CheckedListBoxTests.cs (10)
360
ArgumentOutOfRangeException ex = Assert.Throws<ArgumentOutOfRangeException>(() => box.SetItemCheckState(index,
CheckState
.Checked));
365
[EnumData<
CheckState
>]
366
public void CheckedListBox_SetItemCheckState_Invoke_GetReturnsExpected(
CheckState
value)
382
[InvalidEnumData<
CheckState
>]
383
public void CheckedListBox_SetItemCheckState_InvokeInvalidValue_ThrowsInvalidEnumArgumentException(
CheckState
value)
391
[InlineData(true,
CheckState
.Checked)]
392
[InlineData(false,
CheckState
.Unchecked)]
393
public void CheckedListBox_SetItemChecked(bool send,
CheckState
expected)
746
ItemCheckEventArgs eventArgs = new(0,
CheckState
.Checked,
CheckState
.Unchecked);
System\Windows\Forms\AccessibleObjects\CheckBox.CheckBoxAccessibleObjectTests.cs (24)
113
[InlineData(true,
CheckState
.Checked, (int)ToggleState.ToggleState_On)]
114
[InlineData(true,
CheckState
.Unchecked, (int)ToggleState.ToggleState_Off)]
115
[InlineData(true,
CheckState
.Indeterminate, (int)ToggleState.ToggleState_Indeterminate)]
116
[InlineData(false,
CheckState
.Checked, (int)ToggleState.ToggleState_On)]
117
[InlineData(false,
CheckState
.Unchecked, (int)ToggleState.ToggleState_Off)]
118
[InlineData(false,
CheckState
.Indeterminate, (int)ToggleState.ToggleState_Indeterminate)]
119
public void CheckBoxAccessibleObject_ToggleState_ReturnsExpected(bool createControl,
CheckState
checkState, int toggleState)
136
yield return new object[] { true, false,
CheckState
.Checked, (int)ToggleState.ToggleState_Off };
137
yield return new object[] { true, false,
CheckState
.Indeterminate, (int)ToggleState.ToggleState_Off };
138
yield return new object[] { true, false,
CheckState
.Unchecked, (int)ToggleState.ToggleState_On };
140
yield return new object[] { true, true,
CheckState
.Checked, (int)ToggleState.ToggleState_Indeterminate };
141
yield return new object[] { true, true,
CheckState
.Indeterminate, (int)ToggleState.ToggleState_Off };
142
yield return new object[] { true, true,
CheckState
.Unchecked, (int)ToggleState.ToggleState_On };
144
yield return new object[] { false, true,
CheckState
.Checked, (int)ToggleState.ToggleState_On };
145
yield return new object[] { false, true,
CheckState
.Indeterminate, (int)ToggleState.ToggleState_Indeterminate };
146
yield return new object[] { false, true,
CheckState
.Unchecked, (int)ToggleState.ToggleState_Off };
148
yield return new object[] { false, false,
CheckState
.Checked, (int)ToggleState.ToggleState_On };
149
yield return new object[] { false, false,
CheckState
.Indeterminate, (int)ToggleState.ToggleState_Indeterminate };
150
yield return new object[] { false, false,
CheckState
.Unchecked, (int)ToggleState.ToggleState_Off };
155
public void CheckBoxAccessibleObject_DoDefaultAction_Success(bool createControl, bool threeState,
CheckState
checkState, int toggleState)
263
Assert.Equal(
CheckState
.Unchecked, checkBox.CheckState);
266
Assert.Equal(
CheckState
.Checked, checkBox.CheckState);
270
Assert.Equal(
CheckState
.Indeterminate, checkBox.CheckState);
274
Assert.Equal(
CheckState
.Unchecked, checkBox.CheckState);
System\Windows\Forms\AccessibleObjects\CheckedListBoxItemAccessibleObjectTests.cs (7)
255
[InlineData(true,
CheckState
.Checked, (int)ToggleState.ToggleState_On)]
256
[InlineData(false,
CheckState
.Unchecked, (int)ToggleState.ToggleState_Off)]
257
[InlineData(true,
CheckState
.Indeterminate, (int)ToggleState.ToggleState_Indeterminate)]
258
public void CheckedListBoxItemAccessibleObject_ToggleState_ReturnsExpected(bool checkValue,
CheckState
checkState, int toggleState)
348
? (isChecked.Value ?
CheckState
.Checked :
CheckState
.Unchecked)
349
:
CheckState
.Indeterminate);
System\Windows\Forms\AccessibleObjects\DataGridViewCheckBoxCellAccessibleObjectTests.cs (3)
279
dataGridView.Rows.Add(
CheckState
.Indeterminate);
282
dataGridView.Rows.Add(
CheckState
.Checked);
285
dataGridView.Rows.Add(
CheckState
.Unchecked);
System\Windows\Forms\AccessibleObjects\ToolStripButton.ToolStripButtonAccessibleObjectTests.cs (11)
125
[InlineData(true,
CheckState
.Checked, true)]
126
[InlineData(true,
CheckState
.Unchecked, true)]
127
[InlineData(true,
CheckState
.Indeterminate, true)]
128
[InlineData(false,
CheckState
.Checked, true)]
129
[InlineData(false,
CheckState
.Unchecked, false)]
130
[InlineData(false,
CheckState
.Indeterminate, true)]
131
public void ToolStripButtonAccessibleObject_IsTogglePatternSupported_ReturnsExpected(bool checkOnClick,
CheckState
checkState, bool expected)
158
[InlineData(
CheckState
.Checked, (int)ToggleState.ToggleState_On)]
159
[InlineData(
CheckState
.Unchecked, (int)ToggleState.ToggleState_Off)]
160
[InlineData(
CheckState
.Indeterminate, (int)ToggleState.ToggleState_Indeterminate)]
161
public void ToolStripButtonAccessibleObject_ToggleState_ReturnsExpected(
CheckState
checkState, int expectedToggleState)
System\Windows\Forms\AccessibleObjects\ToolStripMenuItem.ToolStripMenuItemAccessibleObjectTests.cs (11)
198
[InlineData(true,
CheckState
.Checked, true)]
199
[InlineData(true,
CheckState
.Unchecked, true)]
200
[InlineData(true,
CheckState
.Indeterminate, true)]
201
[InlineData(false,
CheckState
.Checked, true)]
202
[InlineData(false,
CheckState
.Unchecked, false)]
203
[InlineData(false,
CheckState
.Indeterminate, true)]
204
public void ToolStripMenuItemAccessibleObject_IsTogglePatternSupported_ReturnsExpected(bool checkOnClick,
CheckState
checkState, bool expected)
218
[InlineData(
CheckState
.Checked, (int)ToggleState.ToggleState_On)]
219
[InlineData(
CheckState
.Unchecked, (int)ToggleState.ToggleState_Off)]
220
[InlineData(
CheckState
.Indeterminate, (int)ToggleState.ToggleState_Indeterminate)]
221
public void ToolStripMenuItemAccessibleObject_ToggleState_ReturnsExpected(
CheckState
checkState, int expectedToggleState)
System\Windows\Forms\CheckBoxTests.cs (33)
44
Assert.Equal(
CheckState
.Unchecked, control.CheckState);
209
[InlineData(true,
CheckState
.Checked)]
210
[InlineData(false,
CheckState
.Unchecked)]
211
public void CheckBox_CheckedGetSet(bool sent,
CheckState
expected)
222
[InlineData(true,
CheckState
.Checked, true,
CheckState
.Indeterminate)]
223
[InlineData(true,
CheckState
.Unchecked, true,
CheckState
.Checked)]
224
[InlineData(true,
CheckState
.Indeterminate, false,
CheckState
.Unchecked)]
225
[InlineData(false,
CheckState
.Checked, false,
CheckState
.Unchecked)]
226
[InlineData(false,
CheckState
.Unchecked, true,
CheckState
.Checked)]
227
[InlineData(false,
CheckState
.Indeterminate, false,
CheckState
.Unchecked)]
228
public void CheckBox_OnClick_AutoCheck_SetCorrectCheckState(bool threeState,
CheckState
checkState, bool expectedChecked,
CheckState
expectedCheckState)
244
[InlineData(true,
CheckState
.Checked, true)]
245
[InlineData(true,
CheckState
.Unchecked, false)]
246
[InlineData(true,
CheckState
.Indeterminate, true)]
247
[InlineData(false,
CheckState
.Checked, true)]
248
[InlineData(false,
CheckState
.Unchecked, false)]
249
[InlineData(false,
CheckState
.Indeterminate, true)]
250
public void CheckBox_OnClick_AutoCheckFalse_DoesNotChangeCheckState(bool threeState,
CheckState
expectedCheckState, bool expectedChecked)
266
[EnumData<
CheckState
>]
267
public void CheckBox_CheckState_Set_GetReturnsExpected(
CheckState
value)
283
[InvalidEnumData<
CheckState
>]
284
public void CheckBox_CheckState_SetInvalidValue_ThrowsInvalidEnumArgumentException(
CheckState
value)
769
checkBox.CheckState = checkBox.CheckState ==
CheckState
.Checked ?
CheckState
.Unchecked :
CheckState
.Checked;
871
checkBox.CheckState.Should().Be(
CheckState
.Checked);
System\Windows\Forms\DataGridViewCellTests.cs (22)
6132
yield return new object[] { typeof(bool), typeof(
CheckState
),
CheckState
.Indeterminate, new DataGridViewCellStyle(), null, null, DBNull.Value };
6133
yield return new object[] { typeof(bool), typeof(
CheckState
),
CheckState
.Checked, new DataGridViewCellStyle(), null, null, true };
6134
yield return new object[] { typeof(bool), typeof(
CheckState
),
CheckState
.Unchecked, new DataGridViewCellStyle(), null, null, false };
6135
yield return new object[] { typeof(bool), typeof(
CheckState
),
CheckState
.Unchecked - 1, new DataGridViewCellStyle(), null, null, false };
6136
yield return new object[] { typeof(bool), typeof(
CheckState
),
CheckState
.Indeterminate + 1, new DataGridViewCellStyle(), null, null, false };
6137
yield return new object[] { typeof(
CheckState
), typeof(
CheckState
),
CheckState
.Checked, new DataGridViewCellStyle(), null, null,
CheckState
.Checked };
6138
yield return new object[] { typeof(int), typeof(
CheckState
),
CheckState
.Checked, new DataGridViewCellStyle(), null, null, 1 };
6139
yield return new object[] { typeof(int), typeof(
CheckState
),
CheckState
.Checked, new DataGridViewCellStyle(), new EnumConverter(typeof(
CheckState
)), null, 1 };
6140
yield return new object[] { typeof(int), typeof(
CheckState
),
CheckState
.Checked, new DataGridViewCellStyle(), null, new EnumConverter(typeof(
CheckState
)), 1 };
System\Windows\Forms\ToolStripButtonTests.cs (66)
38
Assert.Equal(
CheckState
.Unchecked, item.CheckState);
119
Assert.Equal(
CheckState
.Unchecked, item.CheckState);
206
Assert.Equal(
CheckState
.Unchecked, item.CheckState);
296
Assert.Equal(
CheckState
.Unchecked, item.CheckState);
384
Assert.Equal(
CheckState
.Unchecked, item.CheckState);
482
Assert.Equal(
CheckState
.Unchecked, item.CheckState);
636
[InlineData(true,
CheckState
.Checked,
CheckState
.Unchecked)]
637
[InlineData(false,
CheckState
.Unchecked,
CheckState
.Checked)]
638
public void ToolStripButton_Checked_Set_GetReturnsExpected(bool value,
CheckState
expectedCheckState1,
CheckState
expectedCheckState2)
659
[InlineData(true,
CheckState
.Checked,
CheckState
.Unchecked)]
660
[InlineData(false,
CheckState
.Unchecked,
CheckState
.Checked)]
661
public void ToolStripButton_Checked_SetWithOwner_GetReturnsExpected(bool value,
CheckState
expectedCheckState1,
CheckState
expectedCheckState2)
687
[InlineData(true,
CheckState
.Checked,
CheckState
.Unchecked)]
688
[InlineData(false,
CheckState
.Unchecked,
CheckState
.Checked)]
689
public void ToolStripButton_Checked_SetWithOwnerWithHandle_GetReturnsExpected(bool value,
CheckState
expectedCheckState1,
CheckState
expectedCheckState2)
732
[InlineData(true,
CheckState
.Checked,
CheckState
.Unchecked)]
733
[InlineData(false,
CheckState
.Unchecked,
CheckState
.Checked)]
734
public void ToolStripButton_Checked_SetWithParent_GetReturnsExpected(bool value,
CheckState
expectedCheckState1,
CheckState
expectedCheckState2)
760
[InlineData(true, 2,
CheckState
.Checked,
CheckState
.Unchecked)]
761
[InlineData(false, 0,
CheckState
.Unchecked,
CheckState
.Checked)]
762
public void ToolStripButton_Checked_SetWithParentWithHandle_GetReturnsExpected(bool value, int expectedInvalidatedCallCount,
CheckState
expectedCheckState1,
CheckState
expectedCheckState2)
862
[EnumData<
CheckState
>]
863
public void ToolStripButton_CheckState_Set_GetReturnsExpected(
CheckState
value)
870
Assert.Equal(value !=
CheckState
.Unchecked, item.Checked);
875
Assert.Equal(value !=
CheckState
.Unchecked, item.Checked);
879
[EnumData<
CheckState
>]
880
public void ToolStripButton_CheckState_SetWithOwner_GetReturnsExpected(
CheckState
value)
889
Assert.Equal(value !=
CheckState
.Unchecked, item.Checked);
895
Assert.Equal(value !=
CheckState
.Unchecked, item.Checked);
900
[EnumData<
CheckState
>]
901
public void ToolStripButton_CheckState_SetWithOwnerWithHandle_GetReturnsExpected(
CheckState
value)
918
Assert.Equal(value !=
CheckState
.Unchecked, item.Checked);
927
Assert.Equal(value !=
CheckState
.Unchecked, item.Checked);
939
CheckState =
CheckState
.Checked
959
item.CheckState =
CheckState
.Unchecked;
960
Assert.Equal(
CheckState
.Unchecked, item.CheckState);
965
item.CheckState =
CheckState
.Unchecked;
966
Assert.Equal(
CheckState
.Unchecked, item.CheckState);
971
item.CheckState =
CheckState
.Indeterminate;
972
Assert.Equal(
CheckState
.Indeterminate, item.CheckState);
978
item.CheckState =
CheckState
.Unchecked;
979
Assert.Equal(
CheckState
.Unchecked, item.CheckState);
985
item.CheckState =
CheckState
.Indeterminate;
986
Assert.Equal(
CheckState
.Indeterminate, item.CheckState);
992
[InvalidEnumData<
CheckState
>]
993
public void ToolStripButton_CheckState_SetInvalidValue_ThrowsInvalidEnumArgumentException(
CheckState
value)
1039
[InlineData(true,
CheckState
.Checked, AccessibleStates.Focusable | AccessibleStates.Checked)]
1040
[InlineData(true,
CheckState
.Indeterminate, AccessibleStates.Focusable | AccessibleStates.Checked)]
1041
[InlineData(false,
CheckState
.Checked, AccessibleStates.None)]
1042
[InlineData(false,
CheckState
.Indeterminate, AccessibleStates.None)]
1043
public void ToolStripButton_CreateAccessibilityInstance_InvokeChecked_ReturnsExpected(bool enabled,
CheckState
checkState, AccessibleStates expectedState)
System\Windows\Forms\ToolStripButtonTests.Rendering.cs (1)
98
toolStripButton.CheckState =
CheckState
.Indeterminate;
System\Windows\Forms\ToolStripMenuItemTests.cs (4)
52
Assert.Equal(
CheckState
.Unchecked, item.CheckState);
281
CheckState =
CheckState
.Checked,
399
item.CheckState =
CheckState
.Checked;
403
item.CheckState =
CheckState
.Unchecked;
WinFormsControlsTest (25)
CustomComCtl32Button.cs (3)
26
CheckState =
CheckState
.Unchecked,
37
CheckState =
CheckState
.Checked,
81
isPressed = checkbox.CheckState ==
CheckState
.Checked;
MenuStripAndCheckedListBox.Designer.cs (4)
236
this.checkedToolStripMenuItem.CheckState = System.Windows.Forms.
CheckState
.Checked;
246
this.checkedCheckOnClickToolStripMenuItem.CheckState = System.Windows.Forms.
CheckState
.Checked;
255
this.indeterminateToolStripMenuItem.CheckState = System.Windows.Forms.
CheckState
.Indeterminate;
265
this.indeterminateCheckOnClickToolStripMenuItem.CheckState = System.Windows.Forms.
CheckState
.Indeterminate;
MultipleControls.cs (1)
132
checkedListBox1.Items.Add("Pennsylvania",
CheckState
.Checked);
MultipleControls.Designer.cs (4)
236
this.checkedListBox1.SetItemCheckState(0,
CheckState
.Checked);
237
this.checkedListBox1.SetItemCheckState(1,
CheckState
.Indeterminate);
294
this.checkedListBox2.SetItemCheckState(0,
CheckState
.Checked);
295
this.checkedListBox2.SetItemCheckState(1,
CheckState
.Indeterminate);
ToolStripTests.Designer.cs (13)
162
this.toolStrip2_Button1.CheckState = System.Windows.Forms.
CheckState
.Unchecked;
170
this.toolStrip2_Button2.CheckState = System.Windows.Forms.
CheckState
.Checked;
179
this.toolStrip2_Button3.CheckState = System.Windows.Forms.
CheckState
.Indeterminate;
188
this.toolStrip2_Button4.CheckState = System.Windows.Forms.
CheckState
.Unchecked;
222
this.toolStrip3_MenuItem1.CheckState = System.Windows.Forms.
CheckState
.Checked;
247
this.checkCheckOnClickToolStripMenuItem.CheckState =
CheckState
.Checked;
259
this.thirdLevelItem.CheckState = System.Windows.Forms.
CheckState
.Checked;
267
this.thirdLevelButton.CheckState = System.Windows.Forms.
CheckState
.Checked;
299
this.toolStripMenuItem1.CheckState = System.Windows.Forms.
CheckState
.Checked;
316
this.toolStripMenuItem2.CheckState = System.Windows.Forms.
CheckState
.Checked;
321
this.checkedCheckOnClickFToolStripMenuItem.CheckState =
CheckState
.Checked;
330
this.indeterminateToolStripMenuItem.CheckState =
CheckState
.Indeterminate;
338
this.indeterminateCheckOnClickFToolStripMenuItem.CheckState =
CheckState
.Indeterminate;