Ejemplo n.º 1
0
 public override int GetHashCode()
 {
     return(NumberOfJobs.GetHashCode()
            ^ Name.GetHashCode()
            ^ Id.GetHashCode()
            ^ Score.GetHashCode()
            ^ Latitude.GetHashCode()
            ^ Longitude.GetHashCode());
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Serves as a hash function for a particular type.
        /// </summary>
        /// <returns>
        /// A hash code for the current <see cref="T:System.Object"/>.
        /// </returns>
        /// <filterpriority>2</filterpriority>
        public override int GetHashCode()
        {
            unchecked
            {
                var result = 0;
                result = (result * 397) ^ (Id != default(Guid) ? Id.GetHashCode() : DefaultHash);
                result = (result * 397) ^ (NumberOfJobs != default(long) ? NumberOfJobs.GetHashCode() : DefaultHash);
                result = (result * 397) ^ (NumberOfFinishedJobs != default(long) ? NumberOfFinishedJobs.GetHashCode() : DefaultHash);

                return(result);
            }
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Indicates whether the current object is equal to another object of the same type.
        /// </summary>
        /// <returns>
        /// true if the current object is equal to the <paramref name="other"/> parameter; otherwise, false.
        /// </returns>
        /// <param name="other">An object to compare with this object.
        ///                 </param>
        public bool Equals(JobProgress other)
        {
            bool equals = true;

            equals =
                equals && (Id != default(Guid) & other.Id != default(Guid))
               ?  Id.Equals(other.Id)
               :  Id == default(Guid) & other.Id == default(Guid);
            equals =
                equals && (NumberOfJobs != default(long) & other.NumberOfJobs != default(long))
               ?  NumberOfJobs.Equals(other.NumberOfJobs)
               :  NumberOfJobs == default(long) & other.NumberOfJobs == default(long);
            equals =
                equals && (NumberOfFinishedJobs != default(long) & other.NumberOfFinishedJobs != default(long))
               ?  NumberOfFinishedJobs.Equals(other.NumberOfFinishedJobs)
               :  NumberOfFinishedJobs == default(long) & other.NumberOfFinishedJobs == default(long);

            return(equals);
        }