コード例 #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 :)
         if (Symbol != null)
         {
             hashCode = hashCode * 59 + Symbol.GetHashCode();
         }
         if (Description != null)
         {
             hashCode = hashCode * 59 + Description.GetHashCode();
         }
         if (ExchangeListed != null)
         {
             hashCode = hashCode * 59 + ExchangeListed.GetHashCode();
         }
         if (ExchangeTraded != null)
         {
             hashCode = hashCode * 59 + ExchangeTraded.GetHashCode();
         }
         if (Minmovement != null)
         {
             hashCode = hashCode * 59 + Minmovement.GetHashCode();
         }
         if (Minmov2 != null)
         {
             hashCode = hashCode * 59 + Minmov2.GetHashCode();
         }
         if (Fractional != null)
         {
             hashCode = hashCode * 59 + Fractional.GetHashCode();
         }
         if (Pricescale != null)
         {
             hashCode = hashCode * 59 + Pricescale.GetHashCode();
         }
         if (HasIntraday != null)
         {
             hashCode = hashCode * 59 + HasIntraday.GetHashCode();
         }
         if (HasNoVolume != null)
         {
             hashCode = hashCode * 59 + HasNoVolume.GetHashCode();
         }
         if (Type != null)
         {
             hashCode = hashCode * 59 + Type.GetHashCode();
         }
         if (Ticker != null)
         {
             hashCode = hashCode * 59 + Ticker.GetHashCode();
         }
         if (Timezone != null)
         {
             hashCode = hashCode * 59 + Timezone.GetHashCode();
         }
         if (SessionRegular != null)
         {
             hashCode = hashCode * 59 + SessionRegular.GetHashCode();
         }
         if (SupportedResolutions != null)
         {
             hashCode = hashCode * 59 + SupportedResolutions.GetHashCode();
         }
         if (HasDaily != null)
         {
             hashCode = hashCode * 59 + HasDaily.GetHashCode();
         }
         if (IntradayMultipliers != null)
         {
             hashCode = hashCode * 59 + IntradayMultipliers.GetHashCode();
         }
         if (HasWeeklyAndMonthly != null)
         {
             hashCode = hashCode * 59 + HasWeeklyAndMonthly.GetHashCode();
         }
         return(hashCode);
     }
 }
コード例 #2
0
        /// <summary>
        /// Returns true if SymbolInfoArrays instances are equal
        /// </summary>
        /// <param name="other">Instance of SymbolInfoArrays to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(SymbolInfoArrays other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     Symbol == other.Symbol ||
                     Symbol != null &&
                     Symbol.SequenceEqual(other.Symbol)
                     ) &&
                 (
                     Description == other.Description ||
                     Description != null &&
                     Description.SequenceEqual(other.Description)
                 ) &&
                 (
                     ExchangeListed == other.ExchangeListed ||
                     ExchangeListed != null &&
                     ExchangeListed.SequenceEqual(other.ExchangeListed)
                 ) &&
                 (
                     ExchangeTraded == other.ExchangeTraded ||
                     ExchangeTraded != null &&
                     ExchangeTraded.SequenceEqual(other.ExchangeTraded)
                 ) &&
                 (
                     Minmovement == other.Minmovement ||
                     Minmovement != null &&
                     Minmovement.SequenceEqual(other.Minmovement)
                 ) &&
                 (
                     Minmov2 == other.Minmov2 ||
                     Minmov2 != null &&
                     Minmov2.SequenceEqual(other.Minmov2)
                 ) &&
                 (
                     Fractional == other.Fractional ||
                     Fractional != null &&
                     Fractional.SequenceEqual(other.Fractional)
                 ) &&
                 (
                     Pricescale == other.Pricescale ||
                     Pricescale != null &&
                     Pricescale.SequenceEqual(other.Pricescale)
                 ) &&
                 (
                     HasIntraday == other.HasIntraday ||
                     HasIntraday != null &&
                     HasIntraday.SequenceEqual(other.HasIntraday)
                 ) &&
                 (
                     HasNoVolume == other.HasNoVolume ||
                     HasNoVolume != null &&
                     HasNoVolume.SequenceEqual(other.HasNoVolume)
                 ) &&
                 (
                     Type == other.Type ||
                     Type != null &&
                     Type.SequenceEqual(other.Type)
                 ) &&
                 (
                     Ticker == other.Ticker ||
                     Ticker != null &&
                     Ticker.SequenceEqual(other.Ticker)
                 ) &&
                 (
                     Timezone == other.Timezone ||
                     Timezone != null &&
                     Timezone.SequenceEqual(other.Timezone)
                 ) &&
                 (
                     SessionRegular == other.SessionRegular ||
                     SessionRegular != null &&
                     SessionRegular.SequenceEqual(other.SessionRegular)
                 ) &&
                 (
                     SupportedResolutions == other.SupportedResolutions ||
                     SupportedResolutions != null &&
                     SupportedResolutions.SequenceEqual(other.SupportedResolutions)
                 ) &&
                 (
                     HasDaily == other.HasDaily ||
                     HasDaily != null &&
                     HasDaily.SequenceEqual(other.HasDaily)
                 ) &&
                 (
                     IntradayMultipliers == other.IntradayMultipliers ||
                     IntradayMultipliers != null &&
                     IntradayMultipliers.SequenceEqual(other.IntradayMultipliers)
                 ) &&
                 (
                     HasWeeklyAndMonthly == other.HasWeeklyAndMonthly ||
                     HasWeeklyAndMonthly != null &&
                     HasWeeklyAndMonthly.SequenceEqual(other.HasWeeklyAndMonthly)
                 ));
        }