Upraviť

Zdieľať cez


LongValidatorAttribute.MinValue Property

Definition

Gets or sets the minimum value allowed for the property.

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

Property Value

An integer that indicates the allowed minimum value.

Exceptions

The selected value is greater than MaxValue.

Examples

The following example shows how to use the MinValue 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 MinValue property value is included in the allowed range.

Applies to