Exemple #1
0
 /// <summary>
 /// Gets the hash code
 /// </summary>
 /// <returns>Hash code</returns>
 public override int GetHashCode()
 {
     unchecked // Overflow is fine, just wrap
     {
         var hashCode = 41;
         // Suitable nullity checks etc, of course :)
         if (Id != null)
         {
             hashCode = hashCode * 59 + Id.GetHashCode();
         }
         if (Activity != null)
         {
             hashCode = hashCode * 59 + Activity.GetHashCode();
         }
         if (Athlete != null)
         {
             hashCode = hashCode * 59 + Athlete.GetHashCode();
         }
         if (AverageCadence != null)
         {
             hashCode = hashCode * 59 + AverageCadence.GetHashCode();
         }
         if (AverageSpeed != null)
         {
             hashCode = hashCode * 59 + AverageSpeed.GetHashCode();
         }
         if (Distance != null)
         {
             hashCode = hashCode * 59 + Distance.GetHashCode();
         }
         if (ElapsedTime != null)
         {
             hashCode = hashCode * 59 + ElapsedTime.GetHashCode();
         }
         if (StartIndex != null)
         {
             hashCode = hashCode * 59 + StartIndex.GetHashCode();
         }
         if (EndIndex != null)
         {
             hashCode = hashCode * 59 + EndIndex.GetHashCode();
         }
         if (LapIndex != null)
         {
             hashCode = hashCode * 59 + LapIndex.GetHashCode();
         }
         if (MaxSpeed != null)
         {
             hashCode = hashCode * 59 + MaxSpeed.GetHashCode();
         }
         if (MovingTime != null)
         {
             hashCode = hashCode * 59 + MovingTime.GetHashCode();
         }
         if (Name != null)
         {
             hashCode = hashCode * 59 + Name.GetHashCode();
         }
         if (PaceZone != null)
         {
             hashCode = hashCode * 59 + PaceZone.GetHashCode();
         }
         if (Split != null)
         {
             hashCode = hashCode * 59 + Split.GetHashCode();
         }
         if (StartDate != null)
         {
             hashCode = hashCode * 59 + StartDate.GetHashCode();
         }
         if (StartDateLocal != null)
         {
             hashCode = hashCode * 59 + StartDateLocal.GetHashCode();
         }
         if (TotalElevationGain != null)
         {
             hashCode = hashCode * 59 + TotalElevationGain.GetHashCode();
         }
         return(hashCode);
     }
 }
Exemple #2
0
 /// <summary>
 /// Gets the hash code
 /// </summary>
 /// <returns>Hash code</returns>
 public override int GetHashCode()
 {
     unchecked // Overflow is fine, just wrap
     {
         var hashCode = 41;
         // Suitable nullity checks etc, of course :)
         if (Name != null)
         {
             hashCode = hashCode * 59 + Name.GetHashCode();
         }
         if (Activity != null)
         {
             hashCode = hashCode * 59 + Activity.GetHashCode();
         }
         if (Athlete != null)
         {
             hashCode = hashCode * 59 + Athlete.GetHashCode();
         }
         if (MovingTime != null)
         {
             hashCode = hashCode * 59 + MovingTime.GetHashCode();
         }
         if (StartIndex != null)
         {
             hashCode = hashCode * 59 + StartIndex.GetHashCode();
         }
         if (EndIndex != null)
         {
             hashCode = hashCode * 59 + EndIndex.GetHashCode();
         }
         if (AverageCadence != null)
         {
             hashCode = hashCode * 59 + AverageCadence.GetHashCode();
         }
         if (AverageWatts != null)
         {
             hashCode = hashCode * 59 + AverageWatts.GetHashCode();
         }
         if (DeviceWatts != null)
         {
             hashCode = hashCode * 59 + DeviceWatts.GetHashCode();
         }
         if (AverageHeartrate != null)
         {
             hashCode = hashCode * 59 + AverageHeartrate.GetHashCode();
         }
         if (MaxHeartrate != null)
         {
             hashCode = hashCode * 59 + MaxHeartrate.GetHashCode();
         }
         if (Segment != null)
         {
             hashCode = hashCode * 59 + Segment.GetHashCode();
         }
         if (KomRank != null)
         {
             hashCode = hashCode * 59 + KomRank.GetHashCode();
         }
         if (PrRank != null)
         {
             hashCode = hashCode * 59 + PrRank.GetHashCode();
         }
         if (Hidden != null)
         {
             hashCode = hashCode * 59 + Hidden.GetHashCode();
         }
         return(hashCode);
     }
 }
Exemple #3
0
        /// <summary>
        /// Returns true if Lap instances are equal
        /// </summary>
        /// <param name="other">Instance of Lap to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(Lap other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     Id == other.Id ||
                     Id != null &&
                     Id.Equals(other.Id)
                     ) &&
                 (
                     Activity == other.Activity ||
                     Activity != null &&
                     Activity.Equals(other.Activity)
                 ) &&
                 (
                     Athlete == other.Athlete ||
                     Athlete != null &&
                     Athlete.Equals(other.Athlete)
                 ) &&
                 (
                     AverageCadence == other.AverageCadence ||
                     AverageCadence != null &&
                     AverageCadence.Equals(other.AverageCadence)
                 ) &&
                 (
                     AverageSpeed == other.AverageSpeed ||
                     AverageSpeed != null &&
                     AverageSpeed.Equals(other.AverageSpeed)
                 ) &&
                 (
                     Distance == other.Distance ||
                     Distance != null &&
                     Distance.Equals(other.Distance)
                 ) &&
                 (
                     ElapsedTime == other.ElapsedTime ||
                     ElapsedTime != null &&
                     ElapsedTime.Equals(other.ElapsedTime)
                 ) &&
                 (
                     StartIndex == other.StartIndex ||
                     StartIndex != null &&
                     StartIndex.Equals(other.StartIndex)
                 ) &&
                 (
                     EndIndex == other.EndIndex ||
                     EndIndex != null &&
                     EndIndex.Equals(other.EndIndex)
                 ) &&
                 (
                     LapIndex == other.LapIndex ||
                     LapIndex != null &&
                     LapIndex.Equals(other.LapIndex)
                 ) &&
                 (
                     MaxSpeed == other.MaxSpeed ||
                     MaxSpeed != null &&
                     MaxSpeed.Equals(other.MaxSpeed)
                 ) &&
                 (
                     MovingTime == other.MovingTime ||
                     MovingTime != null &&
                     MovingTime.Equals(other.MovingTime)
                 ) &&
                 (
                     Name == other.Name ||
                     Name != null &&
                     Name.Equals(other.Name)
                 ) &&
                 (
                     PaceZone == other.PaceZone ||
                     PaceZone != null &&
                     PaceZone.Equals(other.PaceZone)
                 ) &&
                 (
                     Split == other.Split ||
                     Split != null &&
                     Split.Equals(other.Split)
                 ) &&
                 (
                     StartDate == other.StartDate ||
                     StartDate != null &&
                     StartDate.Equals(other.StartDate)
                 ) &&
                 (
                     StartDateLocal == other.StartDateLocal ||
                     StartDateLocal != null &&
                     StartDateLocal.Equals(other.StartDateLocal)
                 ) &&
                 (
                     TotalElevationGain == other.TotalElevationGain ||
                     TotalElevationGain != null &&
                     TotalElevationGain.Equals(other.TotalElevationGain)
                 ));
        }
Exemple #4
0
        /// <summary>
        /// Returns true if DetailedSegmentEffort instances are equal
        /// </summary>
        /// <param name="other">Instance of DetailedSegmentEffort to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(DetailedSegmentEffort other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     Name == other.Name ||
                     Name != null &&
                     Name.Equals(other.Name)
                     ) &&
                 (
                     Activity == other.Activity ||
                     Activity != null &&
                     Activity.Equals(other.Activity)
                 ) &&
                 (
                     Athlete == other.Athlete ||
                     Athlete != null &&
                     Athlete.Equals(other.Athlete)
                 ) &&
                 (
                     MovingTime == other.MovingTime ||
                     MovingTime != null &&
                     MovingTime.Equals(other.MovingTime)
                 ) &&
                 (
                     StartIndex == other.StartIndex ||
                     StartIndex != null &&
                     StartIndex.Equals(other.StartIndex)
                 ) &&
                 (
                     EndIndex == other.EndIndex ||
                     EndIndex != null &&
                     EndIndex.Equals(other.EndIndex)
                 ) &&
                 (
                     AverageCadence == other.AverageCadence ||
                     AverageCadence != null &&
                     AverageCadence.Equals(other.AverageCadence)
                 ) &&
                 (
                     AverageWatts == other.AverageWatts ||
                     AverageWatts != null &&
                     AverageWatts.Equals(other.AverageWatts)
                 ) &&
                 (
                     DeviceWatts == other.DeviceWatts ||
                     DeviceWatts != null &&
                     DeviceWatts.Equals(other.DeviceWatts)
                 ) &&
                 (
                     AverageHeartrate == other.AverageHeartrate ||
                     AverageHeartrate != null &&
                     AverageHeartrate.Equals(other.AverageHeartrate)
                 ) &&
                 (
                     MaxHeartrate == other.MaxHeartrate ||
                     MaxHeartrate != null &&
                     MaxHeartrate.Equals(other.MaxHeartrate)
                 ) &&
                 (
                     Segment == other.Segment ||
                     Segment != null &&
                     Segment.Equals(other.Segment)
                 ) &&
                 (
                     KomRank == other.KomRank ||
                     KomRank != null &&
                     KomRank.Equals(other.KomRank)
                 ) &&
                 (
                     PrRank == other.PrRank ||
                     PrRank != null &&
                     PrRank.Equals(other.PrRank)
                 ) &&
                 (
                     Hidden == other.Hidden ||
                     Hidden != null &&
                     Hidden.Equals(other.Hidden)
                 ));
        }