public override int GetHashCode() { return((Line == null ? 0 : Line.GetHashCode()) ^ (Outline == null ? 0 : Outline.GetHashCode()) ^ (Fill == null ? 0 : Fill.GetHashCode()) ^ base.GetHashCode()); }
public override int GetHashCode() { return(Line?.GetHashCode() ?? 0 ^ Outline?.GetHashCode() ?? 0 ^ Fill?.GetHashCode() ?? 0 ^ base.GetHashCode()); }
/// <summary> /// Returns a hashcode of the text formatting object, used for example in the /// editor to check if the file was changed /// </summary> /// <returns></returns> public override int GetHashCode() { unchecked { var hashCode = (Font != null ? Font.GetHashCode() : 0); hashCode = (hashCode * 397) ^ Color.GetHashCode(); hashCode = (hashCode * 397) ^ (Outline != null ? Outline.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (Shadow != null ? Shadow.GetHashCode() : 0); return(hashCode); } }
public override int GetHashCode() { unchecked { var hashCode = MainText.GetHashCode(); hashCode = (hashCode * 397) ^ TranslationText.GetHashCode(); hashCode = (hashCode * 397) ^ CopyrightText.GetHashCode(); hashCode = (hashCode * 397) ^ SourceText.GetHashCode(); hashCode = (hashCode * 397) ^ Outline.GetHashCode(); hashCode = (hashCode * 397) ^ Shadow.GetHashCode(); hashCode = (hashCode * 397) ^ MainLineSpacing; hashCode = (hashCode * 397) ^ TranslationLineSpacing; hashCode = (hashCode * 397) ^ (TextOrientation != null ? TextOrientation.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (int)TranslationPosition; hashCode = (hashCode * 397) ^ (int)CopyrightTextPosition; hashCode = (hashCode * 397) ^ (int)SourceTextPosition; hashCode = (hashCode * 397) ^ Borders.GetHashCode(); return(hashCode); } }
/// <summary> /// Gets the hash code /// </summary> /// <returns>Hash code</returns> public override int GetHashCode() { // credit: http://stackoverflow.com/a/263416/677735 unchecked // Overflow is fine, just wrap { int hash = base.GetHashCode(); if (Outline != null) { hash = hash * 59 + Outline.GetHashCode(); } if (VendorId != null) { hash = hash * 59 + VendorId.GetHashCode(); } if (Currency != null) { hash = hash * 59 + Currency.Code.GetHashCode(); } if (Language != null) { hash = hash * 59 + Language.CultureName.GetHashCode(); } if (Keyword != null) { hash = hash * 59 + Keyword.GetHashCode(); } if (SortBy != null) { hash = hash * 59 + SortBy.GetHashCode(); } return(hash); } }