Exemplo n.º 1
0
 /// <inheritdoc />
 public override int GetHashCode()
 {
     unchecked // Overflow is fine, just wrap
     {
         var hashCode = 41;
         if (BgColor != null)
         {
             hashCode = hashCode * 59 + BgColor.GetHashCode();
         }
         if (BorderColor != null)
         {
             hashCode = hashCode * 59 + BorderColor.GetHashCode();
         }
         if (BorderWidth != null)
         {
             hashCode = hashCode * 59 + BorderWidth.GetHashCode();
         }
         if (Font != null)
         {
             hashCode = hashCode * 59 + Font.GetHashCode();
         }
         if (Orientation != null)
         {
             hashCode = hashCode * 59 + Orientation.GetHashCode();
         }
         if (TraceOrder != null)
         {
             hashCode = hashCode * 59 + TraceOrder.GetHashCode();
         }
         if (TraceGroupGap != null)
         {
             hashCode = hashCode * 59 + TraceGroupGap.GetHashCode();
         }
         if (ItemSizing != null)
         {
             hashCode = hashCode * 59 + ItemSizing.GetHashCode();
         }
         if (ItemWidth != null)
         {
             hashCode = hashCode * 59 + ItemWidth.GetHashCode();
         }
         if (ItemClick != null)
         {
             hashCode = hashCode * 59 + ItemClick.GetHashCode();
         }
         if (ItemDoubleClick != null)
         {
             hashCode = hashCode * 59 + ItemDoubleClick.GetHashCode();
         }
         if (X != null)
         {
             hashCode = hashCode * 59 + X.GetHashCode();
         }
         if (XAnchor != null)
         {
             hashCode = hashCode * 59 + XAnchor.GetHashCode();
         }
         if (Y != null)
         {
             hashCode = hashCode * 59 + Y.GetHashCode();
         }
         if (YAnchor != null)
         {
             hashCode = hashCode * 59 + YAnchor.GetHashCode();
         }
         if (UiRevision != null)
         {
             hashCode = hashCode * 59 + UiRevision.GetHashCode();
         }
         if (VAlign != null)
         {
             hashCode = hashCode * 59 + VAlign.GetHashCode();
         }
         if (Title != null)
         {
             hashCode = hashCode * 59 + Title.GetHashCode();
         }
         return(hashCode);
     }
 }
Exemplo n.º 2
0
        /// <inheritdoc />
        public bool Equals([AllowNull] Legend other)
        {
            if (other == null)
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     BgColor == other.BgColor ||
                     BgColor != null &&
                     BgColor.Equals(other.BgColor)
                     ) &&
                 (
                     BorderColor == other.BorderColor ||
                     BorderColor != null &&
                     BorderColor.Equals(other.BorderColor)
                 ) &&
                 (
                     BorderWidth == other.BorderWidth ||
                     BorderWidth != null &&
                     BorderWidth.Equals(other.BorderWidth)
                 ) &&
                 (
                     Font == other.Font ||
                     Font != null &&
                     Font.Equals(other.Font)
                 ) &&
                 (
                     Orientation == other.Orientation ||
                     Orientation != null &&
                     Orientation.Equals(other.Orientation)
                 ) &&
                 (
                     TraceOrder == other.TraceOrder ||
                     TraceOrder != null &&
                     TraceOrder.Equals(other.TraceOrder)
                 ) &&
                 (
                     TraceGroupGap == other.TraceGroupGap ||
                     TraceGroupGap != null &&
                     TraceGroupGap.Equals(other.TraceGroupGap)
                 ) &&
                 (
                     ItemSizing == other.ItemSizing ||
                     ItemSizing != null &&
                     ItemSizing.Equals(other.ItemSizing)
                 ) &&
                 (
                     ItemWidth == other.ItemWidth ||
                     ItemWidth != null &&
                     ItemWidth.Equals(other.ItemWidth)
                 ) &&
                 (
                     ItemClick == other.ItemClick ||
                     ItemClick != null &&
                     ItemClick.Equals(other.ItemClick)
                 ) &&
                 (
                     ItemDoubleClick == other.ItemDoubleClick ||
                     ItemDoubleClick != null &&
                     ItemDoubleClick.Equals(other.ItemDoubleClick)
                 ) &&
                 (
                     X == other.X ||
                     X != null &&
                     X.Equals(other.X)
                 ) &&
                 (
                     XAnchor == other.XAnchor ||
                     XAnchor != null &&
                     XAnchor.Equals(other.XAnchor)
                 ) &&
                 (
                     Y == other.Y ||
                     Y != null &&
                     Y.Equals(other.Y)
                 ) &&
                 (
                     YAnchor == other.YAnchor ||
                     YAnchor != null &&
                     YAnchor.Equals(other.YAnchor)
                 ) &&
                 (
                     UiRevision == other.UiRevision ||
                     UiRevision != null &&
                     UiRevision.Equals(other.UiRevision)
                 ) &&
                 (
                     VAlign == other.VAlign ||
                     VAlign != null &&
                     VAlign.Equals(other.VAlign)
                 ) &&
                 (
                     Title == other.Title ||
                     Title != null &&
                     Title.Equals(other.Title)
                 ));
        }