Esempio n. 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);
        }
Esempio n. 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);
        }
Esempio n. 3
0
 public override ValidationException Validate(ValidatedObject credentials)
 {
     return(this.hadnler.Validate(credentials));
 }
Esempio n. 4
0
 public abstract ValidationException Validate(ValidatedObject toValidate);