/// <summary> /// Returns true if SimpleTradeInfo instances are equal /// </summary> /// <param name="other">Instance of SimpleTradeInfo to be compared</param> /// <returns>Boolean</returns> public bool Equals(SimpleTradeInfo other) { if (ReferenceEquals(null, other)) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return (( InputAddress == other.InputAddress || InputAddress != null && InputAddress.Equals(other.InputAddress) ) && ( InputMemo == other.InputMemo || InputMemo != null && InputMemo.Equals(other.InputMemo) ) && ( InputCoinType == other.InputCoinType || InputCoinType != null && InputCoinType.Equals(other.InputCoinType) ) && ( OutputAddress == other.OutputAddress || OutputAddress != null && OutputAddress.Equals(other.OutputAddress) ) && ( OutputCoinType == other.OutputCoinType || OutputCoinType != null && OutputCoinType.Equals(other.OutputCoinType) ) && ( RefundAddress == other.RefundAddress || RefundAddress != null && RefundAddress.Equals(other.RefundAddress) ) && ( FlatTransactionFeeInInputCoinType == other.FlatTransactionFeeInInputCoinType || FlatTransactionFeeInInputCoinType != null && FlatTransactionFeeInInputCoinType.Equals(other.FlatTransactionFeeInInputCoinType) )); }
/// <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 (InputAddress != null) { hashCode = hashCode * 59 + InputAddress.GetHashCode(); } if (InputMemo != null) { hashCode = hashCode * 59 + InputMemo.GetHashCode(); } if (InputCoinType != null) { hashCode = hashCode * 59 + InputCoinType.GetHashCode(); } if (OutputAddress != null) { hashCode = hashCode * 59 + OutputAddress.GetHashCode(); } if (OutputCoinType != null) { hashCode = hashCode * 59 + OutputCoinType.GetHashCode(); } if (RefundAddress != null) { hashCode = hashCode * 59 + RefundAddress.GetHashCode(); } if (FlatTransactionFeeInInputCoinType != null) { hashCode = hashCode * 59 + FlatTransactionFeeInInputCoinType.GetHashCode(); } return(hashCode); } }