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> /// Returns a hashcode of the song, used for example in the /// editor to check if the file was changed /// </summary> /// <returns></returns> public override int GetHashCode() { unchecked { var hashCode = (int)CopyrightPosition; hashCode = (hashCode * 397) ^ (int)SourcePosition; hashCode = (hashCode * 397) ^ (MainText != null ? MainText.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (TranslationText != null ? TranslationText.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (CopyrightText != null ? CopyrightText.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (SourceText != null ? SourceText.GetHashCode() : 0); hashCode = (hashCode * 397) ^ MainLineSpacing; hashCode = (hashCode * 397) ^ TranslationLineSpacing; hashCode = (hashCode * 397) ^ (TextOrientation != null ? TextOrientation.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (int)TranslationPosition; hashCode = (hashCode * 397) ^ TextOutlineEnabled.GetHashCode(); hashCode = (hashCode * 397) ^ TextShadowEnabled.GetHashCode(); hashCode = (hashCode * 397) ^ (TextBorders != null ? TextBorders.GetHashCode() : 0); return(hashCode); } }