StepAttribute
Ecng.ComponentModel
Validates that a numeric value lies on a discrete grid defined by Base + n * Step.
Erbt von: ValidationAttribute
Implementiert: IValidator
Konstruktoren
StepAttribute
public StepAttribute(decimal step, decimal baseValue)
stepAttribute = StepAttribute(step, baseValue)
Creates new StepAttribute.
- step
- Positive step.
- baseValue
- Grid base (default 0).
Eigenschaften
DisableNullCheck
public bool DisableNullCheck { get; set; }
value = stepAttribute.DisableNullCheck
stepAttribute.DisableNullCheck = value
Allow null values.
Methoden
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.
Rückgabe: True if the value is valid; otherwise, false.