Пример #1
0
        /// <summary>
        /// Загружает список стран, в которые невозможен въезд без страховки
        /// </summary>
        /// <returns></returns>
        private List <Country> LoadCountriesBlacklist()
        {
            List <Country> blacklist = new List <Country>();

            string line;

            System.IO.StreamReader file = null;
            try
            {
                file = new System.IO.StreamReader(blacklistFilename, Encoding.GetEncoding("windows-1251"), true);
                file.ReadLine(); // пропускаем заголовок
                while ((line = file.ReadLine()) != null)
                {
                    blacklist.Add(Country.GetCountry(line));
                }
            }
            catch (IOException) { }
            finally
            {
                if (file != null)
                {
                    file.Close();
                }
            }

            return(blacklist);
        }
Пример #2
0
 private Region(string country, string region)
 {
     this.Country = Country.GetCountry(country);
     this.Name    = region;
 }