コード例 #1
0
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = Color.GetHashCode();
         hashCode = (hashCode * 397) ^ Width.GetHashCode();
         hashCode = (hashCode * 397) ^ Height.GetHashCode();
         hashCode = (hashCode * 397) ^ BackgroundColor.GetHashCode();
         hashCode = (hashCode * 397) ^ BorderLeftColor.GetHashCode();
         hashCode = (hashCode * 397) ^ BorderLeftWidth.GetHashCode();
         hashCode = (hashCode * 397) ^ BorderRightColor.GetHashCode();
         hashCode = (hashCode * 397) ^ BorderTopColor.GetHashCode();
         hashCode = (hashCode * 397) ^ BorderBottomColor.GetHashCode();
         hashCode = (hashCode * 397) ^ BorderRightWidth.GetHashCode();
         hashCode = (hashCode * 397) ^ BorderTopWidth.GetHashCode();
         hashCode = (hashCode * 397) ^ BorderBottomWidth.GetHashCode();
         hashCode = (hashCode * 397) ^ Font.GetHashCode();
         hashCode = (hashCode * 397) ^ FontSize.GetHashCode();
         hashCode = (hashCode * 397) ^ HAlign.GetHashCode();
         hashCode = (hashCode * 397) ^ VAlign.GetHashCode();
         hashCode = (hashCode * 397) ^ IsLineThrough.GetHashCode();
         hashCode = (hashCode * 397) ^ IsOverline.GetHashCode();
         hashCode = (hashCode * 397) ^ IsUnderline.GetHashCode();
         hashCode = (hashCode * 397) ^ IsItalic.GetHashCode();
         hashCode = (hashCode * 397) ^ IsBold.GetHashCode();
         hashCode = (hashCode * 397) ^ BorderBottomStyle.GetHashCode();
         hashCode = (hashCode * 397) ^ BorderLeftStyle.GetHashCode();
         hashCode = (hashCode * 397) ^ BorderRightStyle.GetHashCode();
         hashCode = (hashCode * 397) ^ BorderTopStyle.GetHashCode();
         return(hashCode);
     }
 }
コード例 #2
0
 public override int GetHashCode()
 {
     return(IsBold.GetHashCode() + IsItalic.GetHashCode() + IsStrikedOut.GetHashCode() +
            IsUnderlined.GetHashCode() +
            FontSize.GetHashCode() +
            (string.IsNullOrEmpty(BackgroundBrushString) ? 0 : BackgroundBrushString.GetHashCode()) +
            (string.IsNullOrEmpty(ForegroundBrushString) ? 0 : ForegroundBrushString.GetHashCode()) +
            (string.IsNullOrEmpty(FontFamilyString) ? 0 : FontFamilyString.GetHashCode()));
 }