/// <summary> /// Gets the hash code /// </summary> /// <returns>Hash code</returns> public override int GetHashCode() { unchecked // Overflow is fine, just wrap { int hashCode = 41; hashCode = hashCode * 59 + TextVerticalAlignment.GetHashCode(); hashCode = hashCode * 59 + TextHorizontalAlignment.GetHashCode(); if (Text != null) { hashCode = hashCode * 59 + Text.GetHashCode(); } if (TextColor != null) { hashCode = hashCode * 59 + TextColor.GetHashCode(); } if (FontName != null) { hashCode = hashCode * 59 + FontName.GetHashCode(); } hashCode = hashCode * 59 + StandardFontName.GetHashCode(); hashCode = hashCode * 59 + FontStyle.GetHashCode(); hashCode = hashCode * 59 + FontSize.GetHashCode(); return(hashCode); } }
public override int GetHashCode() { unchecked { int hashCode = (FontName != null ? FontName.GetHashCode() : 0); hashCode = (hashCode * 397) ^ FontSize; //hashCode = (hashCode * 397) ^ (int)TextStyle; hashCode = (hashCode * 397) ^ FontColor.GetHashCode(); hashCode = (hashCode * 397) ^ (Aligment != null ? Aligment.GetHashCode() : 0); return(hashCode); } }
public override int GetHashCode() { return(Bold.GetHashCode() ^ Italic.GetHashCode() ^ (Int32)Underline ^ Strikethrough.GetHashCode() ^ (Int32)VerticalAlignment ^ Shadow.GetHashCode() ^ FontSize.GetHashCode() ^ FontColor.GetHashCode() ^ FontName.GetHashCode() ^ (Int32)FontFamilyNumbering); }
public override int GetHashCode() { unchecked { var hashCode = MinorVersion.GetHashCode(); hashCode = (hashCode * 397) ^ MajorVersion.GetHashCode(); hashCode = (hashCode * 397) ^ (PropMask?.GetHashCode() ?? 0); hashCode = (hashCode * 397) ^ (int)FontEffects; hashCode = (hashCode * 397) ^ (int)FontHeight; hashCode = (hashCode * 397) ^ FontCharSet.GetHashCode(); hashCode = (hashCode * 397) ^ FontPitchAndFamily.GetHashCode(); hashCode = (hashCode * 397) ^ ParagraphAlign.GetHashCode(); hashCode = (hashCode * 397) ^ FontWeight.GetHashCode(); hashCode = (hashCode * 397) ^ (FontName?.GetHashCode() ?? 0); return(hashCode); } }
/// <summary> /// Sirve como la función hash predeterminada. /// </summary> /// <returns>Código hash para el objeto actual.</returns> public override int GetHashCode() { int hash = 17; // Un número primo int prime = 31; // Otro número primo. hash = hash * prime + MetadataItemName.GetHashCode(); hash = hash * prime + PdfPageN.GetHashCode(); hash = hash * prime + IsLastPage.GetHashCode(); hash = hash * prime + ((PdfRectangle == null) ? 0 : PdfRectangle.GetHashCode()); hash = hash * prime + (RegexPattern ?? "").GetHashCode(); hash = hash * prime + Position.GetHashCode(); hash = hash * prime + (SourceTypeName ?? "").GetHashCode(); hash = hash * prime + ((FillColor == null) ? 0 : FillColor.GetHashCode()); hash = hash * prime + ((StrokeColor == null) ? 0 : StrokeColor.GetHashCode()); hash = hash * prime + ((FontName == null) ? 0 : FontName.GetHashCode()); hash = hash * prime + ((FontSize == null) ? 0 : FontSize.GetHashCode()); return(hash); }
public override int GetHashCode() { return(FontName.GetHashCode() * 37 + Size.GetHashCode()); }
/// <summary> /// Returns the hash code of the object. /// </summary> /// <returns>Hash code.</returns> public override int GetHashCode() { // See Jon Skeet: http://stackoverflow.com/questions/263400/what-is-the-best-algorithm-for-an-overridden-system-object-gethashcode/263416#263416 // Overflow is fine, just wrap. // If writing this seems hard, try: https://bitbucket.org/JonHanna/spookilysharp/src, but check the licence. // Warning: GetHashCode *should* be implemented only on immutable fields to guard against the // case where you mutate an object that has been used as a key in a collection. In practice, // you probably don't need to worry about that since it is a dumb thing to do. unchecked { int hash = 17; if (Alignment != null) { hash += 23 * Alignment.Value.GetHashCode(); } if (BorderBottom != null) { hash += 23 * BorderBottom.Value.GetHashCode(); } if (BorderDiagonal != null) { hash += 23 * BorderDiagonal.Value.GetHashCode(); } if (BorderDiagonalColor != null) { hash += 23 * BorderDiagonalColor.Value.GetHashCode(); } if (BorderDiagonalLineStyle != null) { hash += 23 * BorderDiagonalLineStyle.Value.GetHashCode(); } if (BorderLeft != null) { hash += 23 * BorderLeft.Value.GetHashCode(); } if (BorderRight != null) { hash += 23 * BorderRight.Value.GetHashCode(); } if (BorderTop != null) { hash += 23 * BorderTop.Value.GetHashCode(); } if (BottomBorderColor != null) { hash += 23 * BottomBorderColor.Value.GetHashCode(); } if (DataFormat != null) { hash += 23 * DataFormat.Value.GetHashCode(); } if (FillBackgroundColor != null) { hash += 23 * FillBackgroundColor.Value.GetHashCode(); } if (FillForegroundColor != null) { hash += 23 * FillForegroundColor.Value.GetHashCode(); } if (FillPattern != null) { hash += 23 * FillPattern.Value.GetHashCode(); } if (Indention != null) { hash += 23 * Indention.Value.GetHashCode(); } if (LeftBorderColor != null) { hash += 23 * LeftBorderColor.Value.GetHashCode(); } if (RightBorderColor != null) { hash += 23 * RightBorderColor.Value.GetHashCode(); } if (Rotation != null) { hash += 23 * Rotation.Value.GetHashCode(); } if (ShrinkToFit != null) { hash += 23 * ShrinkToFit.Value.GetHashCode(); } if (TopBorderColor != null) { hash += 23 * TopBorderColor.Value.GetHashCode(); } if (VerticalAlignment != null) { hash += 23 * VerticalAlignment.Value.GetHashCode(); } if (WrapText != null) { hash += 23 * WrapText.Value.GetHashCode(); } if (FontWeight != null) { hash += 23 * FontWeight.Value.GetHashCode(); } if (Charset != null) { hash += 23 * Charset.Value.GetHashCode(); } if (Color != null) { hash += 23 * Color.Value.GetHashCode(); } if (FontHeight != null) { hash += 23 * FontHeight.Value.GetHashCode(); } if (FontHeightInPoints != null) { hash += 23 * FontHeightInPoints.Value.GetHashCode(); } if (FontName != null) { hash += 23 * FontName.GetHashCode(); } if (Italic != null) { hash += 23 * Italic.Value.GetHashCode(); } if (Strikeout != null) { hash += 23 * Strikeout.Value.GetHashCode(); } if (SuperScript != null) { hash += 23 * SuperScript.Value.GetHashCode(); } if (Underline != null) { hash += 23 * Underline.Value.GetHashCode(); } if (Format != null) { hash += 23 * Format.GetHashCode(); } return(hash); } }
public override int GetHashCode() { return(FontSize.GetHashCode() ^ FontName.GetHashCode() ^ FontBold.GetHashCode() ^ FontColor.GetHashCode() ^ FGColor.GetHashCode() ^ Borders[0].GetHashCode() ^ Borders[1].GetHashCode() ^ Borders[2].GetHashCode() ^ Borders[3].GetHashCode() ^ CellWidth.GetHashCode() ^ CellHeight.GetHashCode() ^ HorizontalAlignment.GetHashCode() ^ VerticalAlignment.GetHashCode() ^ WrapText.GetHashCode()); }
public override int GetHashCode() { return(LGuiHash.Combine(FontName.GetHashCode(), FontSize.GetHashCode(), Bold.GetHashCode())); }