} // IsEqual private int ComputeHashCode() { var hash = ForegroundColor.GetHashCode(); hash = HashTool.AddHashCode(hash, BackgroundColor); hash = HashTool.AddHashCode(hash, FontFamily); hash = HashTool.AddHashCode(hash, FontSize); return(hash); } // ComputeHashCode
/// <summary> /// Returns a hash code for this instance. /// </summary> /// <returns> /// A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. /// </returns> public override int GetHashCode() { unchecked { int hash = 17; hash = hash * 23 + Char.GetHashCode(); hash = hash * 23 + ForegroundColor.GetHashCode(); hash = hash * 23 + BackgroundColor.GetHashCode(); return(hash); } }
/// <summary> /// Computes the hash code for this object. /// </summary> /// <returns>The hash code.</returns> public override int GetHashCode() { // Overflow is fine, just wrap unchecked { var hash = 17; hash = (hash * 23) + Content.GetHashCode(); hash = (hash * 23) + ForegroundColor.GetHashCode(); hash = (hash * 23) + BackgroundColor.GetHashCode(); return(hash); } }
public override int GetHashCode() { int hash = Text?.GetHashCode() ?? -1; hash ^= BackgroundColor.GetHashCode(); hash ^= ForegroundColor.GetHashCode(); hash ^= FontAttributes.GetHashCode(); hash ^= FontSize.GetHashCode(); hash ^= Command?.GetHashCode() ?? -1; hash ^= CommandParameter?.GetHashCode() ?? -1; return(hash); }
public override int GetHashCode() { unchecked { int hash = 17; hash = hash * 23 + PatternType.GetHashCode(); hash = hash * 23 + ForegroundColor?.GetHashCode() ?? 0; hash = hash * 23 + BackgroundColor?.GetHashCode() ?? 0; return(hash); } }
public override int GetHashCode() { int hash = base.GetHashCode(); hash ^= ForegroundColor.GetHashCode(); hash ^= BackgroundColor.GetHashCode(); hash ^= Underline.GetHashCode(); hash ^= Bold.GetHashCode(); hash ^= Italic.GetHashCode(); if (Text != null) { hash ^= Text.GetHashCode(); } return(hash); }
public override int GetHashCode() { return(Character.GetHashCode() + ForegroundColor.GetHashCode() + BackgroundColor.GetHashCode()); }
public override int GetHashCode() { return(Char.GetHashCode() ^ ForegroundColor.GetHashCode() ^ BackGroundColor.GetHashCode()); }
// override object.GetHashCode public override int GetHashCode() { return(Object.GetHashCode() + BackgroundColor.GetHashCode() + ForegroundColor.GetHashCode()); }