protected override ValidatorResult Validate()
        {
            if (!File.Exists(Input))
            {
                return(ValidatorResult.CreateInvalid(Global.GetStringResource("StringFileNotExists")));
            }

            return(ValidatorResult.CreateValid(Input));
        }
        protected override ValidatorResult Validate()
        {
            foreach (char c in Input)
            {
                if (char.IsWhiteSpace(c))
                {
                    return(ValidatorResult.CreateInvalid(Global.GetStringResource("StringIllegalCharacters")));
                }
            }

            return(ValidatorResult.CreateValid(Input));
        }
Ejemplo n.º 3
0
 public ValidatorResult Validate(string boardingPass)
 {
     if (string.IsNullOrEmpty(boardingPass))
     {
         return(ValidatorResult.CreateInvalid("LoginBoardingPassEmptyErrorText"));
     }
     if (boardingPass.Length != 6 || boardingPass.Length == 6 && boardingPass.Contains(" "))
     {
         return(ValidatorResult.CreateInvalid("LoginBoardingPassIncorrectNumberOfDigitsErrorText"));
     }
     return(ValidatorResult.CreateValid());
 }
Ejemplo n.º 4
0
        public ValidatorResult Validate(string pinCode)
        {
            if (string.IsNullOrEmpty(pinCode))
            {
                return(ValidatorResult.CreateInvalid("WorkspacePinCodeEmptyErrorText"));
            }
            int result;

            if (!int.TryParse(pinCode, out result))
            {
                return(ValidatorResult.CreateInvalid("WorkspacePinCodeOnlyNumbersAllowedErrorText"));
            }
            if (pinCode.Length != 5 || pinCode.Length == 5 && pinCode.Contains(" "))
            {
                return(ValidatorResult.CreateInvalid("WorkspacePinCodeIncorrectNumberOfDigitsErrorText"));
            }
            return(ValidatorResult.CreateValid());
        }
        protected override ValidatorResult Validate()
        {
            if (Input == null)
            {
                return(ValidatorResult.CreateInvalid(Global.GetStringResource("StringInnerError")));
            }

            int result;

            if (!int.TryParse(Input, out result))
            {
                return(ValidatorResult.CreateInvalid(Global.GetStringResource("StringIllegalCharacters")));
            }

            if (result < m_min || result > m_max)
            {
                return(ValidatorResult.CreateInvalid(string.Format(Global.GetStringResource("StringFormatMustBeInRange"), m_min, m_max)));
            }

            return(ValidatorResult.CreateValid(result));
        }
Ejemplo n.º 6
0
 protected override ValidatorResult Validate()
 {
     string[] result = Input.Split(Separator);
     return(ValidatorResult.CreateValid(result));
 }