コード例 #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 (ShowQuantityInsteadOfAmount != null)
         {
             hashCode = hashCode * 59 + ShowQuantityInsteadOfAmount.GetHashCode();
         }
         if (SupportDOM != null)
         {
             hashCode = hashCode * 59 + SupportDOM.GetHashCode();
         }
         if (SupportBrackets != null)
         {
             hashCode = hashCode * 59 + SupportBrackets.GetHashCode();
         }
         if (SupportOrderBrackets != null)
         {
             hashCode = hashCode * 59 + SupportOrderBrackets.GetHashCode();
         }
         if (SupportPositionBrackets != null)
         {
             hashCode = hashCode * 59 + SupportPositionBrackets.GetHashCode();
         }
         if (SupportClosePosition != null)
         {
             hashCode = hashCode * 59 + SupportClosePosition.GetHashCode();
         }
         if (SupportEditAmount != null)
         {
             hashCode = hashCode * 59 + SupportEditAmount.GetHashCode();
         }
         if (SupportLevel2Data != null)
         {
             hashCode = hashCode * 59 + SupportLevel2Data.GetHashCode();
         }
         if (SupportMultiposition != null)
         {
             hashCode = hashCode * 59 + SupportMultiposition.GetHashCode();
         }
         if (SupportPLUpdate != null)
         {
             hashCode = hashCode * 59 + SupportPLUpdate.GetHashCode();
         }
         if (SupportReducePosition != null)
         {
             hashCode = hashCode * 59 + SupportReducePosition.GetHashCode();
         }
         if (SupportStopLimitOrders != null)
         {
             hashCode = hashCode * 59 + SupportStopLimitOrders.GetHashCode();
         }
         if (SupportOrdersHistory != null)
         {
             hashCode = hashCode * 59 + SupportOrdersHistory.GetHashCode();
         }
         if (SupportExecutions != null)
         {
             hashCode = hashCode * 59 + SupportExecutions.GetHashCode();
         }
         if (SupportDigitalSignature != null)
         {
             hashCode = hashCode * 59 + SupportDigitalSignature.GetHashCode();
         }
         return(hashCode);
     }
 }
コード例 #2
0
        /// <summary>
        /// Returns true if AccountFlags instances are equal
        /// </summary>
        /// <param name="other">Instance of AccountFlags to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(AccountFlags other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     ShowQuantityInsteadOfAmount == other.ShowQuantityInsteadOfAmount ||
                     ShowQuantityInsteadOfAmount != null &&
                     ShowQuantityInsteadOfAmount.Equals(other.ShowQuantityInsteadOfAmount)
                     ) &&
                 (
                     SupportDOM == other.SupportDOM ||
                     SupportDOM != null &&
                     SupportDOM.Equals(other.SupportDOM)
                 ) &&
                 (
                     SupportBrackets == other.SupportBrackets ||
                     SupportBrackets != null &&
                     SupportBrackets.Equals(other.SupportBrackets)
                 ) &&
                 (
                     SupportOrderBrackets == other.SupportOrderBrackets ||
                     SupportOrderBrackets != null &&
                     SupportOrderBrackets.Equals(other.SupportOrderBrackets)
                 ) &&
                 (
                     SupportPositionBrackets == other.SupportPositionBrackets ||
                     SupportPositionBrackets != null &&
                     SupportPositionBrackets.Equals(other.SupportPositionBrackets)
                 ) &&
                 (
                     SupportClosePosition == other.SupportClosePosition ||
                     SupportClosePosition != null &&
                     SupportClosePosition.Equals(other.SupportClosePosition)
                 ) &&
                 (
                     SupportEditAmount == other.SupportEditAmount ||
                     SupportEditAmount != null &&
                     SupportEditAmount.Equals(other.SupportEditAmount)
                 ) &&
                 (
                     SupportLevel2Data == other.SupportLevel2Data ||
                     SupportLevel2Data != null &&
                     SupportLevel2Data.Equals(other.SupportLevel2Data)
                 ) &&
                 (
                     SupportMultiposition == other.SupportMultiposition ||
                     SupportMultiposition != null &&
                     SupportMultiposition.Equals(other.SupportMultiposition)
                 ) &&
                 (
                     SupportPLUpdate == other.SupportPLUpdate ||
                     SupportPLUpdate != null &&
                     SupportPLUpdate.Equals(other.SupportPLUpdate)
                 ) &&
                 (
                     SupportReducePosition == other.SupportReducePosition ||
                     SupportReducePosition != null &&
                     SupportReducePosition.Equals(other.SupportReducePosition)
                 ) &&
                 (
                     SupportStopLimitOrders == other.SupportStopLimitOrders ||
                     SupportStopLimitOrders != null &&
                     SupportStopLimitOrders.Equals(other.SupportStopLimitOrders)
                 ) &&
                 (
                     SupportOrdersHistory == other.SupportOrdersHistory ||
                     SupportOrdersHistory != null &&
                     SupportOrdersHistory.Equals(other.SupportOrdersHistory)
                 ) &&
                 (
                     SupportExecutions == other.SupportExecutions ||
                     SupportExecutions != null &&
                     SupportExecutions.Equals(other.SupportExecutions)
                 ) &&
                 (
                     SupportDigitalSignature == other.SupportDigitalSignature ||
                     SupportDigitalSignature != null &&
                     SupportDigitalSignature.Equals(other.SupportDigitalSignature)
                 ));
        }