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(); }
internal void Set(string unstructuredLocation, NamedLocation namedLocation, CountrySubdivision countrySubdivision, Locality locality) { UnstructuredLocation = unstructuredLocation == string.Empty ? null : unstructuredLocation; NamedLocation = namedLocation; CountrySubdivision = countrySubdivision; Locality = locality; }
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); }
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); } }
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); }
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); }
public LocationReference(NamedLocation namedLocation) { this.Set(namedLocation); }
internal LocationReference(string unstructuredLocation, NamedLocation namedLocation, CountrySubdivision countrySubdivision, Locality locality) { Set(unstructuredLocation, namedLocation, countrySubdivision, locality); }
public static bool IsLocationSynonym(this Country country, string location, NamedLocation namedLocation) { return(GetCountryFinder(country.Id).IsLocationSynonym(location, namedLocation)); }
public PartialMatch(bool isSynonym, string key, NamedLocation namedLocation) { _isSynonym = isSynonym; _key = key; _namedLocation = namedLocation.Clone(); }
public PartialMatch(string key, NamedLocation namedLocation) : this(false, key, namedLocation) { }