Beispiel #1
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (GraphHash.Length != 0)
            {
                hash ^= GraphHash.GetHashCode();
            }
            if (RunId.Length != 0)
            {
                hash ^= RunId.GetHashCode();
            }
            if (CreationTimestamp != 0L)
            {
                hash ^= CreationTimestamp.GetHashCode();
            }
            if (Finalized != false)
            {
                hash ^= Finalized.GetHashCode();
            }
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }
Beispiel #2
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (options_ != null)
            {
                hash ^= Options.GetHashCode();
            }
            if (playback_ != null)
            {
                hash ^= Playback.GetHashCode();
            }
            if (currentSession_ != null)
            {
                hash ^= CurrentSession.GetHashCode();
            }
            if (queue_ != null)
            {
                hash ^= Queue.GetHashCode();
            }
            if (HasCreationTimestamp)
            {
                hash ^= CreationTimestamp.GetHashCode();
            }
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }
        /// <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);
            }
        }
        public override int GetHashCode()
        {
            int hash = 1;

            if (GiftboxId != 0UL)
            {
                hash ^= GiftboxId.GetHashCode();
            }
            if (SenderId.Length != 0)
            {
                hash ^= SenderId.GetHashCode();
            }
            if (ReceiverId.Length != 0)
            {
                hash ^= ReceiverId.GetHashCode();
            }
            if (FortId.Length != 0)
            {
                hash ^= FortId.GetHashCode();
            }
            if (FortLat != 0D)
            {
                hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(FortLat);
            }
            if (FortLng != 0D)
            {
                hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(FortLng);
            }
            if (CreationTimestamp != 0L)
            {
                hash ^= CreationTimestamp.GetHashCode();
            }
            if (SentTimestamp != 0L)
            {
                hash ^= SentTimestamp.GetHashCode();
            }
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }
Beispiel #5
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);
            }
        }
Beispiel #6
0
        /// <summary>
        /// Returns true if Order instances are equal
        /// </summary>
        /// <param name="other">Instance of Order to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(Order other)
        {
            if (other is null)
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     Direction == other.Direction ||

                     Direction.Equals(other.Direction)
                     ) &&
                 (
                     ReduceOnly == other.ReduceOnly ||
                     ReduceOnly != null &&
                     ReduceOnly.Equals(other.ReduceOnly)
                 ) &&
                 (
                     Triggered == other.Triggered ||
                     Triggered != null &&
                     Triggered.Equals(other.Triggered)
                 ) &&
                 (
                     OrderId == other.OrderId ||
                     OrderId != null &&
                     OrderId.Equals(other.OrderId)
                 ) &&
                 (
                     Price == other.Price ||
                     Price != null &&
                     Price.Equals(other.Price)
                 ) &&
                 (
                     TimeInForce == other.TimeInForce ||

                     TimeInForce.Equals(other.TimeInForce)
                 ) &&
                 (
                     Api == other.Api ||
                     Api != null &&
                     Api.Equals(other.Api)
                 ) &&
                 (
                     OrderState == other.OrderState ||

                     OrderState.Equals(other.OrderState)
                 ) &&
                 (
                     Implv == other.Implv ||
                     Implv != null &&
                     Implv.Equals(other.Implv)
                 ) &&
                 (
                     Advanced == other.Advanced ||

                     Advanced.Equals(other.Advanced)
                 ) &&
                 (
                     PostOnly == other.PostOnly ||
                     PostOnly != null &&
                     PostOnly.Equals(other.PostOnly)
                 ) &&
                 (
                     Usd == other.Usd ||
                     Usd != null &&
                     Usd.Equals(other.Usd)
                 ) &&
                 (
                     StopPrice == other.StopPrice ||
                     StopPrice != null &&
                     StopPrice.Equals(other.StopPrice)
                 ) &&
                 (
                     OrderType == other.OrderType ||

                     OrderType.Equals(other.OrderType)
                 ) &&
                 (
                     LastUpdateTimestamp == other.LastUpdateTimestamp ||
                     LastUpdateTimestamp != null &&
                     LastUpdateTimestamp.Equals(other.LastUpdateTimestamp)
                 ) &&
                 (
                     OriginalOrderType == other.OriginalOrderType ||

                     OriginalOrderType.Equals(other.OriginalOrderType)
                 ) &&
                 (
                     MaxShow == other.MaxShow ||
                     MaxShow != null &&
                     MaxShow.Equals(other.MaxShow)
                 ) &&
                 (
                     ProfitLoss == other.ProfitLoss ||
                     ProfitLoss != null &&
                     ProfitLoss.Equals(other.ProfitLoss)
                 ) &&
                 (
                     IsLiquidation == other.IsLiquidation ||
                     IsLiquidation != null &&
                     IsLiquidation.Equals(other.IsLiquidation)
                 ) &&
                 (
                     FilledAmount == other.FilledAmount ||
                     FilledAmount != null &&
                     FilledAmount.Equals(other.FilledAmount)
                 ) &&
                 (
                     Label == other.Label ||
                     Label != null &&
                     Label.Equals(other.Label)
                 ) &&
                 (
                     Commission == other.Commission ||
                     Commission != null &&
                     Commission.Equals(other.Commission)
                 ) &&
                 (
                     Amount == other.Amount ||
                     Amount != null &&
                     Amount.Equals(other.Amount)
                 ) &&
                 (
                     Trigger == other.Trigger ||

                     Trigger.Equals(other.Trigger)
                 ) &&
                 (
                     InstrumentName == other.InstrumentName ||
                     InstrumentName != null &&
                     InstrumentName.Equals(other.InstrumentName)
                 ) &&
                 (
                     CreationTimestamp == other.CreationTimestamp ||
                     CreationTimestamp != null &&
                     CreationTimestamp.Equals(other.CreationTimestamp)
                 ) &&
                 (
                     AveragePrice == other.AveragePrice ||
                     AveragePrice != null &&
                     AveragePrice.Equals(other.AveragePrice)
                 ));
        }
        /// <summary>
        /// Returns true if Instrument instances are equal
        /// </summary>
        /// <param name="other">Instance of Instrument to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(Instrument other)
        {
            if (other is null)
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     QuoteCurrency == other.QuoteCurrency ||

                     QuoteCurrency.Equals(other.QuoteCurrency)
                     ) &&
                 (
                     Kind == other.Kind ||

                     Kind.Equals(other.Kind)
                 ) &&
                 (
                     TickSize == other.TickSize ||
                     TickSize != null &&
                     TickSize.Equals(other.TickSize)
                 ) &&
                 (
                     ContractSize == other.ContractSize ||
                     ContractSize != null &&
                     ContractSize.Equals(other.ContractSize)
                 ) &&
                 (
                     IsActive == other.IsActive ||
                     IsActive != null &&
                     IsActive.Equals(other.IsActive)
                 ) &&
                 (
                     OptionType == other.OptionType ||

                     OptionType.Equals(other.OptionType)
                 ) &&
                 (
                     MinTradeAmount == other.MinTradeAmount ||
                     MinTradeAmount != null &&
                     MinTradeAmount.Equals(other.MinTradeAmount)
                 ) &&
                 (
                     InstrumentName == other.InstrumentName ||
                     InstrumentName != null &&
                     InstrumentName.Equals(other.InstrumentName)
                 ) &&
                 (
                     SettlementPeriod == other.SettlementPeriod ||

                     SettlementPeriod.Equals(other.SettlementPeriod)
                 ) &&
                 (
                     Strike == other.Strike ||
                     Strike != null &&
                     Strike.Equals(other.Strike)
                 ) &&
                 (
                     BaseCurrency == other.BaseCurrency ||

                     BaseCurrency.Equals(other.BaseCurrency)
                 ) &&
                 (
                     CreationTimestamp == other.CreationTimestamp ||
                     CreationTimestamp != null &&
                     CreationTimestamp.Equals(other.CreationTimestamp)
                 ) &&
                 (
                     ExpirationTimestamp == other.ExpirationTimestamp ||
                     ExpirationTimestamp != null &&
                     ExpirationTimestamp.Equals(other.ExpirationTimestamp)
                 ));
        }
        public override int GetHashCode()
        {
            int hash = 1;

            if (GiftboxId != 0UL)
            {
                hash ^= GiftboxId.GetHashCode();
            }
            if (SenderId.Length != 0)
            {
                hash ^= SenderId.GetHashCode();
            }
            if (SenderCodename.Length != 0)
            {
                hash ^= SenderCodename.GetHashCode();
            }
            if (ReceiverId.Length != 0)
            {
                hash ^= ReceiverId.GetHashCode();
            }
            if (ReceiverCodename.Length != 0)
            {
                hash ^= ReceiverCodename.GetHashCode();
            }
            if (FortId.Length != 0)
            {
                hash ^= FortId.GetHashCode();
            }
            if (FortName.Length != 0)
            {
                hash ^= FortName.GetHashCode();
            }
            if (FortLat != 0D)
            {
                hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(FortLat);
            }
            if (FortLng != 0D)
            {
                hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(FortLng);
            }
            if (FortImageUrl.Length != 0)
            {
                hash ^= FortImageUrl.GetHashCode();
            }
            if (CreationTimestamp != 0L)
            {
                hash ^= CreationTimestamp.GetHashCode();
            }
            if (SentTimestamp != 0L)
            {
                hash ^= SentTimestamp.GetHashCode();
            }
            if (DeliveryPokemonId != 0UL)
            {
                hash ^= DeliveryPokemonId.GetHashCode();
            }
            if (IsSponsored != false)
            {
                hash ^= IsSponsored.GetHashCode();
            }
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }
Beispiel #9
0
 public int GetDaysInWork()
 {
     return((DateTimeProvider.Now - CreationTimestamp.ToUniversalTime()).Days);
 }
 /// <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 (UnderlyingIndex != null)
         {
             hashCode = hashCode * 59 + UnderlyingIndex.GetHashCode();
         }
         if (Volume != null)
         {
             hashCode = hashCode * 59 + Volume.GetHashCode();
         }
         if (VolumeUsd != null)
         {
             hashCode = hashCode * 59 + VolumeUsd.GetHashCode();
         }
         if (UnderlyingPrice != null)
         {
             hashCode = hashCode * 59 + UnderlyingPrice.GetHashCode();
         }
         if (BidPrice != null)
         {
             hashCode = hashCode * 59 + BidPrice.GetHashCode();
         }
         if (OpenInterest != null)
         {
             hashCode = hashCode * 59 + OpenInterest.GetHashCode();
         }
         if (QuoteCurrency != null)
         {
             hashCode = hashCode * 59 + QuoteCurrency.GetHashCode();
         }
         if (High != null)
         {
             hashCode = hashCode * 59 + High.GetHashCode();
         }
         if (EstimatedDeliveryPrice != null)
         {
             hashCode = hashCode * 59 + EstimatedDeliveryPrice.GetHashCode();
         }
         if (Last != null)
         {
             hashCode = hashCode * 59 + Last.GetHashCode();
         }
         if (MidPrice != null)
         {
             hashCode = hashCode * 59 + MidPrice.GetHashCode();
         }
         if (InterestRate != null)
         {
             hashCode = hashCode * 59 + InterestRate.GetHashCode();
         }
         if (Funding8h != null)
         {
             hashCode = hashCode * 59 + Funding8h.GetHashCode();
         }
         if (MarkPrice != null)
         {
             hashCode = hashCode * 59 + MarkPrice.GetHashCode();
         }
         if (AskPrice != null)
         {
             hashCode = hashCode * 59 + AskPrice.GetHashCode();
         }
         if (InstrumentName != null)
         {
             hashCode = hashCode * 59 + InstrumentName.GetHashCode();
         }
         if (Low != null)
         {
             hashCode = hashCode * 59 + Low.GetHashCode();
         }
         if (BaseCurrency != null)
         {
             hashCode = hashCode * 59 + BaseCurrency.GetHashCode();
         }
         if (CreationTimestamp != null)
         {
             hashCode = hashCode * 59 + CreationTimestamp.GetHashCode();
         }
         if (CurrentFunding != null)
         {
             hashCode = hashCode * 59 + CurrentFunding.GetHashCode();
         }
         return(hashCode);
     }
 }
        /// <summary>
        /// Returns true if BookSummary instances are equal
        /// </summary>
        /// <param name="other">Instance of BookSummary to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(BookSummary other)
        {
            if (other is null)
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     UnderlyingIndex == other.UnderlyingIndex ||
                     UnderlyingIndex != null &&
                     UnderlyingIndex.Equals(other.UnderlyingIndex)
                     ) &&
                 (
                     Volume == other.Volume ||
                     Volume != null &&
                     Volume.Equals(other.Volume)
                 ) &&
                 (
                     VolumeUsd == other.VolumeUsd ||
                     VolumeUsd != null &&
                     VolumeUsd.Equals(other.VolumeUsd)
                 ) &&
                 (
                     UnderlyingPrice == other.UnderlyingPrice ||
                     UnderlyingPrice != null &&
                     UnderlyingPrice.Equals(other.UnderlyingPrice)
                 ) &&
                 (
                     BidPrice == other.BidPrice ||
                     BidPrice != null &&
                     BidPrice.Equals(other.BidPrice)
                 ) &&
                 (
                     OpenInterest == other.OpenInterest ||
                     OpenInterest != null &&
                     OpenInterest.Equals(other.OpenInterest)
                 ) &&
                 (
                     QuoteCurrency == other.QuoteCurrency ||
                     QuoteCurrency != null &&
                     QuoteCurrency.Equals(other.QuoteCurrency)
                 ) &&
                 (
                     High == other.High ||
                     High != null &&
                     High.Equals(other.High)
                 ) &&
                 (
                     EstimatedDeliveryPrice == other.EstimatedDeliveryPrice ||
                     EstimatedDeliveryPrice != null &&
                     EstimatedDeliveryPrice.Equals(other.EstimatedDeliveryPrice)
                 ) &&
                 (
                     Last == other.Last ||
                     Last != null &&
                     Last.Equals(other.Last)
                 ) &&
                 (
                     MidPrice == other.MidPrice ||
                     MidPrice != null &&
                     MidPrice.Equals(other.MidPrice)
                 ) &&
                 (
                     InterestRate == other.InterestRate ||
                     InterestRate != null &&
                     InterestRate.Equals(other.InterestRate)
                 ) &&
                 (
                     Funding8h == other.Funding8h ||
                     Funding8h != null &&
                     Funding8h.Equals(other.Funding8h)
                 ) &&
                 (
                     MarkPrice == other.MarkPrice ||
                     MarkPrice != null &&
                     MarkPrice.Equals(other.MarkPrice)
                 ) &&
                 (
                     AskPrice == other.AskPrice ||
                     AskPrice != null &&
                     AskPrice.Equals(other.AskPrice)
                 ) &&
                 (
                     InstrumentName == other.InstrumentName ||
                     InstrumentName != null &&
                     InstrumentName.Equals(other.InstrumentName)
                 ) &&
                 (
                     Low == other.Low ||
                     Low != null &&
                     Low.Equals(other.Low)
                 ) &&
                 (
                     BaseCurrency == other.BaseCurrency ||
                     BaseCurrency != null &&
                     BaseCurrency.Equals(other.BaseCurrency)
                 ) &&
                 (
                     CreationTimestamp == other.CreationTimestamp ||
                     CreationTimestamp != null &&
                     CreationTimestamp.Equals(other.CreationTimestamp)
                 ) &&
                 (
                     CurrentFunding == other.CurrentFunding ||
                     CurrentFunding != null &&
                     CurrentFunding.Equals(other.CurrentFunding)
                 ));
        }