Example #1
0
        /// <summary>
        ///     Returns true if OrderRunnerChange instances are equal
        /// </summary>
        /// <param name="other">Instance of OrderRunnerChange to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(OrderRunnerChange other)
        {
            // credit: http://stackoverflow.com/a/10454552/677735
            if (other == null)
            {
                return(false);
            }

            return((Mb == other.Mb || Mb != null && Mb.SequenceEqual(other.Mb)) &&
                   (Uo == other.Uo || Uo != null && Uo.SequenceEqual(other.Uo)) &&
                   (Id == other.Id || Id != null && Id.Equals(other.Id)) &&
                   (Hc == other.Hc || Hc != null && Hc.Equals(other.Hc)) &&
                   (FullImage == other.FullImage || FullImage != null && FullImage.Equals(other.FullImage)) &&
                   (Ml == other.Ml || Ml != null && Ml.SequenceEqual(other.Ml)));
        }
Example #2
0
        /// <summary>
        ///     Gets the hash code
        /// </summary>
        /// <returns>Hash code</returns>
        public override int GetHashCode()
        {
            // credit: http://stackoverflow.com/a/263416/677735
            unchecked // Overflow is fine, just wrap
            {
                var hash = 41;
                // Suitable nullity checks etc, of course :)

                if (Mb != null)
                {
                    hash = hash * 59 + Mb.GetHashCode();
                }

                if (Uo != null)
                {
                    hash = hash * 59 + Uo.GetHashCode();
                }

                if (Id != null)
                {
                    hash = hash * 59 + Id.GetHashCode();
                }

                if (Hc != null)
                {
                    hash = hash * 59 + Hc.GetHashCode();
                }

                if (FullImage != null)
                {
                    hash = hash * 59 + FullImage.GetHashCode();
                }

                if (Ml != null)
                {
                    hash = hash * 59 + Ml.GetHashCode();
                }

                return(hash);
            }
        }