Ejemplo n.º 1
0
        /// <summary>
        /// Adds a new entry.
        /// </summary>
        /// <param name="country"></param>
        /// <param name="postalCode"></param>
        /// <param name="commune"></param>
        /// <param name="street"></param>
        /// <param name="houseNumber"></param>
        /// <param name="value"></param>
        public void Add(string country, string postalCode, string commune, string street,
                        string houseNumber, GeoCoordinate value)
        {
            IndexCommunes communes = _index.SearchExact(postalCode);

            if (communes == null)
            {
                communes = new IndexCommunes();
                _index.Add(postalCode, communes);
            }
            IndexStreets streets = communes.SearchExact(commune);

            if (streets == null)
            {
                streets = new IndexStreets();
                communes.Add(commune, streets);
            }
            IndexHouseNumbers numbers = streets.SearchExact(street);

            if (numbers == null)
            {
                numbers = new IndexHouseNumbers();
                streets.Add(street, numbers);
            }
            numbers.Add(houseNumber, value);
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Adds a new entry.
 /// </summary>
 /// <param name="country"></param>
 /// <param name="postalCode"></param>
 /// <param name="commune"></param>
 /// <param name="street"></param>
 /// <param name="houseNumber"></param>
 /// <param name="value"></param>
 public void Add(string country, string postalCode, string commune, string street, 
     string houseNumber, GeoCoordinate value)
 {
     IndexCommunes communes = _index.SearchExact(postalCode);
     if (communes == null)
     {
         communes = new IndexCommunes();
         _index.Add(postalCode, communes);
     }
     IndexStreets streets = communes.SearchExact(commune);
     if (streets == null)
     {
         streets = new IndexStreets();
         communes.Add(commune, streets);
     }
     IndexHouseNumbers numbers = streets.SearchExact(street);
     if (numbers == null)
     {
         numbers = new IndexHouseNumbers();
         streets.Add(street, numbers);
     }
     numbers.Add(houseNumber, value);
 }