LongValidatorAttribute
Declaratively instructs .NET to perform long-integer validation on a configuration property. This class cannot be inherited.
namespace System.Configuration
{
[AttributeUsage(AttributeTargets.Property)]
public sealed class LongValidatorAttribute : ConfigurationValidatorAttribute
{
private long _max = 9223372036854775807;
private long _min = -9223372036854775808;
public override ConfigurationValidatorBase ValidatorInstance => new LongValidator(_min, _max, ExcludeRange);
public long MinValue {
get {
return _min;
}
set {
if (_max < value)
throw new ArgumentOutOfRangeException("value", System.SR.Validator_min_greater_than_max);
_min = value;
}
}
public long MaxValue {
get {
return _max;
}
set {
if (_min > value)
throw new ArgumentOutOfRangeException("value", System.SR.Validator_min_greater_than_max);
_max = value;
}
}
public bool ExcludeRange { get; set; }
}
}