LongValidatorAttribute.ExcludeRange LongValidatorAttribute.ExcludeRange LongValidatorAttribute.ExcludeRange LongValidatorAttribute.ExcludeRange Property

Definition

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.

public:
 property bool ExcludeRange { bool get(); void set(bool value); };
public bool ExcludeRange { get; set; }
member this.ExcludeRange : bool with get, set
Public Property ExcludeRange As Boolean

Property Value

true if the value must be excluded; otherwise, false. The default is false.

Examples

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;
    }
}
<ConfigurationProperty("maxUsers", _
DefaultValue:=10000, _
IsRequired:=False), _
LongValidator(MinValue:=1, _
MaxValue:=10000000, _
ExcludeRange:=False)> _
Public Property MaxUsers() As Long
    Get
        Return Fix(Me("maxUsers"))
    End Get
    Set(ByVal value As Long)
        Me("maxUsers") = value
    End Set
End Property

Remarks

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.

Applies to