PWA Fundvelo der Caritas.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

BicycleGeoPosition.cs 1.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. using System;
  2. namespace cwebplusApp.Shared.Models {
  3. public class BicycleGeoPosition {
  4. private string displayCity;
  5. public double Latitude { get; set; }
  6. public double Longitude { get; set; }
  7. public string Address { get; set; }
  8. public string City { get; set; }
  9. public string Zip { get; set; }
  10. public string DisplayCity {
  11. get { return displayCity; }
  12. set {
  13. displayCity = value;
  14. decodeDisplayCity(value);
  15. }
  16. }
  17. public BicycleGeoPosition() {
  18. Latitude = 0.0;
  19. Longitude = 0.0;
  20. Address = "";
  21. Zip = "";
  22. City = "";
  23. DisplayCity = "";
  24. }
  25. private void decodeDisplayCity(string displayCity) {
  26. if (!String.IsNullOrEmpty(displayCity)) {
  27. displayCity = displayCity.Trim();
  28. char[] delimiterChars = { '-', ' ' };
  29. string[] tokens = displayCity.Split(delimiterChars);
  30. if (tokens.Length == 3) {
  31. Zip = tokens[1];
  32. City = tokens[2];
  33. } else if (tokens.Length == 2) {
  34. Zip = tokens[0];
  35. City = tokens[1];
  36. }
  37. }
  38. }
  39. }
  40. }