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