14 lines
441 B
C#
14 lines
441 B
C#
|
8 years ago
|
namespace Yavsc.Attributes.Validation
|
||
|
|
{
|
||
|
|
public class YaRegularExpression : System.ComponentModel.DataAnnotations.RegularExpressionAttribute {
|
||
|
|
public YaRegularExpression(string pattern): base (pattern)
|
||
|
|
{
|
||
|
|
this.ErrorMessage = pattern;
|
||
|
|
}
|
||
|
|
|
||
|
|
public override string FormatErrorMessage(string name)
|
||
|
|
{
|
||
|
|
return Startup.GlobalLocalizer[this.ErrorMessageResourceName];
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|