IntegerValidatorAttribute.ExcludeRange 속성

정의

MinValueMaxValue 속성 값으로 정의된 범위에 정수를 포함시킬지 아니면 제외시킬지를 나타내는 값을 가져오거나 설정합니다.

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

속성 값

값을 제외해야 하면 true이고, 그렇지 않으면 false입니다. 기본값은 false입니다.

예제

다음 예제에서는 ExcludeRange 속성을 사용하는 방법을 보여 줍니다.

[ConfigurationProperty("maxAttempts", DefaultValue = 101,
    IsRequired = true)]
[IntegerValidator(MinValue = 1, MaxValue = 100,
    ExcludeRange = true)]
public int MaxAttempts
{
    get
    {
        return (int)this["maxAttempts"];
    }
    set
    {
        this["maxAttempts"] = value;
    }
}
<ConfigurationProperty("maxAttempts", _
DefaultValue:=101, _
IsRequired:=True), _
IntegerValidator(MinValue:=1, _
MaxValue:=100, _
ExcludeRange:=True)> _
Public Property MaxAttempts() As Integer
    Get
        Return Fix(Me("maxAttempts"))
    End Get
    Set(ByVal value As Integer)
        Me("maxAttempts") = value
    End Set
End Property

설명

범위는 및 MaxValue 속성 값을 포함합니다MinValue. 속성 값이 ExcludeRange 이면 true허용되는 값이 범위를 벗어났습니다.

적용 대상