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

            return
                ((
                     Sequential == other.Sequential ||
                     Sequential != null &&
                     Sequential.Equals(other.Sequential)
                     ) &&
                 (
                     SequentialMinus == other.SequentialMinus ||
                     SequentialMinus != null &&
                     SequentialMinus.Equals(other.SequentialMinus)
                 ) &&
                 (
                     Diverging == other.Diverging ||
                     Diverging != null &&
                     Diverging.Equals(other.Diverging)
                 ));
        }
Example #2
0
 /// <inheritdoc />
 public override int GetHashCode()
 {
     unchecked // Overflow is fine, just wrap
     {
         var hashCode = 41;
         if (Sequential != null)
         {
             hashCode = hashCode * 59 + Sequential.GetHashCode();
         }
         if (SequentialMinus != null)
         {
             hashCode = hashCode * 59 + SequentialMinus.GetHashCode();
         }
         if (Diverging != null)
         {
             hashCode = hashCode * 59 + Diverging.GetHashCode();
         }
         return(hashCode);
     }
 }