Esempio n. 1
0
        bool ILocationQuery.Contains(LocationReference location1, LocationReference location2)
        {
            // Do some special cases first: Country.

            if (location1.IsCountry && location1.Country.Equals(location2.Country))
            {
                return(true);
            }
            if (!location1.Country.Equals(location2.Country))
            {
                return(false);
            }

            // Country subdivision.

            if (location1.NamedLocation is CountrySubdivision)
            {
                return(Contains(location1.CountrySubdivision, location2));
            }

            // Region.

            if (location1.NamedLocation is Region)
            {
                return(Contains(location1.Region, location2));
            }

            // For now simply compare.

            return(location1.Equals(location2));
        }
Esempio n. 2
0
        public override bool Equals(object obj)
        {
            if (obj is TnfDirectLocationReference)
            {
                var v = obj as TnfDirectLocationReference;

                if (PropertyOid.Equals(v.PropertyOid) &&
                    LocationReferenceType.Equals(v.LocationReferenceType) &&
                    LocationReference.Equals(v.LocationReference) &&
                    SeqNo.Equals(v.SeqNo))
                {
                    return(true);
                }
            }

            return(false);
        }