Ejemplo n.º 1
0
 public void CopyTo(LocationReference location)
 {
     location.UnstructuredLocation = UnstructuredLocation;
     location.NamedLocation        = NamedLocation == null ? null : NamedLocation.Clone();
     location.CountrySubdivision   = CountrySubdivision == null ? null : CountrySubdivision.Clone();
     location.Locality             = Locality == null ? null : Locality.Clone();
 }
Ejemplo n.º 2
0
 internal void Set(string unstructuredLocation, NamedLocation namedLocation, CountrySubdivision countrySubdivision, Locality locality)
 {
     UnstructuredLocation = unstructuredLocation == string.Empty ? null : unstructuredLocation;
     NamedLocation        = namedLocation;
     CountrySubdivision   = countrySubdivision;
     Locality             = locality;
 }
Ejemplo n.º 3
0
        public override int GetHashCode()
        {
            var hashCode = (UnstructuredLocation ?? string.Empty).GetHashCode()
                           ^ (NamedLocation == null ? 0 : NamedLocation.GetHashCode())
                           ^ (CountrySubdivision == null ? 0 : CountrySubdivision.GetHashCode())
                           ^ (Locality == null ? 0 : Locality.GetHashCode());

            return(hashCode);
        }
Ejemplo n.º 4
0
 public static void Set(this LocationReference locationReference, NamedLocation namedLocation)
 {
     if (namedLocation is CountrySubdivision)
     {
         Set(locationReference, (CountrySubdivision)namedLocation);
     }
     else if (namedLocation is Region)
     {
         Set(locationReference, (Region)namedLocation);
     }
     else if (namedLocation is Locality)
     {
         Set(locationReference, (Locality)namedLocation);
     }
     else if (namedLocation is PostalCode)
     {
         Set(locationReference, (PostalCode)namedLocation);
     }
     else if (namedLocation is PostalSuburb)
     {
         Set(locationReference, (PostalSuburb)namedLocation);
     }
 }
Ejemplo n.º 5
0
 public static CountrySubdivision GetCountrySubdivision(NamedLocation namedLocation)
 {
     if (namedLocation is Locality)
     {
         return(GetCountrySubdivision((Locality)namedLocation));
     }
     if (namedLocation is PostalCode)
     {
         return(GetCountrySubdivision((PostalCode)namedLocation));
     }
     if (namedLocation is Region)
     {
         return(GetCountrySubdivision((Region)namedLocation));
     }
     if (namedLocation is PostalSuburb)
     {
         return(((PostalSuburb)namedLocation).CountrySubdivision);
     }
     if (namedLocation is CountrySubdivision)
     {
         return((CountrySubdivision)namedLocation);
     }
     return(null);
 }
Ejemplo n.º 6
0
 public static NamedLocation Clone(this NamedLocation namedLocation)
 {
     if (namedLocation is Locality)
     {
         return(Clone((Locality)namedLocation));
     }
     if (namedLocation is PostalCode)
     {
         return(Clone((PostalCode)namedLocation));
     }
     if (namedLocation is Region)
     {
         return(Clone((Region)namedLocation));
     }
     if (namedLocation is PostalSuburb)
     {
         return(Clone((PostalSuburb)namedLocation));
     }
     if (namedLocation is CountrySubdivision)
     {
         return(Clone((CountrySubdivision)namedLocation));
     }
     return(null);
 }
Ejemplo n.º 7
0
 public LocationReference(NamedLocation namedLocation)
 {
     this.Set(namedLocation);
 }
Ejemplo n.º 8
0
 internal LocationReference(string unstructuredLocation, NamedLocation namedLocation, CountrySubdivision countrySubdivision, Locality locality)
 {
     Set(unstructuredLocation, namedLocation, countrySubdivision, locality);
 }
Ejemplo n.º 9
0
 public static bool IsLocationSynonym(this Country country, string location, NamedLocation namedLocation)
 {
     return(GetCountryFinder(country.Id).IsLocationSynonym(location, namedLocation));
 }
Ejemplo n.º 10
0
 public PartialMatch(bool isSynonym, string key, NamedLocation namedLocation)
 {
     _isSynonym     = isSynonym;
     _key           = key;
     _namedLocation = namedLocation.Clone();
 }
Ejemplo n.º 11
0
 public PartialMatch(string key, NamedLocation namedLocation)
     : this(false, key, namedLocation)
 {
 }