/// <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 (Time != null) { hashCode = hashCode * 59 + Time.GetHashCode(); } if (Distance != null) { hashCode = hashCode * 59 + Distance.GetHashCode(); } if (Latlng != null) { hashCode = hashCode * 59 + Latlng.GetHashCode(); } if (Altitude != null) { hashCode = hashCode * 59 + Altitude.GetHashCode(); } if (VelocitySmooth != null) { hashCode = hashCode * 59 + VelocitySmooth.GetHashCode(); } if (Heartrate != null) { hashCode = hashCode * 59 + Heartrate.GetHashCode(); } if (Cadence != null) { hashCode = hashCode * 59 + Cadence.GetHashCode(); } if (Watts != null) { hashCode = hashCode * 59 + Watts.GetHashCode(); } if (Temp != null) { hashCode = hashCode * 59 + Temp.GetHashCode(); } if (Moving != null) { hashCode = hashCode * 59 + Moving.GetHashCode(); } if (GradeSmooth != null) { hashCode = hashCode * 59 + GradeSmooth.GetHashCode(); } return(hashCode); } }
/// <summary> /// Returns true if StreamSet instances are equal /// </summary> /// <param name="other">Instance of StreamSet to be compared</param> /// <returns>Boolean</returns> public bool Equals(StreamSet other) { if (ReferenceEquals(null, other)) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return (( Time == other.Time || Time != null && Time.Equals(other.Time) ) && ( Distance == other.Distance || Distance != null && Distance.Equals(other.Distance) ) && ( Latlng == other.Latlng || Latlng != null && Latlng.Equals(other.Latlng) ) && ( Altitude == other.Altitude || Altitude != null && Altitude.Equals(other.Altitude) ) && ( VelocitySmooth == other.VelocitySmooth || VelocitySmooth != null && VelocitySmooth.Equals(other.VelocitySmooth) ) && ( Heartrate == other.Heartrate || Heartrate != null && Heartrate.Equals(other.Heartrate) ) && ( Cadence == other.Cadence || Cadence != null && Cadence.Equals(other.Cadence) ) && ( Watts == other.Watts || Watts != null && Watts.Equals(other.Watts) ) && ( Temp == other.Temp || Temp != null && Temp.Equals(other.Temp) ) && ( Moving == other.Moving || Moving != null && Moving.Equals(other.Moving) ) && ( GradeSmooth == other.GradeSmooth || GradeSmooth != null && GradeSmooth.Equals(other.GradeSmooth) )); }