Пример #1
0
        public string GetCountryTranslatedName(Alpha2Code alpha2Code, string languageCode)
        {
            if (Enum.TryParse(languageCode, true, out LanguageCode code))
            {
                return(this.GetCountryTranslatedName(alpha2Code, code));
            }

            return(null);
        }
Пример #2
0
        public ICountryInfo GetCountry(Alpha2Code alpha2Code)
        {
            if (this._alpha2Code2CountryInfo.TryGetValue(alpha2Code, out ICountryInfo countryInfo))
            {
                return(countryInfo);
            }

            return(null);
        }
Пример #3
0
 public Country(string name, Alpha2Code alpha2Code, Alpha3Code alpha3Code, short numericCode, Region region, string subRegion)
 {
     Name        = name;
     Alpha2Code  = alpha2Code;
     Alpha3Code  = alpha3Code;
     NumericCode = numericCode;
     Region      = region;
     SubRegion   = subRegion;
 }
Пример #4
0
        public ICountryTranslation GetCountryTranslation(Alpha2Code alpha2Code)
        {
            if (this._alpha2Code2CountryTranslation.TryGetValue(alpha2Code, out ICountryTranslation countryTranslation))
            {
                return(countryTranslation);
            }

            return(null);
        }
Пример #5
0
        public string GetCountryTranslatedName(Alpha2Code alpha2Code, CultureInfo culture, LanguageCode defaultLanguageCode)
        {
            var name = this.GetCountryTranslatedName(alpha2Code, culture);

            if (string.IsNullOrWhiteSpace(name) == true)
            {
                name = this.GetCountryTranslatedName(alpha2Code, defaultLanguageCode);
            }
            return(name);
        }
Пример #6
0
 public string GetCountryTranslatedName(Alpha2Code alpha2Code, CultureInfo culture)
 {
     return(this.GetCountryTranslatedName(alpha2Code, culture.TwoLetterISOLanguageName));
 }
Пример #7
0
 public string GetCountryTranslatedName(Alpha2Code alpha2Code, LanguageCode languageCode)
 {
     return(this.GetCountryTranslatedName(GetCountry(alpha2Code), languageCode));
 }
Пример #8
0
        public string GetCountryTranslatedName(Alpha2Code alpha2Code, LanguageCode languageCode)
        {
            var countryInfo = this._countryProvider.GetCountry(alpha2Code);

            return(this.GetCountryTranslatedName(countryInfo, languageCode));
        }