示例#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();
 }
示例#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;
 }
示例#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);
        }
示例#4
0
文件: World.cs 项目: formist/LinkMe
 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);
     }
 }
示例#5
0
文件: World.cs 项目: formist/LinkMe
 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);
 }
示例#6
0
文件: World.cs 项目: formist/LinkMe
 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);
 }
示例#7
0
 public LocationReference(NamedLocation namedLocation)
 {
     this.Set(namedLocation);
 }
示例#8
0
 internal LocationReference(string unstructuredLocation, NamedLocation namedLocation, CountrySubdivision countrySubdivision, Locality locality)
 {
     Set(unstructuredLocation, namedLocation, countrySubdivision, locality);
 }
示例#9
0
文件: World.cs 项目: formist/LinkMe
 public static bool IsLocationSynonym(this Country country, string location, NamedLocation namedLocation)
 {
     return(GetCountryFinder(country.Id).IsLocationSynonym(location, namedLocation));
 }
示例#10
0
 public PartialMatch(bool isSynonym, string key, NamedLocation namedLocation)
 {
     _isSynonym     = isSynonym;
     _key           = key;
     _namedLocation = namedLocation.Clone();
 }
示例#11
0
 public PartialMatch(string key, NamedLocation namedLocation)
     : this(false, key, namedLocation)
 {
 }