Пример #1
0
        public override int GetHashCode()
        {
            int hashProductNumber = Number == null ? 0 : Number.GetHashCode();

            int hashProductTypeKey  = TypeKey.GetHashCode();
            int hashProductId       = Id.GetHashCode();
            int hashProductInnerId  = InnerId.GetHashCode();
            int hashProductLocation = IsHome.GetHashCode();

            return(hashProductNumber ^
                   hashProductId ^
                   hashProductInnerId ^
                   hashProductTypeKey ^
                   hashProductLocation);
        }
Пример #2
0
        internal new void OnDeserializedMethod(StreamingContext context)
        {
            Longitude           = Math.Round(Longitude, 5);
            Latitude            = Math.Round(Latitude, 5);
            AvailableBikeStands = Capacity - AvailableBikes;
            // reverse some lat and long as for exemple Daxing have bad values ...
            if (Latitude > 90 || Latitude < -90)
            {
                var tempLat = Latitude;
                Latitude  = Longitude;
                Longitude = tempLat;
            }

            Id = InnerId.ToString();
        }
Пример #3
0
        public override bool Equals(object obj)
        {
            if (!(obj is HaspKey other))
            {
                return(false);
            }

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

            return(Id.Equals(other.Id) &&
                   InnerId.Equals(other.InnerId) &&
                   Number.Equals(other.Number) &&
                   TypeKey.Equals(other.TypeKey) &&
                   IsHome.Equals(other.IsHome));
        }