Esempio n. 1
0
 /// <summary>
 /// Returns a hash code for this instance.
 /// </summary>
 /// <returns>A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table.</returns>
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = (int)OptionType;
         hashCode = (hashCode * 397) ^ BaseNotional.GetHashCode();
         hashCode = (hashCode * 397) ^ Strike.GetHashCode();
         hashCode = (hashCode * 397) ^ Maturity.GetHashCode();
         return(hashCode);
     }
 }
Esempio n. 2
0
        public override int GetHashCode()
        {
            var hashCode = -1593953530;

            hashCode = hashCode * -1521134295 + Name.GetHashCode();
            hashCode = hashCode * -1521134295 + Size.GetHashCode();
            hashCode = hashCode * -1521134295 + Color.GetHashCode();
            hashCode = hashCode * -1521134295 + Bold.GetHashCode();
            hashCode = hashCode * -1521134295 + Italic.GetHashCode();
            hashCode = hashCode * -1521134295 + Strike.GetHashCode();
            hashCode = hashCode * -1521134295 + UnderlineType.GetHashCode();
            return(hashCode);
        }
Esempio n. 3
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);
            }
        }
Esempio n. 4
0
        public override int GetHashCode()
        {
            unchecked
            {
                int hash = 17;

                hash = hash * 23 + Name.GetHashCode();
                if (Size != null)
                {
                    hash = hash * 23 + Size.GetHashCode();
                }
                if (FontFamily != null)
                {
                    hash = hash * 23 + FontFamily.GetHashCode();
                }
                if (VerticalTextAlignment != null)
                {
                    hash = hash * 23 + VerticalTextAlignment.GetHashCode();
                }
                if (Underline != null)
                {
                    hash = hash * 23 + Underline.GetHashCode();
                }
                if (Shadow != null)
                {
                    hash = hash * 23 + Shadow.GetHashCode();
                }
                if (Extend != null)
                {
                    hash = hash * 23 + Extend.GetHashCode();
                }
                if (FontCharSet != null)
                {
                    hash = hash * 23 + FontCharSet.GetHashCode();
                }
                if (Condense != null)
                {
                    hash = hash * 23 + Condense.GetHashCode();
                }
                if (Strike != null)
                {
                    hash = hash * 23 + Strike.GetHashCode();
                }
                if (Italic != null)
                {
                    hash = hash * 23 + Italic.GetHashCode();
                }
                if (Bold != null)
                {
                    hash = hash * 23 + Bold.GetHashCode();
                }
                if (Color != null)
                {
                    hash = hash * 23 + Color.GetHashCode();
                }
                if (FontScheme != null)
                {
                    hash = hash * 23 + FontScheme.GetHashCode();
                }

                return(hash);
            }
        }
Esempio n. 5
0
 public override int GetHashCode()
 {
     return(base.GetHashCode() + Expiry.GetHashCode() + OptionType.GetHashCode()
            + Strike.GetHashCode());
 }