StepAttribute
Ecng.ComponentModel
Validates that a numeric value lies on a discrete grid defined by Base + n * Step.
Herda de: ValidationAttribute
Implementa: IValidator
Construtores
StepAttribute
public StepAttribute(decimal step, decimal baseValue)
stepAttribute = StepAttribute(step, baseValue)
Creates new StepAttribute.
- step
- Positive step.
- baseValue
- Grid base (default 0).
Propriedades
DisableNullCheck
public bool DisableNullCheck { get; set; }
value = stepAttribute.DisableNullCheck
stepAttribute.DisableNullCheck = value
Allow null values.
Métodos
IsValid
public override bool IsValid(object value)
result = stepAttribute.IsValid(value)
Validates the specified value by converting it and applying the custom validation.
- value
- The value to validate.
Retorna: True if the value is valid; otherwise, false.