IntegerValidatorAttribute.MaxValue 속성

정의

속성에 허용되는 최대값을 가져오거나 설정합니다.

public:
 property int MaxValue { int get(); void set(int value); };
public int MaxValue { get; set; }
member this.MaxValue : int with get, set
Public Property MaxValue As Integer

속성 값

허용되는 최대값을 나타내는 정수입니다.

예외

선택한 값이 MinValue보다 작은 경우

예제

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

[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 속성 값은 허용된 범위에 포함됩니다.

적용 대상