Ejemplo n.º 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();
                if (ReduceOnly != null)
                {
                    hashCode = hashCode * 59 + ReduceOnly.GetHashCode();
                }
                if (Triggered != null)
                {
                    hashCode = hashCode * 59 + Triggered.GetHashCode();
                }
                if (OrderId != null)
                {
                    hashCode = hashCode * 59 + OrderId.GetHashCode();
                }
                if (Price != null)
                {
                    hashCode = hashCode * 59 + Price.GetHashCode();
                }

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

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

                hashCode = hashCode * 59 + Advanced.GetHashCode();
                if (PostOnly != null)
                {
                    hashCode = hashCode * 59 + PostOnly.GetHashCode();
                }
                if (Usd != null)
                {
                    hashCode = hashCode * 59 + Usd.GetHashCode();
                }
                if (StopPrice != null)
                {
                    hashCode = hashCode * 59 + StopPrice.GetHashCode();
                }

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

                hashCode = hashCode * 59 + OriginalOrderType.GetHashCode();
                if (MaxShow != null)
                {
                    hashCode = hashCode * 59 + MaxShow.GetHashCode();
                }
                if (ProfitLoss != null)
                {
                    hashCode = hashCode * 59 + ProfitLoss.GetHashCode();
                }
                if (IsLiquidation != null)
                {
                    hashCode = hashCode * 59 + IsLiquidation.GetHashCode();
                }
                if (FilledAmount != null)
                {
                    hashCode = hashCode * 59 + FilledAmount.GetHashCode();
                }
                if (Label != null)
                {
                    hashCode = hashCode * 59 + Label.GetHashCode();
                }
                if (Commission != null)
                {
                    hashCode = hashCode * 59 + Commission.GetHashCode();
                }
                if (Amount != null)
                {
                    hashCode = hashCode * 59 + Amount.GetHashCode();
                }

                hashCode = hashCode * 59 + Trigger.GetHashCode();
                if (InstrumentName != null)
                {
                    hashCode = hashCode * 59 + InstrumentName.GetHashCode();
                }
                if (CreationTimestamp != null)
                {
                    hashCode = hashCode * 59 + CreationTimestamp.GetHashCode();
                }
                if (AveragePrice != null)
                {
                    hashCode = hashCode * 59 + AveragePrice.GetHashCode();
                }
                return(hashCode);
            }
        }
Ejemplo n.º 2
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 :)
                if (SessionProfitLoss != null)
                {
                    hashCode = hashCode * 59 + SessionProfitLoss.GetHashCode();
                }
                if (MarkPrice != null)
                {
                    hashCode = hashCode * 59 + MarkPrice.GetHashCode();
                }
                if (Funding != null)
                {
                    hashCode = hashCode * 59 + Funding.GetHashCode();
                }
                if (Socialized != null)
                {
                    hashCode = hashCode * 59 + Socialized.GetHashCode();
                }
                if (SessionBankrupcy != null)
                {
                    hashCode = hashCode * 59 + SessionBankrupcy.GetHashCode();
                }
                if (Timestamp != null)
                {
                    hashCode = hashCode * 59 + Timestamp.GetHashCode();
                }
                if (ProfitLoss != null)
                {
                    hashCode = hashCode * 59 + ProfitLoss.GetHashCode();
                }
                if (Funded != null)
                {
                    hashCode = hashCode * 59 + Funded.GetHashCode();
                }
                if (IndexPrice != null)
                {
                    hashCode = hashCode * 59 + IndexPrice.GetHashCode();
                }
                if (SessionTax != null)
                {
                    hashCode = hashCode * 59 + SessionTax.GetHashCode();
                }
                if (SessionTaxRate != null)
                {
                    hashCode = hashCode * 59 + SessionTaxRate.GetHashCode();
                }
                if (InstrumentName != null)
                {
                    hashCode = hashCode * 59 + InstrumentName.GetHashCode();
                }
                if (Position != null)
                {
                    hashCode = hashCode * 59 + Position.GetHashCode();
                }

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