Example #1
0
        public override int GetHashCode()
        {
            unchecked // Overflow is fine, just wrap
            {
                int hashCode = 41;

                if (BgColor != null)
                {
                    hashCode = hashCode * 59 + BgColor.GetHashCode();
                }

                if (BgColorArray != null)
                {
                    hashCode = hashCode * 59 + BgColorArray.GetHashCode();
                }

                if (BorderColor != null)
                {
                    hashCode = hashCode * 59 + BorderColor.GetHashCode();
                }

                if (BorderColorArray != null)
                {
                    hashCode = hashCode * 59 + BorderColorArray.GetHashCode();
                }

                if (Font != null)
                {
                    hashCode = hashCode * 59 + Font.GetHashCode();
                }

                if (Align != null)
                {
                    hashCode = hashCode * 59 + Align.GetHashCode();
                }

                if (AlignArray != null)
                {
                    hashCode = hashCode * 59 + AlignArray.GetHashCode();
                }

                if (NameLength != null)
                {
                    hashCode = hashCode * 59 + NameLength.GetHashCode();
                }

                if (NameLengthArray != null)
                {
                    hashCode = hashCode * 59 + NameLengthArray.GetHashCode();
                }

                if (BgColorSrc != null)
                {
                    hashCode = hashCode * 59 + BgColorSrc.GetHashCode();
                }

                if (BorderColorSrc != null)
                {
                    hashCode = hashCode * 59 + BorderColorSrc.GetHashCode();
                }

                if (AlignSrc != null)
                {
                    hashCode = hashCode * 59 + AlignSrc.GetHashCode();
                }

                if (NameLengthSrc != null)
                {
                    hashCode = hashCode * 59 + NameLengthSrc.GetHashCode();
                }

                return(hashCode);
            }
        }
Example #2
0
        /// <inheritdoc />
        public bool Equals([AllowNull] HoverLabel other)
        {
            if (other == null)
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     BgColor == other.BgColor ||
                     BgColor != null &&
                     BgColor.Equals(other.BgColor)
                     ) &&
                 (
                     Equals(BgColorArray, other.BgColorArray) ||
                     BgColorArray != null && other.BgColorArray != null &&
                     BgColorArray.SequenceEqual(other.BgColorArray)
                 ) &&
                 (
                     BorderColor == other.BorderColor ||
                     BorderColor != null &&
                     BorderColor.Equals(other.BorderColor)
                 ) &&
                 (
                     Equals(BorderColorArray, other.BorderColorArray) ||
                     BorderColorArray != null && other.BorderColorArray != null &&
                     BorderColorArray.SequenceEqual(other.BorderColorArray)
                 ) &&
                 (
                     Font == other.Font ||
                     Font != null &&
                     Font.Equals(other.Font)
                 ) &&
                 (
                     Align == other.Align ||
                     Align != null &&
                     Align.Equals(other.Align)
                 ) &&
                 (
                     Equals(AlignArray, other.AlignArray) ||
                     AlignArray != null && other.AlignArray != null &&
                     AlignArray.SequenceEqual(other.AlignArray)
                 ) &&
                 (
                     NameLength == other.NameLength ||
                     NameLength != null &&
                     NameLength.Equals(other.NameLength)
                 ) &&
                 (
                     Equals(NameLengthArray, other.NameLengthArray) ||
                     NameLengthArray != null && other.NameLengthArray != null &&
                     NameLengthArray.SequenceEqual(other.NameLengthArray)
                 ) &&
                 (
                     BgColorSrc == other.BgColorSrc ||
                     BgColorSrc != null &&
                     BgColorSrc.Equals(other.BgColorSrc)
                 ) &&
                 (
                     BorderColorSrc == other.BorderColorSrc ||
                     BorderColorSrc != null &&
                     BorderColorSrc.Equals(other.BorderColorSrc)
                 ) &&
                 (
                     AlignSrc == other.AlignSrc ||
                     AlignSrc != null &&
                     AlignSrc.Equals(other.AlignSrc)
                 ) &&
                 (
                     NameLengthSrc == other.NameLengthSrc ||
                     NameLengthSrc != null &&
                     NameLengthSrc.Equals(other.NameLengthSrc)
                 ));
        }
Example #3
0
        public bool Equals([AllowNull] HoverLabel other)
        {
            if(other == null)
                return false;

            if(ReferenceEquals(this, other))
                return true;

            return (BgColor == other.BgColor && BgColor != null && other.BgColor != null && BgColor.Equals(other.BgColor))                                                                    &&
                   (Equals(BgColorArray, other.BgColorArray) || BgColorArray != null && other.BgColorArray != null && BgColorArray.SequenceEqual(other.BgColorArray))                         &&
                   (BorderColor == other.BorderColor && BorderColor != null && other.BorderColor != null && BorderColor.Equals(other.BorderColor))                                            &&
                   (Equals(BorderColorArray, other.BorderColorArray) || BorderColorArray != null && other.BorderColorArray != null && BorderColorArray.SequenceEqual(other.BorderColorArray)) &&
                   (Font  == other.Font  && Font  != null && other.Font  != null && Font.Equals(other.Font))                                                                                  &&
                   (Align == other.Align && Align != null && other.Align != null && Align.Equals(other.Align))                                                                                &&
                   (Equals(AlignArray, other.AlignArray) || AlignArray != null && other.AlignArray != null && AlignArray.SequenceEqual(other.AlignArray))                                     &&
                   (NameLength == other.NameLength && NameLength != null && other.NameLength != null && NameLength.Equals(other.NameLength))                                                  &&
                   (Equals(NameLengthArray, other.NameLengthArray) || NameLengthArray != null && other.NameLengthArray != null && NameLengthArray.SequenceEqual(other.NameLengthArray))       &&
                   (Split          == other.Split          && Split          != null && other.Split          != null && Split.Equals(other.Split))                                            &&
                   (BgColorSrc     == other.BgColorSrc     && BgColorSrc     != null && other.BgColorSrc     != null && BgColorSrc.Equals(other.BgColorSrc))                                  &&
                   (BorderColorSrc == other.BorderColorSrc && BorderColorSrc != null && other.BorderColorSrc != null && BorderColorSrc.Equals(other.BorderColorSrc))                          &&
                   (AlignSrc       == other.AlignSrc       && AlignSrc       != null && other.AlignSrc       != null && AlignSrc.Equals(other.AlignSrc))                                      &&
                   (NameLengthSrc  == other.NameLengthSrc  && NameLengthSrc  != null && other.NameLengthSrc  != null && NameLengthSrc.Equals(other.NameLengthSrc));
        }