Esempio 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();
 }
Esempio 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;
 }
Esempio 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);
        }
Esempio 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);
     }
 }
Esempio 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);
 }
Esempio 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);
 }
Esempio n. 7
0
 public LocationReference(NamedLocation namedLocation)
 {
     this.Set(namedLocation);
 }
Esempio n. 8
0
 internal LocationReference(string unstructuredLocation, NamedLocation namedLocation, CountrySubdivision countrySubdivision, Locality locality)
 {
     Set(unstructuredLocation, namedLocation, countrySubdivision, locality);
 }
Esempio n. 9
0
 public static bool IsLocationSynonym(this Country country, string location, NamedLocation namedLocation)
 {
     return(GetCountryFinder(country.Id).IsLocationSynonym(location, namedLocation));
 }
Esempio n. 10
0
 public PartialMatch(bool isSynonym, string key, NamedLocation namedLocation)
 {
     _isSynonym     = isSynonym;
     _key           = key;
     _namedLocation = namedLocation.Clone();
 }
Esempio n. 11
0
 public PartialMatch(string key, NamedLocation namedLocation)
     : this(false, key, namedLocation)
 {
 }