Пример #1
0
        public UDRList(IEnumerable <UDRGeography> geographies)
        {
            GeographyKey  key;
            HashSet <UDR> udrs;
            UDR           udr;

            foreach (UDRGeography geography in geographies)
            {
                key = new GeographyKey(geography.countryName, geography.subCountryName, geography.subSubCountryName, geography.locationId, geography.fieldId);
                if (!UDRs.TryGetValue(key, out udrs))
                {
                    udrs = new HashSet <UDR>();
                    UDRs.Add(key, udrs);
                }
                udr = new UDR(geography.userDefRegionId, geography.generalGeoTypeCd, geography.cropName, geography.userDefRegionName);
                if (!udrs.Contains(udr))
                {
                    udrs.Add(udr);
                }
                if (!scopes.Contains(udr.UdrScope))
                {
                    scopes.Add(udr.UdrScope);
                }
            }
        }
Пример #2
0
 public bool Equals(GeographyKey obj)
 {
     return(this.hashcode == obj.hashcode);
 }