Export (0) Print
Expand All

LongValidatorAttribute.ExcludeRange Property

Gets or sets a value that indicates whether to include or exclude the integers in the range defined by the MinValue and MaxValue property values.

Namespace:  System.Configuration
Assembly:  System.Configuration (in System.Configuration.dll)

public bool ExcludeRange { get; set; }

Property Value

Type: System.Boolean
true if the value must be excluded; otherwise, false. The default is false.

The range is inclusive of the MinValue and MaxValue property values. When the ExcludeRange property value is false, the allowed values are outside the range.

The following example shows how to use the ExcludeRange property.

[ConfigurationProperty("maxUsers", DefaultValue = (long)10000,
    IsRequired = false)]
[LongValidator(MinValue = 1, MaxValue = 10000000,
    ExcludeRange = false)]
public long MaxUsers
{
    get
    {
        return (long)this["maxUsers"];
    }
    set
    {
        this["maxUsers"] = value;
    }
}

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1
Show:
© 2015 Microsoft