public override bool Equals(object obj)
        {
            var station = obj as Station;

            if (obj == null)
            {
                return(false);
            }

            return((StationName == null && station.StationName == null ||
                    StationName != null && StationName.Equals(station.StationName)) &&
                   (StateCountryName == null && station.StateCountryName == null ||
                    StateCountryName != null && StateCountryName.Equals(station.StateCountryName)) &&
                   (StateProvinceAbbrev == null && station.StateProvinceAbbrev == null ||
                    StateProvinceAbbrev != null && StateProvinceAbbrev.Equals(station.StateProvinceAbbrev)) &&
                   (ICAO == null && station.ICAO == null ||
                    ICAO != null && ICAO.Equals(station.ICAO)) &&
                   (IATA == null && station.IATA == null ||
                    IATA != null && IATA.Equals(station.IATA)) &&
                   SYNOP == station.SYNOP &&
                   (Latitude == null && station.Latitude == null ||
                    Latitude != null && Latitude.Equals(station.Latitude)) &&
                   (Longitude == null && station.Longitude == null ||
                    Longitude != null && Longitude.Equals(station.Longitude)) &&
                   Elevation == station.Elevation &&
                   METAR == station.METAR &&
                   RADAR == station.RADAR &&
                   AviationFlag == station.AviationFlag &&
                   UpperAir == station.UpperAir &&
                   ObservationSystem == station.ObservationSystem &&
                   OfficeType == station.OfficeType &&
                   (Country == null && station.Country == null ||
                    Country != null && Country.Equals(station.Country)) &&
                   Priority == Priority);
        }
Exemple #2
0
 /// <summary>
 /// Two DnsResourceDataGeographicalPosition are equal if their longitude, latitude and altitude fields are equal.
 /// </summary>
 public bool Equals(DnsResourceDataGeographicalPosition other)
 {
     return(other != null &&
            Longitude.Equals(other.Longitude) &&
            Latitude.Equals(other.Latitude) &&
            Altitude.Equals(other.Altitude));
 }
Exemple #3
0
 public static void Convertion()
 {
     if (!Latitude.Equals(""))
     {
         if (Latitude[0] == 'S')
         {
             Latitude = "-" + Latitude.Remove(0, 1);
         }
         else if (Latitude[0] == 'N')
         {
             Latitude = "+" + Latitude.Remove(0, 1);
         }
     }
     if (!Longitude.Equals(""))
     {
         if (Longitude[0] == 'W')
         {
             Longitude = "-" + Longitude.Remove(0, 1);
         }
         else if (Longitude[0] == 'E')
         {
             Longitude = "+" + Longitude.Remove(0, 1);
         }
     }
 }
Exemple #4
0
        public bool Equals(Coordinate obj)
        {
            // STEP 1: Check for null if a reference type
            // (e.g., a reference type)
            // if (obj == null)
            // {
            //     return false;
            // }

            // STEP 2: Check for ReferenceEquals if this
            // is a reference type
            // if ( ReferenceEquals(this, obj))
            // {
            //   return true;
            // }

            // STEP 4: Possibly check for equivalent hash codes
            // if (this.GetHashCode() != obj.GetHashCode())
            // {
            //    return false;
            // }

            // STEP 5: Check base.Equals if base overrides Equals()
            // System.Diagnostics.Debug.Assert(
            //     base.GetType() != typeof(object) );
            // if ( !base.Equals(obj) )
            // {
            //    return false;
            // }

            // STEP 6: Compare identifying fields for equality
            //         using an overload of Equals on Longitude
            return((Longitude.Equals(obj.Longitude)) &&
                   (Latitude.Equals(obj.Latitude)));
        }
Exemple #5
0
 private bool Equals(GeoCoordinateWithError other)
 {
     return(Latitude.Equals(other.Latitude) &&
            Longitude.Equals(other.Longitude) &&
            LatitudeError.Equals(other.LatitudeError) &&
            LongitudeError.Equals(other.LongitudeError));
 }
Exemple #6
0
 /// <summary>
 /// Check if this Geodetic coordinate equals <paramref name="other"/>
 /// </summary>
 /// <param name="other">The other coordinate to be compared with</param>
 /// <returns>True if two coordinates equals</returns>
 public bool Equals(GeodeticCoordinate other)
 {
     return
         (Latitude.Equals(other.Latitude) &&
          Longitude.Equals(other.Longitude) &&
          Altitude.Equals(other.Altitude));
 }
        /// <inheritdoc />
        public bool Equals(StatusEvent other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return(Flags == other.Flags &&
                   CheckPips(Pips, other.Pips) &&
                   FireGroup == other.FireGroup &&
                   GuiFocus == other.GuiFocus &&
                   Equals(Fuel, other.Fuel) &&
                   LegalState == other.LegalState &&
                   Cargo == other.Cargo &&
                   Latitude.Equals(other.Latitude) &&
                   Altitude.Equals(other.Altitude) &&
                   Longitude.Equals(other.Longitude) &&
                   Heading.Equals(other.Heading) &&
                   BodyName == other.BodyName &&
                   PlanetRadius.Equals(other.PlanetRadius));
        }
Exemple #8
0
        public override int GetHashCode(SpatialEqualityOptions options)
        {
            unchecked
            {
                var latitude  = Latitude;
                var longitude = Longitude;

                if (options.PoleCoordiantesAreEqual && (Latitude.Equals(90) || Latitude.Equals(-90)))
                {
                    longitude = 0;
                }
                else if (options.AntiMeridianCoordinatesAreEqual && Longitude.Equals(-180))
                {
                    longitude = 180;
                }

                var hashCode = latitude.GetHashCode();
                hashCode = (hashCode * 397) ^ longitude.GetHashCode();
                if (options.UseElevation)
                {
                    hashCode = (hashCode * 397) ^ Measure.GetHashCode();
                }
                return(hashCode);
            }
        }
Exemple #9
0
        /// <summary>
        /// Returns true if Location instances are equal
        /// </summary>
        /// <param name="other">Instance of Location to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(Location other)
        {
            if (other is null)
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     Latitude == other.Latitude ||
                     Latitude != null &&
                     Latitude.Equals(other.Latitude)
                     ) &&
                 (
                     Longitude == other.Longitude ||
                     Longitude != null &&
                     Longitude.Equals(other.Longitude)
                 ) &&
                 (
                     Altitude == other.Altitude ||
                     Altitude != null &&
                     Altitude.Equals(other.Altitude)
                 ));
        }
Exemple #10
0
 protected bool Equals(ReverseGeocodeQuery other)
 {
     return(Latitude.Equals(other.Latitude) &&
            Longitude.Equals(other.Longitude) &&
            Limit == other.Limit &&
            Radius == other.Radius &&
            WideSearch.Equals(other.WideSearch));
 }
Exemple #11
0
 public bool Equals(GeoCoordinate other)
 {
     if (object.ReferenceEquals(other, null))
     {
         return(false);
     }
     return(Latitude.Equals(other.Latitude) && Longitude.Equals(other.Longitude));
 }
Exemple #12
0
        public void LongitudeParceTest()
        {
            var result = Longitude.TryParse(_westLongitudeDouble.ToString(CultureInfo.InvariantCulture), out var longitude);

            Assert.IsTrue(result);
            Assert.IsTrue(westLongitude.Equals(longitude));
            Assert.IsFalse(westLongitude == longitude);
        }
 /// <summary>Indicates whether the current object is equal to another object of the same type.</summary>
 /// <param name="other">An object to compare with this object.</param>
 /// <returns>
 ///   <see langword="true" /> if the current object is equal to the <paramref name="other" /> parameter; otherwise, <see langword="false" />.</returns>
 public bool Equals(Cliente other)
 {
     return(Id.Equals(other.Id) &&
            Nome.Equals(other.Nome) &&
            Latitude.Equals(other.Latitude) &&
            Longitude.Equals(other.Longitude) &&
            UserId.Equals(other.UserId) &&
            Password.Equals(other.Password));
 }
 protected bool Equals(GeoIPCityBo other)
 {
     return(LocationId == other.LocationId && string.Equals(CountryCode, other.CountryCode) &&
            string.Equals(RegionCode, other.RegionCode) &&
            string.Equals(CityName, other.CityName) &&
            string.Equals(PostalCode, other.PostalCode) &&
            Latitude.Equals(other.Latitude) && Longitude.Equals(other.Longitude) &&
            MetroCode == other.MetroCode &&
            string.Equals(AreaCode, other.AreaCode));
 }
Exemple #15
0
        public override bool Equals(object obj)
        {
            var objToCompare = obj as Location;

            if (objToCompare == null)
            {
                return(false);
            }

            return(Latitude.Equals(objToCompare.Latitude) && Longitude.Equals(objToCompare.Longitude));
        }
 /// <summary>
 /// Two DnsResourceDataLocationInformation are equal iff their version, size, horizontal precision, vertical precision, latitude,
 /// longitude and altitude fields are equal.
 /// </summary>
 public bool Equals(DnsResourceDataLocationInformation other)
 {
     return(other != null &&
            Version.Equals(other.Version) &&
            Size.Equals(other.Size) &&
            HorizontalPrecision.Equals(other.HorizontalPrecision) &&
            VerticalPrecision.Equals(other.VerticalPrecision) &&
            Latitude.Equals(other.Latitude) &&
            Longitude.Equals(other.Longitude) &&
            Altitude.Equals(other.Altitude));
 }
Exemple #17
0
 //Automatically generated POG
 //Models shouldn't have too much logic, but some comparison should be ok
 public bool Equals(LocationModel other)
 {
     if (ReferenceEquals(null, other))
     {
         return(false);
     }
     if (ReferenceEquals(this, other))
     {
         return(true);
     }
     return(Longitude.Equals(other.Longitude) && Latitude.Equals(other.Latitude) && Altitude.Equals(other.Altitude));
 }
Exemple #18
0
 public bool Equals(Location other)
 {
     if (ReferenceEquals(null, other))
     {
         return(false);
     }
     if (ReferenceEquals(this, other))
     {
         return(true);
     }
     return(Latitude.Equals(other.Latitude) && Longitude.Equals(other.Longitude) && Accuracy.Equals(other.Accuracy) && Altitude.Equals(other.Altitude) && VerticalAccuracy.Equals(other.VerticalAccuracy) && Bearing.Equals(other.Bearing) && Speed.Equals(other.Speed));
 }
Exemple #19
0
 public bool Equals(ImageBase other)
 {
     if (other is null)
     {
         return(false);
     }
     if (ReferenceEquals(this, other))
     {
         return(true);
     }
     return(string.Equals(Path, other.Path) && Size == other.Size && DateModified.Equals(other.DateModified) &&
            Height == other.Height && Width == other.Width && DateTaken.Equals(other.DateTaken) &&
            Latitude.Equals(other.Latitude) && Longitude.Equals(other.Longitude));
 }
Exemple #20
0
        public override bool Equals(object obj, SpatialEqualityOptions options)
        {
            var other = obj as Coordinate;

            if (ReferenceEquals(null, other))
            {
                return(false);
            }

            var other2 = other as CoordinateZM;

            if (ReferenceEquals(null, other2))
            {
                return(false);
            }

            if (options.UseElevation && !Elevation.Equals(other2.Elevation))
            {
                return(false);
            }

            if (options.UseM && !Measure.Equals(other2.Measure))
            {
                return(false);
            }

            if (Latitude.Equals(other.Latitude))
            {
                if (options.PoleCoordiantesAreEqual && Latitude.Equals(90d) || Latitude.Equals(-90d))
                {
                    return(true);
                }

                if (Longitude.Equals(other.Longitude))
                {
                    return(true);
                }

                if (options.AntiMeridianCoordinatesAreEqual)
                {
                    if (Longitude.Equals(180) && other.Longitude.Equals(-180) ||
                        Longitude.Equals(-180) && other.Longitude.Equals(180))
                    {
                        return(true);
                    }
                }
            }

            return(false);
        }
Exemple #21
0
        /// <summary>
        /// Determines whether the specified <see cref="LocationServicePosition"/> has the same latitude and longitude values as this one.
        /// </summary>
        /// <param name="other">The <see cref="LocationServicePosition"/> object to compare with the current instance.</param>
        /// <returns>true if the latitude and longitude properties of both objects have the same value; otherwise, false.</returns>
        public bool Equals(LocationServicePosition other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }

            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return(Latitude.Equals(other.Latitude) && Longitude.Equals(other.Longitude));
        }
Exemple #22
0
        public bool Equals(InstallationLocation other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }

            if (ReferenceEquals(this, other))
            {
                return(true);
            }
            return(Latitude.Equals(other.Latitude) &&
                   Longitude.Equals(other.Longitude) &&
                   Elevation.Equals(other.Elevation));
        }
        public IEnumerable <ValidationResult> Validate(ValidationContext validationContext)
        {
            List <ValidationResult> errors = new List <ValidationResult>();

            if (Longitude.Equals(0.0))
            {
                errors.Add(new ValidationResult("Enter Non-Zero Longitude.", new string[] { "Longitude" }));
            }
            if (Latitude.Equals(0.0))
            {
                errors.Add(new ValidationResult("Enter Non-Zero Latitude.", new string[] { "Latitude" }));
            }

            return(errors);
        }
        public override bool Equals(object obj)
        {
            if (obj == null)
            {
                return(false);
            }
            if (obj.GetType() != this.GetType())
            {
                return(false);
            }

            WorldPoint other = (WorldPoint)obj;

            return
                (Latitude.Equals(other.Latitude) &&
                 Longitude.Equals(other.Longitude) &&
                 FixTime.Equals(other.FixTime));
        }
Exemple #25
0
 public bool Equals(InstallationEntity other)
 {
     if (ReferenceEquals(null, other))
     {
         return(false);
     }
     if (ReferenceEquals(this, other))
     {
         return(true);
     }
     return(Id == other.Id &&
            ExternalId == other.ExternalId &&
            IsAirly == other.IsAirly &&
            Latitude.Equals(other.Latitude) &&
            Longitude.Equals(other.Longitude) &&
            Elevation.Equals(other.Elevation) &&
            Equals(Address, other.Address) &&
            Equals(Sponsor, other.Sponsor));
 }
Exemple #26
0
        public bool AreEqual(PlaceMarkViewModel secondMark)
        {
            if (!Altitude.Equals(secondMark.Altitude))
            {
                return(false);
            }

            if (!Longitude.Equals(secondMark.Longitude))
            {
                return(false);
            }

            if (!Latitude.Equals(secondMark.Latitude))
            {
                return(false);
            }

            return(true);
        }
Exemple #27
0
        public override bool Equals(object obj)
        {
            if (obj is null)
            {
                return(false);
            }
            if (ReferenceEquals(this, obj))
            {
                return(true);
            }
            if (obj.GetType() != GetType())
            {
                return(false);
            }

            var other = (GeoPoint)obj;

            return(Longitude.Equals(other.Longitude) && Latitude.Equals(other.Latitude));
        }
        /// <summary>
        /// Returns true if GeoCoordinates instances are equal
        /// </summary>
        /// <param name="other">Instance of GeoCoordinates to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(GeoCoordinates other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     Elevation == other.Elevation ||
                     Elevation != null &&
                     Elevation.Equals(other.Elevation)
                     ) &&
                 (
                     Latitude == other.Latitude ||
                     Latitude != null &&
                     Latitude.Equals(other.Latitude)
                 ) &&
                 (
                     Longitude == other.Longitude ||
                     Longitude != null &&
                     Longitude.Equals(other.Longitude)
                 ) &&
                 (
                     Type == other.Type ||
                     Type != null &&
                     Type.Equals(other.Type)
                 ) &&
                 (
                     Name == other.Name ||
                     Name != null &&
                     Name.Equals(other.Name)
                 ));
        }
Exemple #29
0
        public override bool Equals(object obj, SpatialEqualityOptions options)
        {
            var other = obj as Coordinate;

            if (ReferenceEquals(null, other))
            {
                return(false);
            }

            if (other.Is3D || other.IsMeasured)
            {
                return(false);
            }

            if (Latitude.Equals(other.Latitude))
            {
                if (options.PoleCoordiantesAreEqual && Latitude.Equals(90d) || Latitude.Equals(-90d))
                {
                    return(true);
                }

                if (Longitude.Equals(other.Longitude))
                {
                    return(true);
                }

                if (options.AntiMeridianCoordinatesAreEqual)
                {
                    if (Longitude.Equals(180) && other.Longitude.Equals(-180) ||
                        Longitude.Equals(-180) && other.Longitude.Equals(180))
                    {
                        return(true);
                    }
                }
            }

            return(false);
        }
Exemple #30
0
        /// <summary>
        /// Returns true if StationItem instances are equal
        /// </summary>
        /// <param name="other">Instance of StationItem to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(StationItem other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     Id == other.Id ||
                     Id != null &&
                     Id.Equals(other.Id)
                     ) &&
                 (
                     Name == other.Name ||
                     Name != null &&
                     Name.Equals(other.Name)
                 ) &&
                 (
                     Latitude == other.Latitude ||
                     Latitude != null &&
                     Latitude.Equals(other.Latitude)
                 ) &&
                 (
                     Longitude == other.Longitude ||
                     Longitude != null &&
                     Longitude.Equals(other.Longitude)
                 ) &&
                 (
                     Comment == other.Comment ||
                     Comment != null &&
                     Comment.Equals(other.Comment)
                 ));
        }