public override bool IsRequiredInternal(object state)
        {
            AccountCountry accountCountry = this.GetAccountCountry(state);

            if (accountCountry != null)
            {
                CountryFieldValidator validator = accountCountry.GetValidator(this._fieldValidatorType);
                if (validator != null && !string.IsNullOrEmpty(validator.Regex))
                {
                    return(true);
                }
            }
            return(false);
        }
        internal override string GetLabelString(object state)
        {
            string         str            = string.Empty;
            AccountCountry accountCountry = this.GetAccountCountry(state);

            if (accountCountry != null)
            {
                CountryFieldValidator validator = accountCountry.GetValidator(this._fieldValidatorType);
                if (validator != null)
                {
                    str = Shell.LoadString(validator.NameStringId);
                }
            }
            return(str);
        }
        internal override string GetOverlayString(object state)
        {
            string         str            = string.Empty;
            AccountCountry accountCountry = this.GetAccountCountry(state);

            if (accountCountry != null)
            {
                CountryFieldValidator validator = accountCountry.GetValidator(this._fieldValidatorType);
                if (validator != null)
                {
                    str = validator.FriendlyFormat;
                }
            }
            return(str);
        }
        public override bool IsValidInternal(string value, object state)
        {
            string         pattern        = null;
            AccountCountry accountCountry = this.GetAccountCountry(state);

            if (accountCountry == null)
            {
                return(true);
            }
            if (accountCountry != null)
            {
                CountryFieldValidator validator = accountCountry.GetValidator(this._fieldValidatorType);
                if (validator != null && !string.IsNullOrEmpty(validator.Regex))
                {
                    pattern = validator.Regex;
                }
            }
            return(string.IsNullOrEmpty(pattern) || value != null && Regex.IsMatch(value, pattern));
        }