IntegerValidatorAttribute Constructor
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.
Creates a new instance of the IntegerValidatorAttribute class.
public:
IntegerValidatorAttribute();
public IntegerValidatorAttribute ();
Public Sub New ()
Examples
The following example shows how to use the IntegerValidatorAttribute constructor.
[ConfigurationProperty("maxSize", DefaultValue = 1000,
IsRequired = true)]
[IntegerValidator()]
public int MaxSize
{
get
{
return (int)this["maxSize"];
}
set
{
this["maxSize"] = value;
}
}
<ConfigurationProperty("maxSize", _
DefaultValue:=1000, _
IsRequired:=True), _
IntegerValidator()> _
Public Property MaxSize() As Integer
Get
Return Fix(Me("maxSize"))
End Get
Set(ByVal value As Integer)
Me("maxSize") = value
End Set
End Property
Remarks
You use this constructor in the attributed model to assure that the value assigned to the related property is an integer.
Applies to
Совместная работа с нами на GitHub
Источник этого содержимого можно найти на GitHub, где также можно создавать и просматривать проблемы и запросы на вытягивание. Дополнительные сведения см. в нашем руководстве для участников.