Ejemplo n.º 1
0
 /// <inheritdoc />
 public override int GetHashCode()
 {
     unchecked // Overflow is fine, just wrap
     {
         var hashCode = 41;
         if (Type != null)
         {
             hashCode = hashCode * 59 + Type.GetHashCode();
         }
         if (Start != null)
         {
             hashCode = hashCode * 59 + Start.GetHashCode();
         }
         if (End != null)
         {
             hashCode = hashCode * 59 + End.GetHashCode();
         }
         if (Size != null)
         {
             hashCode = hashCode * 59 + Size.GetHashCode();
         }
         if (Coloring != null)
         {
             hashCode = hashCode * 59 + Coloring.GetHashCode();
         }
         if (ShowLines != null)
         {
             hashCode = hashCode * 59 + ShowLines.GetHashCode();
         }
         if (ShowLabels != null)
         {
             hashCode = hashCode * 59 + ShowLabels.GetHashCode();
         }
         if (LabelFont != null)
         {
             hashCode = hashCode * 59 + LabelFont.GetHashCode();
         }
         if (LabelFormat != null)
         {
             hashCode = hashCode * 59 + LabelFormat.GetHashCode();
         }
         if (Operation != null)
         {
             hashCode = hashCode * 59 + Operation.GetHashCode();
         }
         if (Value != null)
         {
             hashCode = hashCode * 59 + Value.GetHashCode();
         }
         return(hashCode);
     }
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Serves as a hash function for the objects of <see cref="DumpAttribute"/> and its derived types.
        /// </summary>
        /// <returns>A hash code for the current <see cref="DumpAttribute"/> instance.</returns>
        public override int GetHashCode()
        {
            var hashCode = Constants.HashInitializer;

            unchecked
            {
                hashCode = Constants.HashMultiplier * hashCode + Order.GetHashCode();
                hashCode = Constants.HashMultiplier * hashCode + DumpNullValues.GetHashCode();
                hashCode = Constants.HashMultiplier * hashCode + Skip.GetHashCode();
                hashCode = Constants.HashMultiplier * hashCode + RecurseDump.GetHashCode();
                hashCode = Constants.HashMultiplier * hashCode + (DefaultProperty?.GetHashCode() ?? 0);
                hashCode = Constants.HashMultiplier * hashCode + Mask.GetHashCode();
                hashCode = Constants.HashMultiplier * hashCode + MaskValue.GetHashCode();
                hashCode = Constants.HashMultiplier * hashCode + MaxLength.GetHashCode();
                hashCode = Constants.HashMultiplier * hashCode + MaxDepth.GetHashCode();
                hashCode = Constants.HashMultiplier * hashCode + LabelFormat.GetHashCode();
                hashCode = Constants.HashMultiplier * hashCode + ValueFormat.GetHashCode();
            }

            return(hashCode);
        }