Exemplo n.º 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 (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);
     }
 }
Exemplo n.º 2
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)
                 ));
        }