Пример #1
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (Hours != 0)
            {
                hash ^= Hours.GetHashCode();
            }
            if (Minutes != 0)
            {
                hash ^= Minutes.GetHashCode();
            }
            if (Seconds != 0)
            {
                hash ^= Seconds.GetHashCode();
            }
            if (Nanos != 0)
            {
                hash ^= Nanos.GetHashCode();
            }
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }
Пример #2
0
 public override int GetHashCode()
 {
     unchecked
     {
         return((Hours.GetHashCode() * 10 + Minutes.GetHashCode() * 6) ^ Second.GetHashCode());
     }
 }
Пример #3
0
        // good practice to override this if overriding Equals
        public override int GetHashCode()
        {
            // return a hash (key) value for this object
            // object with same content should return same hash value

            return(Hours.GetHashCode() ^ Minutes.GetHashCode() ^ Minutes.GetHashCode());                 // simple hash
        }
Пример #4
0
 public override int GetHashCode()
 {
     return
         (Hours.GetHashCode() ^
          Minutes.GetHashCode() ^
          Seconds.GetHashCode() ^
          Milliseconds.GetHashCode());
 }
Пример #5
0
 /// <summary>
 /// Serves as the default hash function.
 /// </summary>
 /// <returns>A hash code for the current object.</returns>
 public override int GetHashCode()
 {
     return(base.GetHashCode() ^ Hours.GetHashCode() ^
            Minutes.GetHashCode() ^
            Seconds.GetHashCode() ^
            Frames.GetHashCode() ^
            SubFrames.GetHashCode());
 }
Пример #6
0
        public override int GetHashCode()
        {
            var hashCode = -926758218;

            hashCode = hashCode * -1521134295 + Degrees.GetHashCode();
            hashCode = hashCode * -1521134295 + Minutes.GetHashCode();
            hashCode = hashCode * -1521134295 + Seconds.GetHashCode();
            return(hashCode);
        }
Пример #7
0
        public override int GetHashCode()
        {
            var hashCode = -27068153;

            hashCode = hashCode * -1521134295 + Hours.GetHashCode();
            hashCode = hashCode * -1521134295 + Minutes.GetHashCode();
            hashCode = hashCode * -1521134295 + Seconds.GetHashCode();
            return(hashCode);
        }
Пример #8
0
        public override int GetHashCode()
        {
            var hashCode = -99606436;

            hashCode = hashCode * -1521134295 + base.GetHashCode();
            hashCode = hashCode * -1521134295 + Hours.GetHashCode();
            hashCode = hashCode * -1521134295 + Minutes.GetHashCode();
            hashCode = hashCode * -1521134295 + Seconds.GetHashCode();
            return(hashCode);
        }
Пример #9
0
        public override int GetHashCode()
        {
            var hashCode = -1260144041;

            hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(Name);

            hashCode = hashCode * -1521134295 + Minutes.GetHashCode();
            hashCode = hashCode * -1521134295 + Seconds.GetHashCode();
            hashCode = hashCode * -1521134295 + Date.GetHashCode();
            return(hashCode);
        }
Пример #10
0
        /// <summary>
        ///     Returns a hash code for this instance.
        /// </summary>
        /// <returns>
        ///     A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table.
        /// </returns>
        public override int GetHashCode( )
        {
            int hash = 13;

            hash = (hash * 7) + Positive.GetHashCode( );
            hash = (hash * 7) + Hours.GetHashCode( );
            hash = (hash * 7) + Minutes.GetHashCode( );
            hash = (hash * 7) + Seconds.GetHashCode( );

            return(hash);
        }
Пример #11
0
 /// <summary>
 /// Gets hash code for the angle value.
 /// </summary>
 /// <returns>Hash code value.</returns>
 public override int GetHashCode()
 {
     unchecked
     {
         int hash = 17;
         hash = hash * 23 + Hours.GetHashCode();
         hash = hash * 23 + Minutes.GetHashCode();
         hash = hash * 23 + Seconds.GetHashCode();
         return(hash);
     }
 }
Пример #12
0
        public override int GetHashCode()
        {
            var hashCode = 1266180088;

            hashCode = hashCode * -1521134295 + Hours.GetHashCode();
            hashCode = hashCode * -1521134295 + Minutes.GetHashCode();
            hashCode = hashCode * -1521134295 + Seconds.GetHashCode();
            hashCode = hashCode * -1521134295 + hours.GetHashCode();
            hashCode = hashCode * -1521134295 + minutes.GetHashCode();
            hashCode = hashCode * -1521134295 + seconds.GetHashCode();
            return(hashCode);
        }
Пример #13
0
        public override int GetHashCode()
        {
            var hashCode = 1989793102;

            hashCode = hashCode * -1521134295 + Minutes.GetHashCode();
            hashCode = hashCode * -1521134295 + Seconds.GetHashCode();
            hashCode = hashCode * -1521134295 + Milliseconds.GetHashCode();
            hashCode = hashCode * -1521134295 + minutes.GetHashCode();
            hashCode = hashCode * -1521134295 + seconds.GetHashCode();
            hashCode = hashCode * -1521134295 + milliseconds.GetHashCode();
            return(hashCode);
        }
Пример #14
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);
     }
 }
Пример #15
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);
     }
 }
Пример #16
0
        public override int GetHashCode()
        {
            unchecked
            {
                var hashCode = Name != null?Name.GetHashCode() : 0;

                hashCode = (hashCode * 397) ^ (Year != null ? Year.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ (Month != null ? Month.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ (Hours != null ? Hours.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ (Minutes != null ? Minutes.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ (DayOfMonth != null ? DayOfMonth.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ (DayOfWeek != null ? DayOfWeek.GetHashCode() : 0);
                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);
     }
 }
Пример #18
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (Year != 0)
            {
                hash ^= Year.GetHashCode();
            }
            if (Month != 0)
            {
                hash ^= Month.GetHashCode();
            }
            if (Day != 0)
            {
                hash ^= Day.GetHashCode();
            }
            if (Hours != 0)
            {
                hash ^= Hours.GetHashCode();
            }
            if (Minutes != 0)
            {
                hash ^= Minutes.GetHashCode();
            }
            if (Seconds != 0)
            {
                hash ^= Seconds.GetHashCode();
            }
            if (Nanos != 0)
            {
                hash ^= Nanos.GetHashCode();
            }
            if (timeOffsetCase_ == TimeOffsetOneofCase.UtcOffset)
            {
                hash ^= UtcOffset.GetHashCode();
            }
            if (timeOffsetCase_ == TimeOffsetOneofCase.TimeZone)
            {
                hash ^= TimeZone.GetHashCode();
            }
            hash ^= (int)timeOffsetCase_;
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }
Пример #19
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);
            }
        }
Пример #20
0
 public override int GetHashCode()
 {
     return(Credit.GetHashCode() ^ SMS.GetHashCode() ^ Minutes.GetHashCode() ^ Gigabytes.GetHashCode() ^ Number.GetHashCode());
 }
Пример #21
0
 public override int GetHashCode()
 {
     return(FilePath.GetHashCode() * 37 + Minutes.GetHashCode());
 }
Пример #22
0
 /// <summary>
 /// Przeciążenie metody GetHashCode, aby uniknąć kolizji hashcode'ów i wystąpienia fałszywej równości
 /// </summary>
 /// <returns>
 /// Możliwie różny hashcode od pierwotnego obiektu
 /// </returns>
 public override int GetHashCode()
 {
     return(Hours.GetHashCode() * 17 ^ (Minutes.GetHashCode() * Seconds.GetHashCode()));
 }