コード例 #1
0
        // Get country by alpha3 code.
        public static Country GetCountryByAlpha3(CountryCodeAlpha3 code)
        {
            if (code == CountryCodeAlpha3.None)
            {
                return(null);
            }

            return(CountryList.FirstOrDefault(c => c.Alpha3 == code));
        }
コード例 #2
0
 public Country(string shortName, string fullName, string activeDirectoryName, CountryCode alpha2,
                CountryCodeAlpha3 alpha3, int?numeric)
 {
     ShortName           = shortName;
     FullName            = fullName;
     ActiveDirectoryName = activeDirectoryName;
     Alpha2  = alpha2;
     Alpha3  = alpha3;
     Numeric = numeric;
 }
コード例 #3
0
        public void ActiveDirectoryAlpha3EnumTest(CountryCodeAlpha3 code)
        {
            var query = Countries.GetCountryByAlpha3(code);

            Assert.IsNotNull(query);
        }
コード例 #4
0
 public static CountryCodeAlpha2 ToAlpha2(this CountryCodeAlpha3 countryCode)
 {
     return((CountryCodeAlpha2)countryCode);
 }