整理代码

This commit is contained in:
GG Z
2026-02-20 15:31:44 +08:00
parent 94cf3f3266
commit 9f121cfc7f
149 changed files with 4063 additions and 6964 deletions

View File

@@ -0,0 +1,25 @@
using System.Globalization;
using System.Windows.Controls;
namespace ShrlAlgoToolkit.Mvvm.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;
}
}
}