IntegerValidatorAttribute.MaxValue Property
Definition
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 maximum value allowed for the property.
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
Property Value
An integer that indicates the allowed maximum value.
Exceptions
The selected value is less than MinValue.
Examples
The following example shows how to use the MaxValue 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
Remarks
The MaxValue property value is included in the allowed range.
Applies to
意見反應
https://aka.ms/ContentUserFeedback。
即將登場:在 2024 年,我們將逐步淘汰 GitHub 問題作為內容的意見反應機制,並將它取代為新的意見反應系統。 如需詳細資訊,請參閱:提交並檢視相關的意見反應