Пример #1
0
        /// <summary>Serves as a hash function for a particular type.</summary>
        /// <returns>A hash code for the current Object.</returns>
        public override int GetHashCode()
        {
            string fullName = FullName;
            string name     = Name;

            unchecked
            {
                int hash = Primes[_random];

                if (!Utils.IsNullOrWhiteSpace(fullName))
                {
                    hash = hash * Primes[1] + fullName.GetHashCode();
                }

                if (!Utils.IsNullOrWhiteSpace(name))
                {
                    hash = hash * Primes[1] + name.GetHashCode();
                }

                hash = hash * Primes[1] + Attributes.GetHashCode();
                hash = hash * Primes[1] + CreationTimeUtc.GetHashCode();
                hash = hash * Primes[1] + LastWriteTimeUtc.GetHashCode();

                return(hash);
            }
        }
 public override int GetHashCode() => LastWriteTimeUtc.GetHashCode();