Esempio n. 1
0
 /// <summary>
 /// Serves as the default hash function.
 /// </summary>
 /// <returns>A hash code for the current object.</returns>
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = (int)ErrorCode;
         hashCode = (hashCode * 397) ^ (int)Severity;
         hashCode = (hashCode * 397) ^ Origin.GetHashCode();
         hashCode = (hashCode * 397) ^ Category.GetHashCode();
         hashCode = (hashCode * 397) ^ RefToMessageInError.GetHashCode();
         hashCode = (hashCode * 397) ^ (int)ShortDescription;
         hashCode = (hashCode * 397) ^ Description.GetHashCode();
         hashCode = (hashCode * 397) ^ Detail.GetHashCode();
         return(hashCode);
     }
 }
Esempio n. 2
0
        /// <summary>
        /// Indicates whether the current object is equal to another object of the same type.
        /// </summary>
        /// <param name="other">An object to compare with this object.</param>
        /// <returns>true if the current object is equal to the <paramref name="other" /> parameter; otherwise, false.</returns>
        public bool Equals(ErrorLine other)
        {
            if (other is null)
            {
                return(false);
            }

            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return(ErrorCode == other.ErrorCode &&
                   Severity == other.Severity &&
                   Origin.Equals(other.Origin) &&
                   Category.Equals(other.Category) &&
                   RefToMessageInError.Equals(other.RefToMessageInError) &&
                   ShortDescription == other.ShortDescription &&
                   Description.Equals(other.Description) &&
                   Detail.Equals(other.Detail));
        }