public override int GetHashCode() { if (_hashCode != 0) { return(_hashCode); } long ticks; ticks = CreatedTimestamp.Subtract(new System.DateTime(2011, 6, 18, 19, 12, 00, 0, System.DateTimeKind.Utc)).Ticks; if (ticks > int.MaxValue) { throw new System.OverflowException("If this product is still in use July 6, 2079 it will begin throwing overflow exceptions."); } _hashCode = (int)ticks; // Looks for a unique handle hashcode while (FileSystem.Instance.HandleExists(this)) { _hashCode--; } return(_hashCode); }
/// <summary> /// Returns true if TransferItem instances are equal /// </summary> /// <param name="other">Instance of TransferItem to be compared</param> /// <returns>Boolean</returns> public bool Equals(TransferItem other) { if (other is null) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return (( UpdatedTimestamp == other.UpdatedTimestamp || UpdatedTimestamp != null && UpdatedTimestamp.Equals(other.UpdatedTimestamp) ) && ( Direction == other.Direction || Direction.Equals(other.Direction) ) && ( Amount == other.Amount || Amount != null && Amount.Equals(other.Amount) ) && ( OtherSide == other.OtherSide || OtherSide != null && OtherSide.Equals(other.OtherSide) ) && ( Currency == other.Currency || Currency.Equals(other.Currency) ) && ( State == other.State || State.Equals(other.State) ) && ( CreatedTimestamp == other.CreatedTimestamp || CreatedTimestamp != null && CreatedTimestamp.Equals(other.CreatedTimestamp) ) && ( Type == other.Type || Type.Equals(other.Type) ) && ( Id == other.Id || Id != null && Id.Equals(other.Id) )); }
public string GetLogString() { return("FullPath=" + File.ToString() + "\r\n" + "Creator=" + Creator.GetType().FullName + "\r\n" + "CreatedTimestamp=" + CreatedTimestamp.ToString("o") + "\r\n" + "LastAccess=(File: " + _lastAccess.GetFileName() + ", Method: " + _lastAccess.GetMethod().ReflectedType.FullName + ", Line: " + _lastAccess.GetFileLineNumber().ToString() + ")\r\n" + "Mode=" + Mode.ToString() + "\r\n" + "Access=" + Access.ToString() + "\r\n" + "Share=" + Share.ToString() + "\r\n" + "Options=" + Options.ToString() + "\r\n" + "BufferSize=" + BufferSize.ToString()); }
/// <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 (UpdatedTimestamp != null) { hashCode = hashCode * 59 + UpdatedTimestamp.GetHashCode(); } if (Fee != null) { hashCode = hashCode * 59 + Fee.GetHashCode(); } if (ConfirmedTimestamp != null) { hashCode = hashCode * 59 + ConfirmedTimestamp.GetHashCode(); } if (Amount != null) { hashCode = hashCode * 59 + Amount.GetHashCode(); } if (Priority != null) { hashCode = hashCode * 59 + Priority.GetHashCode(); } hashCode = hashCode * 59 + Currency.GetHashCode(); hashCode = hashCode * 59 + State.GetHashCode(); if (Address != null) { hashCode = hashCode * 59 + Address.GetHashCode(); } if (CreatedTimestamp != null) { hashCode = hashCode * 59 + CreatedTimestamp.GetHashCode(); } if (Id != null) { hashCode = hashCode * 59 + Id.GetHashCode(); } if (TransactionId != null) { hashCode = hashCode * 59 + TransactionId.GetHashCode(); } return(hashCode); } }
/// <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 (UpdatedTimestamp != null) { hashCode = hashCode * 59 + UpdatedTimestamp.GetHashCode(); } hashCode = hashCode * 59 + Direction.GetHashCode(); if (Amount != null) { hashCode = hashCode * 59 + Amount.GetHashCode(); } if (OtherSide != null) { hashCode = hashCode * 59 + OtherSide.GetHashCode(); } hashCode = hashCode * 59 + Currency.GetHashCode(); hashCode = hashCode * 59 + State.GetHashCode(); if (CreatedTimestamp != null) { hashCode = hashCode * 59 + CreatedTimestamp.GetHashCode(); } hashCode = hashCode * 59 + Type.GetHashCode(); if (Id != null) { hashCode = hashCode * 59 + Id.GetHashCode(); } return(hashCode); } }
/// <summary> /// Returns true if Withdrawal instances are equal /// </summary> /// <param name="other">Instance of Withdrawal to be compared</param> /// <returns>Boolean</returns> public bool Equals(Withdrawal other) { if (other is null) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return (( UpdatedTimestamp == other.UpdatedTimestamp || UpdatedTimestamp != null && UpdatedTimestamp.Equals(other.UpdatedTimestamp) ) && ( Fee == other.Fee || Fee != null && Fee.Equals(other.Fee) ) && ( ConfirmedTimestamp == other.ConfirmedTimestamp || ConfirmedTimestamp != null && ConfirmedTimestamp.Equals(other.ConfirmedTimestamp) ) && ( Amount == other.Amount || Amount != null && Amount.Equals(other.Amount) ) && ( Priority == other.Priority || Priority != null && Priority.Equals(other.Priority) ) && ( Currency == other.Currency || Currency.Equals(other.Currency) ) && ( State == other.State || State.Equals(other.State) ) && ( Address == other.Address || Address != null && Address.Equals(other.Address) ) && ( CreatedTimestamp == other.CreatedTimestamp || CreatedTimestamp != null && CreatedTimestamp.Equals(other.CreatedTimestamp) ) && ( Id == other.Id || Id != null && Id.Equals(other.Id) ) && ( TransactionId == other.TransactionId || TransactionId != null && TransactionId.Equals(other.TransactionId) )); }