IntegerValidatorAttribute.MinValue プロパティ

定義

プロパティに指定できる最小値を取得または設定します。

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

プロパティ値

指定できる最小値を示す整数。

例外

選択した値が MaxValue を超えています。

MinValue プロパティを使用する方法を次の例に示します。

[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

注釈

プロパティの MinValue 値は、許容範囲に含まれます。

適用対象