修改命名空间
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
using System.Globalization;
|
||||
using System.Windows.Controls;
|
||||
|
||||
namespace ShrlAlgoToolkit.RevitAddins.Common.ValidationRules
|
||||
{
|
||||
public class UndefinedCharRules : ValidationRule
|
||||
{
|
||||
public override ValidationResult Validate(object value, CultureInfo cultureInfo)
|
||||
{
|
||||
char[] chars = new[] { '\\', ':', '{', '}', '[', ']', '|', ';', '<', '>', '?', '`', '~' };
|
||||
if (value != null)
|
||||
{
|
||||
foreach (var c in chars)
|
||||
{
|
||||
if (value.ToString().IndexOf(c) > -1)
|
||||
{
|
||||
return new(false, $"名称不能包含字符:'\\ : [ ] | {{}}; < > ? ` ~");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return ValidationResult.ValidResult;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user