修改命名空间
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
using System.Globalization;
|
||||
using System.Windows.Controls;
|
||||
|
||||
namespace ShrlAlgoToolkit.RevitAddins.Common.ValidationRules;
|
||||
|
||||
public class RangeValidationRule : ValidationRule
|
||||
{
|
||||
public object Min { get; set; }
|
||||
public object Max { get; set; }
|
||||
|
||||
public override ValidationResult Validate(object value, CultureInfo cultureInfo)
|
||||
{
|
||||
return double.TryParse(value.ToString(), out var d) && d >= Convert.ToDouble(Min) && d <= Convert.ToDouble(Max)
|
||||
? ValidationResult.ValidResult
|
||||
: new ValidationResult(false, "输入值的范围有误");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user