Beispiel #1
0
        /// <summary>
        /// Gets the hash code
        /// </summary>
        /// <returns>Hash code</returns>
        public override int GetHashCode()
        {
            unchecked // Overflow is fine, just wrap
            {
                var hashCode = 41;
                // Suitable nullity checks etc, of course :)

                hashCode = hashCode * 59 + Direction.GetHashCode();

                hashCode = hashCode * 59 + TickDirection.GetHashCode();
                if (Timestamp != null)
                {
                    hashCode = hashCode * 59 + Timestamp.GetHashCode();
                }
                if (Price != null)
                {
                    hashCode = hashCode * 59 + Price.GetHashCode();
                }
                if (TradeSeq != null)
                {
                    hashCode = hashCode * 59 + TradeSeq.GetHashCode();
                }
                if (TradeId != null)
                {
                    hashCode = hashCode * 59 + TradeId.GetHashCode();
                }
                if (Iv != null)
                {
                    hashCode = hashCode * 59 + Iv.GetHashCode();
                }
                if (IndexPrice != null)
                {
                    hashCode = hashCode * 59 + IndexPrice.GetHashCode();
                }
                if (Amount != null)
                {
                    hashCode = hashCode * 59 + Amount.GetHashCode();
                }
                if (InstrumentName != null)
                {
                    hashCode = hashCode * 59 + InstrumentName.GetHashCode();
                }
                return(hashCode);
            }
        }
        /// <summary>
        /// Gets the hash code
        /// </summary>
        /// <returns>Hash code</returns>
        public override int GetHashCode()
        {
            unchecked // Overflow is fine, just wrap
            {
                var hashCode = 41;
                // Suitable nullity checks etc, of course :)

                hashCode = hashCode * 59 + Direction.GetHashCode();

                hashCode = hashCode * 59 + FeeCurrency.GetHashCode();
                if (OrderId != null)
                {
                    hashCode = hashCode * 59 + OrderId.GetHashCode();
                }
                if (Timestamp != null)
                {
                    hashCode = hashCode * 59 + Timestamp.GetHashCode();
                }
                if (Price != null)
                {
                    hashCode = hashCode * 59 + Price.GetHashCode();
                }
                if (Iv != null)
                {
                    hashCode = hashCode * 59 + Iv.GetHashCode();
                }
                if (TradeId != null)
                {
                    hashCode = hashCode * 59 + TradeId.GetHashCode();
                }
                if (Fee != null)
                {
                    hashCode = hashCode * 59 + Fee.GetHashCode();
                }

                hashCode = hashCode * 59 + OrderType.GetHashCode();
                if (TradeSeq != null)
                {
                    hashCode = hashCode * 59 + TradeSeq.GetHashCode();
                }
                if (SelfTrade != null)
                {
                    hashCode = hashCode * 59 + SelfTrade.GetHashCode();
                }

                hashCode = hashCode * 59 + State.GetHashCode();
                if (Label != null)
                {
                    hashCode = hashCode * 59 + Label.GetHashCode();
                }
                if (IndexPrice != null)
                {
                    hashCode = hashCode * 59 + IndexPrice.GetHashCode();
                }
                if (Amount != null)
                {
                    hashCode = hashCode * 59 + Amount.GetHashCode();
                }
                if (InstrumentName != null)
                {
                    hashCode = hashCode * 59 + InstrumentName.GetHashCode();
                }

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

                hashCode = hashCode * 59 + Liquidity.GetHashCode();
                return(hashCode);
            }
        }