IntegerValidatorAttribute.ExcludeRange Propriedade

Definição

Obtém ou define um valor que indica se deve incluir ou excluir os inteiros no intervalo definido pelos MinValue valores da propriedade e MaxValue .

public:
 property bool ExcludeRange { bool get(); void set(bool value); };
public bool ExcludeRange { get; set; }
member this.ExcludeRange : bool with get, set
Public Property ExcludeRange As Boolean

Valor de Propriedade

true se o valor tiver de ser excluído; caso contrário, false. A predefinição é false.

Exemplos

O exemplo seguinte mostra como utilizar a ExcludeRange propriedade.

[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

Observações

O intervalo inclui os MinValue valores das propriedades MaxValue . Quando o ExcludeRange valor da propriedade é true, os valores permitidos estão fora do intervalo.

Aplica-se a