IntegerValidatorAttribute.MinValue Property
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets or sets the minimum value allowed for the property.
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
An integer that indicates the allowed minimum value.
The selected value is greater than MaxValue.
The following example shows how to use the MinValue property.
[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
The MinValue property value is included in the allowed range.
Produkt | Versiounen |
---|---|
.NET | 8 (package-provided), 9 (package-provided), 10 (package-provided) |
.NET Framework | 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET Standard | 2.0 (package-provided) |
Windows Desktop | 3.0, 3.1, 5, 6, 7, 8, 9, 10 |
Feedback zu .NET
.NET ass en Open-Source-Projet. Wielt e Link, fir Feedback ze ginn: