public override int GetHashCode() { unchecked { int hashCode = (FileName != null ? FileName.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (FullPath != null ? FullPath.GetHashCode() : 0); hashCode = (hashCode * 397) ^ SizeInBytes.GetHashCode(); hashCode = (hashCode * 397) ^ (Matches != null ? Matches.GetHashCode() : 0); return(hashCode); } }
public override int GetHashCode() { unchecked // Overflow is fine, just wrap { int hash = 17; // Suitable nullity checks etc, of course :) hash = hash * 23 + Width.GetHashCode(); hash = hash * 23 + Height.GetHashCode(); hash = hash * 23 + ColorCount.GetHashCode(); hash = hash * 23 + ReservedByte.GetHashCode(); hash = hash * 23 + Planes.GetHashCode(); hash = hash * 23 + BitCount.GetHashCode(); hash = hash * 23 + SizeInBytes.GetHashCode(); hash = hash * 23 + FileOffset.GetHashCode(); hash = hash * 23 + (SourceFileName == null ? 1 : SourceFileName.GetHashCode()); hash = hash * 23 + SourceIndex.GetHashCode(); return(hash); } }