コード例 #1
0
        /// <summary>
        /// A hash code for the current object.
        /// </summary>
        public override int GetHashCode()
        {
            var hashCode = 1412678443;

            hashCode = hashCode * -1521134295 + type.GetHashCode();
            hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(name);

            hashCode = hashCode * -1521134295 + intValue.GetHashCode();
            hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(stringValue);

            return(hashCode);
        }
コード例 #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 :)

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

                hashCode = hashCode * 59 + Kind.GetHashCode();
                if (TickSize != null)
                {
                    hashCode = hashCode * 59 + TickSize.GetHashCode();
                }
                if (ContractSize != null)
                {
                    hashCode = hashCode * 59 + ContractSize.GetHashCode();
                }
                if (IsActive != null)
                {
                    hashCode = hashCode * 59 + IsActive.GetHashCode();
                }

                hashCode = hashCode * 59 + OptionType.GetHashCode();
                if (MinTradeAmount != null)
                {
                    hashCode = hashCode * 59 + MinTradeAmount.GetHashCode();
                }
                if (InstrumentName != null)
                {
                    hashCode = hashCode * 59 + InstrumentName.GetHashCode();
                }

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

                hashCode = hashCode * 59 + BaseCurrency.GetHashCode();
                if (CreationTimestamp != null)
                {
                    hashCode = hashCode * 59 + CreationTimestamp.GetHashCode();
                }
                if (ExpirationTimestamp != null)
                {
                    hashCode = hashCode * 59 + ExpirationTimestamp.GetHashCode();
                }
                return(hashCode);
            }
        }
コード例 #3
0
        /// <summary>
        /// Returns a hash code value for this option series.
        /// </summary>
        /// <returns>a hash code value.</returns>
        public override int GetHashCode()
        {
            int  result;
            long temp;

            result = Expiration;
            result = 31 * result + LastTrade;
            temp   = Multiplier != +0.0d ? BitConverter.DoubleToInt64Bits(Multiplier) : 0L;
            result = 31 * result + (int)((ulong)temp ^ ((ulong)temp >> 32));
            temp   = SPC != +0.0d ? BitConverter.DoubleToInt64Bits(SPC) : 0L;
            result = 31 * result + (int)((ulong)temp ^ ((ulong)temp >> 32));
            result = 31 * result + AdditionalUnderlyings.GetHashCode();
            result = 31 * result + MMY.GetHashCode();
            result = 31 * result + OptionType.GetHashCode();
            result = 31 * result + ExpirationStyle.GetHashCode();
            result = 31 * result + SettlementStyle.GetHashCode();
            result = 31 * result + CFI.GetHashCode();
            return(result);
        }
コード例 #4
0
 public override int GetHashCode()
 {
     return(base.GetHashCode() + Expiry.GetHashCode() + OptionType.GetHashCode()
            + Strike.GetHashCode());
 }