Пример #1
0
        /// <summary>
        /// Gets the hash code
        /// </summary>
        /// <returns>Hash code</returns>
        public override int GetHashCode()
        {
            // credit: http://stackoverflow.com/a/263416/677735
            unchecked // Overflow is fine, just wrap
            {
                int hash = 41;
                // Suitable nullity checks

                hash = hash * 59 + Id.GetHashCode();

                if (FileName != null)
                {
                    hash = hash * 59 + FileName.GetHashCode();
                }

                if (FileContents != null)
                {
                    hash = hash * 59 + FileContents.GetHashCode();
                }

                if (Description != null)
                {
                    hash = hash * 59 + Description.GetHashCode();
                }

                if (Type != null)
                {
                    hash = hash * 59 + Type.GetHashCode();
                }

                return(hash);
            }
        }
Пример #2
0
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = base.GetHashCode();
         hashCode = (hashCode * 397) ^ Append.GetHashCode();
         hashCode = (hashCode * 397) ^ (FileContents != null ? FileContents.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (OutputPath != null ? OutputPath.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ Overwrite.GetHashCode();
         hashCode = (hashCode * 397) ^ AppendTop.GetHashCode();
         hashCode = (hashCode * 397) ^ AppendBottom.GetHashCode();
         return(hashCode);
     }
 }