Ejemplo n.º 1
0
        /// <summary>
        /// Returns true if Split instances are equal
        /// </summary>
        /// <param name="other">Instance of Split to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(Split other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     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)
                 ) &&
                 (
                     ElevationDifference == other.ElevationDifference ||
                     ElevationDifference != null &&
                     ElevationDifference.Equals(other.ElevationDifference)
                 ) &&
                 (
                     PaceZone == other.PaceZone ||
                     PaceZone != null &&
                     PaceZone.Equals(other.PaceZone)
                 ) &&
                 (
                     MovingTime == other.MovingTime ||
                     MovingTime != null &&
                     MovingTime.Equals(other.MovingTime)
                 ) &&
                 (
                     _Split == other._Split ||
                     _Split != null &&
                     _Split.Equals(other._Split)
                 ));
        }
Ejemplo n.º 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 (AverageSpeed != null)
         {
             hashCode = hashCode * 59 + AverageSpeed.GetHashCode();
         }
         if (Distance != null)
         {
             hashCode = hashCode * 59 + Distance.GetHashCode();
         }
         if (ElapsedTime != null)
         {
             hashCode = hashCode * 59 + ElapsedTime.GetHashCode();
         }
         if (ElevationDifference != null)
         {
             hashCode = hashCode * 59 + ElevationDifference.GetHashCode();
         }
         if (PaceZone != null)
         {
             hashCode = hashCode * 59 + PaceZone.GetHashCode();
         }
         if (MovingTime != null)
         {
             hashCode = hashCode * 59 + MovingTime.GetHashCode();
         }
         if (_Split != null)
         {
             hashCode = hashCode * 59 + _Split.GetHashCode();
         }
         return(hashCode);
     }
 }