Esempio n. 1
0
 public override int GetHashCode()
 {
     unchecked
     {
         return((Days.GetHashCode() * 397) ^ Months.GetHashCode());
     }
 }
Esempio n. 2
0
 /// <summary>
 /// Returns the hash code for this instance.
 /// </summary>
 /// <returns>A 32-bit signed integer hash code.</returns>
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = Months.GetHashCode();
         hashCode = (hashCode * 397) ^ Days.GetHashCode();
         hashCode = (hashCode * 397) ^ Seconds.GetHashCode();
         hashCode = (hashCode * 397) ^ Nanos;
         return(hashCode);
     }
 }
Esempio n. 3
0
 /// <inheritdoc />
 public override int GetHashCode()
 {
     unchecked
     {
         var hash = 17;
         hash = hash * 31 + Months.GetHashCode();
         hash = hash * 31 + Days.GetHashCode();
         hash = hash * 31 + Nanoseconds.GetHashCode();
         return(hash);
     }
 }
Esempio n. 4
0
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = (Seconds != null ? Seconds.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Minutes != null ? Minutes.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Hours != null ? Hours.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (DaysOfMonth != null ? DaysOfMonth.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Months != null ? Months.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (DaysOfWeek != null ? DaysOfWeek.GetHashCode() : 0);
         return(hashCode);
     }
 }
Esempio n. 5
0
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = Years.GetHashCode();
         hashCode = (hashCode * 397) ^ Months.GetHashCode();
         hashCode = (hashCode * 397) ^ Weeks.GetHashCode();
         hashCode = (hashCode * 397) ^ Days.GetHashCode();
         hashCode = (hashCode * 397) ^ Hours.GetHashCode();
         hashCode = (hashCode * 397) ^ Minutes.GetHashCode();
         hashCode = (hashCode * 397) ^ Seconds.GetHashCode();
         hashCode = (hashCode * 397) ^ Milliseconds.GetHashCode();
         return(hashCode);
     }
 }
 /// <summary>
 /// Returns the hash code for this instance.
 /// </summary>
 /// <returns>A 32-bit signed integer that is the hash code for this instance.</returns>
 public override int GetHashCode()
 {
     unchecked
     {
         int hash = (int)2166136261;
         hash = (hash * 16777619) ^ Years.GetHashCode();
         hash = (hash * 16777619) ^ Months.GetHashCode();
         hash = (hash * 16777619) ^ Weeks.GetHashCode();
         hash = (hash * 16777619) ^ Days.GetHashCode();
         hash = (hash * 16777619) ^ Hours.GetHashCode();
         hash = (hash * 16777619) ^ Minutes.GetHashCode();
         hash = (hash * 16777619) ^ Seconds.GetHashCode();
         return(hash);
     }
 }
Esempio n. 7
0
        /// <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 :)

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

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

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

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

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

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

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

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

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

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

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

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

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

                hashCode = hashCode * 59 + Ticks.GetHashCode();
                return(hashCode);
            }
        }
Esempio n. 8
0
 /// <inheritdoc />
 public override int GetHashCode()
 {
     return(Months.GetHashCode() ^ Years.GetHashCode() ^ TimeSpan.GetHashCode());
 }
Esempio n. 9
0
 /// <summary>
 /// Provides a hash code for this object.
 /// </summary>
 /// <returns>The hash code.</returns>
 public override int GetHashCode()
 {
     return(_totalDays.GetHashCode() ^ Years.GetHashCode() ^ Months.GetHashCode() ^ Weeks.GetHashCode() ^ Days.GetHashCode());
 }
Esempio n. 10
0
 /// <inheritdoc />
 public override int GetHashCode()
 {
     // ReSharper disable NonReadonlyMemberInGetHashCode
     return(Months.GetHashCode() ^ Years.GetHashCode() ^ TimeSpan.GetHashCode());
 }
Esempio n. 11
0
 public override int GetHashCode() => Months.GetHashCode() ^ Years.GetHashCode() ^ TimeSpan.GetHashCode();