/// <summary>
        ///     Returns true if PushEvent instances are equal
        /// </summary>
        /// <param name="other">Instance of PushEvent to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(PushEvent other)
        {
            if (other is null)
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     PusherId == other.PusherId ||
                     PusherId.Equals(other.PusherId)
                     ) &&
                 (
                     Ammount == other.Ammount ||
                     Ammount.Equals(other.Ammount)
                 ) &&
                 (
                     PushDirecton == other.PushDirecton ||
                     PushDirecton.Equals(other.PushDirecton)
                 ) &&
                 (
                     PushedId == other.PushedId ||
                     PushedId.Equals(other.PushedId)
                 ));
        }
Example #2
0
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = Id;
         hashCode = (hashCode * 397) ^ (Title != null ? Title.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ DateTime.GetHashCode();
         hashCode = (hashCode * 397) ^ Ammount.GetHashCode();
         hashCode = (hashCode * 397) ^ (int)TransactionType;
         hashCode = (hashCode * 397) ^ IsRegular.GetHashCode();
         return(hashCode);
     }
 }
Example #3
0
        public byte[] Serialize()
        {
            var tx = new byte[][]
            {
                ByteManipulator.GetBytes(Nonce),
                Ammount.GetBytes(),
                Fee.GetBytes(),
                Source,
                Destination,
                Signature,
                Network
            };

            return(RLP.Encode(tx));
        }
        /// <summary>
        ///     Gets the hash code
        /// </summary>
        /// <returns>Hash code</returns>
        public override int GetHashCode()
        {
            unchecked             // Overflow is fine, just wrap
            {
                int hashCode = 41;
                // Suitable nullity checks etc, of course :)

                hashCode = hashCode * 59 + PusherId.GetHashCode();

                hashCode = hashCode * 59 + Ammount.GetHashCode();

                hashCode = hashCode * 59 + PushDirecton.GetHashCode();

                hashCode = hashCode * 59 + PushedId.GetHashCode();
                return(hashCode);
            }
        }
Example #5
0
 public override string ToString()
 {
     return(_beer + " " + _quantity + "-qty " + _unitPrice.ToString("C") + " Ammount: " + Ammount.ToString("C"));
 }
Example #6
0
 public override string ToString()
 {
     return($"{CreationDate} {BillingNumber} {DebitAccount} {Ammount.ToString("C")} an {CreditAccount}\nWertstellung: {ValueDate}");
 }