public override int GetHashCode() { unchecked { var hashCode = (Pattern != null ? Pattern.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (Replacement != null ? Replacement.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (Source != null ? Source.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (Target != null ? Target.GetHashCode() : 0); return(hashCode); } }
/// <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 (Input != null) { hashCode = hashCode * 59 + Input.GetHashCode(); } if (Match != null) { hashCode = hashCode * 59 + Match.GetHashCode(); } if (Replacement != null) { hashCode = hashCode * 59 + Replacement.GetHashCode(); } hashCode = hashCode * 59 + IgnoreCase.GetHashCode(); return(hashCode); } }