76 references to ValidationConstraints
System.Windows.Forms (20)
System\Windows\Forms\Control.cs (11)
8466
internal bool PerformContainerValidation(
ValidationConstraints
validationConstraints)
8474
if ((validationConstraints &
ValidationConstraints
.ImmediateChildren) !=
ValidationConstraints
.ImmediateChildren
8482
if (((validationConstraints &
ValidationConstraints
.Selectable) ==
ValidationConstraints
.Selectable && !c.GetStyle(ControlStyles.Selectable))
8483
|| ((validationConstraints &
ValidationConstraints
.Enabled) ==
ValidationConstraints
.Enabled && !c.Enabled)
8484
|| ((validationConstraints &
ValidationConstraints
.Visible) ==
ValidationConstraints
.Visible && !c.Visible)
8485
|| ((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)
1845
/// equivalent to calling ValidateChildren(ValidationConstraints.Selectable). See <see cref="
ValidationConstraints
.Selectable"/>
1850
public virtual bool ValidateChildren() => ValidateChildren(
ValidationConstraints
.Selectable);
1858
public virtual bool ValidateChildren(
ValidationConstraints
validationConstraints)
1862
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)
986
[EnumData<
ValidationConstraints
>]
987
public void ContainerControl_ValidateChildren_InvokeValidationConstraintsWithoutChildren_ReturnsTrue(
ValidationConstraints
validationConstraints)
995
yield return new object[] {
ValidationConstraints
.ImmediateChildren, true, 0, 0, 0, 1, 1, 1, 1 };
996
yield return new object[] {
ValidationConstraints
.ImmediateChildren, false, 1, 0, 0, 1, 1, 1, 1 };
998
yield return new object[] {
ValidationConstraints
.Selectable, true, 0, 1, 0, 0, 1, 1, 1 };
999
yield return new object[] {
ValidationConstraints
.Selectable, false, 1, 1, 0, 0, 1, 1, 1 };
1001
yield return new object[] {
ValidationConstraints
.Enabled, true, 0, 1, 1, 1, 0, 1, 1 };
1002
yield return new object[] {
ValidationConstraints
.Enabled, false, 1, 1, 1, 1, 0, 1, 1 };
1004
yield return new object[] {
ValidationConstraints
.Visible, true, 0, 1, 0, 1, 1, 0, 1 };
1005
yield return new object[] {
ValidationConstraints
.Visible, false, 1, 1, 0, 1, 1, 0, 1 };
1007
yield return new object[] {
ValidationConstraints
.TabStop, true, 0, 1, 0, 1, 1, 1, 0 };
1008
yield return new object[] {
ValidationConstraints
.TabStop, false, 1, 1, 0, 1, 1, 1, 0 };
1010
yield return new object[] {
ValidationConstraints
.None, true, 0, 1, 1, 1, 1, 1, 1 };
1011
yield return new object[] {
ValidationConstraints
.None, false, 1, 1, 1, 1, 1, 1, 1 };
1013
yield return new object[] {
ValidationConstraints
.ImmediateChildren |
ValidationConstraints
.Selectable |
ValidationConstraints
.Enabled |
ValidationConstraints
.Visible |
ValidationConstraints
.TabStop, true, 0, 0, 0, 0, 0, 0, 0 };
1014
yield return new object[] {
ValidationConstraints
.ImmediateChildren |
ValidationConstraints
.Selectable |
ValidationConstraints
.Enabled |
ValidationConstraints
.Visible |
ValidationConstraints
.TabStop, false, 1, 0, 0, 0, 0, 0, 0 };
1019
public void ContainerControl_ValidateChildren_InvokeValidationConstraintsWithChildren_ReturnsExpected(
ValidationConstraints
validationConstraints, bool cancel, int expectedChild1CallCount, int expectedGrandchild2CallCount, int expectedGrandchild3CallCount, int expectedChild4CallCount, int expectedChild5CallCount, int expectedChild6CallCount, int expectedChild7CallCount)
1212
[InlineData((
ValidationConstraints
)(-1))]
1213
[InlineData((
ValidationConstraints
)(0x20))]
1214
public void ContainerControl_ValidateChildren_InvalidValidationConstraints_ThrowsInvalidEnumArgumentException(
ValidationConstraints
validationConstraints)
System\Windows\Forms\UserControlTests.cs (28)
1452
[EnumData<
ValidationConstraints
>]
1453
public void UserControl_ValidateChildren_InvokeValidationConstraintsWithoutChildren_ReturnsTrue(
ValidationConstraints
validationConstraints)
1461
yield return new object[] {
ValidationConstraints
.ImmediateChildren, true, 0, 0, 0, 1, 1, 1, 1 };
1462
yield return new object[] {
ValidationConstraints
.ImmediateChildren, false, 1, 0, 0, 1, 1, 1, 1 };
1464
yield return new object[] {
ValidationConstraints
.Selectable, true, 0, 1, 0, 0, 1, 1, 1 };
1465
yield return new object[] {
ValidationConstraints
.Selectable, false, 1, 1, 0, 0, 1, 1, 1 };
1467
yield return new object[] {
ValidationConstraints
.Enabled, true, 0, 1, 1, 1, 0, 1, 1 };
1468
yield return new object[] {
ValidationConstraints
.Enabled, false, 1, 1, 1, 1, 0, 1, 1 };
1470
yield return new object[] {
ValidationConstraints
.Visible, true, 0, 1, 0, 1, 1, 0, 1 };
1471
yield return new object[] {
ValidationConstraints
.Visible, false, 1, 1, 0, 1, 1, 0, 1 };
1473
yield return new object[] {
ValidationConstraints
.TabStop, true, 0, 1, 0, 1, 1, 1, 0 };
1474
yield return new object[] {
ValidationConstraints
.TabStop, false, 1, 1, 0, 1, 1, 1, 0 };
1476
yield return new object[] {
ValidationConstraints
.None, true, 0, 1, 1, 1, 1, 1, 1 };
1477
yield return new object[] {
ValidationConstraints
.None, false, 1, 1, 1, 1, 1, 1, 1 };
1479
yield return new object[] {
ValidationConstraints
.ImmediateChildren |
ValidationConstraints
.Selectable |
ValidationConstraints
.Enabled |
ValidationConstraints
.Visible |
ValidationConstraints
.TabStop, true, 0, 0, 0, 0, 0, 0, 0 };
1480
yield return new object[] {
ValidationConstraints
.ImmediateChildren |
ValidationConstraints
.Selectable |
ValidationConstraints
.Enabled |
ValidationConstraints
.Visible |
ValidationConstraints
.TabStop, false, 1, 0, 0, 0, 0, 0, 0 };
1485
public void UserControl_ValidateChildren_InvokeValidationConstraintsWithChildren_ReturnsExpected(
ValidationConstraints
validationConstraints, bool cancel, int expectedChild1CallCount, int expectedGrandchild2CallCount, int expectedGrandchild3CallCount, int expectedChild4CallCount, int expectedChild5CallCount, int expectedChild6CallCount, int expectedChild7CallCount)
1678
[InlineData((
ValidationConstraints
)(-1))]
1679
[InlineData((
ValidationConstraints
)(0x20))]
1680
public void UserControl_ValidateChildren_InvalidValidationConstraints_ThrowsInvalidEnumArgumentException(
ValidationConstraints
validationConstraints)