コード例 #1
0
        public bool IsSpam(string countryCode)
        {
            if (!System.Enum.IsDefined(typeof(CountryWhiteList), Extension.ToUpper()) ||
                !System.Enum.IsDefined(typeof(CountryWhiteList), countryCode.ToUpper()))
            {
                Validity += "Extension or IP country code is not valid.\n";
                IsValid   = false;
            }

            if (Identifier.Count(Char.IsLetter) <= Identifier.Count(char.IsDigit))
            {
                Validity += "Identifier should have more letters than digits.\n";
                IsValid   = false;
            }

            if (Domains.Count() > 3)
            {
                Validity += "Number of Domains should be less than 3.\n";
                IsValid   = false;
            }

            return(IsValid);
        }