示例#1
0
        public override ValidationException Validate(ValidatedObject credentials)
        {
            string username = credentials.Username;
            Regex  regex    = new Regex(@"[A-Za-z0-9]{3,24}");

            if (!regex.IsMatch(username))
            {
                return(new ValidationException("Login has to contain only latin letters and numbers and contain from 3 to 24 symbols", "login"));
            }
            if (this.hadnler != null)
            {
                return(this.hadnler.Validate(credentials));
            }
            return(null);
        }
示例#2
0
        public override ValidationException Validate(ValidatedObject credentials)
        {
            string password = credentials.Password;
            Regex  regex    = new Regex(@"[A-Za-z0-9]{3,24}");

            if (!regex.IsMatch(password))
            {
                return(new ValidationException("Pasword has to contain only latin letters and numbers and contain from 3 to 24 symbols", "password"));
            }
            if (this.hadnler != null)
            {
                return(this.hadnler.Validate(credentials));
            }
            return(null);
        }
示例#3
0
 public override ValidationException Validate(ValidatedObject credentials)
 {
     return(this.hadnler.Validate(credentials));
 }
示例#4
0
 public abstract ValidationException Validate(ValidatedObject toValidate);