Пример #1
0
 internal bool IsValid()
 {
     return(PassportValidator.SimpleValidate(this) &&
            PassportValidator.ValidateBYR(Extract("byr")) &&
            PassportValidator.ValidateIYR(Extract("iyr")) &&
            PassportValidator.ValidateEYR(Extract("eyr")) &&
            PassportValidator.ValidateHeight(Extract("hgt")) &&
            PassportValidator.ValidateHairColor(Extract("hcl")) &&
            PassportValidator.ValidatePattern(Extract("ecl"), "^(amb|blu|brn|gry|grn|hzl|oth)$") &&
            PassportValidator.ValidatePattern(Extract("pid"), @"\d{9}"));
 }