Example #1
0
 public OsmCity(long osmId, string name, string suburbDistrict, LocalityType localityType)
 {
     OsmId          = osmId;
     Name           = name;
     SuburbDistrict = suburbDistrict;
     LocalityType   = localityType;
 }
Example #2
0
 void Completion_MatchSelected(object o, MatchSelectedArgs args)
 {
     city         = args.Model.GetValue(args.Iter, (int)columns.City).ToString();
     cityDistrict = args.Model.GetValue(args.Iter, (int)columns.District).ToString();
     locality     = (LocalityType)args.Model.GetValue(args.Iter, (int)columns.Locality);
     UpdateText();
     OsmId = (long)args.Model.GetValue(args.Iter, (int)columns.OsmId);
     OnCitySelected();
     args.RetVal = true;
 }
Example #3
0
 public static string ConvertToString(this LocalityType localityType)
 {
     return(LocalityTypeConsts.Dict[localityType]);
 }
Example #4
0
 void Completion_MatchSelected(object o, MatchSelectedArgs args)
 {
     city = args.Model.GetValue (args.Iter, (int)columns.City).ToString ();
     cityDistrict = args.Model.GetValue (args.Iter, (int)columns.District).ToString ();
     locality = (LocalityType)args.Model.GetValue (args.Iter, (int)columns.Locality);
     UpdateText ();
     osmId = (long)args.Model.GetValue (args.Iter, (int)columns.OsmId);
     OnCitySelected ();
     args.RetVal = true;
 }
Example #5
0
 public static string GetShortNameOfLocalityType(LocalityType type)
 {
     switch (type) {
     case LocalityType.allotments:
         return "д.п.";
     case LocalityType.city:
         return "г.";
     case LocalityType.farm:
         return "фер.";
     case LocalityType.hamlet:
         return "дер.";
     case LocalityType.isolated_dwelling:
         return "х.";
     case LocalityType.town:
         return "г.";
     case LocalityType.village:
         return "н.п.";
     default:
         throw new NotSupportedException ();
     }
 }
Example #6
0
 public long GetCityId(string City, string CityDistrict, LocalityType localityType)
 {
     logger.Debug($"Запрос id для города {City}({CityDistrict})...");
     return(Osm.GetCityId(City, CityDistrict, localityType.ToString()));;
 }