65 references to AutoValidate
System.Windows.Forms (23)
System\Windows\Forms\Control.cs (3)
10432internal static AutoValidate GetAutoValidateForControl(Control control) 10435return (parent is not null) ? parent.AutoValidate : AutoValidate.EnablePreventFocusChange; 10447return GetAutoValidateForControl(this) != AutoValidate.Disable;
System\Windows\Forms\Form.cs (1)
569public override AutoValidate AutoValidate
System\Windows\Forms\Layout\Containers\ContainerControl.cs (17)
31private AutoValidate _autoValidate = AutoValidate.Inherit; 203[AmbientValue(AutoValidate.Inherit)] 206public virtual AutoValidate AutoValidate 210if (_autoValidate != AutoValidate.Inherit) 219if (value is < AutoValidate.Inherit or > AutoValidate.EnableAllowFocusChange) 221throw new InvalidEnumArgumentException(nameof(value), (int)value, typeof(AutoValidate)); 1748AutoValidate autoValidateMode = GetAutoValidateForControl(_unvalidatedControl); 1751if (autoValidateMode == AutoValidate.Disable) 1764bool preventFocusChangeOnError = (autoValidateMode == AutoValidate.EnablePreventFocusChange); 1798if (AutoValidate == AutoValidate.EnablePreventFocusChange || 1825AutoValidate autoValidateMode = GetAutoValidateForControl(controlToValidate); 1828if (checkAutoValidate && autoValidateMode == AutoValidate.Disable) 1833preventFocusChangeOnError = (autoValidateMode == AutoValidate.EnablePreventFocusChange); 1834validatedControlAllowsFocusChange = (autoValidateMode == AutoValidate.EnableAllowFocusChange); 1989internal 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)
36Assert.Equal(AutoValidate.EnablePreventFocusChange, control.AutoValidate); 280yield return new object[] { AutoValidate.Disable, AutoValidate.Disable }; 281yield return new object[] { AutoValidate.EnablePreventFocusChange, AutoValidate.EnablePreventFocusChange }; 282yield return new object[] { AutoValidate.EnableAllowFocusChange, AutoValidate.EnableAllowFocusChange }; 283yield return new object[] { AutoValidate.Inherit, AutoValidate.EnablePreventFocusChange }; 288public void UserControl_AutoValidate_Set_GetReturnsExpected(AutoValidate value, AutoValidate expected) 317control.AutoValidate = AutoValidate.EnablePreventFocusChange; 318Assert.Equal(AutoValidate.EnablePreventFocusChange, control.AutoValidate); 322control.AutoValidate = AutoValidate.EnablePreventFocusChange; 323Assert.Equal(AutoValidate.EnablePreventFocusChange, control.AutoValidate); 327control.AutoValidate = AutoValidate.EnableAllowFocusChange; 328Assert.Equal(AutoValidate.EnableAllowFocusChange, control.AutoValidate); 333control.AutoValidate = AutoValidate.Disable; 339[InvalidEnumData<AutoValidate>] 340public void ContainerControl_AutoValidate_SetInvalidValue_ThrowsInvalidEnumArgumentException(AutoValidate value)
System\Windows\Forms\Design\ComponentEditorFormTests.cs (1)
68Assert.Equal(AutoValidate.EnablePreventFocusChange, control.AutoValidate);
System\Windows\Forms\FormTests.cs (1)
67Assert.Equal(AutoValidate.EnablePreventFocusChange, control.AutoValidate);
System\Windows\Forms\PropertyGridTests.cs (1)
41Assert.Equal(AutoValidate.EnablePreventFocusChange, control.AutoValidate);
System\Windows\Forms\UserControlTests.cs (19)
671yield return new object[] { AutoValidate.Disable, AutoValidate.Disable }; 672yield return new object[] { AutoValidate.EnablePreventFocusChange, AutoValidate.EnablePreventFocusChange }; 673yield return new object[] { AutoValidate.EnableAllowFocusChange, AutoValidate.EnableAllowFocusChange }; 674yield return new object[] { AutoValidate.Inherit, AutoValidate.EnablePreventFocusChange }; 679public void UserControl_AutoValidate_Set_GetReturnsExpected(AutoValidate value, AutoValidate expected) 708control.AutoValidate = AutoValidate.EnablePreventFocusChange; 709Assert.Equal(AutoValidate.EnablePreventFocusChange, control.AutoValidate); 713control.AutoValidate = AutoValidate.EnablePreventFocusChange; 714Assert.Equal(AutoValidate.EnablePreventFocusChange, control.AutoValidate); 718control.AutoValidate = AutoValidate.EnableAllowFocusChange; 719Assert.Equal(AutoValidate.EnableAllowFocusChange, control.AutoValidate); 724control.AutoValidate = AutoValidate.Disable; 730[InvalidEnumData<AutoValidate>] 731public void UserControl_AutoValidate_SetInvalidValue_ThrowsInvalidEnumArgumentException(AutoValidate value)