76 references to ValidationConstraints
System.Windows.Forms (20)
System\Windows\Forms\Control.cs (11)
8468
internal bool PerformContainerValidation(
ValidationConstraints
validationConstraints)
8476
if ((validationConstraints &
ValidationConstraints
.ImmediateChildren) !=
ValidationConstraints
.ImmediateChildren
8484
if (((validationConstraints &
ValidationConstraints
.Selectable) ==
ValidationConstraints
.Selectable && !c.GetStyle(ControlStyles.Selectable))
8485
|| ((validationConstraints &
ValidationConstraints
.Enabled) ==
ValidationConstraints
.Enabled && !c.Enabled)
8486
|| ((validationConstraints &
ValidationConstraints
.Visible) ==
ValidationConstraints
.Visible && !c.Visible)
8487
|| ((validationConstraints &
ValidationConstraints
.TabStop) ==
ValidationConstraints
.TabStop && !c.TabStop))
System\Windows\Forms\Form.cs (2)
6492
/// equivalent to calling ValidateChildren(ValidationConstraints.Selectable). See <see cref="
ValidationConstraints
.Selectable"/>
6508
public override bool ValidateChildren(
ValidationConstraints
validationConstraints)
System\Windows\Forms\Layout\Containers\ContainerControl.cs (4)
1846
/// equivalent to calling ValidateChildren(ValidationConstraints.Selectable). See <see cref="
ValidationConstraints
.Selectable"/>
1851
public virtual bool ValidateChildren() => ValidateChildren(
ValidationConstraints
.Selectable);
1859
public virtual bool ValidateChildren(
ValidationConstraints
validationConstraints)
1863
throw new InvalidEnumArgumentException(nameof(validationConstraints), (int)validationConstraints, typeof(
ValidationConstraints
));
System\Windows\Forms\Layout\Containers\ValidationConstraints.cs (1)
8
/// by the <see cref="ContainerControl.ValidateChildren(
ValidationConstraints
)"/> method.
System\Windows\Forms\UserControl.cs (2)
220
/// equivalent to calling ValidateChildren(ValidationConstraints.Selectable). See <see cref="
ValidationConstraints
.Selectable"/>
236
public override bool ValidateChildren(
ValidationConstraints
validationConstraints)
System.Windows.Forms.Tests (56)
System\Windows\Forms\ContainerControlTests.cs (28)
984
[EnumData<
ValidationConstraints
>]
985
public void ContainerControl_ValidateChildren_InvokeValidationConstraintsWithoutChildren_ReturnsTrue(
ValidationConstraints
validationConstraints)
993
yield return new object[] {
ValidationConstraints
.ImmediateChildren, true, 0, 0, 0, 1, 1, 1, 1 };
994
yield return new object[] {
ValidationConstraints
.ImmediateChildren, false, 1, 0, 0, 1, 1, 1, 1 };
996
yield return new object[] {
ValidationConstraints
.Selectable, true, 0, 1, 0, 0, 1, 1, 1 };
997
yield return new object[] {
ValidationConstraints
.Selectable, false, 1, 1, 0, 0, 1, 1, 1 };
999
yield return new object[] {
ValidationConstraints
.Enabled, true, 0, 1, 1, 1, 0, 1, 1 };
1000
yield return new object[] {
ValidationConstraints
.Enabled, false, 1, 1, 1, 1, 0, 1, 1 };
1002
yield return new object[] {
ValidationConstraints
.Visible, true, 0, 1, 0, 1, 1, 0, 1 };
1003
yield return new object[] {
ValidationConstraints
.Visible, false, 1, 1, 0, 1, 1, 0, 1 };
1005
yield return new object[] {
ValidationConstraints
.TabStop, true, 0, 1, 0, 1, 1, 1, 0 };
1006
yield return new object[] {
ValidationConstraints
.TabStop, false, 1, 1, 0, 1, 1, 1, 0 };
1008
yield return new object[] {
ValidationConstraints
.None, true, 0, 1, 1, 1, 1, 1, 1 };
1009
yield return new object[] {
ValidationConstraints
.None, false, 1, 1, 1, 1, 1, 1, 1 };
1011
yield return new object[] {
ValidationConstraints
.ImmediateChildren |
ValidationConstraints
.Selectable |
ValidationConstraints
.Enabled |
ValidationConstraints
.Visible |
ValidationConstraints
.TabStop, true, 0, 0, 0, 0, 0, 0, 0 };
1012
yield return new object[] {
ValidationConstraints
.ImmediateChildren |
ValidationConstraints
.Selectable |
ValidationConstraints
.Enabled |
ValidationConstraints
.Visible |
ValidationConstraints
.TabStop, false, 1, 0, 0, 0, 0, 0, 0 };
1017
public void ContainerControl_ValidateChildren_InvokeValidationConstraintsWithChildren_ReturnsExpected(
ValidationConstraints
validationConstraints, bool cancel, int expectedChild1CallCount, int expectedGrandchild2CallCount, int expectedGrandchild3CallCount, int expectedChild4CallCount, int expectedChild5CallCount, int expectedChild6CallCount, int expectedChild7CallCount)
1210
[InlineData((
ValidationConstraints
)(-1))]
1211
[InlineData((
ValidationConstraints
)(0x20))]
1212
public void ContainerControl_ValidateChildren_InvalidValidationConstraints_ThrowsInvalidEnumArgumentException(
ValidationConstraints
validationConstraints)
System\Windows\Forms\UserControlTests.cs (28)
1450
[EnumData<
ValidationConstraints
>]
1451
public void UserControl_ValidateChildren_InvokeValidationConstraintsWithoutChildren_ReturnsTrue(
ValidationConstraints
validationConstraints)
1459
yield return new object[] {
ValidationConstraints
.ImmediateChildren, true, 0, 0, 0, 1, 1, 1, 1 };
1460
yield return new object[] {
ValidationConstraints
.ImmediateChildren, false, 1, 0, 0, 1, 1, 1, 1 };
1462
yield return new object[] {
ValidationConstraints
.Selectable, true, 0, 1, 0, 0, 1, 1, 1 };
1463
yield return new object[] {
ValidationConstraints
.Selectable, false, 1, 1, 0, 0, 1, 1, 1 };
1465
yield return new object[] {
ValidationConstraints
.Enabled, true, 0, 1, 1, 1, 0, 1, 1 };
1466
yield return new object[] {
ValidationConstraints
.Enabled, false, 1, 1, 1, 1, 0, 1, 1 };
1468
yield return new object[] {
ValidationConstraints
.Visible, true, 0, 1, 0, 1, 1, 0, 1 };
1469
yield return new object[] {
ValidationConstraints
.Visible, false, 1, 1, 0, 1, 1, 0, 1 };
1471
yield return new object[] {
ValidationConstraints
.TabStop, true, 0, 1, 0, 1, 1, 1, 0 };
1472
yield return new object[] {
ValidationConstraints
.TabStop, false, 1, 1, 0, 1, 1, 1, 0 };
1474
yield return new object[] {
ValidationConstraints
.None, true, 0, 1, 1, 1, 1, 1, 1 };
1475
yield return new object[] {
ValidationConstraints
.None, false, 1, 1, 1, 1, 1, 1, 1 };
1477
yield return new object[] {
ValidationConstraints
.ImmediateChildren |
ValidationConstraints
.Selectable |
ValidationConstraints
.Enabled |
ValidationConstraints
.Visible |
ValidationConstraints
.TabStop, true, 0, 0, 0, 0, 0, 0, 0 };
1478
yield return new object[] {
ValidationConstraints
.ImmediateChildren |
ValidationConstraints
.Selectable |
ValidationConstraints
.Enabled |
ValidationConstraints
.Visible |
ValidationConstraints
.TabStop, false, 1, 0, 0, 0, 0, 0, 0 };
1483
public void UserControl_ValidateChildren_InvokeValidationConstraintsWithChildren_ReturnsExpected(
ValidationConstraints
validationConstraints, bool cancel, int expectedChild1CallCount, int expectedGrandchild2CallCount, int expectedGrandchild3CallCount, int expectedChild4CallCount, int expectedChild5CallCount, int expectedChild6CallCount, int expectedChild7CallCount)
1676
[InlineData((
ValidationConstraints
)(-1))]
1677
[InlineData((
ValidationConstraints
)(0x20))]
1678
public void UserControl_ValidateChildren_InvalidValidationConstraints_ThrowsInvalidEnumArgumentException(
ValidationConstraints
validationConstraints)