65 references to AutoValidate
System.Windows.Forms (23)
System\Windows\Forms\Control.cs (3)
10434
internal static
AutoValidate
GetAutoValidateForControl(Control control)
10437
return (parent is not null) ? parent.AutoValidate :
AutoValidate
.EnablePreventFocusChange;
10449
return GetAutoValidateForControl(this) !=
AutoValidate
.Disable;
System\Windows\Forms\Form.cs (1)
569
public override
AutoValidate
AutoValidate
System\Windows\Forms\Layout\Containers\ContainerControl.cs (17)
32
private
AutoValidate
_autoValidate =
AutoValidate
.Inherit;
204
[AmbientValue(
AutoValidate
.Inherit)]
207
public virtual
AutoValidate
AutoValidate
211
if (_autoValidate !=
AutoValidate
.Inherit)
220
if (value is <
AutoValidate
.Inherit or >
AutoValidate
.EnableAllowFocusChange)
222
throw new InvalidEnumArgumentException(nameof(value), (int)value, typeof(
AutoValidate
));
1749
AutoValidate
autoValidateMode = GetAutoValidateForControl(_unvalidatedControl);
1752
if (autoValidateMode ==
AutoValidate
.Disable)
1765
bool preventFocusChangeOnError = (autoValidateMode ==
AutoValidate
.EnablePreventFocusChange);
1799
if (AutoValidate ==
AutoValidate
.EnablePreventFocusChange ||
1826
AutoValidate
autoValidateMode = GetAutoValidateForControl(controlToValidate);
1829
if (checkAutoValidate && autoValidateMode ==
AutoValidate
.Disable)
1834
preventFocusChangeOnError = (autoValidateMode ==
AutoValidate
.EnablePreventFocusChange);
1835
validatedControlAllowsFocusChange = (autoValidateMode ==
AutoValidate
.EnableAllowFocusChange);
1990
internal virtual bool ShouldSerializeAutoValidate() => _autoValidate !=
AutoValidate
.Inherit;
System\Windows\Forms\Printing\PrintPreviewDialog.cs (1)
106
public override
AutoValidate
AutoValidate
System\Windows\Forms\UserControl.cs (1)
104
public override
AutoValidate
AutoValidate
System.Windows.Forms.Tests (42)
System\Windows\Forms\ContainerControlTests.cs (20)
34
Assert.Equal(
AutoValidate
.EnablePreventFocusChange, control.AutoValidate);
278
yield return new object[] {
AutoValidate
.Disable,
AutoValidate
.Disable };
279
yield return new object[] {
AutoValidate
.EnablePreventFocusChange,
AutoValidate
.EnablePreventFocusChange };
280
yield return new object[] {
AutoValidate
.EnableAllowFocusChange,
AutoValidate
.EnableAllowFocusChange };
281
yield return new object[] {
AutoValidate
.Inherit,
AutoValidate
.EnablePreventFocusChange };
286
public void UserControl_AutoValidate_Set_GetReturnsExpected(
AutoValidate
value,
AutoValidate
expected)
315
control.AutoValidate =
AutoValidate
.EnablePreventFocusChange;
316
Assert.Equal(
AutoValidate
.EnablePreventFocusChange, control.AutoValidate);
320
control.AutoValidate =
AutoValidate
.EnablePreventFocusChange;
321
Assert.Equal(
AutoValidate
.EnablePreventFocusChange, control.AutoValidate);
325
control.AutoValidate =
AutoValidate
.EnableAllowFocusChange;
326
Assert.Equal(
AutoValidate
.EnableAllowFocusChange, control.AutoValidate);
331
control.AutoValidate =
AutoValidate
.Disable;
337
[InvalidEnumData<
AutoValidate
>]
338
public void ContainerControl_AutoValidate_SetInvalidValue_ThrowsInvalidEnumArgumentException(
AutoValidate
value)
System\Windows\Forms\Design\ComponentEditorFormTests.cs (1)
66
Assert.Equal(
AutoValidate
.EnablePreventFocusChange, control.AutoValidate);
System\Windows\Forms\FormTests.cs (1)
65
Assert.Equal(
AutoValidate
.EnablePreventFocusChange, control.AutoValidate);
System\Windows\Forms\PropertyGridTests.cs (1)
39
Assert.Equal(
AutoValidate
.EnablePreventFocusChange, control.AutoValidate);
System\Windows\Forms\UserControlTests.cs (19)
669
yield return new object[] {
AutoValidate
.Disable,
AutoValidate
.Disable };
670
yield return new object[] {
AutoValidate
.EnablePreventFocusChange,
AutoValidate
.EnablePreventFocusChange };
671
yield return new object[] {
AutoValidate
.EnableAllowFocusChange,
AutoValidate
.EnableAllowFocusChange };
672
yield return new object[] {
AutoValidate
.Inherit,
AutoValidate
.EnablePreventFocusChange };
677
public void UserControl_AutoValidate_Set_GetReturnsExpected(
AutoValidate
value,
AutoValidate
expected)
706
control.AutoValidate =
AutoValidate
.EnablePreventFocusChange;
707
Assert.Equal(
AutoValidate
.EnablePreventFocusChange, control.AutoValidate);
711
control.AutoValidate =
AutoValidate
.EnablePreventFocusChange;
712
Assert.Equal(
AutoValidate
.EnablePreventFocusChange, control.AutoValidate);
716
control.AutoValidate =
AutoValidate
.EnableAllowFocusChange;
717
Assert.Equal(
AutoValidate
.EnableAllowFocusChange, control.AutoValidate);
722
control.AutoValidate =
AutoValidate
.Disable;
728
[InvalidEnumData<
AutoValidate
>]
729
public void UserControl_AutoValidate_SetInvalidValue_ThrowsInvalidEnumArgumentException(
AutoValidate
value)