Esempio n. 1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Country"/> class.
        /// </summary>
        /// <param name="twoLetterIsoCode">The two letter ISO code.</param>
        protected Country(string twoLetterIsoCode)
        {
            Validate.Is.Not.Null(twoLetterIsoCode, "twoLetterIsoCode");
            switch (twoLetterIsoCode)
            {
            case "US":
                this.divisions = CountryDivision.GetUnitedStatesDivisions(this);
                break;

            case "CA":
                this.divisions = CountryDivision.GetCanadaDivisions(this);
                break;

            default:
                this.divisions = new ReadOnlyCollection <CountryDivision>(new List <CountryDivision>());
                break;
            }
        }
Esempio n. 2
0
 /// <summary>
 /// Returns true if they are equal.
 /// </summary>
 /// <param name="other">The other.</param>
 /// <returns>True if they are equal.</returns>
 public bool Equals(CountryDivision other)
 {
     return(this.TwoLetterCode == other.TwoLetterCode && this.Type == other.Type && this.EnglishName == other.EnglishName && this.NativeName == other.NativeName);
 }