Ejemplo n.º 1
0
 public override int GetHashCode()
 {
     return((Line == null ? 0 : Line.GetHashCode())
            ^ (Outline == null ? 0 :  Outline.GetHashCode())
            ^ (Fill == null ? 0 : Fill.GetHashCode())
            ^ base.GetHashCode());
 }
Ejemplo n.º 2
0
 public override int GetHashCode()
 {
     return(Line?.GetHashCode() ?? 0
            ^ Outline?.GetHashCode() ?? 0
            ^ Fill?.GetHashCode() ?? 0
            ^ base.GetHashCode());
 }
Ejemplo n.º 3
0
 /// <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);
     }
 }
Ejemplo n.º 4
0
 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);
            }
        }